netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] bonding: Remove net_device_stats from bonding struct
@ 2010-02-02  0:06 Ajit Khaparde
  2010-02-02 21:40 ` Jay Vosburgh
  2010-02-04  4:33 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ajit Khaparde @ 2010-02-02  0:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ajit Khaparde

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

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
 drivers/net/bonding/bond_main.c |    2 +-
 drivers/net/bonding/bonding.h   |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6221936..1787e3c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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;
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 558ec13..257a7a4 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -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];
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next-2.6] bonding: Remove net_device_stats from bonding struct
  2010-02-02  0:06 [PATCH net-next-2.6] bonding: Remove net_device_stats from bonding struct Ajit Khaparde
@ 2010-02-02 21:40 ` Jay Vosburgh
  2010-02-04  4:33 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jay Vosburgh @ 2010-02-02 21:40 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: David Miller, netdev

Ajit Khaparde <ajitkhaparde@gmail.com> wrote:

>There is no need to maintain stats in the bonding structure.
>Use the instance of net_device_stats in netdevice.
>
>Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>

	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.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

	-J

>---
> drivers/net/bonding/bond_main.c |    2 +-
> drivers/net/bonding/bonding.h   |    1 -
> 2 files changed, 1 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 6221936..1787e3c 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -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;
>diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>index 558ec13..257a7a4 100644
>--- a/drivers/net/bonding/bonding.h
>+++ b/drivers/net/bonding/bonding.h
>@@ -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];
>-- 
>1.6.3.3
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next-2.6] bonding: Remove net_device_stats from bonding struct
  2010-02-02  0:06 [PATCH net-next-2.6] bonding: Remove net_device_stats from bonding struct Ajit Khaparde
  2010-02-02 21:40 ` Jay Vosburgh
@ 2010-02-04  4:33 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2010-02-04  4:33 UTC (permalink / raw)
  To: ajitk, ajitkhaparde; +Cc: netdev

From: Ajit Khaparde <ajitkhaparde@gmail.com>
Date: Tue, 2 Feb 2010 05:36:52 +0530

> There is no need to maintain stats in the bonding structure.
> Use the instance of net_device_stats in netdevice.
> 
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-04  4:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-02  0:06 [PATCH net-next-2.6] bonding: Remove net_device_stats from bonding struct Ajit Khaparde
2010-02-02 21:40 ` Jay Vosburgh
2010-02-04  4:33 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).