Skip to content

Commit a85e998

Browse files
Padmanabh Ratnakardavem330
authored andcommitted
be2net: Fix configuring VLAN for VF for Lancer
Allow adding VLANs for Lancer VF. VLAN ID 0 should not be added to list of VLANs sent to FW. Signed-off-by: Padmanabh Ratnakar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 67297ad commit a85e998

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,15 @@ static int be_vlan_add_vid(struct net_device *netdev, u16 vid)
879879
struct be_adapter *adapter = netdev_priv(netdev);
880880
int status = 0;
881881

882-
if (!be_physfn(adapter)) {
882+
if (!lancer_chip(adapter) && !be_physfn(adapter)) {
883883
status = -EINVAL;
884884
goto ret;
885885
}
886886

887+
/* Packets with VID 0 are always received by Lancer by default */
888+
if (lancer_chip(adapter) && vid == 0)
889+
goto ret;
890+
887891
adapter->vlan_tag[vid] = 1;
888892
if (adapter->vlans_added <= (adapter->max_vlans + 1))
889893
status = be_vid_config(adapter);
@@ -901,11 +905,15 @@ static int be_vlan_rem_vid(struct net_device *netdev, u16 vid)
901905
struct be_adapter *adapter = netdev_priv(netdev);
902906
int status = 0;
903907

904-
if (!be_physfn(adapter)) {
908+
if (!lancer_chip(adapter) && !be_physfn(adapter)) {
905909
status = -EINVAL;
906910
goto ret;
907911
}
908912

913+
/* Packets with VID 0 are always received by Lancer by default */
914+
if (lancer_chip(adapter) && vid == 0)
915+
goto ret;
916+
909917
adapter->vlan_tag[vid] = 0;
910918
if (adapter->vlans_added <= adapter->max_vlans)
911919
status = be_vid_config(adapter);

0 commit comments

Comments
 (0)