diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-09 20:38:59 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-09 20:38:59 +0300 |
commit | 99b48cff405333afe26ac603b37639c410a48e5d (patch) | |
tree | 31b427930317b1596ca6070585f66a108b722580 /include | |
parent | 200d018eff4be3a1fb9823441cfcebb7de86a677 (diff) | |
parent | d3dcc077bf88806201093f86325ec656e4dbfbce (diff) | |
download | linux-99b48cff405333afe26ac603b37639c410a48e5d.tar.xz |
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.h | 6 | ||||
-rw-r--r-- | include/linux/if_link.h | 6 | ||||
-rw-r--r-- | include/linux/netdevice.h | 11 | ||||
-rw-r--r-- | include/linux/rtnetlink.h | 2 | ||||
-rw-r--r-- | include/linux/xfrm.h | 2 | ||||
-rw-r--r-- | include/net/ax25.h | 20 | ||||
-rw-r--r-- | include/net/neighbour.h | 18 |
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 __u32 tstamp; /* updated timestamp, hundredths of seconds */ }; +/* backwards compatibility for userspace */ +#ifndef __KERNEL__ +#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg)))) +#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg)) +#endif + #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 #define IFLA_MAX (__IFLA_MAX - 1) +/* backwards compatibility for userspace */ +#ifndef __KERNEL__ +#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) +#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) +#endif + /* ifi_flags. 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 { struct hh_cache *hh_next; /* Next entry */ atomic_t hh_refcnt; /* number of users */ - __be16 hh_type; /* protocol identifier, f.e ETH_P_IP +/* + * We want hh_output, hh_len, hh_lock and hh_data be a in a separate + * cache line on SMP. + * They are mostly read, but hh_refcnt may be changed quite frequently, + * incurring cache line ping pongs. + */ + __be16 hh_type ____cacheline_aligned_in_smp; + /* protocol identifier, f.e ETH_P_IP * NOTE: For VLANs, this will be the * encapuslated type. --BLG */ u16 hh_len; /* length of header */ int (*hh_output)(struct sk_buff *skb); - rwlock_t hh_lock; + seqlock_t hh_lock; /* cached hardware header; allow for machine alignment needs. */ #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 @@ #include <linux/netlink.h> #include <linux/if_link.h> +#include <linux/if_addr.h> +#include <linux/neighbour.h> /**** * 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 { #define XFRMGRP_EXPIRE 2 #define XFRMGRP_SA 4 #define XFRMGRP_POLICY 8 -#define XFRMGRP_REPORT 0x10 +#define XFRMGRP_REPORT 0x20 #endif enum 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 *); extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); /* ax25_addr.c */ -extern ax25_address null_ax25_address; -extern char *ax2asc(char *buf, ax25_address *); -extern void asc2ax(ax25_address *addr, char *callsign); -extern int ax25cmp(ax25_address *, ax25_address *); -extern int ax25digicmp(ax25_digi *, ax25_digi *); -extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); -extern int ax25_addr_build(unsigned char *, ax25_address *, ax25_address *, ax25_digi *, int, int); -extern int ax25_addr_size(ax25_digi *); -extern void ax25_digi_invert(ax25_digi *, ax25_digi *); +extern const ax25_address ax25_bcast; +extern const ax25_address ax25_defaddr; +extern const ax25_address null_ax25_address; +extern int ax25cmp(const ax25_address *, const ax25_address *); +extern int ax25digicmp(const ax25_digi *, const ax25_digi *); +extern const unsigned char *ax25_addr_parse(const unsigned char *, int, + ax25_address *, ax25_address *, ax25_digi *, int *, int *); +extern int ax25_addr_build(unsigned char *, const ax25_address *, + const ax25_address *, const ax25_digi *, int, int); +extern int ax25_addr_size(const ax25_digi *); +extern void ax25_digi_invert(const ax25_digi *, ax25_digi *); /* ax25_dev.c */ extern 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) return 0; } +static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) +{ + unsigned seq; + int hh_len; + + do { + int hh_alen; + + seq = read_seqbegin(&hh->hh_lock); + hh_len = hh->hh_len; + hh_alen = HH_DATA_ALIGN(hh_len); + memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); + } while (read_seqretry(&hh->hh_lock, seq)); + + skb_push(skb, hh_len); + return hh->hh_output(skb); +} + static inline struct neighbour * __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) { |