Thread (2 messages) flat view 2 messages, 2 authors, 2014-02-24

Re: [PATCH net 5/5] be2net: isolate TX workarounds not applicable to Skyhawk-R

From: Sergei Shtylyov <hidden>
Date: 2014-02-24 18:15:50

Hello.

On 02/24/2014 09:51 AM, Somnath Kotur wrote:
From: Vasundhara Volam <redacted>
Some of TX workarounds in be_xmit_workarounds() routine
are not applicable (and result in HW errors) to Skyhawk-R chip.
Isolate BE3-R/Lancer specific workarounds to a separate routine.

Signed-off-by: Vasundhara Volam <redacted>
Signed-off-by: Sathya Perla <redacted>
Signed-off-by: Somnath Kotur <redacted>
---
  drivers/net/ethernet/emulex/benet/be_main.c |   42 ++++++++++++++++++--------
  1 files changed, 29 insertions(+), 13 deletions(-)
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f6a4481..6cf6e2a 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
[...]
quoted hunk ↗ jump to hunk
@@ -991,6 +981,32 @@ err:
  	return NULL;
  }

+static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
+					   struct sk_buff *skb,
+					   bool *skip_hw_vlan)
+{
+	/* 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 pad short packets (<= 32 bytes) to a 36-byte length.
+	 */
+	if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
+		if (skb_padto(skb, 36))
+			goto err;
    Why not just return NULL?
+		skb->len = 36;
+	}
+
+	if (BEx_chip(adapter) || lancer_chip(adapter)) {
+		skb = be_lancer_xmit_workarounds(adapter, skb, skip_hw_vlan);
+		if (!skb)
+			goto err;
    Likewise...
+	}
+
+	return skb;
+
+err:
+	return NULL;
+}
+
WBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help