diff mbox

[net] be2net: Fix to avoid hardware workaround when not needed

Message ID 458bdd84-53ce-489e-b134-f435c5fd6a50@CMEXHTCAS2.ad.emulex.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Sarveshwar Bandi July 16, 2013, 7:14 a.m. UTC
From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

Hardware workaround requesting hardware to skip vlan insertion is necessary
only when umc or qnq is enabled. Enabling this workaround in other scenarios
could cause controller to stall.

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

David Miller July 16, 2013, 8:03 p.m. UTC | #1
From: <sarveshwar.bandi@emulex.com>
Date: Tue, 16 Jul 2013 12:44:02 +0530

> From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
> 
> Hardware workaround requesting hardware to skip vlan insertion is necessary
> only when umc or qnq is enabled. Enabling this workaround in other scenarios
> could cause controller to stall.
> 
> Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sarveshwar Bandi July 17, 2013, 3:03 a.m. UTC | #2
Dave,
  Please queue up this patch for 3.10 stable.

Thanks,
Sarvesh
  

-----Original Message-----
From: David Miller [mailto:davem@davemloft.net] 
Sent: Wednesday, July 17, 2013 1:34 AM
To: Bandi, Sarveshwar
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net] be2net: Fix to avoid hardware workaround when not needed

From: <sarveshwar.bandi@emulex.com>
Date: Tue, 16 Jul 2013 12:44:02 +0530

> From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
> 
> Hardware workaround requesting hardware to skip vlan insertion is 
> necessary only when umc or qnq is enabled. Enabling this workaround in 
> other scenarios could cause controller to stall.
> 
> Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 17, 2013, 5:01 a.m. UTC | #3
From: "Bandi, Sarveshwar" <Sarveshwar.Bandi@Emulex.Com>
Date: Wed, 17 Jul 2013 03:03:52 +0000

>   Please queue up this patch for 3.10 stable.

Done.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rick Jones July 17, 2013, 4:01 p.m. UTC | #4
On 07/16/2013 10:01 PM, David Miller wrote:
> From: "Bandi, Sarveshwar" <Sarveshwar.Bandi@Emulex.Com>
> Date: Wed, 17 Jul 2013 03:03:52 +0000
>
>>    Please queue up this patch for 3.10 stable.
>
> Done.

Huzzah! (I was hitting this bug...)

rick jones
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 2df48bb..181edb5 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -782,16 +782,22 @@  static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
 
 	if (vlan_tx_tag_present(skb))
 		vlan_tag = be_get_tx_vlan_tag(adapter, skb);
-	else if (qnq_async_evt_rcvd(adapter) && adapter->pvid)
-		vlan_tag = adapter->pvid;
+
+	if (qnq_async_evt_rcvd(adapter) && adapter->pvid) {
+		if (!vlan_tag)
+			vlan_tag = adapter->pvid;
+		/* f/w workaround to set skip_hw_vlan = 1, informs the F/W to
+		 * skip VLAN insertion
+		 */
+		if (skip_hw_vlan)
+			*skip_hw_vlan = true;
+	}
 
 	if (vlan_tag) {
 		skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
 		if (unlikely(!skb))
 			return skb;
 		skb->vlan_tci = 0;
-		if (skip_hw_vlan)
-			*skip_hw_vlan = true;
 	}
 
 	/* Insert the outer VLAN, if any */