diff options
Diffstat (limited to 'include/linux/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 361 |
1 files changed, 161 insertions, 200 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2ddb48d9312c..bec1cc7d5e3c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -318,9 +318,13 @@ enum { | |||
| 318 | 318 | ||
| 319 | SKB_GSO_GRE = 1 << 6, | 319 | SKB_GSO_GRE = 1 << 6, |
| 320 | 320 | ||
| 321 | SKB_GSO_UDP_TUNNEL = 1 << 7, | 321 | SKB_GSO_IPIP = 1 << 7, |
| 322 | 322 | ||
| 323 | SKB_GSO_MPLS = 1 << 8, | 323 | SKB_GSO_SIT = 1 << 8, |
| 324 | |||
| 325 | SKB_GSO_UDP_TUNNEL = 1 << 9, | ||
| 326 | |||
| 327 | SKB_GSO_MPLS = 1 << 10, | ||
| 324 | }; | 328 | }; |
| 325 | 329 | ||
| 326 | #if BITS_PER_LONG > 32 | 330 | #if BITS_PER_LONG > 32 |
| @@ -333,11 +337,6 @@ typedef unsigned int sk_buff_data_t; | |||
| 333 | typedef unsigned char *sk_buff_data_t; | 337 | typedef unsigned char *sk_buff_data_t; |
| 334 | #endif | 338 | #endif |
| 335 | 339 | ||
| 336 | #if defined(CONFIG_NF_DEFRAG_IPV4) || defined(CONFIG_NF_DEFRAG_IPV4_MODULE) || \ | ||
| 337 | defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
| 338 | #define NET_SKBUFF_NF_DEFRAG_NEEDED 1 | ||
| 339 | #endif | ||
| 340 | |||
| 341 | /** | 340 | /** |
| 342 | * struct sk_buff - socket buffer | 341 | * struct sk_buff - socket buffer |
| 343 | * @next: Next buffer in list | 342 | * @next: Next buffer in list |
| @@ -370,7 +369,6 @@ typedef unsigned char *sk_buff_data_t; | |||
| 370 | * @protocol: Packet protocol from driver | 369 | * @protocol: Packet protocol from driver |
| 371 | * @destructor: Destruct function | 370 | * @destructor: Destruct function |
| 372 | * @nfct: Associated connection, if any | 371 | * @nfct: Associated connection, if any |
| 373 | * @nfct_reasm: netfilter conntrack re-assembly pointer | ||
| 374 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 372 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
| 375 | * @skb_iif: ifindex of device we arrived on | 373 | * @skb_iif: ifindex of device we arrived on |
| 376 | * @tc_index: Traffic control index | 374 | * @tc_index: Traffic control index |
| @@ -459,9 +457,6 @@ struct sk_buff { | |||
| 459 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 457 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 460 | struct nf_conntrack *nfct; | 458 | struct nf_conntrack *nfct; |
| 461 | #endif | 459 | #endif |
| 462 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
| 463 | struct sk_buff *nfct_reasm; | ||
| 464 | #endif | ||
| 465 | #ifdef CONFIG_BRIDGE_NETFILTER | 460 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 466 | struct nf_bridge_info *nf_bridge; | 461 | struct nf_bridge_info *nf_bridge; |
| 467 | #endif | 462 | #endif |
| @@ -498,7 +493,7 @@ struct sk_buff { | |||
| 498 | * headers if needed | 493 | * headers if needed |
| 499 | */ | 494 | */ |
| 500 | __u8 encapsulation:1; | 495 | __u8 encapsulation:1; |
| 501 | /* 7/9 bit hole (depending on ndisc_nodetype presence) */ | 496 | /* 6/8 bit hole (depending on ndisc_nodetype presence) */ |
| 502 | kmemcheck_bitfield_end(flags2); | 497 | kmemcheck_bitfield_end(flags2); |
| 503 | 498 | ||
| 504 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL | 499 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL |
| @@ -585,8 +580,8 @@ static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) | |||
| 585 | skb->_skb_refdst = (unsigned long)dst; | 580 | skb->_skb_refdst = (unsigned long)dst; |
| 586 | } | 581 | } |
| 587 | 582 | ||
| 588 | extern void __skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst, | 583 | void __skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst, |
| 589 | bool force); | 584 | bool force); |
| 590 | 585 | ||
| 591 | /** | 586 | /** |
| 592 | * skb_dst_set_noref - sets skb dst, hopefully, without taking reference | 587 | * skb_dst_set_noref - sets skb dst, hopefully, without taking reference |
| @@ -634,20 +629,20 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb) | |||
| 634 | return (struct rtable *)skb_dst(skb); | 629 | return (struct rtable *)skb_dst(skb); |
| 635 | } | 630 | } |
| 636 | 631 | ||
| 637 | extern void kfree_skb(struct sk_buff *skb); | 632 | void kfree_skb(struct sk_buff *skb); |
| 638 | extern void kfree_skb_list(struct sk_buff *segs); | 633 | void kfree_skb_list(struct sk_buff *segs); |
| 639 | extern void skb_tx_error(struct sk_buff *skb); | 634 | void skb_tx_error(struct sk_buff *skb); |
| 640 | extern void consume_skb(struct sk_buff *skb); | 635 | void consume_skb(struct sk_buff *skb); |
| 641 | extern void __kfree_skb(struct sk_buff *skb); | 636 | void __kfree_skb(struct sk_buff *skb); |
| 642 | extern struct kmem_cache *skbuff_head_cache; | 637 | extern struct kmem_cache *skbuff_head_cache; |
| 643 | 638 | ||
| 644 | extern void kfree_skb_partial(struct sk_buff *skb, bool head_stolen); | 639 | void kfree_skb_partial(struct sk_buff *skb, bool head_stolen); |
| 645 | extern bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, | 640 | bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, |
| 646 | bool *fragstolen, int *delta_truesize); | 641 | bool *fragstolen, int *delta_truesize); |
| 647 | 642 | ||
| 648 | extern struct sk_buff *__alloc_skb(unsigned int size, | 643 | struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int flags, |
| 649 | gfp_t priority, int flags, int node); | 644 | int node); |
| 650 | extern struct sk_buff *build_skb(void *data, unsigned int frag_size); | 645 | struct sk_buff *build_skb(void *data, unsigned int frag_size); |
| 651 | static inline struct sk_buff *alloc_skb(unsigned int size, | 646 | static inline struct sk_buff *alloc_skb(unsigned int size, |
| 652 | gfp_t priority) | 647 | gfp_t priority) |
| 653 | { | 648 | { |
| @@ -660,41 +655,33 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | |||
| 660 | return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE); | 655 | return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE); |
| 661 | } | 656 | } |
| 662 | 657 | ||
| 663 | extern struct sk_buff *__alloc_skb_head(gfp_t priority, int node); | 658 | struct sk_buff *__alloc_skb_head(gfp_t priority, int node); |
| 664 | static inline struct sk_buff *alloc_skb_head(gfp_t priority) | 659 | static inline struct sk_buff *alloc_skb_head(gfp_t priority) |
| 665 | { | 660 | { |
| 666 | return __alloc_skb_head(priority, -1); | 661 | return __alloc_skb_head(priority, -1); |
| 667 | } | 662 | } |
| 668 | 663 | ||
| 669 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); | 664 | struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); |
| 670 | extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); | 665 | int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); |
| 671 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 666 | struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); |
| 672 | gfp_t priority); | 667 | struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority); |
| 673 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, | 668 | struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, gfp_t gfp_mask); |
| 674 | gfp_t priority); | 669 | |
| 675 | extern struct sk_buff *__pskb_copy(struct sk_buff *skb, | 670 | int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask); |
| 676 | int headroom, gfp_t gfp_mask); | 671 | struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, |
| 677 | 672 | unsigned int headroom); | |
| 678 | extern int pskb_expand_head(struct sk_buff *skb, | 673 | struct sk_buff *skb_copy_expand(const struct sk_buff *skb, int newheadroom, |
| 679 | int nhead, int ntail, | 674 | int newtailroom, gfp_t priority); |
| 680 | gfp_t gfp_mask); | 675 | int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, |
| 681 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | 676 | int len); |
| 682 | unsigned int headroom); | 677 | int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer); |
| 683 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 678 | int skb_pad(struct sk_buff *skb, int pad); |
| 684 | int newheadroom, int newtailroom, | ||
| 685 | gfp_t priority); | ||
| 686 | extern int skb_to_sgvec(struct sk_buff *skb, | ||
| 687 | struct scatterlist *sg, int offset, | ||
| 688 | int len); | ||
| 689 | extern int skb_cow_data(struct sk_buff *skb, int tailbits, | ||
| 690 | struct sk_buff **trailer); | ||
| 691 | extern int skb_pad(struct sk_buff *skb, int pad); | ||
| 692 | #define dev_kfree_skb(a) consume_skb(a) | 679 | #define dev_kfree_skb(a) consume_skb(a) |
| 693 | 680 | ||
| 694 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | 681 | int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, |
| 695 | int getfrag(void *from, char *to, int offset, | 682 | int getfrag(void *from, char *to, int offset, |
| 696 | int len,int odd, struct sk_buff *skb), | 683 | int len, int odd, struct sk_buff *skb), |
| 697 | void *from, int length); | 684 | void *from, int length); |
| 698 | 685 | ||
| 699 | struct skb_seq_state { | 686 | struct skb_seq_state { |
| 700 | __u32 lower_offset; | 687 | __u32 lower_offset; |
| @@ -706,18 +693,17 @@ struct skb_seq_state { | |||
| 706 | __u8 *frag_data; | 693 | __u8 *frag_data; |
| 707 | }; | 694 | }; |
| 708 | 695 | ||
| 709 | extern void skb_prepare_seq_read(struct sk_buff *skb, | 696 | void skb_prepare_seq_read(struct sk_buff *skb, unsigned int from, |
| 710 | unsigned int from, unsigned int to, | 697 | unsigned int to, struct skb_seq_state *st); |
| 711 | struct skb_seq_state *st); | 698 | unsigned int skb_seq_read(unsigned int consumed, const u8 **data, |
| 712 | extern unsigned int skb_seq_read(unsigned int consumed, const u8 **data, | 699 | struct skb_seq_state *st); |
| 713 | struct skb_seq_state *st); | 700 | void skb_abort_seq_read(struct skb_seq_state *st); |
| 714 | extern void skb_abort_seq_read(struct skb_seq_state *st); | ||
| 715 | 701 | ||
| 716 | extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | 702 | unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, |
| 717 | unsigned int to, struct ts_config *config, | 703 | unsigned int to, struct ts_config *config, |
| 718 | struct ts_state *state); | 704 | struct ts_state *state); |
| 719 | 705 | ||
| 720 | extern void __skb_get_rxhash(struct sk_buff *skb); | 706 | void __skb_get_rxhash(struct sk_buff *skb); |
| 721 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) | 707 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) |
| 722 | { | 708 | { |
| 723 | if (!skb->l4_rxhash) | 709 | if (!skb->l4_rxhash) |
| @@ -1095,7 +1081,8 @@ static inline void skb_queue_head_init_class(struct sk_buff_head *list, | |||
| 1095 | * The "__skb_xxxx()" functions are the non-atomic ones that | 1081 | * The "__skb_xxxx()" functions are the non-atomic ones that |
| 1096 | * can only be called with interrupts disabled. | 1082 | * can only be called with interrupts disabled. |
| 1097 | */ | 1083 | */ |
| 1098 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); | 1084 | void skb_insert(struct sk_buff *old, struct sk_buff *newsk, |
| 1085 | struct sk_buff_head *list); | ||
| 1099 | static inline void __skb_insert(struct sk_buff *newsk, | 1086 | static inline void __skb_insert(struct sk_buff *newsk, |
| 1100 | struct sk_buff *prev, struct sk_buff *next, | 1087 | struct sk_buff *prev, struct sk_buff *next, |
| 1101 | struct sk_buff_head *list) | 1088 | struct sk_buff_head *list) |
| @@ -1201,8 +1188,8 @@ static inline void __skb_queue_after(struct sk_buff_head *list, | |||
| 1201 | __skb_insert(newsk, prev, prev->next, list); | 1188 | __skb_insert(newsk, prev, prev->next, list); |
| 1202 | } | 1189 | } |
| 1203 | 1190 | ||
| 1204 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, | 1191 | void skb_append(struct sk_buff *old, struct sk_buff *newsk, |
| 1205 | struct sk_buff_head *list); | 1192 | struct sk_buff_head *list); |
| 1206 | 1193 | ||
| 1207 | static inline void __skb_queue_before(struct sk_buff_head *list, | 1194 | static inline void __skb_queue_before(struct sk_buff_head *list, |
| 1208 | struct sk_buff *next, | 1195 | struct sk_buff *next, |
| @@ -1221,7 +1208,7 @@ static inline void __skb_queue_before(struct sk_buff_head *list, | |||
| 1221 | * | 1208 | * |
| 1222 | * A buffer cannot be placed on two lists at the same time. | 1209 | * A buffer cannot be placed on two lists at the same time. |
| 1223 | */ | 1210 | */ |
| 1224 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | 1211 | void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); |
| 1225 | static inline void __skb_queue_head(struct sk_buff_head *list, | 1212 | static inline void __skb_queue_head(struct sk_buff_head *list, |
| 1226 | struct sk_buff *newsk) | 1213 | struct sk_buff *newsk) |
| 1227 | { | 1214 | { |
| @@ -1238,7 +1225,7 @@ static inline void __skb_queue_head(struct sk_buff_head *list, | |||
| 1238 | * | 1225 | * |
| 1239 | * A buffer cannot be placed on two lists at the same time. | 1226 | * A buffer cannot be placed on two lists at the same time. |
| 1240 | */ | 1227 | */ |
| 1241 | extern void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk); | 1228 | void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk); |
| 1242 | static inline void __skb_queue_tail(struct sk_buff_head *list, | 1229 | static inline void __skb_queue_tail(struct sk_buff_head *list, |
| 1243 | struct sk_buff *newsk) | 1230 | struct sk_buff *newsk) |
| 1244 | { | 1231 | { |
| @@ -1249,7 +1236,7 @@ static inline void __skb_queue_tail(struct sk_buff_head *list, | |||
| 1249 | * remove sk_buff from list. _Must_ be called atomically, and with | 1236 | * remove sk_buff from list. _Must_ be called atomically, and with |
| 1250 | * the list known.. | 1237 | * the list known.. |
| 1251 | */ | 1238 | */ |
| 1252 | extern void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list); | 1239 | void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list); |
| 1253 | static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | 1240 | static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) |
| 1254 | { | 1241 | { |
| 1255 | struct sk_buff *next, *prev; | 1242 | struct sk_buff *next, *prev; |
| @@ -1270,7 +1257,7 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | |||
| 1270 | * so must be used with appropriate locks held only. The head item is | 1257 | * so must be used with appropriate locks held only. The head item is |
| 1271 | * returned or %NULL if the list is empty. | 1258 | * returned or %NULL if the list is empty. |
| 1272 | */ | 1259 | */ |
| 1273 | extern struct sk_buff *skb_dequeue(struct sk_buff_head *list); | 1260 | struct sk_buff *skb_dequeue(struct sk_buff_head *list); |
| 1274 | static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | 1261 | static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) |
| 1275 | { | 1262 | { |
| 1276 | struct sk_buff *skb = skb_peek(list); | 1263 | struct sk_buff *skb = skb_peek(list); |
| @@ -1287,7 +1274,7 @@ static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | |||
| 1287 | * so must be used with appropriate locks held only. The tail item is | 1274 | * so must be used with appropriate locks held only. The tail item is |
| 1288 | * returned or %NULL if the list is empty. | 1275 | * returned or %NULL if the list is empty. |
| 1289 | */ | 1276 | */ |
| 1290 | extern struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list); | 1277 | struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list); |
| 1291 | static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) | 1278 | static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) |
| 1292 | { | 1279 | { |
| 1293 | struct sk_buff *skb = skb_peek_tail(list); | 1280 | struct sk_buff *skb = skb_peek_tail(list); |
| @@ -1361,7 +1348,7 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, | |||
| 1361 | * @size: the length of the data | 1348 | * @size: the length of the data |
| 1362 | * | 1349 | * |
| 1363 | * As per __skb_fill_page_desc() -- initialises the @i'th fragment of | 1350 | * As per __skb_fill_page_desc() -- initialises the @i'th fragment of |
| 1364 | * @skb to point to &size bytes at offset @off within @page. In | 1351 | * @skb to point to @size bytes at offset @off within @page. In |
| 1365 | * addition updates @skb such that @i is the last fragment. | 1352 | * addition updates @skb such that @i is the last fragment. |
| 1366 | * | 1353 | * |
| 1367 | * Does not take any additional reference on the fragment. | 1354 | * Does not take any additional reference on the fragment. |
| @@ -1373,8 +1360,11 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i, | |||
| 1373 | skb_shinfo(skb)->nr_frags = i + 1; | 1360 | skb_shinfo(skb)->nr_frags = i + 1; |
| 1374 | } | 1361 | } |
| 1375 | 1362 | ||
| 1376 | extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, | 1363 | void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, |
| 1377 | int off, int size, unsigned int truesize); | 1364 | int size, unsigned int truesize); |
| 1365 | |||
| 1366 | void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size, | ||
| 1367 | unsigned int truesize); | ||
| 1378 | 1368 | ||
| 1379 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) | 1369 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) |
| 1380 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb)) | 1370 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb)) |
| @@ -1418,7 +1408,8 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) | |||
| 1418 | /* | 1408 | /* |
| 1419 | * Add data to an sk_buff | 1409 | * Add data to an sk_buff |
| 1420 | */ | 1410 | */ |
| 1421 | extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len); | 1411 | unsigned char *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len); |
| 1412 | unsigned char *skb_put(struct sk_buff *skb, unsigned int len); | ||
| 1422 | static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) | 1413 | static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) |
| 1423 | { | 1414 | { |
| 1424 | unsigned char *tmp = skb_tail_pointer(skb); | 1415 | unsigned char *tmp = skb_tail_pointer(skb); |
| @@ -1428,7 +1419,7 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) | |||
| 1428 | return tmp; | 1419 | return tmp; |
| 1429 | } | 1420 | } |
| 1430 | 1421 | ||
| 1431 | extern unsigned char *skb_push(struct sk_buff *skb, unsigned int len); | 1422 | unsigned char *skb_push(struct sk_buff *skb, unsigned int len); |
| 1432 | static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) | 1423 | static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) |
| 1433 | { | 1424 | { |
| 1434 | skb->data -= len; | 1425 | skb->data -= len; |
| @@ -1436,7 +1427,7 @@ static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) | |||
| 1436 | return skb->data; | 1427 | return skb->data; |
| 1437 | } | 1428 | } |
| 1438 | 1429 | ||
| 1439 | extern unsigned char *skb_pull(struct sk_buff *skb, unsigned int len); | 1430 | unsigned char *skb_pull(struct sk_buff *skb, unsigned int len); |
| 1440 | static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) | 1431 | static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) |
| 1441 | { | 1432 | { |
| 1442 | skb->len -= len; | 1433 | skb->len -= len; |
| @@ -1449,7 +1440,7 @@ static inline unsigned char *skb_pull_inline(struct sk_buff *skb, unsigned int l | |||
| 1449 | return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); | 1440 | return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); |
| 1450 | } | 1441 | } |
| 1451 | 1442 | ||
| 1452 | extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); | 1443 | unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); |
| 1453 | 1444 | ||
| 1454 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) | 1445 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) |
| 1455 | { | 1446 | { |
| @@ -1753,7 +1744,7 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) | |||
| 1753 | #define NET_SKB_PAD max(32, L1_CACHE_BYTES) | 1744 | #define NET_SKB_PAD max(32, L1_CACHE_BYTES) |
| 1754 | #endif | 1745 | #endif |
| 1755 | 1746 | ||
| 1756 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); | 1747 | int ___pskb_trim(struct sk_buff *skb, unsigned int len); |
| 1757 | 1748 | ||
| 1758 | static inline void __skb_trim(struct sk_buff *skb, unsigned int len) | 1749 | static inline void __skb_trim(struct sk_buff *skb, unsigned int len) |
| 1759 | { | 1750 | { |
| @@ -1765,7 +1756,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len) | |||
| 1765 | skb_set_tail_pointer(skb, len); | 1756 | skb_set_tail_pointer(skb, len); |
| 1766 | } | 1757 | } |
| 1767 | 1758 | ||
| 1768 | extern void skb_trim(struct sk_buff *skb, unsigned int len); | 1759 | void skb_trim(struct sk_buff *skb, unsigned int len); |
| 1769 | 1760 | ||
| 1770 | static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) | 1761 | static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) |
| 1771 | { | 1762 | { |
| @@ -1838,7 +1829,7 @@ static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask) | |||
| 1838 | * the list and one reference dropped. This function does not take the | 1829 | * the list and one reference dropped. This function does not take the |
| 1839 | * list lock and the caller must hold the relevant locks to use it. | 1830 | * list lock and the caller must hold the relevant locks to use it. |
| 1840 | */ | 1831 | */ |
| 1841 | extern void skb_queue_purge(struct sk_buff_head *list); | 1832 | void skb_queue_purge(struct sk_buff_head *list); |
| 1842 | static inline void __skb_queue_purge(struct sk_buff_head *list) | 1833 | static inline void __skb_queue_purge(struct sk_buff_head *list) |
| 1843 | { | 1834 | { |
| 1844 | struct sk_buff *skb; | 1835 | struct sk_buff *skb; |
| @@ -1850,11 +1841,10 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) | |||
| 1850 | #define NETDEV_FRAG_PAGE_MAX_SIZE (PAGE_SIZE << NETDEV_FRAG_PAGE_MAX_ORDER) | 1841 | #define NETDEV_FRAG_PAGE_MAX_SIZE (PAGE_SIZE << NETDEV_FRAG_PAGE_MAX_ORDER) |
| 1851 | #define NETDEV_PAGECNT_MAX_BIAS NETDEV_FRAG_PAGE_MAX_SIZE | 1842 | #define NETDEV_PAGECNT_MAX_BIAS NETDEV_FRAG_PAGE_MAX_SIZE |
| 1852 | 1843 | ||
| 1853 | extern void *netdev_alloc_frag(unsigned int fragsz); | 1844 | void *netdev_alloc_frag(unsigned int fragsz); |
| 1854 | 1845 | ||
| 1855 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | 1846 | struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, |
| 1856 | unsigned int length, | 1847 | gfp_t gfp_mask); |
| 1857 | gfp_t gfp_mask); | ||
| 1858 | 1848 | ||
| 1859 | /** | 1849 | /** |
| 1860 | * netdev_alloc_skb - allocate an skbuff for rx on a specific device | 1850 | * netdev_alloc_skb - allocate an skbuff for rx on a specific device |
| @@ -2071,6 +2061,8 @@ static inline void skb_frag_set_page(struct sk_buff *skb, int f, | |||
| 2071 | __skb_frag_set_page(&skb_shinfo(skb)->frags[f], page); | 2061 | __skb_frag_set_page(&skb_shinfo(skb)->frags[f], page); |
| 2072 | } | 2062 | } |
| 2073 | 2063 | ||
| 2064 | bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio); | ||
| 2065 | |||
| 2074 | /** | 2066 | /** |
| 2075 | * skb_frag_dma_map - maps a paged fragment via the DMA API | 2067 | * skb_frag_dma_map - maps a paged fragment via the DMA API |
| 2076 | * @dev: the device to map the fragment to | 2068 | * @dev: the device to map the fragment to |
| @@ -2271,24 +2263,6 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, | |||
| 2271 | 2263 | ||
| 2272 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | 2264 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); |
| 2273 | 2265 | ||
| 2274 | /** | ||
| 2275 | * pskb_trim_rcsum - trim received skb and update checksum | ||
| 2276 | * @skb: buffer to trim | ||
| 2277 | * @len: new length | ||
| 2278 | * | ||
| 2279 | * This is exactly the same as pskb_trim except that it ensures the | ||
| 2280 | * checksum of received packets are still valid after the operation. | ||
| 2281 | */ | ||
| 2282 | |||
| 2283 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | ||
| 2284 | { | ||
| 2285 | if (likely(len >= skb->len)) | ||
| 2286 | return 0; | ||
| 2287 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
| 2288 | skb->ip_summed = CHECKSUM_NONE; | ||
| 2289 | return __pskb_trim(skb, len); | ||
| 2290 | } | ||
| 2291 | |||
| 2292 | #define skb_queue_walk(queue, skb) \ | 2266 | #define skb_queue_walk(queue, skb) \ |
| 2293 | for (skb = (queue)->next; \ | 2267 | for (skb = (queue)->next; \ |
| 2294 | skb != (struct sk_buff *)(queue); \ | 2268 | skb != (struct sk_buff *)(queue); \ |
| @@ -2342,60 +2316,70 @@ static inline void skb_frag_add_head(struct sk_buff *skb, struct sk_buff *frag) | |||
| 2342 | #define skb_walk_frags(skb, iter) \ | 2316 | #define skb_walk_frags(skb, iter) \ |
| 2343 | for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) | 2317 | for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) |
| 2344 | 2318 | ||
| 2345 | extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, | 2319 | struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, |
| 2346 | int *peeked, int *off, int *err); | 2320 | int *peeked, int *off, int *err); |
| 2347 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | 2321 | struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, |
| 2348 | int noblock, int *err); | 2322 | int *err); |
| 2349 | extern unsigned int datagram_poll(struct file *file, struct socket *sock, | 2323 | unsigned int datagram_poll(struct file *file, struct socket *sock, |
| 2350 | struct poll_table_struct *wait); | 2324 | struct poll_table_struct *wait); |
| 2351 | extern int skb_copy_datagram_iovec(const struct sk_buff *from, | 2325 | int skb_copy_datagram_iovec(const struct sk_buff *from, int offset, |
| 2352 | int offset, struct iovec *to, | 2326 | struct iovec *to, int size); |
| 2353 | int size); | 2327 | int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen, |
| 2354 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | 2328 | struct iovec *iov); |
| 2355 | int hlen, | 2329 | int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, |
| 2356 | struct iovec *iov); | 2330 | const struct iovec *from, int from_offset, |
| 2357 | extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, | 2331 | int len); |
| 2358 | int offset, | 2332 | int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *frm, |
| 2359 | const struct iovec *from, | 2333 | int offset, size_t count); |
| 2360 | int from_offset, | 2334 | int skb_copy_datagram_const_iovec(const struct sk_buff *from, int offset, |
| 2361 | int len); | 2335 | const struct iovec *to, int to_offset, |
| 2362 | extern int zerocopy_sg_from_iovec(struct sk_buff *skb, | 2336 | int size); |
| 2363 | const struct iovec *frm, | 2337 | void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
| 2364 | int offset, | 2338 | void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb); |
| 2365 | size_t count); | 2339 | int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); |
| 2366 | extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, | 2340 | int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); |
| 2367 | int offset, | 2341 | int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len); |
| 2368 | const struct iovec *to, | 2342 | __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to, |
| 2369 | int to_offset, | 2343 | int len, __wsum csum); |
| 2370 | int size); | 2344 | int skb_splice_bits(struct sk_buff *skb, unsigned int offset, |
| 2371 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 2345 | struct pipe_inode_info *pipe, unsigned int len, |
| 2372 | extern void skb_free_datagram_locked(struct sock *sk, | 2346 | unsigned int flags); |
| 2373 | struct sk_buff *skb); | 2347 | void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); |
| 2374 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 2348 | void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); |
| 2375 | unsigned int flags); | 2349 | int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); |
| 2376 | extern __wsum skb_checksum(const struct sk_buff *skb, int offset, | 2350 | void skb_scrub_packet(struct sk_buff *skb, bool xnet); |
| 2377 | int len, __wsum csum); | 2351 | struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); |
| 2378 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, | 2352 | |
| 2379 | void *to, int len); | 2353 | struct skb_checksum_ops { |
| 2380 | extern int skb_store_bits(struct sk_buff *skb, int offset, | 2354 | __wsum (*update)(const void *mem, int len, __wsum wsum); |
| 2381 | const void *from, int len); | 2355 | __wsum (*combine)(__wsum csum, __wsum csum2, int offset, int len); |
| 2382 | extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, | 2356 | }; |
| 2383 | int offset, u8 *to, int len, | 2357 | |
| 2384 | __wsum csum); | 2358 | __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len, |
| 2385 | extern int skb_splice_bits(struct sk_buff *skb, | 2359 | __wsum csum, const struct skb_checksum_ops *ops); |
| 2386 | unsigned int offset, | 2360 | __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, |
| 2387 | struct pipe_inode_info *pipe, | 2361 | __wsum csum); |
| 2388 | unsigned int len, | 2362 | |
| 2389 | unsigned int flags); | 2363 | /** |
| 2390 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | 2364 | * pskb_trim_rcsum - trim received skb and update checksum |
| 2391 | extern void skb_split(struct sk_buff *skb, | 2365 | * @skb: buffer to trim |
| 2392 | struct sk_buff *skb1, const u32 len); | 2366 | * @len: new length |
| 2393 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, | 2367 | * |
| 2394 | int shiftlen); | 2368 | * This is exactly the same as pskb_trim except that it ensures the |
| 2395 | extern void skb_scrub_packet(struct sk_buff *skb, bool xnet); | 2369 | * checksum of received packets are still valid after the operation. |
| 2396 | 2370 | */ | |
| 2397 | extern struct sk_buff *skb_segment(struct sk_buff *skb, | 2371 | |
| 2398 | netdev_features_t features); | 2372 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) |
| 2373 | { | ||
| 2374 | if (likely(len >= skb->len)) | ||
| 2375 | return 0; | ||
| 2376 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | ||
| 2377 | __wsum adj = skb_checksum(skb, len, skb->len - len, 0); | ||
| 2378 | |||
| 2379 | skb->csum = csum_sub(skb->csum, adj); | ||
| 2380 | } | ||
| 2381 | return __pskb_trim(skb, len); | ||
| 2382 | } | ||
| 2399 | 2383 | ||
| 2400 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 2384 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
| 2401 | int len, void *buffer) | 2385 | int len, void *buffer) |
| @@ -2440,7 +2424,7 @@ static inline void skb_copy_to_linear_data_offset(struct sk_buff *skb, | |||
| 2440 | memcpy(skb->data + offset, from, len); | 2424 | memcpy(skb->data + offset, from, len); |
| 2441 | } | 2425 | } |
| 2442 | 2426 | ||
| 2443 | extern void skb_init(void); | 2427 | void skb_init(void); |
| 2444 | 2428 | ||
| 2445 | static inline ktime_t skb_get_ktime(const struct sk_buff *skb) | 2429 | static inline ktime_t skb_get_ktime(const struct sk_buff *skb) |
| 2446 | { | 2430 | { |
| @@ -2483,12 +2467,12 @@ static inline ktime_t net_invalid_timestamp(void) | |||
| 2483 | return ktime_set(0, 0); | 2467 | return ktime_set(0, 0); |
| 2484 | } | 2468 | } |
| 2485 | 2469 | ||
| 2486 | extern void skb_timestamping_init(void); | 2470 | void skb_timestamping_init(void); |
| 2487 | 2471 | ||
| 2488 | #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING | 2472 | #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING |
| 2489 | 2473 | ||
| 2490 | extern void skb_clone_tx_timestamp(struct sk_buff *skb); | 2474 | void skb_clone_tx_timestamp(struct sk_buff *skb); |
| 2491 | extern bool skb_defer_rx_timestamp(struct sk_buff *skb); | 2475 | bool skb_defer_rx_timestamp(struct sk_buff *skb); |
| 2492 | 2476 | ||
| 2493 | #else /* CONFIG_NETWORK_PHY_TIMESTAMPING */ | 2477 | #else /* CONFIG_NETWORK_PHY_TIMESTAMPING */ |
| 2494 | 2478 | ||
| @@ -2529,8 +2513,8 @@ void skb_complete_tx_timestamp(struct sk_buff *skb, | |||
| 2529 | * generates a software time stamp (otherwise), then queues the clone | 2513 | * generates a software time stamp (otherwise), then queues the clone |
| 2530 | * to the error queue of the socket. Errors are silently ignored. | 2514 | * to the error queue of the socket. Errors are silently ignored. |
| 2531 | */ | 2515 | */ |
| 2532 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, | 2516 | void skb_tstamp_tx(struct sk_buff *orig_skb, |
| 2533 | struct skb_shared_hwtstamps *hwtstamps); | 2517 | struct skb_shared_hwtstamps *hwtstamps); |
| 2534 | 2518 | ||
| 2535 | static inline void sw_tx_timestamp(struct sk_buff *skb) | 2519 | static inline void sw_tx_timestamp(struct sk_buff *skb) |
| 2536 | { | 2520 | { |
| @@ -2562,8 +2546,8 @@ static inline void skb_tx_timestamp(struct sk_buff *skb) | |||
| 2562 | */ | 2546 | */ |
| 2563 | void skb_complete_wifi_ack(struct sk_buff *skb, bool acked); | 2547 | void skb_complete_wifi_ack(struct sk_buff *skb, bool acked); |
| 2564 | 2548 | ||
| 2565 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 2549 | __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
| 2566 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 2550 | __sum16 __skb_checksum_complete(struct sk_buff *skb); |
| 2567 | 2551 | ||
| 2568 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) | 2552 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) |
| 2569 | { | 2553 | { |
| @@ -2593,7 +2577,7 @@ static inline __sum16 skb_checksum_complete(struct sk_buff *skb) | |||
| 2593 | } | 2577 | } |
| 2594 | 2578 | ||
| 2595 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2579 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 2596 | extern void nf_conntrack_destroy(struct nf_conntrack *nfct); | 2580 | void nf_conntrack_destroy(struct nf_conntrack *nfct); |
| 2597 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 2581 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
| 2598 | { | 2582 | { |
| 2599 | if (nfct && atomic_dec_and_test(&nfct->use)) | 2583 | if (nfct && atomic_dec_and_test(&nfct->use)) |
| @@ -2605,18 +2589,6 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct) | |||
| 2605 | atomic_inc(&nfct->use); | 2589 | atomic_inc(&nfct->use); |
| 2606 | } | 2590 | } |
| 2607 | #endif | 2591 | #endif |
| 2608 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
| 2609 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) | ||
| 2610 | { | ||
| 2611 | if (skb) | ||
| 2612 | atomic_inc(&skb->users); | ||
| 2613 | } | ||
| 2614 | static inline void nf_conntrack_put_reasm(struct sk_buff *skb) | ||
| 2615 | { | ||
| 2616 | if (skb) | ||
| 2617 | kfree_skb(skb); | ||
| 2618 | } | ||
| 2619 | #endif | ||
| 2620 | #ifdef CONFIG_BRIDGE_NETFILTER | 2592 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 2621 | static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) | 2593 | static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) |
| 2622 | { | 2594 | { |
| @@ -2635,10 +2607,6 @@ static inline void nf_reset(struct sk_buff *skb) | |||
| 2635 | nf_conntrack_put(skb->nfct); | 2607 | nf_conntrack_put(skb->nfct); |
| 2636 | skb->nfct = NULL; | 2608 | skb->nfct = NULL; |
| 2637 | #endif | 2609 | #endif |
| 2638 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
| 2639 | nf_conntrack_put_reasm(skb->nfct_reasm); | ||
| 2640 | skb->nfct_reasm = NULL; | ||
| 2641 | #endif | ||
| 2642 | #ifdef CONFIG_BRIDGE_NETFILTER | 2610 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 2643 | nf_bridge_put(skb->nf_bridge); | 2611 | nf_bridge_put(skb->nf_bridge); |
| 2644 | skb->nf_bridge = NULL; | 2612 | skb->nf_bridge = NULL; |
| @@ -2660,10 +2628,6 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
| 2660 | nf_conntrack_get(src->nfct); | 2628 | nf_conntrack_get(src->nfct); |
| 2661 | dst->nfctinfo = src->nfctinfo; | 2629 | dst->nfctinfo = src->nfctinfo; |
| 2662 | #endif | 2630 | #endif |
| 2663 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
| 2664 | dst->nfct_reasm = src->nfct_reasm; | ||
| 2665 | nf_conntrack_get_reasm(src->nfct_reasm); | ||
| 2666 | #endif | ||
| 2667 | #ifdef CONFIG_BRIDGE_NETFILTER | 2631 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 2668 | dst->nf_bridge = src->nf_bridge; | 2632 | dst->nf_bridge = src->nf_bridge; |
| 2669 | nf_bridge_get(src->nf_bridge); | 2633 | nf_bridge_get(src->nf_bridge); |
| @@ -2675,9 +2639,6 @@ static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
| 2675 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2639 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 2676 | nf_conntrack_put(dst->nfct); | 2640 | nf_conntrack_put(dst->nfct); |
| 2677 | #endif | 2641 | #endif |
| 2678 | #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED | ||
| 2679 | nf_conntrack_put_reasm(dst->nfct_reasm); | ||
| 2680 | #endif | ||
| 2681 | #ifdef CONFIG_BRIDGE_NETFILTER | 2642 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 2682 | nf_bridge_put(dst->nf_bridge); | 2643 | nf_bridge_put(dst->nf_bridge); |
| 2683 | #endif | 2644 | #endif |
| @@ -2732,28 +2693,27 @@ static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) | |||
| 2732 | return skb->queue_mapping != 0; | 2693 | return skb->queue_mapping != 0; |
| 2733 | } | 2694 | } |
| 2734 | 2695 | ||
| 2735 | extern u16 __skb_tx_hash(const struct net_device *dev, | 2696 | u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb, |
| 2736 | const struct sk_buff *skb, | 2697 | unsigned int num_tx_queues); |
| 2737 | unsigned int num_tx_queues); | ||
| 2738 | 2698 | ||
| 2739 | #ifdef CONFIG_XFRM | ||
| 2740 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | 2699 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) |
| 2741 | { | 2700 | { |
| 2701 | #ifdef CONFIG_XFRM | ||
| 2742 | return skb->sp; | 2702 | return skb->sp; |
| 2743 | } | ||
| 2744 | #else | 2703 | #else |
| 2745 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | ||
| 2746 | { | ||
| 2747 | return NULL; | 2704 | return NULL; |
| 2748 | } | ||
| 2749 | #endif | 2705 | #endif |
| 2706 | } | ||
| 2750 | 2707 | ||
| 2751 | /* Keeps track of mac header offset relative to skb->head. | 2708 | /* Keeps track of mac header offset relative to skb->head. |
| 2752 | * It is useful for TSO of Tunneling protocol. e.g. GRE. | 2709 | * It is useful for TSO of Tunneling protocol. e.g. GRE. |
| 2753 | * For non-tunnel skb it points to skb_mac_header() and for | 2710 | * For non-tunnel skb it points to skb_mac_header() and for |
| 2754 | * tunnel skb it points to outer mac header. */ | 2711 | * tunnel skb it points to outer mac header. |
| 2712 | * Keeps track of level of encapsulation of network headers. | ||
| 2713 | */ | ||
| 2755 | struct skb_gso_cb { | 2714 | struct skb_gso_cb { |
| 2756 | int mac_offset; | 2715 | int mac_offset; |
| 2716 | int encap_level; | ||
| 2757 | }; | 2717 | }; |
| 2758 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) | 2718 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) |
| 2759 | 2719 | ||
| @@ -2783,12 +2743,13 @@ static inline bool skb_is_gso(const struct sk_buff *skb) | |||
| 2783 | return skb_shinfo(skb)->gso_size; | 2743 | return skb_shinfo(skb)->gso_size; |
| 2784 | } | 2744 | } |
| 2785 | 2745 | ||
| 2746 | /* Note: Should be called only if skb_is_gso(skb) is true */ | ||
| 2786 | static inline bool skb_is_gso_v6(const struct sk_buff *skb) | 2747 | static inline bool skb_is_gso_v6(const struct sk_buff *skb) |
| 2787 | { | 2748 | { |
| 2788 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; | 2749 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; |
| 2789 | } | 2750 | } |
| 2790 | 2751 | ||
| 2791 | extern void __skb_warn_lro_forwarding(const struct sk_buff *skb); | 2752 | void __skb_warn_lro_forwarding(const struct sk_buff *skb); |
| 2792 | 2753 | ||
| 2793 | static inline bool skb_warn_if_lro(const struct sk_buff *skb) | 2754 | static inline bool skb_warn_if_lro(const struct sk_buff *skb) |
| 2794 | { | 2755 | { |
