Skip to content

Commit c0e64ef

Browse files
Sathya Perladavem330
authored andcommitted
be2net: non-member vlan pkts not received in promiscous mode
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>
1 parent ea172a0 commit c0e64ef

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

drivers/net/benet/be_cmds.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,9 +1586,11 @@ int be_cmd_promiscuous_config(struct be_adapter *adapter, bool en)
15861586
OPCODE_COMMON_NTWK_RX_FILTER, sizeof(*req));
15871587

15881588
req->if_id = cpu_to_le32(adapter->if_handle);
1589-
req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS);
1589+
req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS
1590+
| BE_IF_FLAGS_VLAN_PROMISCUOUS);
15901591
if (en)
1591-
req->if_flags = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS);
1592+
req->if_flags = cpu_to_le32(BE_IF_FLAGS_PROMISCUOUS
1593+
| BE_IF_FLAGS_VLAN_PROMISCUOUS);
15921594

15931595
sge->pa_hi = cpu_to_le32(upper_32_bits(promiscous_cmd.dma));
15941596
sge->pa_lo = cpu_to_le32(promiscous_cmd.dma & 0xFFFFFFFF);

drivers/net/benet/be_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,10 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num)
728728
status = be_cmd_vlan_config(adapter, if_handle, vtag, 1, 1, 0);
729729
}
730730

731+
/* No need to further configure vids if in promiscuous mode */
732+
if (adapter->promiscuous)
733+
return 0;
734+
731735
if (adapter->vlans_added <= adapter->max_vlans) {
732736
/* Construct VLAN Table to give to HW */
733737
for (i = 0; i < VLAN_N_VID; i++) {
@@ -787,6 +791,9 @@ static void be_set_multicast_list(struct net_device *netdev)
787791
if (adapter->promiscuous) {
788792
adapter->promiscuous = false;
789793
be_cmd_promiscuous_config(adapter, false);
794+
795+
if (adapter->vlans_added)
796+
be_vid_config(adapter, false, 0);
790797
}
791798

792799
/* Enable multicast promisc if num configured exceeds what we support */

0 commit comments

Comments
 (0)