Re: [GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-20 Thread David Miller
From: YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]>
Date: Thu, 19 Apr 2007 21:04:54 +0900 (JST)

> [IPV6] SNMP: Export statistics via netlink without CONFIG_PROC_FS.
> 
> Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

I applied this to my net-2.6.22 tree, thank you.
-
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


Re: [GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-20 Thread David Miller
From: YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]>
Date: Thu, 19 Apr 2007 15:42:09 +0900 (JST)

> [IPV6] SNMP: Netlink interface.
> [IPV6] SNMP: Move some statistic bits to net/ipv6/proc.c.
> [IPV4] SNMP: Move some statistic bits to net/ipv4/proc.c.

I applied these as patches to my net-2.6.22 tree.

Thanks.
-
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


Re: [GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-19 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Thu, 19 Apr 2007 13:24:12 -0700 (PDT)), 
David Miller <[EMAIL PROTECTED]> says:

> From: YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]>
> Date: Thu, 19 Apr 2007 21:04:54 +0900 (JST)
> 
> > net-2.6.22-20070417-stats-20070419
> 
> I tried to pull this but I killed it before it tried to merge
> because it looked very large:
> 
> remote: Generating pack...
> remote: Done counting 5200 objects.
> remote: Result has 4227 objects.
> 
> such a small set of changes should not need so many objects
> :-)
:
> I'm going to rebase my tree today, so please resubmit this work
> after I sent a notification here that I have done so.

Hmm, strange; something was wrong.
Any way, of course, I will do so.

Regards,

--yoshfuji
-
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


Re: [GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-19 Thread David Miller
From: YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]>
Date: Thu, 19 Apr 2007 21:04:54 +0900 (JST)

> net-2.6.22-20070417-stats-20070419

I tried to pull this but I killed it before it tried to merge
because it looked very large:

remote: Generating pack...
remote: Done counting 5200 objects.
remote: Result has 4227 objects.

such a small set of changes should not need so many objects
:-)

I imagined you created your net-2.6.22 tree from a more
recent clone of Linus's tree, and therefore I'd end
up getting all of those changes too.

What I'll do is try to pull your work into another tree,
extract out just the ipv6 changes discussed here and
then apply them as patches to my net-2.6.22 tree.

Actually, a pull into net-2.6.22 didn't at all, see below :-(

I'm going to rebase my tree today, so please resubmit this work
after I sent a notification here that I have done so.

Thank you.

[EMAIL PROTECTED]:~/src/GIT$ git clone -l -s net-2.6.22/.git ipv6-2.6.22
Initialized empty Git repository in /home/davem/src/GIT/ipv6-2.6.22/.git/
Checking files out...
 100% (21559/21559) done
[EMAIL PROTECTED]:~/src/GIT$ cd ipv6-2.6.22
[EMAIL PROTECTED]:~/src/GIT/ipv6-2.6.22$ git pull 
git://git.linux-ipv6.org/gitroot/yoshfuji/linux-2.6-dev.git 
net-2.6.22-20070417-stats-20070419
remote: Generating pack...
remote: Done counting 5200 objects.
remote: Result has 4227 objects.
remote: Deltifying 4227 objects.
remote: 
Indexing 4227 objects.
remote: Total 4227, written 4227 (delta 3889), reused 1 (delta 1)
 100% (4227/4227) done
Resolving 3889 deltas.
 100% (3889/3889) done
1377 objects were added to complete this thin pack.
 100% (22194/22194) done
