Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1781f7f5 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

[UDP]: Restore missing inDatagrams increments



The previous move of the the UDP inDatagrams counter caused the
counting of encapsulated packets, SUNRPC data (as opposed to call)
packets and RXRPC packets to go missing.

This patch restores all of these.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27ab2568
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -164,15 +164,6 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);
#define ICMP6MSGIN_INC_STATS_USER(idev, field) \
	_DEVINC(icmpv6msg, _USER, idev, field)

DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6);
DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
#define UDP6_INC_STATS_BH(field, is_udplite) 			      do  {  \
	if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field);         \
	else		SNMP_INC_STATS_BH(udp_stats_in6, field);    } while(0)
#define UDP6_INC_STATS_USER(field, is_udplite)			       do {    \
	if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field);         \
	else		SNMP_INC_STATS_USER(udp_stats_in6, field);    } while(0)

struct ip6_ra_chain
{
	struct ip6_ra_chain	*next;
+25 −0
Original line number Diff line number Diff line
@@ -139,6 +139,12 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
				   int (*push_pending_frames)(struct sock *));

DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6);

/* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */
DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics);
DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);

/*
 * 	SNMP statistics for UDP and UDP-Lite
 */
@@ -149,6 +155,25 @@ DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
	if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field);         \
	else		SNMP_INC_STATS_BH(udp_statistics, field);    }  while(0)

#define UDP6_INC_STATS_BH(field, is_udplite) 			      do  {  \
	if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field);         \
	else		SNMP_INC_STATS_BH(udp_stats_in6, field);    } while(0)
#define UDP6_INC_STATS_USER(field, is_udplite)			       do {    \
	if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field);         \
	else		SNMP_INC_STATS_USER(udp_stats_in6, field);    } while(0)

#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
#define UDPX_INC_STATS_BH(sk, field) \
	do { \
		if ((sk)->sk_family == AF_INET) \
			UDP_INC_STATS_BH(field, 0); \
		else \
			UDP6_INC_STATS_BH(field, 0); \
	} while (0);
#else
#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(field, 0)
#endif

/* /proc */
struct udp_seq_afinfo {
	struct module		*owner;
+0 −3
Original line number Diff line number Diff line
@@ -13,9 +13,6 @@
extern struct proto 		udplite_prot;
extern struct hlist_head 	udplite_hash[UDP_HTABLE_SIZE];

/* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */
DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics);

/*
 *	Checksum computation is all in software, hence simpler getfrag.
 */
+5 −1
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@
 */

DEFINE_SNMP_STAT(struct udp_mib, udp_statistics) __read_mostly;
EXPORT_SYMBOL(udp_statistics);

struct hlist_head udp_hash[UDP_HTABLE_SIZE];
DEFINE_RWLOCK(udp_hash_lock);
@@ -969,9 +970,12 @@ int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
			int ret;

			ret = (*up->encap_rcv)(sk, skb);
			if (ret <= 0)
			if (ret <= 0) {
				UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS,
						 is_udplite);
				return -ret;
			}
		}

		/* FALLTHROUGH -- it's a UDP Packet */
	}
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <net/ip.h>
#include <net/sock.h>
#include <net/tcp.h>
#include <net/udp.h>
#include <net/transp_v6.h>
#include <net/ipv6.h>

Loading