ipv6: making IP/ICMP mibs per/namespace
Subsystems (6)
cover ipv6: making IP/ICMP mibs per/namespace
This patch series makes IP6/ICMP6 mibs per/namespace using infrastructure accepted with UDP6 mib infrastructure.
Regards,
Den
PATCH 1/14 ipv6: local dev is actually unused in ip6_fragment
--- net/ipv6/ip6_output.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
net/ipv6/ip6_output.c +0 -2
@@ -613,7 +613,6 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)static int ip6_fragment (struct sk_buff *skb,int (*output)(struct sk_buff *)) { -struct net_device *dev;struct sk_buff *frag;struct rt6_info *rt = (struct rt6_info *)skb->dst;struct ipv6_pinfo *np = skb->sk ?inet6_sk (skb->sk) :NULL ;
@@ -624,7 +623,6 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))int ptr, offset =0 , err=0 ;u8 *prevhdr, nexthdr =0 ; - dev = rt->u.dst.dev; hlen =ip6_find_1stfragopt (skb, &prevhdr); nexthdr = *prevhdr;
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 01/14] ipv6: local dev is actually unused in ip6_fragment
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:49 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 2/14 ipv6: consolidate error paths in ipv6_frag_rcv
In reply to Denis V. Lunev--- net/ipv6/reassembly.c | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-)
net/ipv6/reassembly.c +10 -12
@@ -578,19 +578,12 @@ static int ipv6_frag_rcv(struct sk_buff *skb)IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMREQDS );/* Jumbo payload inhibits frag. header */ -if (hdr->payload_len==0 ) { -IP6_INC_STATS (ip6_dst_idev (skb->dst),IPSTATS_MIB_INHDRERRORS ); -icmpv6_param_prob (skb,ICMPV6_HDR_FIELD , -skb_network_header_len (skb)); -return -1 ; - } +if (hdr->payload_len==0 ) + goto fail_hdr; +if (!pskb_may_pull (skb, (skb_transport_offset (skb) + -sizeof (struct frag_hdr )))) { -IP6_INC_STATS (ip6_dst_idev (skb->dst),IPSTATS_MIB_INHDRERRORS ); -icmpv6_param_prob (skb,ICMPV6_HDR_FIELD , -skb_network_header_len (skb)); -return -1 ; - } +sizeof (struct frag_hdr )))) + goto fail_hdr; hdr =ipv6_hdr (skb); fhdr = (struct frag_hdr *)skb_transport_header (skb);
@@ -624,6 +617,11 @@ static int ipv6_frag_rcv(struct sk_buff *skb)IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMFAILS );kfree_skb (skb);return -1 ; + +fail_hdr: +IP6_INC_STATS (ip6_dst_idev (skb->dst),IPSTATS_MIB_INHDRERRORS ); +icmpv6_param_prob (skb,ICMPV6_HDR_FIELD ,skb_network_header_len (skb)); +return -1 ; } static struct inet6_protocol frag_protocol =
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 02/14] ipv6: consolidate error paths in ipv6_frag_rcv
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:50 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 3/14 netns: add net parameter to IP6_INC_STATS
In reply to Denis V. Lunev--- include/net/ipv6.h | 3 +- net/ipv6/icmp.c | 2 +- net/ipv6/ip6_output.c | 56 +++++++++++++++++++++++++++++------------------- net/ipv6/mcast.c | 10 ++++---- net/ipv6/ndisc.c | 4 +- net/ipv6/netfilter.c | 3 +- net/ipv6/raw.c | 4 +- net/ipv6/reassembly.c | 8 +++--- net/ipv6/route.c | 7 ++++- 9 files changed, 57 insertions(+), 40 deletions(-)
include/net/ipv6.h +2 -1
@@ -129,7 +129,8 @@ extern struct ctl_path net_ipv6_ctl_path[];/* MIBs */ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); -#define IP6_INC_STATS (idev,field) _DEVINC(ipv6, , idev, field) +#define IP6_INC_STATS (net, idev,field) ({ (void)(net); \ + _DEVINC(ipv6, , idev, field); })#define IP6_INC_STATS_BH (idev,field) _DEVINC(ipv6, _BH, idev, field)#define IP6_ADD_STATS_BH (idev,field,val) _DEVADD(ipv6, _BH, idev, field, val)
net/ipv6/icmp.c +1 -1
@@ -183,7 +183,7 @@ static inline int icmpv6_xrlim_allow(struct sock *sk, int type,*/ dst =ip6_route_output (net, sk, fl);if (dst->error) { -IP6_INC_STATS (ip6_dst_idev (dst), +IP6_INC_STATS (net,ip6_dst_idev (dst),IPSTATS_MIB_OUTNOROUTES ); }else if (dst->dev && (dst->dev->flags&IFF_LOOPBACK )) { res =1 ;
net/ipv6/ip6_output.c +34 -22
198 lines not on this page · raw message
net/ipv6/mcast.c +5 -5
@@ -1446,7 +1446,7 @@ static void mld_sendpack(struct sk_buff *skb)int err;struct flowi fl; -IP6_INC_STATS (idev,IPSTATS_MIB_OUTREQUESTS ); +IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTREQUESTS ); payload_len = (skb->tail - skb->network_header) -sizeof (*pip6); mldlen = skb->tail - skb->transport_header; pip6->payload_len =htons (payload_len);
@@ -1771,7 +1771,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)struct flowi fl;rcu_read_lock (); -IP6_INC_STATS (__in6_dev_get (dev), +IP6_INC_STATS (net,__in6_dev_get (dev),IPSTATS_MIB_OUTREQUESTS );rcu_read_unlock ();if (type ==ICMPV6_MGM_REDUCTION )
@@ -1787,7 +1787,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)if (skb ==NULL ) {rcu_read_lock (); -IP6_INC_STATS (__in6_dev_get (dev), +IP6_INC_STATS (net,__in6_dev_get (dev),IPSTATS_MIB_OUTDISCARDS );rcu_read_unlock ();return ;
@@ -1841,9 +1841,9 @@ out:if (!err) {ICMP6MSGOUT_INC_STATS (idev, type);ICMP6_INC_STATS (idev,ICMP6_MIB_OUTMSGS ); -IP6_INC_STATS (idev,IPSTATS_MIB_OUTMCASTPKTS ); +IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTMCASTPKTS ); }else -IP6_INC_STATS (idev,IPSTATS_MIB_OUTDISCARDS ); +IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTDISCARDS );if (likely (idev !=NULL ))in6_dev_put (idev);
net/ipv6/ndisc.c +2 -2
@@ -516,7 +516,7 @@ static void __ndisc_send(struct net_device *dev, skb->dst = dst; idev =in6_dev_get (dst->dev); -IP6_INC_STATS (idev,IPSTATS_MIB_OUTREQUESTS ); +IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTREQUESTS ); err =NF_HOOK (PF_INET6 ,NF_INET_LOCAL_OUT , skb,NULL , dst->dev, dst_output);
@@ -1581,7 +1581,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, buff->dst = dst; idev =in6_dev_get (dst->dev); -IP6_INC_STATS (idev,IPSTATS_MIB_OUTREQUESTS ); +IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTREQUESTS ); err =NF_HOOK (PF_INET6 ,NF_INET_LOCAL_OUT , buff,NULL , dst->dev, dst_output);if (!err) {
net/ipv6/netfilter.c +2 -1
@@ -33,7 +33,8 @@ int ip6_route_me_harder(struct sk_buff *skb)#endif if (dst->error) { -IP6_INC_STATS (ip6_dst_idev (dst),IPSTATS_MIB_OUTNOROUTES ); +IP6_INC_STATS (&init_net,ip6_dst_idev (dst), +IPSTATS_MIB_OUTNOROUTES );LIMIT_NETDEBUG (KERN_DEBUG "ip6_route_me_harder: No more route.\n" );dst_release (dst);return -EINVAL ;
net/ipv6/raw.c +2 -2
@@ -638,7 +638,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,if (err) goto error_fault; -IP6_INC_STATS (rt->rt6i_idev,IPSTATS_MIB_OUTREQUESTS ); +IP6_INC_STATS (sock_net (sk), rt->rt6i_idev,IPSTATS_MIB_OUTREQUESTS ); err =NF_HOOK (PF_INET6 ,NF_INET_LOCAL_OUT , skb,NULL , rt->u.dst.dev, dst_output);if (err >0 )
@@ -652,7 +652,7 @@ error_fault: err = -EFAULT ;kfree_skb (skb); error: -IP6_INC_STATS (rt->rt6i_idev,IPSTATS_MIB_OUTDISCARDS ); +IP6_INC_STATS (sock_net (sk), rt->rt6i_idev,IPSTATS_MIB_OUTDISCARDS );return err; }
net/ipv6/reassembly.c +4 -4
@@ -433,7 +433,8 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,return -1 ; err: -IP6_INC_STATS (ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMFAILS ); +IP6_INC_STATS (dev_net (skb->dst->dev),ip6_dst_idev (skb->dst), +IPSTATS_MIB_REASMFAILS );kfree_skb (skb);return -1 ; }
@@ -573,7 +574,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)struct frag_hdr *fhdr;struct frag_queue *fq;struct ipv6hdr *hdr =ipv6_hdr (skb); -struct net *net; +struct net *net =dev_net (skb->dst->dev);IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMREQDS );
@@ -597,7 +598,6 @@ static int ipv6_frag_rcv(struct sk_buff *skb)return 1 ; } - net =dev_net (skb->dev);if (atomic_read (&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh)ip6_evictor (net,ip6_dst_idev (skb->dst));
@@ -619,7 +619,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)return -1 ; fail_hdr: -IP6_INC_STATS (ip6_dst_idev (skb->dst),IPSTATS_MIB_INHDRERRORS ); +IP6_INC_STATS (net,ip6_dst_idev (skb->dst),IPSTATS_MIB_INHDRERRORS );icmpv6_param_prob (skb,ICMPV6_HDR_FIELD ,skb_network_header_len (skb));return -1 ; }
net/ipv6/route.c +5 -2
@@ -1833,16 +1833,19 @@ int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg)static int ip6_pkt_drop (struct sk_buff *skb,int code,int ipstats_mib_noroutes) {int type; +struct dst_entry *dst = skb->dst;switch (ipstats_mib_noroutes) {case IPSTATS_MIB_INNOROUTES : type =ipv6_addr_type (&ipv6_hdr (skb)->daddr);if (type ==IPV6_ADDR_ANY || type ==IPV6_ADDR_RESERVED ) { -IP6_INC_STATS (ip6_dst_idev (skb->dst),IPSTATS_MIB_INADDRERRORS ); +IP6_INC_STATS (dev_net (dst->dev),ip6_dst_idev (dst), +IPSTATS_MIB_INADDRERRORS );break ; }/* FALLTHROUGH */ case IPSTATS_MIB_OUTNOROUTES : -IP6_INC_STATS (ip6_dst_idev (skb->dst), ipstats_mib_noroutes); +IP6_INC_STATS (dev_net (dst->dev),ip6_dst_idev (dst), + ipstats_mib_noroutes);break ; }icmpv6_send (skb,ICMPV6_DEST_UNREACH , code,0 , skb->dev);
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 03/14] netns: add net parameter to IP6_INC_STATS
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:51 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 4/14 ipv6: added net argument to IP6_INC_STATS_BH
In reply to Denis V. Lunev--- include/net/ipv6.h | 3 ++- net/ipv6/exthdrs.c | 42 ++++++++++++++++++++++++------------------ net/ipv6/ip6_input.c | 27 ++++++++++++++++----------- net/ipv6/ip6_output.c | 18 +++++++++++------- net/ipv6/mcast.c | 4 ++-- net/ipv6/reassembly.c | 26 +++++++++++++++----------- 6 files changed, 70 insertions(+), 50 deletions(-)
include/net/ipv6.h +2 -1
@@ -131,7 +131,8 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);#define IP6_INC_STATS (net, idev,field) ({ (void)(net); \ _DEVINC(ipv6, , idev, field); }) -#define IP6_INC_STATS_BH (idev,field) _DEVINC(ipv6, _BH, idev, field) +#define IP6_INC_STATS_BH (net, idev,field) ({ (void)(net); \ + _DEVINC(ipv6, _BH, idev, field); })#define IP6_ADD_STATS_BH (idev,field,val) _DEVADD(ipv6, _BH, idev, field, val) DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics);
net/ipv6/exthdrs.c +24 -18
150 lines not on this page · raw message
net/ipv6/ip6_input.c +16 -11
@@ -59,6 +59,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptstruct ipv6hdr *hdr;u32 pkt_len;struct inet6_dev *idev; +struct net *net =dev_net (skb->dev);if (skb->pkt_type ==PACKET_OTHERHOST ) {kfree_skb (skb);
@@ -69,11 +70,11 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt idev =__in6_dev_get (skb->dev); -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INRECEIVES ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INRECEIVES );if ((skb =skb_share_check (skb,GFP_ATOMIC )) ==NULL || !idev ||unlikely (idev->cnf.disable_ipv6)) { -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INDISCARDS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INDISCARDS );rcu_read_unlock (); goto out; }
@@ -118,11 +119,12 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt/* pkt_len may be zero if Jumbo payload option is present */ if (pkt_len || hdr->nexthdr !=NEXTHDR_HOP ) {if (pkt_len +sizeof (struct ipv6hdr ) > skb->len) { -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INTRUNCATEDPKTS ); +IP6_INC_STATS_BH (net, + idev,IPSTATS_MIB_INTRUNCATEDPKTS ); goto drop; }if (pskb_trim_rcsum (skb, pkt_len +sizeof (struct ipv6hdr ))) { -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INHDRERRORS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INHDRERRORS ); goto drop; } hdr =ipv6_hdr (skb);
@@ -130,7 +132,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptif (hdr->nexthdr ==NEXTHDR_HOP ) {if (ipv6_parse_hopopts (skb) <0 ) { -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INHDRERRORS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INHDRERRORS );rcu_read_unlock ();return 0 ; }
@@ -141,7 +143,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptreturn NF_HOOK (PF_INET6 ,NF_INET_PRE_ROUTING , skb, dev,NULL , ip6_rcv_finish); err: -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INHDRERRORS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INHDRERRORS ); drop:rcu_read_unlock ();kfree_skb (skb);
@@ -161,6 +163,7 @@ static int ip6_input_finish(struct sk_buff *skb)int nexthdr, raw;u8 hash;struct inet6_dev *idev; +struct net *net =dev_net (skb->dst->dev);/* * Parse extension headers
@@ -205,24 +208,25 @@ resubmit:if (ret >0 ) goto resubmit;else if (ret ==0 ) -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INDELIVERS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INDELIVERS ); }else {if (!raw) {if (xfrm6_policy_check (NULL ,XFRM_POLICY_IN , skb)) { -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INUNKNOWNPROTOS ); +IP6_INC_STATS_BH (net, idev, +IPSTATS_MIB_INUNKNOWNPROTOS );icmpv6_send (skb,ICMPV6_PARAMPROB ,ICMPV6_UNK_NEXTHDR , nhoff, skb->dev); } }else -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INDELIVERS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INDELIVERS );kfree_skb (skb); }rcu_read_unlock ();return 0 ; discard: -IP6_INC_STATS_BH (idev,IPSTATS_MIB_INDISCARDS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_INDISCARDS );rcu_read_unlock ();kfree_skb (skb);return 0 ;
@@ -240,7 +244,8 @@ int ip6_mc_input(struct sk_buff *skb)struct ipv6hdr *hdr;int deliver; -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_INMCASTPKTS ); +IP6_INC_STATS_BH (dev_net (skb->dst->dev), +ip6_dst_idev (skb->dst),IPSTATS_MIB_INMCASTPKTS ); hdr =ipv6_hdr (skb); deliver =ipv6_chk_mcast_addr (skb->dev, &hdr->daddr,NULL );
net/ipv6/ip6_output.c +11 -7
@@ -103,7 +103,8 @@ static int ip6_output_finish(struct sk_buff *skb)else if (dst->neighbour)return dst->neighbour->output (skb); -IP6_INC_STATS_BH (ip6_dst_idev (dst),IPSTATS_MIB_OUTNOROUTES ); +IP6_INC_STATS_BH (dev_net (dst->dev), +ip6_dst_idev (dst),IPSTATS_MIB_OUTNOROUTES );kfree_skb (skb);return -EINVAL ;
@@ -458,7 +459,8 @@ int ip6_forward(struct sk_buff *skb) skb->dev = dst->dev;icmpv6_send (skb,ICMPV6_TIME_EXCEED ,ICMPV6_EXC_HOPLIMIT ,0 , skb->dev); -IP6_INC_STATS_BH (ip6_dst_idev (dst),IPSTATS_MIB_INHDRERRORS ); +IP6_INC_STATS_BH (net, +ip6_dst_idev (dst),IPSTATS_MIB_INHDRERRORS );kfree_skb (skb);return -ETIMEDOUT ;
@@ -527,8 +529,10 @@ int ip6_forward(struct sk_buff *skb)/* Again, force OUTPUT device used as source address */ skb->dev = dst->dev;icmpv6_send (skb,ICMPV6_PKT_TOOBIG ,0 ,dst_mtu (dst), skb->dev); -IP6_INC_STATS_BH (ip6_dst_idev (dst),IPSTATS_MIB_INTOOBIGERRORS ); -IP6_INC_STATS_BH (ip6_dst_idev (dst),IPSTATS_MIB_FRAGFAILS ); +IP6_INC_STATS_BH (net, +ip6_dst_idev (dst),IPSTATS_MIB_INTOOBIGERRORS ); +IP6_INC_STATS_BH (net, +ip6_dst_idev (dst),IPSTATS_MIB_FRAGFAILS );kfree_skb (skb);return -EMSGSIZE ; }
@@ -544,12 +548,12 @@ int ip6_forward(struct sk_buff *skb) hdr->hop_limit--; -IP6_INC_STATS_BH (ip6_dst_idev (dst),IPSTATS_MIB_OUTFORWDATAGRAMS ); +IP6_INC_STATS_BH (net,ip6_dst_idev (dst),IPSTATS_MIB_OUTFORWDATAGRAMS );return NF_HOOK (PF_INET6 ,NF_INET_FORWARD , skb, skb->dev, dst->dev, ip6_forward_finish); error: -IP6_INC_STATS_BH (ip6_dst_idev (dst),IPSTATS_MIB_INADDRERRORS ); +IP6_INC_STATS_BH (net,ip6_dst_idev (dst),IPSTATS_MIB_INADDRERRORS ); drop:kfree_skb (skb);return -EINVAL ;
@@ -991,7 +995,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, out_err_release:if (err == -ENETUNREACH ) -IP6_INC_STATS_BH (NULL ,IPSTATS_MIB_OUTNOROUTES ); +IP6_INC_STATS_BH (net,NULL ,IPSTATS_MIB_OUTNOROUTES );dst_release (*dst); *dst =NULL ;return err;
net/ipv6/mcast.c +2 -2
@@ -1476,9 +1476,9 @@ out:if (!err) {ICMP6MSGOUT_INC_STATS_BH (idev,ICMPV6_MLD2_REPORT );ICMP6_INC_STATS_BH (idev,ICMP6_MIB_OUTMSGS ); -IP6_INC_STATS_BH (idev,IPSTATS_MIB_OUTMCASTPKTS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_OUTMCASTPKTS ); }else -IP6_INC_STATS_BH (idev,IPSTATS_MIB_OUTDISCARDS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_OUTDISCARDS );if (likely (idev !=NULL ))in6_dev_put (idev);
net/ipv6/reassembly.c +15 -11
@@ -213,8 +213,8 @@ static void ip6_frag_expire(unsigned long data) goto out;rcu_read_lock (); -IP6_INC_STATS_BH (__in6_dev_get (dev),IPSTATS_MIB_REASMTIMEOUT ); -IP6_INC_STATS_BH (__in6_dev_get (dev),IPSTATS_MIB_REASMFAILS ); +IP6_INC_STATS_BH (net,__in6_dev_get (dev),IPSTATS_MIB_REASMTIMEOUT ); +IP6_INC_STATS_BH (net,__in6_dev_get (dev),IPSTATS_MIB_REASMFAILS );rcu_read_unlock ();/* Don't send error if the first segment did not arrive. */
@@ -257,7 +257,7 @@ fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst, return container_of(q, struct frag_queue, q); oom: -IP6_INC_STATS_BH (idev,IPSTATS_MIB_REASMFAILS ); +IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_REASMFAILS );return NULL ; }
@@ -267,6 +267,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,struct sk_buff *prev, *next;struct net_device *dev;int offset, end; +struct net *net =dev_net (skb->dst->dev);if (fq->q.last_in &INET_FRAG_COMPLETE ) goto err;
@@ -276,7 +277,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1)));if ((unsigned int )end >IPV6_MAXPLEN ) { -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst), +IP6_INC_STATS_BH (net,ip6_dst_idev (skb->dst),IPSTATS_MIB_INHDRERRORS ); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, ((u8 *)&fhdr->frag_off -
@@ -309,7 +310,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,/* RFC2460 says always send parameter problem in * this case. -DaveM */ -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst), +IP6_INC_STATS_BH (net,ip6_dst_idev (skb->dst),IPSTATS_MIB_INHDRERRORS );icmpv6_param_prob (skb,ICMPV6_HDR_FIELD , offsetof(struct ipv6hdr , payload_len));
@@ -433,7 +434,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,return -1 ; err: -IP6_INC_STATS (dev_net (skb->dst->dev),ip6_dst_idev (skb->dst), +IP6_INC_STATS (net,ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMFAILS );kfree_skb (skb);return -1 ;
@@ -550,7 +551,8 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, head->csum);rcu_read_lock (); -IP6_INC_STATS_BH (__in6_dev_get (dev),IPSTATS_MIB_REASMOKS ); +IP6_INC_STATS_BH (dev_net (dev), +__in6_dev_get (dev),IPSTATS_MIB_REASMOKS );rcu_read_unlock (); fq->q.fragments =NULL ;return 1 ;
@@ -564,7 +566,8 @@ out_oom:printk (KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n" ); out_fail:rcu_read_lock (); -IP6_INC_STATS_BH (__in6_dev_get (dev),IPSTATS_MIB_REASMFAILS ); +IP6_INC_STATS_BH (dev_net (dev), +__in6_dev_get (dev),IPSTATS_MIB_REASMFAILS );rcu_read_unlock ();return -1 ; }
@@ -576,7 +579,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)struct ipv6hdr *hdr =ipv6_hdr (skb);struct net *net =dev_net (skb->dst->dev); -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMREQDS ); +IP6_INC_STATS_BH (net,ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMREQDS );/* Jumbo payload inhibits frag. header */ if (hdr->payload_len==0 )
@@ -592,7 +595,8 @@ static int ipv6_frag_rcv(struct sk_buff *skb)if (!(fhdr->frag_off &htons (0xFFF9 ))) {/* It is not a fragmented frame */ skb->transport_header +=sizeof (struct frag_hdr ); -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMOKS ); +IP6_INC_STATS_BH (net, +ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMOKS );IP6CB (skb)->nhoff = (u8 *)fhdr -skb_network_header (skb);return 1 ;
@@ -614,7 +618,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)return ret; } -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMFAILS ); +IP6_INC_STATS_BH (net,ip6_dst_idev (skb->dst),IPSTATS_MIB_REASMFAILS );kfree_skb (skb);return -1 ;
Signature · 1 line
1.5.3.rc5
David Miller
maintainerRe: [PATCH net-next 04/14] ipv6: added net argument to IP6_INC_STATS_BH
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:52 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Please type "make allmodconfig" before all test builds. Or at least use grep when changing interface signatures.
You missed net/ipv6/ip6mr.c in these changes.
I added the following change to your commit to fix the build:
net/ipv6/ip6mr.c +2 -1
@@ -1383,7 +1383,8 @@ int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg)static inline int ip6mr_forward2_finish (struct sk_buff *skb) { -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_OUTFORWDATAGRAMS ); +IP6_INC_STATS_BH (dev_net (skb->dst->dev),ip6_dst_idev (skb->dst), +IPSTATS_MIB_OUTFORWDATAGRAMS );return dst_output (skb); }
Re: [PATCH net-next 04/14] ipv6: added net argument to IP6_INC_STATS_BH
Quoted 18 lines · David Miller
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:52 +0400Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>Please type "make allmodconfig" before all test builds. Or at least use grep when changing interface signatures.
You missed
net/ipv6/ip6mr.cin these changes.I added the following change to your commit to fix the build:
net/ipv6/ip6mr.c +0
-0
net/ipv6/ip6mr.c int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg) · line 1390
Quoted 9 lines
net/ipv6/ip6mr.c +2
-1@@ -1383,7 +1383,8 @@ int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg)static inline int ip6mr_forward2_finish (struct sk_buff *skb) { -IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_OUTFORWDATAGRAMS ); +IP6_INC_STATS_BH (dev_net (skb->dst->dev),ip6_dst_idev (skb->dst), +IPSTATS_MIB_OUTFORWDATAGRAMS );return dst_output (skb); }
sorry. thanks a lot
PATCH 5/14 ipv6: added net argument to IP6_ADD_STATS_BH
In reply to Denis V. Lunev--- include/net/ipv6.h | 3 ++- net/ipv6/reassembly.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
include/net/ipv6.h +2 -1
@@ -133,7 +133,8 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); _DEVINC(ipv6, , idev, field); })#define IP6_INC_STATS_BH (net, idev,field) ({ (void)(net); \ _DEVINC(ipv6, _BH, idev, field); }) -#define IP6_ADD_STATS_BH (idev,field,val) _DEVADD(ipv6, _BH, idev, field, val) +#define IP6_ADD_STATS_BH (net, idev,field,val) ({ (void)(net); \ + _DEVADD(ipv6, _BH, idev, field, val); }) DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);
net/ipv6/reassembly.c +1 -1
@@ -189,7 +189,7 @@ static void ip6_evictor(struct net *net, struct inet6_dev *idev) evicted =inet_frag_evictor (&net->ipv6.frags, &ip6_frags);if (evicted) -IP6_ADD_STATS_BH (idev,IPSTATS_MIB_REASMFAILS , evicted); +IP6_ADD_STATS_BH (net, idev,IPSTATS_MIB_REASMFAILS , evicted); }static void ip6_frag_expire (unsigned long data)
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 05/14] ipv6: added net argument to IP6_ADD_STATS_BH
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:53 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 6/14 ipv6: added net argument to ICMP6_INC_STATS
In reply to Denis V. Lunev--- include/net/ipv6.h | 3 ++- net/ipv6/mcast.c | 2 +- net/ipv6/ndisc.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-)
include/net/ipv6.h +2 -1
@@ -139,7 +139,8 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); -#define ICMP6_INC_STATS (idev, field) _DEVINC(icmpv6, , idev, field) +#define ICMP6_INC_STATS (net, idev, field) ({ (void)(net); \ + _DEVINC(icmpv6, , idev, field); })#define ICMP6_INC_STATS_BH (idev, field) _DEVINC(icmpv6, _BH, idev, field)#define ICMP6MSGOUT_INC_STATS (idev, field) \
net/ipv6/mcast.c +1 -1
@@ -1840,7 +1840,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) out:if (!err) {ICMP6MSGOUT_INC_STATS (idev, type); -ICMP6_INC_STATS (idev,ICMP6_MIB_OUTMSGS ); +ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS );IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTMCASTPKTS ); }else IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTDISCARDS );
net/ipv6/ndisc.c +2 -2
@@ -522,7 +522,7 @@ static void __ndisc_send(struct net_device *dev, dst_output);if (!err) {ICMP6MSGOUT_INC_STATS (idev, type); -ICMP6_INC_STATS (idev,ICMP6_MIB_OUTMSGS ); +ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS ); }if (likely (idev !=NULL ))
@@ -1586,7 +1586,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, dst_output);if (!err) {ICMP6MSGOUT_INC_STATS (idev,NDISC_REDIRECT ); -ICMP6_INC_STATS (idev,ICMP6_MIB_OUTMSGS ); +ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS ); }if (likely (idev !=NULL ))
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 06/14] ipv6: added net argument to ICMP6_INC_STATS
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:54 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 7/14 ipv6: added net argument to ICMP6_INC_STATS_BH
In reply to Denis V. Lunev--- include/net/ipv6.h | 3 ++- net/dccp/ipv6.c | 6 ++++-- net/ipv6/icmp.c | 4 ++-- net/ipv6/ip6_output.c | 2 +- net/ipv6/mcast.c | 2 +- net/ipv6/tcp_ipv6.c | 3 ++- net/sctp/ipv6.c | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-)
include/net/ipv6.h +2 -1
@@ -141,7 +141,8 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);#define ICMP6_INC_STATS (net, idev, field) ({ (void)(net); \ _DEVINC(icmpv6, , idev, field); }) -#define ICMP6_INC_STATS_BH (idev, field) _DEVINC(icmpv6, _BH, idev, field) +#define ICMP6_INC_STATS_BH (net, idev, field) ({ (void)(net); \ + _DEVINC(icmpv6, _BH, idev, field); })#define ICMP6MSGOUT_INC_STATS (idev, field) \ _DEVINC(icmpv6msg, , idev, field +256)
net/dccp/ipv6.c +4 -2
@@ -98,7 +98,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,if (skb->len < offset +sizeof (*dh) || skb->len < offset +__dccp_basic_hdr_len (dh)) { -ICMP6_INC_STATS_BH (__in6_dev_get (skb->dev),ICMP6_MIB_INERRORS ); +ICMP6_INC_STATS_BH (net,__in6_dev_get (skb->dev), +ICMP6_MIB_INERRORS );return ; }
@@ -107,7 +108,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, &hdr->saddr, dh->dccph_sport, inet6_iif(skb));if (sk ==NULL ) { -ICMP6_INC_STATS_BH (__in6_dev_get (skb->dev),ICMP6_MIB_INERRORS ); +ICMP6_INC_STATS_BH (net,__in6_dev_get (skb->dev), +ICMP6_MIB_INERRORS );return ; }
net/ipv6/icmp.c +2 -2
@@ -664,7 +664,7 @@ static int icmpv6_rcv(struct sk_buff *skb)skb_set_network_header (skb, nh); } -ICMP6_INC_STATS_BH (idev,ICMP6_MIB_INMSGS ); +ICMP6_INC_STATS_BH (dev_net (dev), idev,ICMP6_MIB_INMSGS ); saddr = &ipv6_hdr (skb)->saddr; daddr = &ipv6_hdr (skb)->daddr;
@@ -772,7 +772,7 @@ static int icmpv6_rcv(struct sk_buff *skb)return 0 ; discard_it: -ICMP6_INC_STATS_BH (idev,ICMP6_MIB_INERRORS ); +ICMP6_INC_STATS_BH (dev_net (dev), idev,ICMP6_MIB_INERRORS ); drop_no_count:kfree_skb (skb);return 0 ;
net/ipv6/ip6_output.c +1 -1
@@ -1483,7 +1483,7 @@ int ip6_push_pending_frames(struct sock *sk)struct inet6_dev *idev =ip6_dst_idev (skb->dst);ICMP6MSGOUT_INC_STATS_BH (idev,icmp6_hdr (skb)->icmp6_type); -ICMP6_INC_STATS_BH (idev,ICMP6_MIB_OUTMSGS ); +ICMP6_INC_STATS_BH (net, idev,ICMP6_MIB_OUTMSGS ); } err =ip6_local_out (skb);
net/ipv6/mcast.c +1 -1
@@ -1475,7 +1475,7 @@ static void mld_sendpack(struct sk_buff *skb) out:if (!err) {ICMP6MSGOUT_INC_STATS_BH (idev,ICMPV6_MLD2_REPORT ); -ICMP6_INC_STATS_BH (idev,ICMP6_MIB_OUTMSGS ); +ICMP6_INC_STATS_BH (net, idev,ICMP6_MIB_OUTMSGS );IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_OUTMCASTPKTS ); }else IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_OUTDISCARDS );
net/ipv6/tcp_ipv6.c +2 -1
@@ -330,7 +330,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, th->dest, &hdr->saddr, th->source, skb->dev->ifindex);if (sk ==NULL ) { -ICMP6_INC_STATS_BH (__in6_dev_get (skb->dev),ICMP6_MIB_INERRORS ); +ICMP6_INC_STATS_BH (net,__in6_dev_get (skb->dev), +ICMP6_MIB_INERRORS );return ; }
net/sctp/ipv6.c +1 -1
@@ -156,7 +156,7 @@ SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, skb->network_header = saveip; skb->transport_header = savesctp;if (!sk) { -ICMP6_INC_STATS_BH (idev,ICMP6_MIB_INERRORS ); +ICMP6_INC_STATS_BH (dev_net (skb->dev), idev,ICMP6_MIB_INERRORS ); goto out; }
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 07/14] ipv6: added net argument to ICMP6_INC_STATS_BH
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:55 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 8/14 ipv6: added net argument to ICMP6MSGOUT_INC_STATS
In reply to Denis V. Lunev--- include/net/ipv6.h | 4 ++-- net/ipv6/mcast.c | 2 +- net/ipv6/ndisc.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
include/net/ipv6.h +2 -2
@@ -144,8 +144,8 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);#define ICMP6_INC_STATS_BH (net, idev, field) ({ (void)(net); \ _DEVINC(icmpv6, _BH, idev, field); }) -#define ICMP6MSGOUT_INC_STATS (idev, field) \ - _DEVINC(icmpv6msg, , idev, field +256) +#define ICMP6MSGOUT_INC_STATS (net, idev, field) ({ (void)(net); \ + _DEVINC(icmpv6msg, , idev, field +256); })#define ICMP6MSGOUT_INC_STATS_BH (idev, field) \ _DEVINC(icmpv6msg, _BH, idev, field +256)#define ICMP6MSGIN_INC_STATS (idev, field) \
net/ipv6/mcast.c +1 -1
@@ -1839,7 +1839,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) dst_output); out:if (!err) { -ICMP6MSGOUT_INC_STATS (idev, type); +ICMP6MSGOUT_INC_STATS (net, idev, type);ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS );IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTMCASTPKTS ); }else
net/ipv6/ndisc.c +2 -2
@@ -521,7 +521,7 @@ static void __ndisc_send(struct net_device *dev, err =NF_HOOK (PF_INET6 ,NF_INET_LOCAL_OUT , skb,NULL , dst->dev, dst_output);if (!err) { -ICMP6MSGOUT_INC_STATS (idev, type); +ICMP6MSGOUT_INC_STATS (net, idev, type);ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS ); }
@@ -1585,7 +1585,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, err =NF_HOOK (PF_INET6 ,NF_INET_LOCAL_OUT , buff,NULL , dst->dev, dst_output);if (!err) { -ICMP6MSGOUT_INC_STATS (idev,NDISC_REDIRECT ); +ICMP6MSGOUT_INC_STATS (net, idev,NDISC_REDIRECT );ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS ); }
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 08/14] ipv6: added net argument to ICMP6MSGOUT_INC_STATS
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:56 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 9/14 ipv6: added net argument to ICMP6MSGOUT_INC_STATS_BH
In reply to Denis V. Lunev--- include/net/ipv6.h | 4 ++-- net/ipv6/ip6_output.c | 2 +- net/ipv6/mcast.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
include/net/ipv6.h +2 -2
@@ -146,8 +146,8 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);#define ICMP6MSGOUT_INC_STATS (net, idev, field) ({ (void)(net); \ _DEVINC(icmpv6msg, , idev, field +256); }) -#define ICMP6MSGOUT_INC_STATS_BH (idev, field) \ - _DEVINC(icmpv6msg, _BH, idev, field +256) +#define ICMP6MSGOUT_INC_STATS_BH (net, idev, field) ({ (void)(net); \ + _DEVINC(icmpv6msg, _BH, idev, field +256); })#define ICMP6MSGIN_INC_STATS (idev, field) \ _DEVINC(icmpv6msg, , idev, field)#define ICMP6MSGIN_INC_STATS_BH (idev, field) \
net/ipv6/ip6_output.c +1 -1
@@ -1482,7 +1482,7 @@ int ip6_push_pending_frames(struct sock *sk)if (proto ==IPPROTO_ICMPV6 ) {struct inet6_dev *idev =ip6_dst_idev (skb->dst); -ICMP6MSGOUT_INC_STATS_BH (idev,icmp6_hdr (skb)->icmp6_type); +ICMP6MSGOUT_INC_STATS_BH (net, idev,icmp6_hdr (skb)->icmp6_type);ICMP6_INC_STATS_BH (net, idev,ICMP6_MIB_OUTMSGS ); }
net/ipv6/mcast.c +1 -1
@@ -1474,7 +1474,7 @@ static void mld_sendpack(struct sk_buff *skb) dst_output); out:if (!err) { -ICMP6MSGOUT_INC_STATS_BH (idev,ICMPV6_MLD2_REPORT ); +ICMP6MSGOUT_INC_STATS_BH (net, idev,ICMPV6_MLD2_REPORT );ICMP6_INC_STATS_BH (net, idev,ICMP6_MIB_OUTMSGS );IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_OUTMCASTPKTS ); }else
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 09/14] ipv6: added net argument to ICMP6MSGOUT_INC_STATS_BH
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:57 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 10/14 ipv6: ICMP6MSGIN_INC_STATS is not used
In reply to Denis V. LunevRemoved.
--- include/net/ipv6.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
include/net/ipv6.h +0 -2
@@ -148,8 +148,6 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); _DEVINC(icmpv6msg, , idev, field +256); })#define ICMP6MSGOUT_INC_STATS_BH (net, idev, field) ({ (void)(net); \ _DEVINC(icmpv6msg, _BH, idev, field +256); }) -#define ICMP6MSGIN_INC_STATS (idev, field) \ - _DEVINC(icmpv6msg, , idev, field)#define ICMP6MSGIN_INC_STATS_BH (idev, field) \ _DEVINC(icmpv6msg, _BH, idev, field)
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 10/14] ipv6: ICMP6MSGIN_INC_STATS is not used
This is there to parallel the definitions for other stats macros. I don't think it should be removed, since it's part of the standard interface for incrementing counters. If someone has a need to increment it without, say, _BH, I wouldn't want them to have to come up with it from scratch again...
It's cost is the two lines of code it takes, but you could consider it "documentation" for any future users that want that variant.
+-DLS
David Miller
maintainerRe: [PATCH net-next 10/14] ipv6: ICMP6MSGIN_INC_STATS is not used
From: David Stevens <[email protected]>
Date: Wed, 8 Oct 2008 10:37:25 -0700
Quoted 10 lines
This is there to parallel the definitions for other stats macros. I don't think it should be removed, since it's part of the standard interface for incrementing counters. If someone has a need to increment it without, say,
_BH, I wouldn't want them to have to come up with it from scratch again...It's cost is the two lines of code it takes, but you could consider it "documentation" for any future users that want that variant.
I disagree.
It's more work to change interfaces globally like these namespace guys frequently have to, if we leave unused interfaces around.
The changelog history clearly contains the old macro so it can be resurrected properly, and folks such as you or myself can point this out if someone adds an improper reimplementation.
Re: [PATCH net-next 10/14] ipv6: ICMP6MSGIN_INC_STATS is not used
In reply to Denis V. LunevFrom: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:58 +0400
Quoted 3 lines
Removed.
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 11/14 ipv6: added net argument to ICMP6MSGIN_INC_STATS_BH
In reply to Denis V. Lunev--- include/net/ipv6.h | 4 ++-- net/ipv6/icmp.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
include/net/ipv6.h +2 -2
@@ -148,8 +148,8 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); _DEVINC(icmpv6msg, , idev, field +256); })#define ICMP6MSGOUT_INC_STATS_BH (net, idev, field) ({ (void)(net); \ _DEVINC(icmpv6msg, _BH, idev, field +256); }) -#define ICMP6MSGIN_INC_STATS_BH (idev, field) \ - _DEVINC(icmpv6msg, _BH, idev, field) +#define ICMP6MSGIN_INC_STATS_BH (net, idev, field) ({ (void)(net); \ + _DEVINC(icmpv6msg, _BH, idev, field); })struct ip6_ra_chain {
net/ipv6/icmp.c +1 -1
@@ -693,7 +693,7 @@ static int icmpv6_rcv(struct sk_buff *skb) type = hdr->icmp6_type; -ICMP6MSGIN_INC_STATS_BH (idev, type); +ICMP6MSGIN_INC_STATS_BH (dev_net (dev), idev, type);switch (type) {case ICMPV6_ECHO_REQUEST :
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 11/14] ipv6: added net argument to ICMP6MSGIN_INC_STATS_BH
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:51:59 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 12/14 ipv6: added net argument to _DEVINC/_DEVADD
In reply to Denis V. Lunev--- include/net/ipv6.h | 40 +++++++++++++++++++++------------------- 1 files changed, 21 insertions(+), 19 deletions(-)
include/net/ipv6.h +21 -19
@@ -110,17 +110,19 @@ struct frag_hdr {extern int sysctl_mld_max_msf;extern struct ctl_path net_ipv6_ctl_path[]; -#define _DEVINC (statname, modifier, idev, field) \ +#define _DEVINC (net, statname, modifier, idev, field) \ ({ \ struct inet6_dev *_idev = (idev); \ + (void)(net); \ if (likely(_idev != NULL)) \ SNMP_INC_STATS##modifier((_idev)->stats.statname, (field)); \ SNMP_INC_STATS##modifier(statname##_statistics, (field)); \ }) -#define _DEVADD (statname, modifier, idev, field, val) \ +#define _DEVADD (net, statname, modifier, idev, field, val) \ ({ \ struct inet6_dev *_idev = (idev); \ + (void)(net); \ if (likely(_idev != NULL)) \ SNMP_ADD_STATS##modifier((_idev)->stats.statname, (field), (val)); \ SNMP_ADD_STATS##modifier(statname##_statistics, (field), (val));\
@@ -129,27 +131,27 @@ extern struct ctl_path net_ipv6_ctl_path[];/* MIBs */ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); -#define IP6_INC_STATS (net, idev,field) ({ (void)(net); \ - _DEVINC(ipv6, , idev, field); }) -#define IP6_INC_STATS_BH (net, idev,field) ({ (void)(net); \ - _DEVINC(ipv6, _BH, idev, field); }) -#define IP6_ADD_STATS_BH (net, idev,field,val) ({ (void)(net); \ - _DEVADD(ipv6, _BH, idev, field, val); }) +#define IP6_INC_STATS (net, idev,field) \ + _DEVINC(net, ipv6, , idev, field) +#define IP6_INC_STATS_BH (net, idev,field) \ + _DEVINC(net, ipv6, _BH, idev, field) +#define IP6_ADD_STATS_BH (net, idev,field,val) \ + _DEVADD(net, ipv6, _BH, idev, field, val) DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); -#define ICMP6_INC_STATS (net, idev, field) ({ (void)(net); \ - _DEVINC(icmpv6, , idev, field); }) -#define ICMP6_INC_STATS_BH (net, idev, field) ({ (void)(net); \ - _DEVINC(icmpv6, _BH, idev, field); }) - -#define ICMP6MSGOUT_INC_STATS (net, idev, field) ({ (void)(net); \ - _DEVINC(icmpv6msg, , idev, field +256); }) -#define ICMP6MSGOUT_INC_STATS_BH (net, idev, field) ({ (void)(net); \ - _DEVINC(icmpv6msg, _BH, idev, field +256); }) -#define ICMP6MSGIN_INC_STATS_BH (net, idev, field) ({ (void)(net); \ - _DEVINC(icmpv6msg, _BH, idev, field); }) +#define ICMP6_INC_STATS (net, idev, field) \ + _DEVINC(net, icmpv6, , idev, field) +#define ICMP6_INC_STATS_BH (net, idev, field) \ + _DEVINC(net, icmpv6, _BH, idev, field) + +#define ICMP6MSGOUT_INC_STATS (net, idev, field) \ + _DEVINC(net, icmpv6msg, , idev, field +256) +#define ICMP6MSGOUT_INC_STATS_BH (net, idev, field) \ + _DEVINC(net, icmpv6msg, _BH, idev, field +256) +#define ICMP6MSGIN_INC_STATS_BH (net, idev, field) \ + _DEVINC(net, icmpv6msg, _BH, idev, field)struct ip6_ra_chain {
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 12/14] ipv6: added net argument to _DEVINC/_DEVADD
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:52:00 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
APplied.
PATCH 13/14 ipv6: making ip and icmp statistics per/namespace
In reply to Denis V. Lunev--- include/net/ipv6.h | 10 ++-------- include/net/netns/mib.h | 3 +++ net/ipv6/af_inet6.c | 38 ++++++++++++++++++-------------------- net/ipv6/proc.c | 8 +++++--- 4 files changed, 28 insertions(+), 31 deletions(-)
include/net/ipv6.h +2 -8
@@ -113,23 +113,20 @@ extern struct ctl_path net_ipv6_ctl_path[];#define _DEVINC (net, statname, modifier, idev, field) \ ({ \ struct inet6_dev *_idev = (idev); \ - (void)(net); \ if (likely(_idev != NULL)) \ SNMP_INC_STATS##modifier((_idev)->stats.statname, (field)); \ - SNMP_INC_STATS##modifier(statname##_statistics, (field)); \ + SNMP_INC_STATS##modifier((net)->mib.statname##_statistics, (field));\ })#define _DEVADD (net, statname, modifier, idev, field, val) \ ({ \ struct inet6_dev *_idev = (idev); \ - (void)(net); \ if (likely(_idev != NULL)) \ SNMP_ADD_STATS##modifier((_idev)->stats.statname, (field), (val)); \ - SNMP_ADD_STATS##modifier(statname##_statistics, (field), (val));\ + SNMP_ADD_STATS##modifier((net)->mib.statname##_statistics, (field), (val));\ })/* MIBs */ -DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);#define IP6_INC_STATS (net, idev,field) \ _DEVINC(net, ipv6, , idev, field)
@@ -138,9 +135,6 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);#define IP6_ADD_STATS_BH (net, idev,field,val) \ _DEVADD(net, ipv6, _BH, idev, field, val) -DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); -DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); -#define ICMP6_INC_STATS (net, idev, field) \ _DEVINC(net, icmpv6, , idev, field)#define ICMP6_INC_STATS_BH (net, idev, field) \
include/net/netns/mib.h +3 -0
@@ -16,6 +16,9 @@ struct netns_mib {struct proc_dir_entry *proc_net_devsnmp6; DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6); DEFINE_SNMP_STAT(struct udp_mib, udplite_stats_in6); + DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); + DEFINE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); + DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);#endif };
net/ipv6/af_inet6.c +18 -20
@@ -797,31 +797,11 @@ static void ipv6_packet_cleanup(void)static int __init init_ipv6_mibs (void ) { -if (snmp_mib_init ((void **)ipv6_statistics, -sizeof (struct ipstats_mib )) <0 ) - goto err_ip_mib; -if (snmp_mib_init ((void **)icmpv6_statistics, -sizeof (struct icmpv6_mib )) <0 ) - goto err_icmp_mib; -if (snmp_mib_init ((void **)icmpv6msg_statistics, -sizeof (struct icmpv6msg_mib )) <0 ) - goto err_icmpmsg_mib;return 0 ; - -err_icmpmsg_mib: -snmp_mib_free ((void **)icmpv6_statistics); -err_icmp_mib: -snmp_mib_free ((void **)ipv6_statistics); -err_ip_mib: -return -ENOMEM ; - }static void cleanup_ipv6_mibs (void ) { -snmp_mib_free ((void **)ipv6_statistics); -snmp_mib_free ((void **)icmpv6_statistics); -snmp_mib_free ((void **)icmpv6msg_statistics); }static int __net_init ipv6_init_mibs (struct net *net)
@@ -832,8 +812,23 @@ static int __net_init ipv6_init_mibs(struct net *net)if (snmp_mib_init ((void **)net->mib.udplite_stats_in6,sizeof (struct udp_mib )) <0 ) goto err_udplite_mib; +if (snmp_mib_init ((void **)net->mib.ipv6_statistics, +sizeof (struct ipstats_mib )) <0 ) + goto err_ip_mib; +if (snmp_mib_init ((void **)net->mib.icmpv6_statistics, +sizeof (struct icmpv6_mib )) <0 ) + goto err_icmp_mib; +if (snmp_mib_init ((void **)net->mib.icmpv6msg_statistics, +sizeof (struct icmpv6msg_mib )) <0 ) + goto err_icmpmsg_mib;return 0 ; +err_icmpmsg_mib: +snmp_mib_free ((void **)net->mib.icmpv6_statistics); +err_icmp_mib: +snmp_mib_free ((void **)net->mib.ipv6_statistics); +err_ip_mib: +snmp_mib_free ((void **)net->mib.udplite_stats_in6); err_udplite_mib:snmp_mib_free ((void **)net->mib.udp_stats_in6);return -ENOMEM ;
@@ -843,6 +838,9 @@ static void __net_exit ipv6_cleanup_mibs(struct net *net) {snmp_mib_free ((void **)net->mib.udp_stats_in6);snmp_mib_free ((void **)net->mib.udplite_stats_in6); +snmp_mib_free ((void **)net->mib.ipv6_statistics); +snmp_mib_free ((void **)net->mib.icmpv6_statistics); +snmp_mib_free ((void **)net->mib.icmpv6msg_statistics); }static int inet6_net_init (struct net *net)
net/ipv6/proc.c +5 -3
@@ -177,9 +177,11 @@ static int snmp6_seq_show(struct seq_file *seq, void *v) {struct net *net = (struct net *)seq->private; -snmp6_seq_show_item (seq, (void **)ipv6_statistics, snmp6_ipstats_list); -snmp6_seq_show_item (seq, (void **)icmpv6_statistics, snmp6_icmp6_list); -snmp6_seq_show_icmpv6msg (seq, (void **)icmpv6msg_statistics); +snmp6_seq_show_item (seq, (void **)net->mib.ipv6_statistics, + snmp6_ipstats_list); +snmp6_seq_show_item (seq, (void **)net->mib.icmpv6_statistics, + snmp6_icmp6_list); +snmp6_seq_show_icmpv6msg (seq, (void **)net->mib.icmpv6msg_statistics);snmp6_seq_show_item (seq, (void **)net->mib.udp_stats_in6, snmp6_udp6_list); snmp6_seq_show_item(seq, (void **)net->mib.udplite_stats_in6,
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 13/14] ipv6: making ip and icmp statistics per/namespace
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:52:01 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
PATCH 14/14 ipv6: remove unused not init_ipv6_mibs/cleanup_ipv6_mibs
In reply to Denis V. Lunev--- net/ipv6/af_inet6.c | 17 ----------------- 1 files changed, 0 insertions(+), 17 deletions(-)
net/ipv6/af_inet6.c +0 -17
@@ -795,15 +795,6 @@ static void ipv6_packet_cleanup(void)dev_remove_pack (&ipv6_packet_type); } -static int __init init_ipv6_mibs (void ) -{ -return 0 ; -} - -static void cleanup_ipv6_mibs (void ) -{ -} -static int __net_init ipv6_init_mibs (struct net *net) { if (snmp_mib_init((void **)net->mib.udp_stats_in6,
@@ -935,11 +926,6 @@ static int __init inet6_init(void)if (err) goto out_sock_register_fail; -/* Initialise ipv6 mibs */ - err =init_ipv6_mibs (); -if (err) - goto out_unregister_sock; -#ifdef CONFIG_SYSCTL err =ipv6_static_sysctl_register ();if (err)
@@ -1073,8 +1059,6 @@ register_pernet_fail:ipv6_static_sysctl_unregister (); static_sysctl_fail:#endif -cleanup_ipv6_mibs (); -out_unregister_sock:sock_unregister (PF_INET6 );rtnl_unregister_all (PF_INET6 ); out_sock_register_fail:
@@ -1131,7 +1115,6 @@ static void __exit inet6_exit(void)#ifdef CONFIG_SYSCTL ipv6_static_sysctl_unregister ();#endif -cleanup_ipv6_mibs ();proto_unregister (&rawv6_prot);proto_unregister (&udplitev6_prot);proto_unregister (&udpv6_prot);
Signature · 1 line
1.5.3.rc5
Re: [PATCH net-next 14/14] ipv6: remove unused not init_ipv6_mibs/cleanup_ipv6_mibs
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 8 Oct 2008 15:52:02 +0400
Quoted 1 line
Signed-off-by Denis V. Lunev <[email protected]>
Applied.
Thanks.