aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h48
1 files changed, 15 insertions, 33 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 85577a4ffa61..a05a5f7c0b73 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -22,12 +22,10 @@
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23#include <asm/types.h> 23#include <asm/types.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/mm.h>
26#include <linux/highmem.h>
27#include <linux/poll.h>
28#include <linux/net.h> 25#include <linux/net.h>
29#include <linux/textsearch.h> 26#include <linux/textsearch.h>
30#include <net/checksum.h> 27#include <net/checksum.h>
28#include <linux/rcupdate.h>
31#include <linux/dmaengine.h> 29#include <linux/dmaengine.h>
32 30
33#define HAVE_ALLOC_SKB /* For the drivers to know */ 31#define HAVE_ALLOC_SKB /* For the drivers to know */
@@ -139,7 +137,7 @@ struct skb_shared_info {
139 /* Warning: this field is not always filled in (UFO)! */ 137 /* Warning: this field is not always filled in (UFO)! */
140 unsigned short gso_segs; 138 unsigned short gso_segs;
141 unsigned short gso_type; 139 unsigned short gso_type;
142 unsigned int ip6_frag_id; 140 __be32 ip6_frag_id;
143 struct sk_buff *frag_list; 141 struct sk_buff *frag_list;
144 skb_frag_t frags[MAX_SKB_FRAGS]; 142 skb_frag_t frags[MAX_SKB_FRAGS];
145}; 143};
@@ -216,7 +214,7 @@ enum {
216 * @tail: Tail pointer 214 * @tail: Tail pointer
217 * @end: End pointer 215 * @end: End pointer
218 * @destructor: Destruct function 216 * @destructor: Destruct function
219 * @nfmark: Can be used for communication between hooks 217 * @mark: Generic packet mark
220 * @nfct: Associated connection, if any 218 * @nfct: Associated connection, if any
221 * @ipvs_property: skbuff is owned by ipvs 219 * @ipvs_property: skbuff is owned by ipvs
222 * @nfctinfo: Relationship of this skb to the connection 220 * @nfctinfo: Relationship of this skb to the connection
@@ -273,8 +271,11 @@ struct sk_buff {
273 271
274 unsigned int len, 272 unsigned int len,
275 data_len, 273 data_len,
276 mac_len, 274 mac_len;
277 csum; 275 union {
276 __wsum csum;
277 __u32 csum_offset;
278 };
278 __u32 priority; 279 __u32 priority;
279 __u8 local_df:1, 280 __u8 local_df:1,
280 cloned:1, 281 cloned:1,
@@ -295,7 +296,6 @@ struct sk_buff {
295#ifdef CONFIG_BRIDGE_NETFILTER 296#ifdef CONFIG_BRIDGE_NETFILTER
296 struct nf_bridge_info *nf_bridge; 297 struct nf_bridge_info *nf_bridge;
297#endif 298#endif
298 __u32 nfmark;
299#endif /* CONFIG_NETFILTER */ 299#endif /* CONFIG_NETFILTER */
300#ifdef CONFIG_NET_SCHED 300#ifdef CONFIG_NET_SCHED
301 __u16 tc_index; /* traffic control index */ 301 __u16 tc_index; /* traffic control index */
@@ -310,6 +310,7 @@ struct sk_buff {
310 __u32 secmark; 310 __u32 secmark;
311#endif 311#endif
312 312
313 __u32 mark;
313 314
314 /* These elements must be at the end, see alloc_skb() for details. */ 315 /* These elements must be at the end, see alloc_skb() for details. */
315 unsigned int truesize; 316 unsigned int truesize;
@@ -1199,8 +1200,7 @@ static inline int skb_add_data(struct sk_buff *skb,
1199 1200
1200 if (skb->ip_summed == CHECKSUM_NONE) { 1201 if (skb->ip_summed == CHECKSUM_NONE) {
1201 int err = 0; 1202 int err = 0;
1202 unsigned int csum = csum_and_copy_from_user(from, 1203 __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy),
1203 skb_put(skb, copy),
1204 copy, 0, &err); 1204 copy, 0, &err);
1205 if (!err) { 1205 if (!err) {
1206 skb->csum = csum_block_add(skb->csum, csum, off); 1206 skb->csum = csum_block_add(skb->csum, csum, off);
@@ -1293,24 +1293,6 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1293 return __pskb_trim(skb, len); 1293 return __pskb_trim(skb, len);
1294} 1294}
1295 1295
1296static inline void *kmap_skb_frag(const skb_frag_t *frag)
1297{
1298#ifdef CONFIG_HIGHMEM
1299 BUG_ON(in_irq());
1300
1301 local_bh_disable();
1302#endif
1303 return kmap_atomic(frag->page, KM_SKB_DATA_SOFTIRQ);
1304}
1305
1306static inline void kunmap_skb_frag(void *vaddr)
1307{
1308 kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
1309#ifdef CONFIG_HIGHMEM
1310 local_bh_enable();
1311#endif
1312}
1313
1314#define skb_queue_walk(queue, skb) \ 1296#define skb_queue_walk(queue, skb) \
1315 for (skb = (queue)->next; \ 1297 for (skb = (queue)->next; \
1316 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ 1298 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \
@@ -1335,15 +1317,15 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
1335extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 1317extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
1336extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, 1318extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb,
1337 unsigned int flags); 1319 unsigned int flags);
1338extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, 1320extern __wsum skb_checksum(const struct sk_buff *skb, int offset,
1339 int len, unsigned int csum); 1321 int len, __wsum csum);
1340extern int skb_copy_bits(const struct sk_buff *skb, int offset, 1322extern int skb_copy_bits(const struct sk_buff *skb, int offset,
1341 void *to, int len); 1323 void *to, int len);
1342extern int skb_store_bits(const struct sk_buff *skb, int offset, 1324extern int skb_store_bits(const struct sk_buff *skb, int offset,
1343 void *from, int len); 1325 void *from, int len);
1344extern unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb, 1326extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb,
1345 int offset, u8 *to, int len, 1327 int offset, u8 *to, int len,
1346 unsigned int csum); 1328 __wsum csum);
1347extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); 1329extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
1348extern void skb_split(struct sk_buff *skb, 1330extern void skb_split(struct sk_buff *skb,
1349 struct sk_buff *skb1, const u32 len); 1331 struct sk_buff *skb1, const u32 len);
@@ -1399,7 +1381,7 @@ static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *
1399 1381
1400extern void __net_timestamp(struct sk_buff *skb); 1382extern void __net_timestamp(struct sk_buff *skb);
1401 1383
1402extern unsigned int __skb_checksum_complete(struct sk_buff *skb); 1384extern __sum16 __skb_checksum_complete(struct sk_buff *skb);
1403 1385
1404/** 1386/**
1405 * skb_checksum_complete - Calculate checksum of an entire packet 1387 * skb_checksum_complete - Calculate checksum of an entire packet