Skip to content

Commit

Permalink
be2net: Pad skb to meet min Tx pkt size in lancer
Browse files Browse the repository at this point in the history
In Lancer, packets that are 32 bytes or less may cause a transmit stall.
The work-around is to pad such packets to a 36 byte length.

Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Somnath Kotur authored and David S. Miller committed May 28, 2013
1 parent eeb65ce commit 4826566
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,16 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
unsigned int eth_hdr_len;
struct iphdr *ip;

/* Lancer ASIC has a bug wherein packets that are 32 bytes or less
* may cause a transmit stall on that port. So the work-around is to
* pad such packets to a 36-byte length.
*/
if (unlikely(lancer_chip(adapter) && skb->len <= 32)) {
if (skb_padto(skb, 36))
goto tx_drop;
skb->len = 36;
}

/* For padded packets, BE HW modifies tot_len field in IP header
* incorrecly when VLAN tag is inserted by HW.
*/
Expand Down

0 comments on commit 4826566

Please sign in to comment.