netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Cc: Xavier Selvin <xavier.selvin@emulex.com>
Subject: [PATCH net-next 3/6] be2net: non-member vlan pkts not received in promiscous mode
Date: Wed, 3 Aug 2011 11:27:43 +0530	[thread overview]
Message-ID: <1312351066-16745-4-git-send-email-sathya.perla@emulex.com> (raw)
In-Reply-To: <1312351066-16745-1-git-send-email-sathya.perla@emulex.com>

While configuring promiscous mode, explicitly set the
VLAN_PROMISCOUS bit to make this happen. When switching off
promiscous mode, re-program the vids.

Signed-off-by: Xavier Selvin <xavier.selvin@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/benet/be_cmds.c |    6 ++++--
 drivers/net/benet/be_main.c |    7 +++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 1c25dbd..73fd949 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1586,9 +1586,11 @@ int be_cmd_promiscuous_config(struct be_adapter *adapter, bool en)
 			OPCODE_COMMON_NTWK_RX_FILTER, sizeof(*req));
 
 	req->if_id = cpu_to_le32(adapter->if_handle);
-	req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS);
+	req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS
+				| BE_IF_FLAGS_VLAN_PROMISCUOUS);
 	if (en)
-		req->if_flags = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS);
+		req->if_flags = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS
+				| BE_IF_FLAGS_VLAN_PROMISCUOUS);
 
 	sge->pa_hi = cpu_to_le32(upper_32_bits(promiscous_cmd.dma));
 	sge->pa_lo = cpu_to_le32(promiscous_cmd.dma & 0xFFFFFFFF);
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 3b2c5e6..32a5b11 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -728,6 +728,10 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num)
 		status = be_cmd_vlan_config(adapter, if_handle, vtag, 1, 1, 0);
 	}
 
+	/* No need to further configure vids if in promiscuous mode */
+	if (adapter->promiscuous)
+		return 0;
+
 	if (adapter->vlans_added <= adapter->max_vlans)  {
 		/* Construct VLAN Table to give to HW */
 		for (i = 0; i < VLAN_N_VID; i++) {
@@ -787,6 +791,9 @@ static void be_set_multicast_list(struct net_device *netdev)
 	if (adapter->promiscuous) {
 		adapter->promiscuous = false;
 		be_cmd_promiscuous_config(adapter, false);
+
+		if (adapter->vlans_added)
+			be_vid_config(adapter, false, 0);
 	}
 
 	/* Enable multicast promisc if num configured exceeds what we support */
-- 
1.7.4


  parent reply	other threads:[~2011-08-03  5:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03  5:57 [PATCH net-next 0/6] be2net: fixes Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 1/6] be2net: remove wrong and unnecessary calls to netif_carrier_off() Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 2/6] be2net: no need to query link status Sathya Perla
2011-08-03  5:57 ` Sathya Perla [this message]
2011-08-03  5:57 ` [PATCH net-next 4/6] be2net: use RX_FILTER cmd to program multicast addresses Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 5/6] be2net: add support for flashing Teranetics PHY firmware Sathya Perla
2011-08-03  5:57 ` [PATCH net-next 6/6] be2net: drop pkts that do not belong to the port Sathya Perla
2011-08-03 10:27 ` [PATCH net-next 0/6] be2net: fixes David Miller
2011-08-09 15:47 ` Eric Dumazet
2011-08-09 16:23   ` Eric Dumazet
2011-08-10 10:15     ` Sathya.Perla
2011-08-12  9:56     ` David Miller

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=1312351066-16745-4-git-send-email-sathya.perla@emulex.com \
    --to=sathya.perla@emulex.com \
    --cc=netdev@vger.kernel.org \
    --cc=xavier.selvin@emulex.com \
    /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).