Skip to content

Commit

Permalink
be2net: non-member vlan pkts not received in promiscous mode
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sathya Perla authored and David S. Miller committed Aug 3, 2011
1 parent ea172a0 commit c0e64ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit c0e64ef

Please sign in to comment.