Auto-merged Documentation/feature-removal-schedule.txt
Auto-merged Documentation/networking/ip-sysctl.txt
Auto-merged arch/ia64/hp/sim/simeth.c
Auto-merged arch/ia64/sn/kernel/xpnet.c
Auto-merged drivers/char/random.c
Auto-merged drivers/connector/connector.c
Auto-merged drivers/infiniband/ulp/ipoib/ipoib_cm.c
Auto-merged drivers/isdn/gigaset/usb-gigaset.c
Auto-merged drivers/isdn/hysdn/hycapi.c
CONFLICT (content): Merge conflict in drivers/isdn/hysdn/hycapi.c
Auto-merged drivers/isdn/pcbit/capi.c
CONFLICT (content): Merge conflict in drivers/isdn/pcbit/capi.c
Auto-merged drivers/net/3c523.c
CONFLICT (content): Merge conflict in drivers/net/3c523.c
Auto-merged drivers/net/8139too.c
Auto-merged drivers/net/appletalk/ltpc.c
Auto-merged drivers/net/atari_bionet.c
Auto-merged drivers/net/atari_pamsnet.c
Auto-merged drivers/net/atl1/atl1_main.c
Auto-merged drivers/net/b44.c
Auto-merged drivers/net/bnx2.c
Auto-merged drivers/net/bonding/bond_main.c
Auto-merged drivers/net/chelsio/sge.c
Auto-merged drivers/net/cxgb3/cxgb3_offload.c
Auto-merged drivers/net/cxgb3/sge.c
Auto-merged drivers/net/defxx.c
Auto-merged drivers/net/e1000/e1000_main.c
Auto-merged drivers/net/ehea/ehea_main.c
Auto-merged drivers/net/forcedeth.c
Auto-merged drivers/net/irda/ali-ircc.c
Auto-merged drivers/net/irda/au1k_ir.c
Auto-merged drivers/net/irda/donauboe.c
Auto-merged drivers/net/irda/mcs7780.c
Auto-merged drivers/net/irda/nsc-ircc.c
Auto-merged drivers/net/irda/pxaficp_ir.c
Auto-merged drivers/net/irda/stir4200.c
Auto-merged drivers/net/irda/via-ircc.c
Auto-merged drivers/net/irda/w83977af_ir.c
Auto-merged drivers/net/ixgb/ixgb_main.c
Auto-merged drivers/net/loopback.c
CONFLICT (content): Merge conflict in drivers/net/loopback.c
Auto-merged drivers/net/macb.c
Auto-merged drivers/net/mv643xx_eth.c
Auto-merged drivers/net/myri10ge/myri10ge.c
Auto-merged drivers/net/netxen/netxen_nic_init.c
Auto-merged drivers/net/ni52.c
CONFLICT (content): Merge conflict in drivers/net/ni52.c
Auto-merged drivers/net/qla3xxx.c
Auto-merged drivers/net/r8169.c
Auto-merged drivers/net/sc92031.c
Auto-merged drivers/net/sis190.c
Auto-merged drivers/net/sk98lin/skge.c
Auto-merged drivers/net/skfp/skfddi.c
Auto-merged drivers/net/skge.c
Auto-merged drivers/net/sky2.c
Auto-merged drivers/net/sun3lance.c
Auto-merged drivers/net/sungem.c
Auto-merged drivers/net/tg3.c
Auto-merged drivers/net/tokenring/3c359.c
CONFLICT (content): Merge conflict in drivers/net/tokenring/3c359.c
Auto-merged drivers/net/tokenring/olympic.c
CONFLICT (content): Merge conflict in drivers/net/tokenring/olympic.c
Auto-merged drivers/net/tokenring/smctr.c
Auto-merged drivers/net/tokenring/tms380tr.c
Auto-merged drivers/net/wan/pc300_drv.c
Auto-merged drivers/net/wan/pc300_tty.c
Auto-merged drivers/net/wan/z85230.c
Auto-merged drivers/net/wireless/prism54/islpci_eth.c
CONFLICT (content): Merge conflict in drivers/net/wireless/prism54/islpci_eth.c
Auto-merged drivers/s390/net/qeth_main.c
Auto-merged drivers/scsi/scsi_netlink.c
Auto-merged drivers/scsi/scsi_transport_iscsi.c
Auto-merged drivers/usb/atm/usbatm.c
CONFLICT (content): Merge conflict in drivers/usb/atm/usbatm.c
Auto-merged drivers/usb/net/asix.c
Auto-merged fs/compat_ioctl.c
Auto-merged fs/ecryptfs/netlink.c
Auto-merged include/linux/dccp.h
Auto-merged include/linux/fib_rules.h
CONFLICT (content): Merge conflict in in

