Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b54881f9 authored by Ajit Khaparde's avatar Ajit Khaparde Committed by David S. Miller
Browse files

be2net: Fix to prevent Tx stall on SH-R when packet size < 32



Tx on SH-R can lockup if the packet size is less than 32 bytes.
Pad such packets to a safer 36-byte size.
Patch uses the Lancer-R workaround - which checks for packet <= 32-bytes

Signed-off-by: default avatarAjit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a97b7c3a
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -855,11 +855,11 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
	unsigned int eth_hdr_len;
	unsigned int eth_hdr_len;
	struct iphdr *ip;
	struct iphdr *ip;


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