diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 00:04:44 -0400 |
commit | f8965467f366fd18f01feafb5db10512d7b4422c (patch) | |
tree | 3706a9cd779859271ca61b85c63a1bc3f82d626e /include/net/snmp.h | |
parent | a26272e5200765691e67d6780e52b32498fdb659 (diff) | |
parent | 2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
qlcnic: adding co maintainer
ixgbe: add support for active DA cables
ixgbe: dcb, do not tag tc_prio_control frames
ixgbe: fix ixgbe_tx_is_paused logic
ixgbe: always enable vlan strip/insert when DCB is enabled
ixgbe: remove some redundant code in setting FCoE FIP filter
ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
ixgbe: fix header len when unsplit packet overflows to data buffer
ipv6: Never schedule DAD timer on dead address
ipv6: Use POSTDAD state
ipv6: Use state_lock to protect ifa state
ipv6: Replace inet6_ifaddr->dead with state
cxgb4: notify upper drivers if the device is already up when they load
cxgb4: keep interrupts available when the ports are brought down
cxgb4: fix initial addition of MAC address
cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
cnic: Convert cnic_local_flags to atomic ops.
can: Fix SJA1000 command register writes on SMP systems
bridge: fix build for CONFIG_SYSFS disabled
ARCNET: Limit com20020 PCI ID matches for SOHARD cards
...
Fix up various conflicts with pcmcia tree drivers/net/
{pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
wireless/orinoco/spectrum_cs.c} and feature removal
(Documentation/feature-removal-schedule.txt).
Also fix a non-content conflict due to pm_qos_requirement getting
renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'include/net/snmp.h')
-rw-r--r-- | include/net/snmp.h | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/include/net/snmp.h b/include/net/snmp.h index 692ee0061dc4..92456f1035f5 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -52,26 +52,11 @@ struct snmp_mib { | |||
52 | * count on the 20Gb/s + networks people expect in a few years time! | 52 | * count on the 20Gb/s + networks people expect in a few years time! |
53 | */ | 53 | */ |
54 | 54 | ||
55 | /* | ||
56 | * The rule for padding: | ||
57 | * Best is power of two because then the right structure can be found by a | ||
58 | * simple shift. The structure should be always cache line aligned. | ||
59 | * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add | ||
60 | * instructions to emulate multiply in case it is not power-of-two. | ||
61 | * Currently n is always <=3 for all sizes so simple cache line alignment | ||
62 | * is enough. | ||
63 | * | ||
64 | * The best solution would be a global CPU local area , especially on 64 | ||
65 | * and 128byte cacheline machine it makes a *lot* of sense -AK | ||
66 | */ | ||
67 | |||
68 | #define __SNMP_MIB_ALIGN__ ____cacheline_aligned | ||
69 | |||
70 | /* IPstats */ | 55 | /* IPstats */ |
71 | #define IPSTATS_MIB_MAX __IPSTATS_MIB_MAX | 56 | #define IPSTATS_MIB_MAX __IPSTATS_MIB_MAX |
72 | struct ipstats_mib { | 57 | struct ipstats_mib { |
73 | unsigned long mibs[IPSTATS_MIB_MAX]; | 58 | unsigned long mibs[IPSTATS_MIB_MAX]; |
74 | } __SNMP_MIB_ALIGN__; | 59 | }; |
75 | 60 | ||
76 | /* ICMP */ | 61 | /* ICMP */ |
77 | #define ICMP_MIB_DUMMY __ICMP_MIB_MAX | 62 | #define ICMP_MIB_DUMMY __ICMP_MIB_MAX |
@@ -79,36 +64,36 @@ struct ipstats_mib { | |||
79 | 64 | ||
80 | struct icmp_mib { | 65 | struct icmp_mib { |
81 | unsigned long mibs[ICMP_MIB_MAX]; | 66 | unsigned long mibs[ICMP_MIB_MAX]; |
82 | } __SNMP_MIB_ALIGN__; | 67 | }; |
83 | 68 | ||
84 | #define ICMPMSG_MIB_MAX __ICMPMSG_MIB_MAX | 69 | #define ICMPMSG_MIB_MAX __ICMPMSG_MIB_MAX |
85 | struct icmpmsg_mib { | 70 | struct icmpmsg_mib { |
86 | unsigned long mibs[ICMPMSG_MIB_MAX]; | 71 | unsigned long mibs[ICMPMSG_MIB_MAX]; |
87 | } __SNMP_MIB_ALIGN__; | 72 | }; |
88 | 73 | ||
89 | /* ICMP6 (IPv6-ICMP) */ | 74 | /* ICMP6 (IPv6-ICMP) */ |
90 | #define ICMP6_MIB_MAX __ICMP6_MIB_MAX | 75 | #define ICMP6_MIB_MAX __ICMP6_MIB_MAX |
91 | struct icmpv6_mib { | 76 | struct icmpv6_mib { |
92 | unsigned long mibs[ICMP6_MIB_MAX]; | 77 | unsigned long mibs[ICMP6_MIB_MAX]; |
93 | } __SNMP_MIB_ALIGN__; | 78 | }; |
94 | 79 | ||
95 | #define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX | 80 | #define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX |
96 | struct icmpv6msg_mib { | 81 | struct icmpv6msg_mib { |
97 | unsigned long mibs[ICMP6MSG_MIB_MAX]; | 82 | unsigned long mibs[ICMP6MSG_MIB_MAX]; |
98 | } __SNMP_MIB_ALIGN__; | 83 | }; |
99 | 84 | ||
100 | 85 | ||
101 | /* TCP */ | 86 | /* TCP */ |
102 | #define TCP_MIB_MAX __TCP_MIB_MAX | 87 | #define TCP_MIB_MAX __TCP_MIB_MAX |
103 | struct tcp_mib { | 88 | struct tcp_mib { |
104 | unsigned long mibs[TCP_MIB_MAX]; | 89 | unsigned long mibs[TCP_MIB_MAX]; |
105 | } __SNMP_MIB_ALIGN__; | 90 | }; |
106 | 91 | ||
107 | /* UDP */ | 92 | /* UDP */ |
108 | #define UDP_MIB_MAX __UDP_MIB_MAX | 93 | #define UDP_MIB_MAX __UDP_MIB_MAX |
109 | struct udp_mib { | 94 | struct udp_mib { |
110 | unsigned long mibs[UDP_MIB_MAX]; | 95 | unsigned long mibs[UDP_MIB_MAX]; |
111 | } __SNMP_MIB_ALIGN__; | 96 | }; |
112 | 97 | ||
113 | /* Linux */ | 98 | /* Linux */ |
114 | #define LINUX_MIB_MAX __LINUX_MIB_MAX | 99 | #define LINUX_MIB_MAX __LINUX_MIB_MAX |
@@ -148,6 +133,8 @@ struct linux_xfrm_mib { | |||
148 | __this_cpu_add(mib[0]->mibs[field], addend) | 133 | __this_cpu_add(mib[0]->mibs[field], addend) |
149 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ | 134 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ |
150 | this_cpu_add(mib[1]->mibs[field], addend) | 135 | this_cpu_add(mib[1]->mibs[field], addend) |
136 | #define SNMP_ADD_STATS(mib, field, addend) \ | ||
137 | this_cpu_add(mib[0]->mibs[field], addend) | ||
151 | /* | 138 | /* |
152 | * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" | 139 | * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" |
153 | * to make @ptr a non-percpu pointer. | 140 | * to make @ptr a non-percpu pointer. |