diff options
| author | David S. Miller <davem@davemloft.net> | 2012-05-16 22:17:37 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-05-16 22:17:37 -0400 |
| commit | 028940342a906db8da014a7603a0deddc2c323dd (patch) | |
| tree | 688dbc38a3e218f2493d311b1d70a67668837347 /include/linux | |
| parent | be3eed2e96340d3c7a4d1ea1d63e7bd6095d1e34 (diff) | |
| parent | 0e93b4b304ae052ba1bc73f6d34a68556fe93429 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netdevice.h | 9 | ||||
| -rw-r--r-- | include/linux/netfilter/ipset/ip_set_ahash.h | 16 | ||||
| -rw-r--r-- | include/linux/seqlock.h | 23 | ||||
| -rw-r--r-- | include/linux/usb/usbnet.h | 3 |
4 files changed, 40 insertions, 11 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f377fb8b527..b0f6f22723c3 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1426,15 +1426,6 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) | |||
| 1426 | return 0; | 1426 | return 0; |
| 1427 | } | 1427 | } |
| 1428 | 1428 | ||
| 1429 | #ifndef CONFIG_NET_NS | ||
| 1430 | static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
| 1431 | { | ||
| 1432 | skb->dev = dev; | ||
| 1433 | } | ||
| 1434 | #else /* CONFIG_NET_NS */ | ||
| 1435 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev); | ||
| 1436 | #endif | ||
| 1437 | |||
| 1438 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | 1429 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
| 1439 | { | 1430 | { |
| 1440 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | 1431 | #ifdef CONFIG_NET_DSA_TAG_TRAILER |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index 289b62d9dd1f..b114d35aea5e 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
| @@ -99,6 +99,22 @@ struct ip_set_hash { | |||
| 99 | #endif | 99 | #endif |
| 100 | }; | 100 | }; |
| 101 | 101 | ||
| 102 | static size_t | ||
| 103 | htable_size(u8 hbits) | ||
| 104 | { | ||
| 105 | size_t hsize; | ||
| 106 | |||
| 107 | /* We must fit both into u32 in jhash and size_t */ | ||
| 108 | if (hbits > 31) | ||
| 109 | return 0; | ||
| 110 | hsize = jhash_size(hbits); | ||
| 111 | if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket) | ||
| 112 | < hsize) | ||
| 113 | return 0; | ||
| 114 | |||
| 115 | return hsize * sizeof(struct hbucket) + sizeof(struct htable); | ||
| 116 | } | ||
| 117 | |||
| 102 | /* Compute htable_bits from the user input parameter hashsize */ | 118 | /* Compute htable_bits from the user input parameter hashsize */ |
| 103 | static u8 | 119 | static u8 |
| 104 | htable_bits(u32 hashsize) | 120 | htable_bits(u32 hashsize) |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index c6db9fb33c44..600060e25ec6 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -141,7 +141,7 @@ static inline unsigned __read_seqcount_begin(const seqcount_t *s) | |||
| 141 | unsigned ret; | 141 | unsigned ret; |
| 142 | 142 | ||
| 143 | repeat: | 143 | repeat: |
| 144 | ret = s->sequence; | 144 | ret = ACCESS_ONCE(s->sequence); |
| 145 | if (unlikely(ret & 1)) { | 145 | if (unlikely(ret & 1)) { |
| 146 | cpu_relax(); | 146 | cpu_relax(); |
| 147 | goto repeat; | 147 | goto repeat; |
| @@ -166,6 +166,27 @@ static inline unsigned read_seqcount_begin(const seqcount_t *s) | |||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | /** | 168 | /** |
| 169 | * raw_seqcount_begin - begin a seq-read critical section | ||
| 170 | * @s: pointer to seqcount_t | ||
| 171 | * Returns: count to be passed to read_seqcount_retry | ||
| 172 | * | ||
| 173 | * raw_seqcount_begin opens a read critical section of the given seqcount. | ||
| 174 | * Validity of the critical section is tested by checking read_seqcount_retry | ||
| 175 | * function. | ||
| 176 | * | ||
| 177 | * Unlike read_seqcount_begin(), this function will not wait for the count | ||
| 178 | * to stabilize. If a writer is active when we begin, we will fail the | ||
| 179 | * read_seqcount_retry() instead of stabilizing at the beginning of the | ||
| 180 | * critical section. | ||
| 181 | */ | ||
| 182 | static inline unsigned raw_seqcount_begin(const seqcount_t *s) | ||
| 183 | { | ||
| 184 | unsigned ret = ACCESS_ONCE(s->sequence); | ||
| 185 | smp_rmb(); | ||
| 186 | return ret & ~1; | ||
| 187 | } | ||
| 188 | |||
| 189 | /** | ||
| 169 | * __read_seqcount_retry - end a seq-read critical section (without barrier) | 190 | * __read_seqcount_retry - end a seq-read critical section (without barrier) |
| 170 | * @s: pointer to seqcount_t | 191 | * @s: pointer to seqcount_t |
| 171 | * @start: count, from read_seqcount_begin | 192 | * @start: count, from read_seqcount_begin |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 605b0aa8d852..76f439647c4b 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -191,7 +191,8 @@ extern void usbnet_cdc_status(struct usbnet *, struct urb *); | |||
| 191 | enum skb_state { | 191 | enum skb_state { |
| 192 | illegal = 0, | 192 | illegal = 0, |
| 193 | tx_start, tx_done, | 193 | tx_start, tx_done, |
| 194 | rx_start, rx_done, rx_cleanup | 194 | rx_start, rx_done, rx_cleanup, |
| 195 | unlink_start | ||
| 195 | }; | 196 | }; |
| 196 | 197 | ||
| 197 | struct skb_data { /* skb->cb is one of these */ | 198 | struct skb_data { /* skb->cb is one of these */ |
