diff options
author | Kalesh AP <kalesh.purayil@emulex.com> | 2015-01-20 03:51:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-24 20:22:42 -0500 |
commit | 00d594c3da568647ccbae506da12d3186600b377 (patch) | |
tree | 2186f03c0f927670c6c49282aafa2c1e7571463a /drivers/net/ethernet/emulex/benet | |
parent | 0700d8161ec9d3809238c703ad8d37c02e658c15 (diff) |
be2net: fix failure case in setting flow control
When the FW cmd to set flow control fails, the adapter state must simply
reflect the old values.
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>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_ethtool.c | 14 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 12 |
2 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c index 32c53bc0e07a..4d2de4700769 100644 --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c | |||
@@ -705,15 +705,17 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd) | |||
705 | 705 | ||
706 | if (ecmd->autoneg != adapter->phy.fc_autoneg) | 706 | if (ecmd->autoneg != adapter->phy.fc_autoneg) |
707 | return -EINVAL; | 707 | return -EINVAL; |
708 | adapter->tx_fc = ecmd->tx_pause; | ||
709 | adapter->rx_fc = ecmd->rx_pause; | ||
710 | 708 | ||
711 | status = be_cmd_set_flow_control(adapter, | 709 | status = be_cmd_set_flow_control(adapter, ecmd->tx_pause, |
712 | adapter->tx_fc, adapter->rx_fc); | 710 | ecmd->rx_pause); |
713 | if (status) | 711 | if (status) { |
714 | dev_warn(&adapter->pdev->dev, "Pause param set failed\n"); | 712 | dev_warn(&adapter->pdev->dev, "Pause param set failed\n"); |
713 | return be_cmd_status(status); | ||
714 | } | ||
715 | 715 | ||
716 | return be_cmd_status(status); | 716 | adapter->tx_fc = ecmd->tx_pause; |
717 | adapter->rx_fc = ecmd->rx_pause; | ||
718 | return 0; | ||
717 | } | 719 | } |
718 | 720 | ||
719 | static int be_set_phys_id(struct net_device *netdev, | 721 | static int be_set_phys_id(struct net_device *netdev, |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index c40d7efa24c2..f5ac35ccc57e 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -3667,7 +3667,6 @@ int be_update_queues(struct be_adapter *adapter) | |||
3667 | static int be_setup(struct be_adapter *adapter) | 3667 | static int be_setup(struct be_adapter *adapter) |
3668 | { | 3668 | { |
3669 | struct device *dev = &adapter->pdev->dev; | 3669 | struct device *dev = &adapter->pdev->dev; |
3670 | u32 tx_fc, rx_fc; | ||
3671 | int status; | 3670 | int status; |
3672 | 3671 | ||
3673 | be_setup_init(adapter); | 3672 | be_setup_init(adapter); |
@@ -3717,11 +3716,14 @@ static int be_setup(struct be_adapter *adapter) | |||
3717 | 3716 | ||
3718 | be_cmd_get_acpi_wol_cap(adapter); | 3717 | be_cmd_get_acpi_wol_cap(adapter); |
3719 | 3718 | ||
3720 | be_cmd_get_flow_control(adapter, &tx_fc, &rx_fc); | 3719 | status = be_cmd_set_flow_control(adapter, adapter->tx_fc, |
3720 | adapter->rx_fc); | ||
3721 | if (status) | ||
3722 | be_cmd_get_flow_control(adapter, &adapter->tx_fc, | ||
3723 | &adapter->rx_fc); | ||
3721 | 3724 | ||
3722 | if (rx_fc != adapter->rx_fc || tx_fc != adapter->tx_fc) | 3725 | dev_info(&adapter->pdev->dev, "HW Flow control - TX:%d RX:%d\n", |
3723 | be_cmd_set_flow_control(adapter, adapter->tx_fc, | 3726 | adapter->tx_fc, adapter->rx_fc); |
3724 | adapter->rx_fc); | ||
3725 | 3727 | ||
3726 | if (be_physfn(adapter)) | 3728 | if (be_physfn(adapter)) |
3727 | be_cmd_set_logical_link_config(adapter, | 3729 | be_cmd_set_logical_link_config(adapter, |