netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@broadcom.com>
To: netdev@vger.kernel.org
Subject: [net-next PATCH 1/4] be2net: clear vlan-promisc setting before programming the vlan list
Date: Fri, 22 Jul 2016 06:55:43 -0400	[thread overview]
Message-ID: <1469184946-26309-2-git-send-email-sathya.perla@broadcom.com> (raw)
In-Reply-To: <1469184946-26309-1-git-send-email-sathya.perla@broadcom.com>

From: Somnath Kotur <somnath.kotur@emulex.com>

The Lancer FW has a bug due to which in some cases vlan-promisc setting
is cleared eventhough the vlan-list programming did not succeed (via
VLAN_CONFIG) cmd. The driver has no way of knowing if the vlan-promisc
mode was cleared or not when this cmd fails. To work around this issue,
this patch first explicitly clears the vlan-promisc mode via RX_FILTER
cmd and then tries to program the vlan list.
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>

Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 1f16e73..2782299 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1427,6 +1427,11 @@ static int be_vid_config(struct be_adapter *adapter)
 	if (adapter->vlans_added > be_max_vlans(adapter))
 		return be_set_vlan_promisc(adapter);
 
+	if (adapter->if_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {
+		status = be_clear_vlan_promisc(adapter);
+		if (status)
+			return status;
+	}
 	/* Construct VLAN Table to give to HW */
 	for_each_set_bit(i, adapter->vids, VLAN_N_VID)
 		vids[num++] = cpu_to_le16(i);
@@ -1439,8 +1444,6 @@ static int be_vid_config(struct be_adapter *adapter)
 		    addl_status(status) ==
 				MCC_ADDL_STATUS_INSUFFICIENT_RESOURCES)
 			return be_set_vlan_promisc(adapter);
-	} else if (adapter->if_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {
-		status = be_clear_vlan_promisc(adapter);
 	}
 	return status;
 }
-- 
2.4.1

  reply	other threads:[~2016-07-22 10:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 10:55 [net-next PATCH 0/4] be2net: patch set Sathya Perla
2016-07-22 10:55 ` Sathya Perla [this message]
2016-07-22 10:55 ` [net-next PATCH 2/4] be2net: do not remove vids from driver table if be_vid_config() fails Sathya Perla
2016-07-22 10:55 ` [net-next PATCH 3/4] be2net: Avoid unnecessary firmware updates of multicast list Sathya Perla
2016-07-22 10:55 ` [net-next PATCH 4/4] be2net: replace polling with sleeping in the FW completion path Sathya Perla
2016-07-25 17:51   ` David Miller
2016-07-26  7:18     ` Sathya Perla
2016-07-26  8:10       ` Sathya Perla
2016-07-27  8:03         ` Sathya Perla
2016-07-27  8:07           ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-07-27  9:26 [net-next PATCH 0/4] be2net: patch set Sathya Perla
2016-07-27  9:26 ` [net-next PATCH 1/4] be2net: clear vlan-promisc setting before programming the vlan list Sathya Perla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469184946-26309-2-git-send-email-sathya.perla@broadcom.com \
    --to=sathya.perla@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).