Skip to content

Commit 841f60f

Browse files
Somnath Koturdavem330
authored andcommitted
be2net: clear vlan-promisc setting before programming the vlan list
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 <[email protected]> Signed-off-by: Sathya Perla <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0e7bbcc commit 841f60f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,11 @@ static int be_vid_config(struct be_adapter *adapter)
14271427
if (adapter->vlans_added > be_max_vlans(adapter))
14281428
return be_set_vlan_promisc(adapter);
14291429

1430+
if (adapter->if_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {
1431+
status = be_clear_vlan_promisc(adapter);
1432+
if (status)
1433+
return status;
1434+
}
14301435
/* Construct VLAN Table to give to HW */
14311436
for_each_set_bit(i, adapter->vids, VLAN_N_VID)
14321437
vids[num++] = cpu_to_le16(i);
@@ -1439,8 +1444,6 @@ static int be_vid_config(struct be_adapter *adapter)
14391444
addl_status(status) ==
14401445
MCC_ADDL_STATUS_INSUFFICIENT_RESOURCES)
14411446
return be_set_vlan_promisc(adapter);
1442-
} else if (adapter->if_flags & BE_IF_FLAGS_VLAN_PROMISCUOUS) {
1443-
status = be_clear_vlan_promisc(adapter);
14441447
}
14451448
return status;
14461449
}

0 commit comments

Comments
 (0)