be2net: fix unnecessary access to hardware to get link, port info
Every time while doing ethtool->get_settings we are accessing the hardware to get link status and port information. This is not necessary. We now use the cached copy for this info and update it when the link status changes. From: Suresh R <sureshr@serverengines.com> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
b7b83ac39a
commit
0dffc83e5b
@@ -220,6 +220,7 @@ void be_link_status_update(struct be_adapter *adapter, bool link_up)
|
||||
|
||||
/* If link came up or went down */
|
||||
if (adapter->link_up != link_up) {
|
||||
adapter->link_speed = -1;
|
||||
if (link_up) {
|
||||
netif_start_queue(netdev);
|
||||
netif_carrier_on(netdev);
|
||||
@@ -1674,6 +1675,8 @@ static int be_setup(struct be_adapter *adapter)
|
||||
if (status != 0)
|
||||
goto rx_qs_destroy;
|
||||
|
||||
adapter->link_speed = -1;
|
||||
|
||||
return 0;
|
||||
|
||||
rx_qs_destroy:
|
||||
|
Reference in New Issue
Block a user