Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78339
b: refs/heads/master
c: 1781f7f
h: refs/heads/master
i:
  78337: 0142ee9
  78335: f6319d2
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 28, 2008
1 parent 59f0551 commit 8743bdf
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 27ab2568649d5ba6c5a20212079b7c4f6da4ca0d
refs/heads/master: 1781f7f5804e52ee2d35328b129602146a8d8254
9 changes: 0 additions & 9 deletions trunk/include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
25 changes: 25 additions & 0 deletions trunk/include/net/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/net/udplite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
6 changes: 5 additions & 1 deletion trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -969,8 +970,11 @@ 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 */
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv6/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 2 additions & 0 deletions trunk/net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/ipv6.h>
#include <linux/icmpv6.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <asm/uaccess.h>

Expand All @@ -51,6 +52,7 @@
#include "udp_impl.h"

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

static inline int udp_v6_get_port(struct sock *sk, unsigned short snum)
{
Expand Down
4 changes: 4 additions & 0 deletions trunk/net/rxrpc/ar-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <net/sock.h>
#include <net/af_rxrpc.h>
#include <net/ip.h>
#include <net/udp.h>
#include "ar-internal.h"

unsigned long rxrpc_ack_timeout = 1;
Expand Down Expand Up @@ -707,10 +708,13 @@ void rxrpc_data_ready(struct sock *sk, int count)
if (skb_checksum_complete(skb)) {
rxrpc_free_skb(skb);
rxrpc_put_local(local);
UDP_INC_STATS_BH(UDP_MIB_INERRORS, 0);
_leave(" [CSUM failed]");
return;
}

UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS, 0);

/* the socket buffer we have is owned by UDP, with UDP's data all over
* it, but we really want our own */
skb_orphan(skb);
Expand Down
6 changes: 5 additions & 1 deletion trunk/net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,12 @@ static void xs_udp_data_ready(struct sock *sk, int len)
copied = repsize;

/* Suck it into the iovec, verify checksum if not done by hw. */
if (csum_partial_copy_to_xdr(&rovr->rq_private_buf, skb))
if (csum_partial_copy_to_xdr(&rovr->rq_private_buf, skb)) {
UDPX_INC_STATS_BH(sk, UDP_MIB_INERRORS);
goto out_unlock;
}

UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS);

/* Something worked... */
dst_confirm(skb->dst);
Expand Down

0 comments on commit 8743bdf

Please sign in to comment.