Commit a85e9986 authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

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: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 67297ad8
...@@ -879,11 +879,15 @@ static int be_vlan_add_vid(struct net_device *netdev, u16 vid) ...@@ -879,11 +879,15 @@ static int be_vlan_add_vid(struct net_device *netdev, u16 vid)
struct be_adapter *adapter = netdev_priv(netdev); struct be_adapter *adapter = netdev_priv(netdev);
int status = 0; int status = 0;
if (!be_physfn(adapter)) { if (!lancer_chip(adapter) && !be_physfn(adapter)) {
status = -EINVAL; status = -EINVAL;
goto ret; goto ret;
} }
/* Packets with VID 0 are always received by Lancer by default */
if (lancer_chip(adapter) && vid == 0)
goto ret;
adapter->vlan_tag[vid] = 1; adapter->vlan_tag[vid] = 1;
if (adapter->vlans_added <= (adapter->max_vlans + 1)) if (adapter->vlans_added <= (adapter->max_vlans + 1))
status = be_vid_config(adapter); status = be_vid_config(adapter);
...@@ -901,11 +905,15 @@ static int be_vlan_rem_vid(struct net_device *netdev, u16 vid) ...@@ -901,11 +905,15 @@ static int be_vlan_rem_vid(struct net_device *netdev, u16 vid)
struct be_adapter *adapter = netdev_priv(netdev); struct be_adapter *adapter = netdev_priv(netdev);
int status = 0; int status = 0;
if (!be_physfn(adapter)) { if (!lancer_chip(adapter) && !be_physfn(adapter)) {
status = -EINVAL; status = -EINVAL;
goto ret; goto ret;
} }
/* Packets with VID 0 are always received by Lancer by default */
if (lancer_chip(adapter) && vid == 0)
goto ret;
adapter->vlan_tag[vid] = 0; adapter->vlan_tag[vid] = 0;
if (adapter->vlans_added <= adapter->max_vlans) if (adapter->vlans_added <= adapter->max_vlans)
status = be_vid_config(adapter); status = be_vid_config(adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment