[PATCH] skb_padto()-area fixes in 8390, wavelan
Ar Iau, 2006-06-22 am 21:29 +1000, ysgrifennodd Herbert Xu: > Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > > > > The 8390 change (corrected version) also makes 8390.c faster so should > > be applied anyway, and the orinoco one fixes some code that isn't even > > needed and someone forgot to remove long ago. Otherwise the skb_padto > > Yeah I agree totally. However, I haven't actually seen the fixed 8390 > version being posted yet or at least not to netdev :) Ah the resounding clang of a subtle hint ;) Signed-off-by: Alan Cox <alan@redhat.com> - Return 8390.c to the old way of handling short packets (which is also faster) - Remove the skb_padto from orinoco. This got left in when the padding bad write patch was added and is actually not needed. This is fixing a merge error way back when. - Wavelan can also use the stack based buffer trick if you want Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
@@ -275,12 +275,14 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
|
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
|
||||||
int send_length = skb->len, output_page;
|
int send_length = skb->len, output_page;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
char buf[ETH_ZLEN];
|
||||||
|
char *data = skb->data;
|
||||||
|
|
||||||
if (skb->len < ETH_ZLEN) {
|
if (skb->len < ETH_ZLEN) {
|
||||||
skb = skb_padto(skb, ETH_ZLEN);
|
memset(buf, 0, ETH_ZLEN); /* more efficient than doing just the needed bits */
|
||||||
if (skb == NULL)
|
memcpy(buf, data, skb->len);
|
||||||
return 0;
|
|
||||||
send_length = ETH_ZLEN;
|
send_length = ETH_ZLEN;
|
||||||
|
data = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mask interrupts from the ethercard.
|
/* Mask interrupts from the ethercard.
|
||||||
@@ -347,7 +349,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
* trigger the send later, upon receiving a Tx done interrupt.
|
* trigger the send later, upon receiving a Tx done interrupt.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ei_block_output(dev, send_length, skb->data, output_page);
|
ei_block_output(dev, send_length, data, output_page);
|
||||||
|
|
||||||
if (! ei_local->txing)
|
if (! ei_local->txing)
|
||||||
{
|
{
|
||||||
|
@@ -2903,6 +2903,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
|
|||||||
{
|
{
|
||||||
net_local *lp = (net_local *) dev->priv;
|
net_local *lp = (net_local *) dev->priv;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
char data[ETH_ZLEN];
|
||||||
|
|
||||||
#ifdef DEBUG_TX_TRACE
|
#ifdef DEBUG_TX_TRACE
|
||||||
printk(KERN_DEBUG "%s: ->wavelan_packet_xmit(0x%X)\n", dev->name,
|
printk(KERN_DEBUG "%s: ->wavelan_packet_xmit(0x%X)\n", dev->name,
|
||||||
@@ -2937,15 +2938,16 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
|
|||||||
* able to detect collisions, therefore in theory we don't really
|
* able to detect collisions, therefore in theory we don't really
|
||||||
* need to pad. Jean II */
|
* need to pad. Jean II */
|
||||||
if (skb->len < ETH_ZLEN) {
|
if (skb->len < ETH_ZLEN) {
|
||||||
skb = skb_padto(skb, ETH_ZLEN);
|
memset(data, 0, ETH_ZLEN);
|
||||||
if (skb == NULL)
|
memcpy(data, skb->data, skb->len);
|
||||||
return 0;
|
/* Write packet on the card */
|
||||||
|
if(wv_packet_write(dev, data, ETH_ZLEN))
|
||||||
|
return 1; /* We failed */
|
||||||
}
|
}
|
||||||
|
else if(wv_packet_write(dev, skb->data, skb->len))
|
||||||
/* Write packet on the card */
|
|
||||||
if(wv_packet_write(dev, skb->data, skb->len))
|
|
||||||
return 1; /* We failed */
|
return 1; /* We failed */
|
||||||
|
|
||||||
|
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
|
|
||||||
#ifdef DEBUG_TX_TRACE
|
#ifdef DEBUG_TX_TRACE
|
||||||
|
Reference in New Issue
Block a user