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>
This commit is contained in:
parent
0700d8161e
commit
00d594c3da
2 changed files with 16 additions and 12 deletions
|
@ -705,15 +705,17 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
|
||||||
|
|
||||||
if (ecmd->autoneg != adapter->phy.fc_autoneg)
|
if (ecmd->autoneg != adapter->phy.fc_autoneg)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
status = be_cmd_set_flow_control(adapter, ecmd->tx_pause,
|
||||||
|
ecmd->rx_pause);
|
||||||
|
if (status) {
|
||||||
|
dev_warn(&adapter->pdev->dev, "Pause param set failed\n");
|
||||||
|
return be_cmd_status(status);
|
||||||
|
}
|
||||||
|
|
||||||
adapter->tx_fc = ecmd->tx_pause;
|
adapter->tx_fc = ecmd->tx_pause;
|
||||||
adapter->rx_fc = ecmd->rx_pause;
|
adapter->rx_fc = ecmd->rx_pause;
|
||||||
|
return 0;
|
||||||
status = be_cmd_set_flow_control(adapter,
|
|
||||||
adapter->tx_fc, adapter->rx_fc);
|
|
||||||
if (status)
|
|
||||||
dev_warn(&adapter->pdev->dev, "Pause param set failed\n");
|
|
||||||
|
|
||||||
return be_cmd_status(status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int be_set_phys_id(struct net_device *netdev,
|
static int be_set_phys_id(struct net_device *netdev,
|
||||||
|
|
|
@ -3667,7 +3667,6 @@ int be_update_queues(struct be_adapter *adapter)
|
||||||
static int be_setup(struct be_adapter *adapter)
|
static int be_setup(struct be_adapter *adapter)
|
||||||
{
|
{
|
||||||
struct device *dev = &adapter->pdev->dev;
|
struct device *dev = &adapter->pdev->dev;
|
||||||
u32 tx_fc, rx_fc;
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
be_setup_init(adapter);
|
be_setup_init(adapter);
|
||||||
|
@ -3717,11 +3716,14 @@ static int be_setup(struct be_adapter *adapter)
|
||||||
|
|
||||||
be_cmd_get_acpi_wol_cap(adapter);
|
be_cmd_get_acpi_wol_cap(adapter);
|
||||||
|
|
||||||
be_cmd_get_flow_control(adapter, &tx_fc, &rx_fc);
|
status = be_cmd_set_flow_control(adapter, adapter->tx_fc,
|
||||||
|
adapter->rx_fc);
|
||||||
|
if (status)
|
||||||
|
be_cmd_get_flow_control(adapter, &adapter->tx_fc,
|
||||||
|
&adapter->rx_fc);
|
||||||
|
|
||||||
if (rx_fc != adapter->rx_fc || tx_fc != adapter->tx_fc)
|
dev_info(&adapter->pdev->dev, "HW Flow control - TX:%d RX:%d\n",
|
||||||
be_cmd_set_flow_control(adapter, adapter->tx_fc,
|
adapter->tx_fc, adapter->rx_fc);
|
||||||
adapter->rx_fc);
|
|
||||||
|
|
||||||
if (be_physfn(adapter))
|
if (be_physfn(adapter))
|
||||||
be_cmd_set_logical_link_config(adapter,
|
be_cmd_set_logical_link_config(adapter,
|
||||||
|
|
Loading…
Add table
Reference in a new issue