diff options
author | Somnath Kotur <somnath.kotur@emulex.com> | 2014-03-03 03:54:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-03 15:48:11 -0500 |
commit | c502224efb2eaec47f16da39235079598a0f3ed2 (patch) | |
tree | 5e7301336c923b3ccfba6a9a70b52dd953df91c3 /drivers/net | |
parent | e842b068bf9a9eb7b38e0e1875357440a1fd2169 (diff) |
be2net: Fix to reset transparent vlan tagging
For disabling transparent tagging issue SET_HSW_CONFIG with pvid_valid=1
and pvid=0xFFFF and not with the default pvid as this case would fail in Lancer.
Hence removing the get_hsw_config call from be_vf_setup() as it's
only use of getting default pvid is no longer needed.
Also do proper housekeeping only if the FW command succeeds.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 28 |
2 files changed, 12 insertions, 20 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 8d09615da585..05529e273050 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -350,11 +350,13 @@ struct be_drv_stats { | |||
350 | u32 roce_drops_crc; | 350 | u32 roce_drops_crc; |
351 | }; | 351 | }; |
352 | 352 | ||
353 | /* A vlan-id of 0xFFFF must be used to clear transparent vlan-tagging */ | ||
354 | #define BE_RESET_VLAN_TAG_ID 0xFFFF | ||
355 | |||
353 | struct be_vf_cfg { | 356 | struct be_vf_cfg { |
354 | unsigned char mac_addr[ETH_ALEN]; | 357 | unsigned char mac_addr[ETH_ALEN]; |
355 | int if_handle; | 358 | int if_handle; |
356 | int pmac_id; | 359 | int pmac_id; |
357 | u16 def_vid; | ||
358 | u16 vlan_tag; | 360 | u16 vlan_tag; |
359 | u32 tx_rate; | 361 | u32 tx_rate; |
360 | }; | 362 | }; |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 04ac9c6a0d39..45662af28928 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1287,24 +1287,20 @@ static int be_set_vf_vlan(struct net_device *netdev, | |||
1287 | 1287 | ||
1288 | if (vlan || qos) { | 1288 | if (vlan || qos) { |
1289 | vlan |= qos << VLAN_PRIO_SHIFT; | 1289 | vlan |= qos << VLAN_PRIO_SHIFT; |
1290 | if (vf_cfg->vlan_tag != vlan) { | 1290 | if (vf_cfg->vlan_tag != vlan) |
1291 | /* If this is new value, program it. Else skip. */ | ||
1292 | vf_cfg->vlan_tag = vlan; | ||
1293 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, | 1291 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, |
1294 | vf_cfg->if_handle, 0); | 1292 | vf_cfg->if_handle, 0); |
1295 | } | ||
1296 | } else { | 1293 | } else { |
1297 | /* Reset Transparent Vlan Tagging. */ | 1294 | /* Reset Transparent Vlan Tagging. */ |
1298 | vf_cfg->vlan_tag = 0; | 1295 | status = be_cmd_set_hsw_config(adapter, BE_RESET_VLAN_TAG_ID, |
1299 | vlan = vf_cfg->def_vid; | 1296 | vf + 1, vf_cfg->if_handle, 0); |
1300 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, | ||
1301 | vf_cfg->if_handle, 0); | ||
1302 | } | 1297 | } |
1303 | 1298 | ||
1304 | 1299 | if (!status) | |
1305 | if (status) | 1300 | vf_cfg->vlan_tag = vlan; |
1301 | else | ||
1306 | dev_info(&adapter->pdev->dev, | 1302 | dev_info(&adapter->pdev->dev, |
1307 | "VLAN %d config on VF %d failed\n", vlan, vf); | 1303 | "VLAN %d config on VF %d failed\n", vlan, vf); |
1308 | return status; | 1304 | return status; |
1309 | } | 1305 | } |
1310 | 1306 | ||
@@ -3013,11 +3009,11 @@ static int be_vf_setup_init(struct be_adapter *adapter) | |||
3013 | 3009 | ||
3014 | static int be_vf_setup(struct be_adapter *adapter) | 3010 | static int be_vf_setup(struct be_adapter *adapter) |
3015 | { | 3011 | { |
3012 | struct device *dev = &adapter->pdev->dev; | ||
3016 | struct be_vf_cfg *vf_cfg; | 3013 | struct be_vf_cfg *vf_cfg; |
3017 | u16 def_vlan, lnk_speed; | ||
3018 | int status, old_vfs, vf; | 3014 | int status, old_vfs, vf; |
3019 | struct device *dev = &adapter->pdev->dev; | ||
3020 | u32 privileges; | 3015 | u32 privileges; |
3016 | u16 lnk_speed; | ||
3021 | 3017 | ||
3022 | old_vfs = pci_num_vf(adapter->pdev); | 3018 | old_vfs = pci_num_vf(adapter->pdev); |
3023 | if (old_vfs) { | 3019 | if (old_vfs) { |
@@ -3084,12 +3080,6 @@ static int be_vf_setup(struct be_adapter *adapter) | |||
3084 | if (!status) | 3080 | if (!status) |
3085 | vf_cfg->tx_rate = lnk_speed; | 3081 | vf_cfg->tx_rate = lnk_speed; |
3086 | 3082 | ||
3087 | status = be_cmd_get_hsw_config(adapter, &def_vlan, | ||
3088 | vf + 1, vf_cfg->if_handle, NULL); | ||
3089 | if (status) | ||
3090 | goto err; | ||
3091 | vf_cfg->def_vid = def_vlan; | ||
3092 | |||
3093 | if (!old_vfs) | 3083 | if (!old_vfs) |
3094 | be_cmd_enable_vf(adapter, vf + 1); | 3084 | be_cmd_enable_vf(adapter, vf + 1); |
3095 | } | 3085 | } |