Skip to contentSkip to conversation

be2net: fix unnecessary access to hardware to get link, port info

PATCH Applied Ajit Khaparde 2 participants 2 messages Nov 30, 2009 – Dec 2, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/6 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 <[email protected]>

---
 drivers/net/benet/be.h         |    2 +
 drivers/net/benet/be_ethtool.c |   56 ++++++++++++++++++++++++---------------
 drivers/net/benet/be_main.c    |    3 ++
 3 files changed, 39 insertions(+), 22 deletions(-)
drivers/net/benet/be.h +2 -0
index d90cc01..1224748 100644
@@ -272,6 +272,8 @@ struct be_adapter {
 	u32 cap;
 	u32 rx_fc;		/* Rx flow control */
 	u32 tx_fc;		/* Tx flow control */
+	int link_speed;
+	u8 port_type;
 };
 
 extern const struct ethtool_ops be_ethtool_ops;
drivers/net/benet/be_ethtool.c +33 -21

69 lines not on this page · raw message

drivers/net/benet/be_main.c +3 -0
index f3e97ab..e291b1b 100644
@@ -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:
Signature · 1 line
1.6.3.3
maintainer Applied
#1 lore raw

From: Ajit Khaparde <[email protected]>
Date: Mon, 30 Nov 2009 09:27:46 +0530

Quoted 8 lines

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 <[email protected]>

Applied.