netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com
Subject: [PATCH 2/3] [NET]: Allow dumping of application specific statistics if no primary TLV is used
Date: Sat, 2 Apr 2005 01:28:01 +0200	[thread overview]
Message-ID: <20050401232801.GL3086@postel.suug.ch> (raw)
In-Reply-To: <20050401232654.GJ3086@postel.suug.ch>

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/04/01 14:24:14+02:00 tgraf@suug.ch 
#   [NET]: Allow dumping of application specific statistics if no primary TLV is used
#   
#   Although this case is hypothetical at the moment, more advanced actions are
#   likely to need this in the future.
#   
#   Signed-off-by: Thomas Graf <tgraf@suug.ch>
#   Signed-off-by: David S. Miller <davem@davemloft.net> 
# 
# net/core/gen_stats.c
#   2005/04/01 14:23:57+02:00 tgraf@suug.ch +7 -4
#   [NET]: Allow dumping of application specific statistics if no primary TLV is used
# 
# include/net/gen_stats.h
#   2005/04/01 14:23:57+02:00 tgraf@suug.ch +2 -1
#   [NET]: Allow dumping of application specific statistics if no primary TLV is used
# 
diff -Nru a/include/net/gen_stats.h b/include/net/gen_stats.h
--- a/include/net/gen_stats.h	2005-04-02 01:18:33 +02:00
+++ b/include/net/gen_stats.h	2005-04-02 01:18:33 +02:00
@@ -15,7 +15,8 @@
 	/* Backward compatability */
 	int               compat_tc_stats;
 	int               compat_xstats;
-	struct rtattr *   xstats;
+	void *            xstats;
+	int               xstats_len;
 	struct tc_stats   tc_stats;
 };
 
diff -Nru a/net/core/gen_stats.c b/net/core/gen_stats.c
--- a/net/core/gen_stats.c	2005-04-02 01:18:33 +02:00
+++ b/net/core/gen_stats.c	2005-04-02 01:18:33 +02:00
@@ -177,8 +177,11 @@
 int
 gnet_stats_copy_app(struct gnet_dump *d, void *st, int len)
 {
-	if (d->compat_xstats)
-		d->xstats = (struct rtattr *) d->skb->tail;
+	if (d->compat_xstats) {
+		d->xstats = st;
+		d->xstats_len = len;
+	}
+
 	return gnet_stats_copy(d, TCA_STATS_APP, st, len);
 }
 
@@ -206,8 +209,8 @@
 			return -1;
 
 	if (d->compat_xstats && d->xstats) {
-		if (gnet_stats_copy(d, d->compat_xstats, RTA_DATA(d->xstats),
-			RTA_PAYLOAD(d->xstats)) < 0)
+		if (gnet_stats_copy(d, d->compat_xstats, d->xstats,
+			d->xstats_len) < 0)
 			return -1;
 	}
 

  parent reply	other threads:[~2005-04-01 23:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-01 23:26 [PATCHSET] action statistics dumping fix & gnet_stats improvements Thomas Graf
2005-04-01 23:27 ` [PATCH 1/3] [PKT_SCHED]: Properly return when no backward compatibility action statistics are to be dumped Thomas Graf
2005-04-01 23:28 ` Thomas Graf [this message]
2005-04-01 23:28 ` [PATCH 3/3] [NET]: Improve gnet_stats_* dumping logic to be less error prone Thomas Graf
2005-04-01 23:49 ` [PATCHSET] action statistics dumping fix & gnet_stats improvements David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050401232801.GL3086@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).