aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalesh AP <kalesh.purayil@emulex.com>2014-07-17 06:50:24 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-17 19:38:14 -0400
commitabccf23e3eebcd5b7b0ad5d2ad6d1f6d81af6b47 (patch)
tree94bb5236532f8cdde8c19bf07db3e5a063decd4c
parent0532d4e36678d626b41528c00fefe3d6e04130b3 (diff)
be2net: fix return status of some ndo methods
The netlink layer expects a -ve status value to be returned when a driver ndo method encounters an error. The driver was directly passing the error status returned by FW (a positive value) to the stack. This patch fixes this by returning -EIO status when a FW-cmd reports an error. Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 8826b778b3ab..988f7658c960 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1281,13 +1281,15 @@ static int be_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
1281 vf + 1); 1281 vf + 1);
1282 } 1282 }
1283 1283
1284 if (status) 1284 if (status) {
1285 dev_err(&adapter->pdev->dev, "MAC %pM set on VF %d Failed\n", 1285 dev_err(&adapter->pdev->dev, "MAC %pM set on VF %d Failed: %#x",
1286 mac, vf); 1286 mac, vf, status);
1287 else 1287 return be_cmd_status(status);
1288 memcpy(vf_cfg->mac_addr, mac, ETH_ALEN); 1288 }
1289 1289
1290 return status; 1290 ether_addr_copy(vf_cfg->mac_addr, mac);
1291
1292 return 0;
1291} 1293}
1292 1294
1293static int be_get_vf_config(struct net_device *netdev, int vf, 1295static int be_get_vf_config(struct net_device *netdev, int vf,
@@ -1336,12 +1338,16 @@ static int be_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos)
1336 vf + 1, vf_cfg->if_handle, 0); 1338 vf + 1, vf_cfg->if_handle, 0);
1337 } 1339 }
1338 1340
1339 if (!status) 1341 if (status) {
1340 vf_cfg->vlan_tag = vlan; 1342 dev_err(&adapter->pdev->dev,
1341 else 1343 "VLAN %d config on VF %d failed : %#x\n", vlan,
1342 dev_info(&adapter->pdev->dev, 1344 vf, status);
1343 "VLAN %d config on VF %d failed\n", vlan, vf); 1345 return be_cmd_status(status);
1344 return status; 1346 }
1347
1348 vf_cfg->vlan_tag = vlan;
1349
1350 return 0;
1345} 1351}
1346 1352
1347static int be_set_vf_tx_rate(struct net_device *netdev, int vf, 1353static int be_set_vf_tx_rate(struct net_device *netdev, int vf,
@@ -1403,7 +1409,7 @@ config_qos:
1403err: 1409err:
1404 dev_err(dev, "TX-rate setting of %dMbps on VF%d failed\n", 1410 dev_err(dev, "TX-rate setting of %dMbps on VF%d failed\n",
1405 max_tx_rate, vf); 1411 max_tx_rate, vf);
1406 return status; 1412 return be_cmd_status(status);
1407} 1413}
1408static int be_set_vf_link_state(struct net_device *netdev, int vf, 1414static int be_set_vf_link_state(struct net_device *netdev, int vf,
1409 int link_state) 1415 int link_state)
@@ -1418,10 +1424,15 @@ static int be_set_vf_link_state(struct net_device *netdev, int vf,
1418 return -EINVAL; 1424 return -EINVAL;
1419 1425
1420 status = be_cmd_set_logical_link_config(adapter, link_state, vf+1); 1426 status = be_cmd_set_logical_link_config(adapter, link_state, vf+1);
1421 if (!status) 1427 if (status) {
1422 adapter->vf_cfg[vf].plink_tracking = link_state; 1428 dev_err(&adapter->pdev->dev,
1429 "Link state change on VF %d failed: %#x\n", vf, status);
1430 return be_cmd_status(status);
1431 }
1423 1432
1424 return status; 1433 adapter->vf_cfg[vf].plink_tracking = link_state;
1434
1435 return 0;
1425} 1436}
1426 1437
1427static void be_aic_update(struct be_aic_obj *aic, u64 rx_pkts, u64 tx_pkts, 1438static void be_aic_update(struct be_aic_obj *aic, u64 rx_pkts, u64 tx_pkts,