Re: [GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-19 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Thu, 19 Apr 2007 17:58:55 +0900 (JST)), 
YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]> says:

> In article <[EMAIL PROTECTED]> (at Thu, 19 Apr 2007 10:44:12 +0200), Thomas 
> Graf <[EMAIL PROTECTED]> says:
> 
> > * YOSHIFUJI Hideaki <[EMAIL PROTECTED]> 2007-04-19 15:42
> > > 
> > > Please consider pulling following changesets for supporting exporting
> > > stats information via netlink, on top of net-2.6.22.
> > 
> > The netlink bits are perfectly fine, why the dependency on proc fs?
> 
> I'll follow up to eliminate such dependency afterwards.

Here it is.

All changesets are available on the
net-2.6.22-20070417-stats-20070419
branch at
.

---
[IPV6] SNMP: Export statistics via netlink without CONFIG_PROC_FS.

Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/ipv6/proc.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 5c3ce1c..c847cef 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -141,6 +141,7 @@ static struct snmp_mib snmp6_udplite6_list[] = {
SNMP_MIB_ITEM("UdpLite6OutDatagrams", UDP_MIB_OUTDATAGRAMS),
SNMP_MIB_SENTINEL
 };
+#endif /* CONFIG_PROC_FS */
 
 static unsigned long
 fold_field(void *mib[], int offt)
@@ -155,6 +156,7 @@ fold_field(void *mib[], int offt)
return res;
 }
 
+#ifdef CONFIG_PROC_FS
 static inline void
 snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_mib 
*itemlist)
 {
@@ -206,6 +208,7 @@ static const struct file_operations snmp6_seq_fops = {
.llseek  = seq_lseek,
.release = single_release,
 };
+#endif /* CONFIG_PROC_FS */
 
 static inline void
 __snmp6_fill_stats(u64 *stats, void **mib, int items, int bytes)
@@ -232,6 +235,7 @@ snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int 
attrtype, int bytes)
}
 }
 
+#ifdef CONFIG_PROC_FS
 int snmp6_register_dev(struct inet6_dev *idev)
 {
struct proc_dir_entry *p;
@@ -309,12 +313,6 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
return 0;
 }
 
-void
-snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype, int bytes)
-{
-   memset(stats, 0, sizeof(bytes));
-}
-
 #endif /* CONFIG_PROC_FS */
 
 int snmp6_alloc_dev(struct inet6_dev *idev)
-- 
1.5.1

-
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


Re: [GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-19 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Thu, 19 Apr 2007 10:44:12 +0200), Thomas 
Graf <[EMAIL PROTECTED]> says:

> * YOSHIFUJI Hideaki <[EMAIL PROTECTED]> 2007-04-19 15:42
> > 
> > Please consider pulling following changesets for supporting exporting
> > stats information via netlink, on top of net-2.6.22.
> 
> The netlink bits are perfectly fine, why the dependency on proc fs?

I'll follow up to eliminate such dependency afterwards.

--yoshfuji
-
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


Re: [GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-19 Thread Thomas Graf
* YOSHIFUJI Hideaki / ?$B5HF#1QL@ <[EMAIL PROTECTED]> 2007-04-19 15:42
> 
> Please consider pulling following changesets for supporting exporting
> stats information via netlink, on top of net-2.6.22.

The netlink bits are perfectly fine, why the dependency on proc fs?
-
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


[GIT PATCH] Exporting IPv6 statistics via netlink.

2007-04-18 Thread YOSHIFUJI Hideaki / 吉藤英明
Hello.

(Sorry for resending..., I failed to put an appropriate subject line...)

Please consider pulling following changesets for supporting exporting
stats information via netlink, on top of net-2.6.22.

Statistics values are exported as u64.  Correspoinding draft patch
for iproute2 can be found at



3rd patch is preparation for preparation for future support for
IPv4 per-interface statistics and netlink interface, so we may want
to drop it for now.

All changeset are available on branch
net-2.6.22-20070417-stats-20070417
at
.

Regards,

---

HEADLINES
-

[IPV6] SNMP: Netlink interface.
[IPV6] SNMP: Move some statistic bits to net/ipv6/proc.c.
[IPV4] SNMP: Move some statistic bits to net/ipv4/proc.c.

DIFFSTAT


 include/linux/if_link.h |1 +
 include/net/ip.h|3 ++
 include/net/ipv6.h  |1 +
 net/ipv4/af_inet.c  |   59 ++---
 net/ipv4/proc.c |   25 +++
 net/ipv6/addrconf.c |   22 +
 net/ipv6/af_inet6.c |   33 -
 net/ipv6/proc.c |   62 +++
 8 files changed, 148 insertions(+), 58 deletions(-)

CHANGESETS
--

commit 4fa0b46927813ad4d70c82e0049d419345ddb7de
Author: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
Date:   Tue Apr 3 18:21:31 2007 +0900

[IPV6] SNMP: Netlink interface.

Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 35ed3b5..604c243 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -126,6 +126,7 @@ enum
IFLA_INET6_STATS,   /* statistics   */
IFLA_INET6_MCAST,   /* MC things. What of them? */
IFLA_INET6_CACHEINFO,   /* time values and max reasm size */
+   IFLA_INET6_ICMP6STATS,  /* statistics (icmpv6)  */
__IFLA_INET6_MAX
 };
 
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 00328b7..4408def 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -172,6 +172,7 @@ int snmp6_alloc_dev(struct inet6_dev *idev);
 int snmp6_free_dev(struct inet6_dev *idev);
 int snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign);
 void snmp6_mib_free(void *ptr[2]);
+void snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype, int 
bytes);
 
 struct ip6_ra_chain
 {
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 47d3adf..d80ca98 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3429,6 +3429,8 @@ static inline size_t inet6_if_nlmsg_size(void)
nla_total_size(4) /* IFLA_INET6_FLAGS */
+ nla_total_size(sizeof(struct ifla_cacheinfo))
+ nla_total_size(DEVCONF_MAX * 4) /* IFLA_INET6_CONF */
+   + nla_total_size(IPSTATS_MIB_MAX * 8) /* 
IFLA_INET6_STATS */
+   + nla_total_size(ICMP6_MIB_MAX * 8) /* 
IFLA_INET6_ICMP6STATS */
 );
 }
 
@@ -3436,7 +3438,7 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct 
inet6_dev *idev,
 u32 pid, u32 seq, int event, unsigned int flags)
 {
struct net_device *dev = idev->dev;
-   struct nlattr *conf;
+   struct nlattr *nla;
struct ifinfomsg *hdr;
struct nlmsghdr *nlh;
void *protoinfo;
@@ -3476,12 +3478,22 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, 
struct inet6_dev *idev,
ci.retrans_time = idev->nd_parms->retrans_time;
NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci);
 
-   conf = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32));
-   if (conf == NULL)
+   nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32));
+   if (nla == NULL)
goto nla_put_failure;
-   ipv6_store_devconf(&idev->cnf, nla_data(conf), nla_len(conf));
+   ipv6_store_devconf(&idev->cnf, nla_data(nla), nla_len(nla));
 
-   /* XXX - Statistics/MC not implemented */
+   /* XXX - MC not implemented */
+
+   nla = nla_reserve(skb, IFLA_INET6_STATS, IPSTATS_MIB_MAX * sizeof(u64));
+   if (nla == NULL)
+   goto nla_put_failure;
+   snmp6_fill_stats(nla_data(nla), idev, IFLA_INET6_STATS, nla_len(nla));
+
+   nla = nla_reserve(skb, IFLA_INET6_ICMP6STATS, ICMP6_MIB_MAX * 
sizeof(u64));
+   if (nla == NULL)
+   goto nla_put_failure;
+   snmp6_fill_stats(nla_data(nla), idev, IFLA_INET6_ICMP6STATS, 
nla_len(nla));
 
nla_nest_end(skb, protoinfo);
return nlmsg_end(skb, nlh);
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index fa3fb50..0dc5515 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -207,6 +207,31 @@ static const struct file_operations snmp6_seq_fops = {
.release =