aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 23:01:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 23:01:30 -0500
commitc5ce28df0e7c01a1de23c36ebdefcd803f2b6cbb (patch)
tree9830baf38832769e1cf621708889111bbe3c93df /include/linux/skbuff.h
parent29afc4e9a408f2304e09c6dd0dbcfbd2356d0faa (diff)
parent9399f0c51489ae8c16d6559b82a452fdc1895e91 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) More iov_iter conversion work from Al Viro. [ The "crypto: switch af_alg_make_sg() to iov_iter" commit was wrong, and this pull actually adds an extra commit on top of the branch I'm pulling to fix that up, so that the pre-merge state is ok. - Linus ] 2) Various optimizations to the ipv4 forwarding information base trie lookup implementation. From Alexander Duyck. 3) Remove sock_iocb altogether, from CHristoph Hellwig. 4) Allow congestion control algorithm selection via routing metrics. From Daniel Borkmann. 5) Make ipv4 uncached route list per-cpu, from Eric Dumazet. 6) Handle rfs hash collisions more gracefully, also from Eric Dumazet. 7) Add xmit_more support to r8169, e1000, and e1000e drivers. From Florian Westphal. 8) Transparent Ethernet Bridging support for GRO, from Jesse Gross. 9) Add BPF packet actions to packet scheduler, from Jiri Pirko. 10) Add support for uniqu flow IDs to openvswitch, from Joe Stringer. 11) New NetCP ethernet driver, from Muralidharan Karicheri and Wingman Kwok. 12) More sanely handle out-of-window dupacks, which can result in serious ACK storms. From Neal Cardwell. 13) Various rhashtable bug fixes and enhancements, from Herbert Xu, Patrick McHardy, and Thomas Graf. 14) Support xmit_more in be2net, from Sathya Perla. 15) Group Policy extensions for vxlan, from Thomas Graf. 16) Remove Checksum Offload support for vxlan, from Tom Herbert. 17) Like ipv4, support lockless transmit over ipv6 UDP sockets. From Vlad Yasevich. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1494+1 commits) crypto: fix af_alg_make_sg() conversion to iov_iter ipv4: Namespecify TCP PMTU mechanism i40e: Fix for stats init function call in Rx setup tcp: don't include Fast Open option in SYN-ACK on pure SYN-data openvswitch: Only set TUNNEL_VXLAN_OPT if VXLAN-GBP metadata is set ipv6: Make __ipv6_select_ident static ipv6: Fix fragment id assignment on LE arches. bridge: Fix inability to add non-vlan fdb entry net: Mellanox: Delete unnecessary checks before the function call "vunmap" cxgb4: Add support in cxgb4 to get expansion rom version via ethtool ethtool: rename reserved1 memeber in ethtool_drvinfo for expansion ROM version net: dsa: Remove redundant phy_attach() IB/mlx4: Reset flow support for IB kernel ULPs IB/mlx4: Always use the correct port for mirrored multicast attachments net/bonding: Fix potential bad memory access during bonding events tipc: remove tipc_snprintf tipc: nl compat add noop and remove legacy nl framework tipc: convert legacy nl stats show to nl compat tipc: convert legacy nl net id get to nl compat tipc: convert legacy nl net id set to nl compat ...
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h44
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
2486static inline int skb_add_data(struct sk_buff *skb, 2489static 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
2694static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) 2696static 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
2700static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) 2701static 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 */
3105static 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)
3100void nf_conntrack_destroy(struct nf_conntrack *nfct); 3122void nf_conntrack_destroy(struct nf_conntrack *nfct);
3101static inline void nf_conntrack_put(struct nf_conntrack *nfct) 3123static inline void nf_conntrack_put(struct nf_conntrack *nfct)