Skip to contentSkip to conversation

bonding: Remove net_device_stats from bonding struct

PATCH Applied Ajit Khaparde 3 participants 3 messages Feb 2, 2010 – Feb 4, 2010

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

PATCH 1/1 bonding: Remove net_device_stats from bonding struct

There is no need to maintain stats in the bonding structure. Use the instance of net_device_stats in netdevice.

---
 drivers/net/bonding/bond_main.c |    2 +-
 drivers/net/bonding/bonding.h   |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +1 -1
index 6221936..1787e3c 100644
@@ -3742,7 +3742,7 @@ static int bond_close(struct net_device *bond_dev)
 static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
-	struct net_device_stats *stats = &bond->stats;
+	struct net_device_stats *stats = &bond_dev->stats;
 	struct net_device_stats local_stats;
 	struct slave *slave;
 	int i;
drivers/net/bonding/bonding.h +0 -1
index 558ec13..257a7a4 100644
@@ -197,7 +197,6 @@ struct bonding {
 	s8	 send_grat_arp;
 	s8	 send_unsol_na;
 	s8	 setup_by_slave;
-	struct   net_device_stats stats;
 #ifdef CONFIG_PROC_FS
 	struct   proc_dir_entry *proc_entry;
 	char     proc_file_name[IFNAMSIZ];
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 4 lines · Ajit Khaparde

There is no need to maintain stats in the bonding structure. Use the instance of net_device_stats in netdevice.

Note that the accumulation of stats across the slaves is done
into a separate local instance of net_device_stats, so partial results shouldn't be visible.

	-J
Quoted 37 lines

---

drivers/net/bonding/bond_main.c |    2 +-
drivers/net/bonding/bonding.h   |    1 -
2 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +1 -1
index 6221936..1787e3c 100644
@@ -3742,7 +3742,7 @@ static int bond_close(struct net_device *bond_dev)
 static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
-	struct net_device_stats *stats = &bond->stats;
+	struct net_device_stats *stats = &bond_dev->stats;
 	struct net_device_stats local_stats;
 	struct slave *slave;
 	int i;
drivers/net/bonding/bonding.h +0 -1
index 558ec13..257a7a4 100644
@@ -197,7 +197,6 @@ struct bonding {
 	s8	 send_grat_arp;
 	s8	 send_unsol_na;
 	s8	 setup_by_slave;
-	struct   net_device_stats stats;
 #ifdef CONFIG_PROC_FS
 	struct   proc_dir_entry *proc_entry;
 	char     proc_file_name[IFNAMSIZ];
Signature · 6 lines
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html