Commit 9e90c961 authored by Ajit Khaparde's avatar Ajit Khaparde Committed by David S. Miller

be2net: fix to set proper flow control on resume

If be2 goes into suspend after a user changes the flow control settings,
we are not programming them back after resume. This patch takes care of it.
We now get the flow control settings before going to suspend mode and
then apply them during resume.
Signed-off-by: default avatarAjit Khaparde <ajitk@serverengines.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb7b2284
...@@ -259,6 +259,8 @@ struct be_adapter { ...@@ -259,6 +259,8 @@ struct be_adapter {
u32 port_num; u32 port_num;
bool promiscuous; bool promiscuous;
u32 cap; u32 cap;
u32 rx_fc; /* Rx flow control */
u32 tx_fc; /* Tx flow control */
}; };
extern const struct ethtool_ops be_ethtool_ops; extern const struct ethtool_ops be_ethtool_ops;
......
...@@ -323,10 +323,12 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd) ...@@ -323,10 +323,12 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
if (ecmd->autoneg != 0) if (ecmd->autoneg != 0)
return -EINVAL; return -EINVAL;
adapter->tx_fc = ecmd->tx_pause;
adapter->rx_fc = ecmd->rx_pause;
status = be_cmd_set_flow_control(adapter, ecmd->tx_pause, status = be_cmd_set_flow_control(adapter,
ecmd->rx_pause); adapter->tx_fc, adapter->rx_fc);
if (!status) if (status)
dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");
return status; return status;
......
...@@ -1652,7 +1652,8 @@ static int be_setup(struct be_adapter *adapter) ...@@ -1652,7 +1652,8 @@ static int be_setup(struct be_adapter *adapter)
if (status != 0) if (status != 0)
goto mccqs_destroy; goto mccqs_destroy;
status = be_cmd_set_flow_control(adapter, true, true); status = be_cmd_set_flow_control(adapter,
adapter->tx_fc, adapter->rx_fc);
if (status != 0) if (status != 0)
goto mccqs_destroy; goto mccqs_destroy;
return 0; return 0;
...@@ -1909,6 +1910,10 @@ static void be_netdev_init(struct net_device *netdev) ...@@ -1909,6 +1910,10 @@ static void be_netdev_init(struct net_device *netdev)
adapter->rx_csum = true; adapter->rx_csum = true;
/* Default settings for Rx and Tx flow control */
adapter->rx_fc = true;
adapter->tx_fc = true;
netif_set_gso_max_size(netdev, 65535); netif_set_gso_max_size(netdev, 65535);
BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); BE_SET_NETDEV_OPS(netdev, &be_netdev_ops);
...@@ -2171,6 +2176,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -2171,6 +2176,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
be_close(netdev); be_close(netdev);
rtnl_unlock(); rtnl_unlock();
} }
be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc);
be_clear(adapter); be_clear(adapter);
pci_save_state(pdev); pci_save_state(pdev);
......
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