diff options
Diffstat (limited to 'include/linux/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2741c0c55e83..8f5d9e7f8734 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -155,8 +155,6 @@ struct skb_shared_info { | |||
| 155 | #define SKB_DATAREF_SHIFT 16 | 155 | #define SKB_DATAREF_SHIFT 16 |
| 156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) | 156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) |
| 157 | 157 | ||
| 158 | extern struct timeval skb_tv_base; | ||
| 159 | |||
| 160 | struct skb_timeval { | 158 | struct skb_timeval { |
| 161 | u32 off_sec; | 159 | u32 off_sec; |
| 162 | u32 off_usec; | 160 | u32 off_usec; |
| @@ -175,7 +173,7 @@ enum { | |||
| 175 | * @prev: Previous buffer in list | 173 | * @prev: Previous buffer in list |
| 176 | * @list: List we are on | 174 | * @list: List we are on |
| 177 | * @sk: Socket we are owned by | 175 | * @sk: Socket we are owned by |
| 178 | * @tstamp: Time we arrived stored as offset to skb_tv_base | 176 | * @tstamp: Time we arrived |
| 179 | * @dev: Device we arrived on/are leaving by | 177 | * @dev: Device we arrived on/are leaving by |
| 180 | * @input_dev: Device we arrived on | 178 | * @input_dev: Device we arrived on |
| 181 | * @h: Transport layer header | 179 | * @h: Transport layer header |
| @@ -304,37 +302,37 @@ struct sk_buff { | |||
| 304 | 302 | ||
| 305 | extern void __kfree_skb(struct sk_buff *skb); | 303 | extern void __kfree_skb(struct sk_buff *skb); |
| 306 | extern struct sk_buff *__alloc_skb(unsigned int size, | 304 | extern struct sk_buff *__alloc_skb(unsigned int size, |
| 307 | unsigned int __nocast priority, int fclone); | 305 | gfp_t priority, int fclone); |
| 308 | static inline struct sk_buff *alloc_skb(unsigned int size, | 306 | static inline struct sk_buff *alloc_skb(unsigned int size, |
| 309 | unsigned int __nocast priority) | 307 | gfp_t priority) |
| 310 | { | 308 | { |
| 311 | return __alloc_skb(size, priority, 0); | 309 | return __alloc_skb(size, priority, 0); |
| 312 | } | 310 | } |
| 313 | 311 | ||
| 314 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | 312 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, |
| 315 | unsigned int __nocast priority) | 313 | gfp_t priority) |
| 316 | { | 314 | { |
| 317 | return __alloc_skb(size, priority, 1); | 315 | return __alloc_skb(size, priority, 1); |
| 318 | } | 316 | } |
| 319 | 317 | ||
| 320 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, | 318 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, |
| 321 | unsigned int size, | 319 | unsigned int size, |
| 322 | unsigned int __nocast priority); | 320 | gfp_t priority); |
| 323 | extern void kfree_skbmem(struct sk_buff *skb); | 321 | extern void kfree_skbmem(struct sk_buff *skb); |
| 324 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 322 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
| 325 | unsigned int __nocast priority); | 323 | gfp_t priority); |
| 326 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, | 324 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, |
| 327 | unsigned int __nocast priority); | 325 | gfp_t priority); |
| 328 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, | 326 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, |
| 329 | unsigned int __nocast gfp_mask); | 327 | gfp_t gfp_mask); |
| 330 | extern int pskb_expand_head(struct sk_buff *skb, | 328 | extern int pskb_expand_head(struct sk_buff *skb, |
| 331 | int nhead, int ntail, | 329 | int nhead, int ntail, |
| 332 | unsigned int __nocast gfp_mask); | 330 | gfp_t gfp_mask); |
| 333 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | 331 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, |
| 334 | unsigned int headroom); | 332 | unsigned int headroom); |
| 335 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 333 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, |
| 336 | int newheadroom, int newtailroom, | 334 | int newheadroom, int newtailroom, |
| 337 | unsigned int __nocast priority); | 335 | gfp_t priority); |
| 338 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); | 336 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); |
| 339 | #define dev_kfree_skb(a) kfree_skb(a) | 337 | #define dev_kfree_skb(a) kfree_skb(a) |
| 340 | extern void skb_over_panic(struct sk_buff *skb, int len, | 338 | extern void skb_over_panic(struct sk_buff *skb, int len, |
| @@ -486,7 +484,7 @@ static inline int skb_shared(const struct sk_buff *skb) | |||
| 486 | * NULL is returned on a memory allocation failure. | 484 | * NULL is returned on a memory allocation failure. |
| 487 | */ | 485 | */ |
| 488 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | 486 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, |
| 489 | unsigned int __nocast pri) | 487 | gfp_t pri) |
| 490 | { | 488 | { |
| 491 | might_sleep_if(pri & __GFP_WAIT); | 489 | might_sleep_if(pri & __GFP_WAIT); |
| 492 | if (skb_shared(skb)) { | 490 | if (skb_shared(skb)) { |
| @@ -518,7 +516,7 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | |||
| 518 | * %NULL is returned on a memory allocation failure. | 516 | * %NULL is returned on a memory allocation failure. |
| 519 | */ | 517 | */ |
| 520 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | 518 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, |
| 521 | unsigned int __nocast pri) | 519 | gfp_t pri) |
| 522 | { | 520 | { |
| 523 | might_sleep_if(pri & __GFP_WAIT); | 521 | might_sleep_if(pri & __GFP_WAIT); |
| 524 | if (skb_cloned(skb)) { | 522 | if (skb_cloned(skb)) { |
| @@ -1019,7 +1017,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) | |||
| 1019 | * %NULL is returned in there is no free memory. | 1017 | * %NULL is returned in there is no free memory. |
| 1020 | */ | 1018 | */ |
| 1021 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | 1019 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, |
| 1022 | unsigned int __nocast gfp_mask) | 1020 | gfp_t gfp_mask) |
| 1023 | { | 1021 | { |
| 1024 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); | 1022 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); |
| 1025 | if (likely(skb)) | 1023 | if (likely(skb)) |
| @@ -1132,8 +1130,8 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i, | |||
| 1132 | * If there is no free memory -ENOMEM is returned, otherwise zero | 1130 | * If there is no free memory -ENOMEM is returned, otherwise zero |
| 1133 | * is returned and the old skb data released. | 1131 | * is returned and the old skb data released. |
| 1134 | */ | 1132 | */ |
| 1135 | extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp); | 1133 | extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); |
| 1136 | static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp) | 1134 | static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) |
| 1137 | { | 1135 | { |
| 1138 | return __skb_linearize(skb, gfp); | 1136 | return __skb_linearize(skb, gfp); |
| 1139 | } | 1137 | } |
| @@ -1255,10 +1253,6 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
| 1255 | { | 1253 | { |
| 1256 | stamp->tv_sec = skb->tstamp.off_sec; | 1254 | stamp->tv_sec = skb->tstamp.off_sec; |
| 1257 | stamp->tv_usec = skb->tstamp.off_usec; | 1255 | stamp->tv_usec = skb->tstamp.off_usec; |
| 1258 | if (skb->tstamp.off_sec) { | ||
| 1259 | stamp->tv_sec += skb_tv_base.tv_sec; | ||
| 1260 | stamp->tv_usec += skb_tv_base.tv_usec; | ||
| 1261 | } | ||
| 1262 | } | 1256 | } |
| 1263 | 1257 | ||
| 1264 | /** | 1258 | /** |
| @@ -1272,8 +1266,8 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
| 1272 | */ | 1266 | */ |
| 1273 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) | 1267 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) |
| 1274 | { | 1268 | { |
| 1275 | skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; | 1269 | skb->tstamp.off_sec = stamp->tv_sec; |
| 1276 | skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; | 1270 | skb->tstamp.off_usec = stamp->tv_usec; |
| 1277 | } | 1271 | } |
| 1278 | 1272 | ||
| 1279 | extern void __net_timestamp(struct sk_buff *skb); | 1273 | extern void __net_timestamp(struct sk_buff *skb); |
