diff options
Diffstat (limited to 'include/linux/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 85ab7d72b54c..1bb36edb66b9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -626,8 +626,11 @@ struct sk_buff { | |||
| 626 | __u32 hash; | 626 | __u32 hash; |
| 627 | __be16 vlan_proto; | 627 | __be16 vlan_proto; |
| 628 | __u16 vlan_tci; | 628 | __u16 vlan_tci; |
| 629 | #ifdef CONFIG_NET_RX_BUSY_POLL | 629 | #if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS) |
| 630 | unsigned int napi_id; | 630 | union { |
| 631 | unsigned int napi_id; | ||
| 632 | unsigned int sender_cpu; | ||
| 633 | }; | ||
| 631 | #endif | 634 | #endif |
| 632 | #ifdef CONFIG_NETWORK_SECMARK | 635 | #ifdef CONFIG_NETWORK_SECMARK |
| 633 | __u32 secmark; | 636 | __u32 secmark; |
| @@ -2484,19 +2487,18 @@ static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) | |||
| 2484 | } | 2487 | } |
| 2485 | 2488 | ||
| 2486 | static inline int skb_add_data(struct sk_buff *skb, | 2489 | static inline int skb_add_data(struct sk_buff *skb, |
| 2487 | char __user *from, int copy) | 2490 | struct iov_iter *from, int copy) |
| 2488 | { | 2491 | { |
| 2489 | const int off = skb->len; | 2492 | const int off = skb->len; |
| 2490 | 2493 | ||
| 2491 | if (skb->ip_summed == CHECKSUM_NONE) { | 2494 | if (skb->ip_summed == CHECKSUM_NONE) { |
| 2492 | int err = 0; | 2495 | __wsum csum = 0; |
| 2493 | __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy), | 2496 | if (csum_and_copy_from_iter(skb_put(skb, copy), copy, |
| 2494 | copy, 0, &err); | 2497 | &csum, from) == copy) { |
| 2495 | if (!err) { | ||
| 2496 | skb->csum = csum_block_add(skb->csum, csum, off); | 2498 | skb->csum = csum_block_add(skb->csum, csum, off); |
| 2497 | return 0; | 2499 | return 0; |
| 2498 | } | 2500 | } |
| 2499 | } else if (!copy_from_user(skb_put(skb, copy), from, copy)) | 2501 | } else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy) |
| 2500 | return 0; | 2502 | return 0; |
| 2501 | 2503 | ||
| 2502 | __skb_trim(skb, off); | 2504 | __skb_trim(skb, off); |
| @@ -2693,8 +2695,7 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); | |||
| 2693 | 2695 | ||
| 2694 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) | 2696 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) |
| 2695 | { | 2697 | { |
| 2696 | /* XXX: stripping const */ | 2698 | return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT; |
| 2697 | return memcpy_fromiovec(data, (struct iovec *)msg->msg_iter.iov, len); | ||
| 2698 | } | 2699 | } |
| 2699 | 2700 | ||
| 2700 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) | 2701 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) |
| @@ -3071,7 +3072,7 @@ static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto) | |||
| 3071 | 3072 | ||
| 3072 | #define skb_checksum_validate_zero_check(skb, proto, check, \ | 3073 | #define skb_checksum_validate_zero_check(skb, proto, check, \ |
| 3073 | compute_pseudo) \ | 3074 | compute_pseudo) \ |
| 3074 | __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo) | 3075 | __skb_checksum_validate(skb, proto, true, true, check, compute_pseudo) |
| 3075 | 3076 | ||
| 3076 | #define skb_checksum_simple_validate(skb) \ | 3077 | #define skb_checksum_simple_validate(skb) \ |
| 3077 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) | 3078 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) |
| @@ -3096,6 +3097,27 @@ do { \ | |||
| 3096 | compute_pseudo(skb, proto)); \ | 3097 | compute_pseudo(skb, proto)); \ |
| 3097 | } while (0) | 3098 | } while (0) |
| 3098 | 3099 | ||
| 3100 | /* Update skbuf and packet to reflect the remote checksum offload operation. | ||
| 3101 | * When called, ptr indicates the starting point for skb->csum when | ||
| 3102 | * ip_summed is CHECKSUM_COMPLETE. If we need create checksum complete | ||
| 3103 | * here, skb_postpull_rcsum is done so skb->csum start is ptr. | ||
| 3104 | */ | ||
| 3105 | static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, | ||
| 3106 | int start, int offset) | ||
| 3107 | { | ||
| 3108 | __wsum delta; | ||
| 3109 | |||
| 3110 | if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) { | ||
| 3111 | __skb_checksum_complete(skb); | ||
| 3112 | skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data); | ||
| 3113 | } | ||
| 3114 | |||
| 3115 | delta = remcsum_adjust(ptr, skb->csum, start, offset); | ||
| 3116 | |||
| 3117 | /* Adjust skb->csum since we changed the packet */ | ||
| 3118 | skb->csum = csum_add(skb->csum, delta); | ||
| 3119 | } | ||
| 3120 | |||
| 3099 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 3121 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 3100 | void nf_conntrack_destroy(struct nf_conntrack *nfct); | 3122 | void nf_conntrack_destroy(struct nf_conntrack *nfct); |
| 3101 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 3123 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
