diff options
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 59 |
1 files changed, 49 insertions, 10 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 50db9b04a552..192250bd49f5 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/kmemcheck.h> | 18 | #include <linux/kmemcheck.h> |
19 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
20 | #include <linux/time.h> | 20 | #include <linux/time.h> |
21 | #include <linux/bug.h> | ||
21 | #include <linux/cache.h> | 22 | #include <linux/cache.h> |
22 | 23 | ||
23 | #include <linux/atomic.h> | 24 | #include <linux/atomic.h> |
@@ -94,6 +95,13 @@ | |||
94 | * about CHECKSUM_UNNECESSARY. 8) | 95 | * about CHECKSUM_UNNECESSARY. 8) |
95 | * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead. | 96 | * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead. |
96 | * | 97 | * |
98 | * UNNECESSARY: device will do per protocol specific csum. Protocol drivers | ||
99 | * that do not want net to perform the checksum calculation should use | ||
100 | * this flag in their outgoing skbs. | ||
101 | * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC | ||
102 | * offload. Correspondingly, the FCoE protocol driver | ||
103 | * stack should use CHECKSUM_UNNECESSARY. | ||
104 | * | ||
97 | * Any questions? No questions, good. --ANK | 105 | * Any questions? No questions, good. --ANK |
98 | */ | 106 | */ |
99 | 107 | ||
@@ -361,6 +369,7 @@ typedef unsigned char *sk_buff_data_t; | |||
361 | * ports. | 369 | * ports. |
362 | * @wifi_acked_valid: wifi_acked was set | 370 | * @wifi_acked_valid: wifi_acked was set |
363 | * @wifi_acked: whether frame was acked on wifi or not | 371 | * @wifi_acked: whether frame was acked on wifi or not |
372 | * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS | ||
364 | * @dma_cookie: a cookie to one of several possible DMA operations | 373 | * @dma_cookie: a cookie to one of several possible DMA operations |
365 | * done by skb DMA functions | 374 | * done by skb DMA functions |
366 | * @secmark: security marking | 375 | * @secmark: security marking |
@@ -438,6 +447,11 @@ struct sk_buff { | |||
438 | #endif | 447 | #endif |
439 | 448 | ||
440 | int skb_iif; | 449 | int skb_iif; |
450 | |||
451 | __u32 rxhash; | ||
452 | |||
453 | __u16 vlan_tci; | ||
454 | |||
441 | #ifdef CONFIG_NET_SCHED | 455 | #ifdef CONFIG_NET_SCHED |
442 | __u16 tc_index; /* traffic control index */ | 456 | __u16 tc_index; /* traffic control index */ |
443 | #ifdef CONFIG_NET_CLS_ACT | 457 | #ifdef CONFIG_NET_CLS_ACT |
@@ -445,8 +459,6 @@ struct sk_buff { | |||
445 | #endif | 459 | #endif |
446 | #endif | 460 | #endif |
447 | 461 | ||
448 | __u32 rxhash; | ||
449 | |||
450 | __u16 queue_mapping; | 462 | __u16 queue_mapping; |
451 | kmemcheck_bitfield_begin(flags2); | 463 | kmemcheck_bitfield_begin(flags2); |
452 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 464 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
@@ -456,7 +468,8 @@ struct sk_buff { | |||
456 | __u8 l4_rxhash:1; | 468 | __u8 l4_rxhash:1; |
457 | __u8 wifi_acked_valid:1; | 469 | __u8 wifi_acked_valid:1; |
458 | __u8 wifi_acked:1; | 470 | __u8 wifi_acked:1; |
459 | /* 10/12 bit hole (depending on ndisc_nodetype presence) */ | 471 | __u8 no_fcs:1; |
472 | /* 9/11 bit hole (depending on ndisc_nodetype presence) */ | ||
460 | kmemcheck_bitfield_end(flags2); | 473 | kmemcheck_bitfield_end(flags2); |
461 | 474 | ||
462 | #ifdef CONFIG_NET_DMA | 475 | #ifdef CONFIG_NET_DMA |
@@ -470,8 +483,6 @@ struct sk_buff { | |||
470 | __u32 dropcount; | 483 | __u32 dropcount; |
471 | }; | 484 | }; |
472 | 485 | ||
473 | __u16 vlan_tci; | ||
474 | |||
475 | sk_buff_data_t transport_header; | 486 | sk_buff_data_t transport_header; |
476 | sk_buff_data_t network_header; | 487 | sk_buff_data_t network_header; |
477 | sk_buff_data_t mac_header; | 488 | sk_buff_data_t mac_header; |
@@ -876,6 +887,24 @@ static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_) | |||
876 | } | 887 | } |
877 | 888 | ||
878 | /** | 889 | /** |
890 | * skb_peek_next - peek skb following the given one from a queue | ||
891 | * @skb: skb to start from | ||
892 | * @list_: list to peek at | ||
893 | * | ||
894 | * Returns %NULL when the end of the list is met or a pointer to the | ||
895 | * next element. The reference count is not incremented and the | ||
896 | * reference is therefore volatile. Use with caution. | ||
897 | */ | ||
898 | static inline struct sk_buff *skb_peek_next(struct sk_buff *skb, | ||
899 | const struct sk_buff_head *list_) | ||
900 | { | ||
901 | struct sk_buff *next = skb->next; | ||
902 | if (next == (struct sk_buff *)list_) | ||
903 | next = NULL; | ||
904 | return next; | ||
905 | } | ||
906 | |||
907 | /** | ||
879 | * skb_peek_tail - peek at the tail of an &sk_buff_head | 908 | * skb_peek_tail - peek at the tail of an &sk_buff_head |
880 | * @list_: list to peek at | 909 | * @list_: list to peek at |
881 | * | 910 | * |
@@ -1152,7 +1181,7 @@ static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) | |||
1152 | } | 1181 | } |
1153 | 1182 | ||
1154 | 1183 | ||
1155 | static inline int skb_is_nonlinear(const struct sk_buff *skb) | 1184 | static inline bool skb_is_nonlinear(const struct sk_buff *skb) |
1156 | { | 1185 | { |
1157 | return skb->data_len; | 1186 | return skb->data_len; |
1158 | } | 1187 | } |
@@ -1216,7 +1245,7 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i, | |||
1216 | } | 1245 | } |
1217 | 1246 | ||
1218 | extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, | 1247 | extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, |
1219 | int off, int size); | 1248 | int off, int size, unsigned int truesize); |
1220 | 1249 | ||
1221 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) | 1250 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) |
1222 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb)) | 1251 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb)) |
@@ -1465,6 +1494,16 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
1465 | } | 1494 | } |
1466 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ | 1495 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ |
1467 | 1496 | ||
1497 | static inline void skb_mac_header_rebuild(struct sk_buff *skb) | ||
1498 | { | ||
1499 | if (skb_mac_header_was_set(skb)) { | ||
1500 | const unsigned char *old_mac = skb_mac_header(skb); | ||
1501 | |||
1502 | skb_set_mac_header(skb, -skb->mac_len); | ||
1503 | memmove(skb_mac_header(skb), old_mac, skb->mac_len); | ||
1504 | } | ||
1505 | } | ||
1506 | |||
1468 | static inline int skb_checksum_start_offset(const struct sk_buff *skb) | 1507 | static inline int skb_checksum_start_offset(const struct sk_buff *skb) |
1469 | { | 1508 | { |
1470 | return skb->csum_start - skb_headroom(skb); | 1509 | return skb->csum_start - skb_headroom(skb); |
@@ -2045,7 +2084,7 @@ static inline void skb_frag_add_head(struct sk_buff *skb, struct sk_buff *frag) | |||
2045 | for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) | 2084 | for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) |
2046 | 2085 | ||
2047 | extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, | 2086 | extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, |
2048 | int *peeked, int *err); | 2087 | int *peeked, int *off, int *err); |
2049 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | 2088 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, |
2050 | int noblock, int *err); | 2089 | int noblock, int *err); |
2051 | extern unsigned int datagram_poll(struct file *file, struct socket *sock, | 2090 | extern unsigned int datagram_poll(struct file *file, struct socket *sock, |
@@ -2438,12 +2477,12 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | |||
2438 | } | 2477 | } |
2439 | #endif | 2478 | #endif |
2440 | 2479 | ||
2441 | static inline int skb_is_gso(const struct sk_buff *skb) | 2480 | static inline bool skb_is_gso(const struct sk_buff *skb) |
2442 | { | 2481 | { |
2443 | return skb_shinfo(skb)->gso_size; | 2482 | return skb_shinfo(skb)->gso_size; |
2444 | } | 2483 | } |
2445 | 2484 | ||
2446 | static inline int skb_is_gso_v6(const struct sk_buff *skb) | 2485 | static inline bool skb_is_gso_v6(const struct sk_buff *skb) |
2447 | { | 2486 | { |
2448 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; | 2487 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; |
2449 | } | 2488 | } |