aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-09 12:38:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-09 12:38:59 -0500
commit99b48cff405333afe26ac603b37639c410a48e5d (patch)
tree31b427930317b1596ca6070585f66a108b722580 /include
parent200d018eff4be3a1fb9823441cfcebb7de86a677 (diff)
parentd3dcc077bf88806201093f86325ec656e4dbfbce (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NETLINK]: Put {IFA,IFLA}_{RTA,PAYLOAD} macros back for userspace. [NET_SCHED] sch_htb: turn intermediate classes into leaves [NET_SCHED] sch_cbq: deactivating when grafting, purging etc. [XFRM]: Fix XFRMGRP_REPORT to use correct multicast group. [NET]: Force a cache line split in hh_cache in SMP. [NETPOLL]: make arp replies through netpoll use mac address of sender [NETLINK]: Restore API compatibility of address and neighbour bits [AX.25]: Fix default address and broadcast address initialization. [AX.25]: Constify ax25 utility functions [BNX2]: Add an error check. [NET]: Convert hh_lock to seqlock.
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_addr.h6
-rw-r--r--include/linux/if_link.h6
-rw-r--r--include/linux/netdevice.h11
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/xfrm.h2
-rw-r--r--include/net/ax25.h20
-rw-r--r--include/net/neighbour.h18
7 files changed, 53 insertions, 12 deletions
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
index dbe8f6120a40..d557e4ce9b6b 100644
--- a/include/linux/if_addr.h
+++ b/include/linux/if_addr.h
@@ -52,4 +52,10 @@ struct ifa_cacheinfo
52 __u32 tstamp; /* updated timestamp, hundredths of seconds */ 52 __u32 tstamp; /* updated timestamp, hundredths of seconds */
53}; 53};
54 54
55/* backwards compatibility for userspace */
56#ifndef __KERNEL__
57#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
58#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
59#endif
60
55#endif 61#endif
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index e963a077e6f5..35ed3b5467f3 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -82,6 +82,12 @@ enum
82 82
83#define IFLA_MAX (__IFLA_MAX - 1) 83#define IFLA_MAX (__IFLA_MAX - 1)
84 84
85/* backwards compatibility for userspace */
86#ifndef __KERNEL__
87#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
88#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
89#endif
90
85/* ifi_flags. 91/* ifi_flags.
86 92
87 IFF_* flags. 93 IFF_* flags.
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c57088f575a3..6be767c76b37 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -193,13 +193,20 @@ struct hh_cache
193{ 193{
194 struct hh_cache *hh_next; /* Next entry */ 194 struct hh_cache *hh_next; /* Next entry */
195 atomic_t hh_refcnt; /* number of users */ 195 atomic_t hh_refcnt; /* number of users */
196 __be16 hh_type; /* protocol identifier, f.e ETH_P_IP 196/*
197 * We want hh_output, hh_len, hh_lock and hh_data be a in a separate
198 * cache line on SMP.
199 * They are mostly read, but hh_refcnt may be changed quite frequently,
200 * incurring cache line ping pongs.
201 */
202 __be16 hh_type ____cacheline_aligned_in_smp;
203 /* protocol identifier, f.e ETH_P_IP
197 * NOTE: For VLANs, this will be the 204 * NOTE: For VLANs, this will be the
198 * encapuslated type. --BLG 205 * encapuslated type. --BLG
199 */ 206 */
200 u16 hh_len; /* length of header */ 207 u16 hh_len; /* length of header */
201 int (*hh_output)(struct sk_buff *skb); 208 int (*hh_output)(struct sk_buff *skb);
202 rwlock_t hh_lock; 209 seqlock_t hh_lock;
203 210
204 /* cached hardware header; allow for machine alignment needs. */ 211 /* cached hardware header; allow for machine alignment needs. */
205#define HH_DATA_MOD 16 212#define HH_DATA_MOD 16
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 493297acdae8..4a629ea70cc4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/netlink.h> 4#include <linux/netlink.h>
5#include <linux/if_link.h> 5#include <linux/if_link.h>
6#include <linux/if_addr.h>
7#include <linux/neighbour.h>
6 8
7/**** 9/****
8 * Routing/neighbour discovery messages. 10 * Routing/neighbour discovery messages.
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 088ba8113f7e..9529ea1ae392 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -357,7 +357,7 @@ struct xfrm_user_report {
357#define XFRMGRP_EXPIRE 2 357#define XFRMGRP_EXPIRE 2
358#define XFRMGRP_SA 4 358#define XFRMGRP_SA 4
359#define XFRMGRP_POLICY 8 359#define XFRMGRP_POLICY 8
360#define XFRMGRP_REPORT 0x10 360#define XFRMGRP_REPORT 0x20
361#endif 361#endif
362 362
363enum xfrm_nlgroups { 363enum xfrm_nlgroups {
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 69374cd1a857..e1d116f11923 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -282,15 +282,17 @@ extern void ax25_fillin_cb(ax25_cb *, ax25_dev *);
282extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); 282extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
283 283
284/* ax25_addr.c */ 284/* ax25_addr.c */
285extern ax25_address null_ax25_address; 285extern const ax25_address ax25_bcast;
286extern char *ax2asc(char *buf, ax25_address *); 286extern const ax25_address ax25_defaddr;
287extern void asc2ax(ax25_address *addr, char *callsign); 287extern const ax25_address null_ax25_address;
288extern int ax25cmp(ax25_address *, ax25_address *); 288extern int ax25cmp(const ax25_address *, const ax25_address *);
289extern int ax25digicmp(ax25_digi *, ax25_digi *); 289extern int ax25digicmp(const ax25_digi *, const ax25_digi *);
290extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); 290extern const unsigned char *ax25_addr_parse(const unsigned char *, int,
291extern int ax25_addr_build(unsigned char *, ax25_address *, ax25_address *, ax25_digi *, int, int); 291 ax25_address *, ax25_address *, ax25_digi *, int *, int *);
292extern int ax25_addr_size(ax25_digi *); 292extern int ax25_addr_build(unsigned char *, const ax25_address *,
293extern void ax25_digi_invert(ax25_digi *, ax25_digi *); 293 const ax25_address *, const ax25_digi *, int, int);
294extern int ax25_addr_size(const ax25_digi *);
295extern void ax25_digi_invert(const ax25_digi *, ax25_digi *);
294 296
295/* ax25_dev.c */ 297/* ax25_dev.c */
296extern ax25_dev *ax25_dev_list; 298extern ax25_dev *ax25_dev_list;
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 23967031ddb7..3725b93c52f3 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -309,6 +309,24 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
309 return 0; 309 return 0;
310} 310}
311 311
312static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb)
313{
314 unsigned seq;
315 int hh_len;
316
317 do {
318 int hh_alen;
319
320 seq = read_seqbegin(&hh->hh_lock);
321 hh_len = hh->hh_len;
322 hh_alen = HH_DATA_ALIGN(hh_len);
323 memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
324 } while (read_seqretry(&hh->hh_lock, seq));
325
326 skb_push(skb, hh_len);
327 return hh->hh_output(skb);
328}
329
312static inline struct neighbour * 330static inline struct neighbour *
313__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) 331__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat)
314{ 332{