diff options
| author | David S. Miller <davem@davemloft.net> | 2013-10-19 19:37:06 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-10-19 19:37:06 -0400 |
| commit | 53481da372851a5506deb5247302f75459b472b4 (patch) | |
| tree | f56596d0aa56f97a2a54cd18749805ae2c4becc8 /include | |
| parent | b917eb155c56bbb766140b406979820e719e3f55 (diff) | |
| parent | 117401ee1df6517203454637fbc3e7e660ce45f6 (diff) | |
Merge branch 'ipip_gso'
Eric Dumazet says:
====================
net: Implement GSO/TSO support for IPIP
This patch serie implements GSO/TSO support for IPIP
David, please note it applies after "ipv4: gso: send_check() & segment() cleanups"
( http://patchwork.ozlabs.org/patch/284714/ )
Broadcom bnx2x driver is now enabled for TSO support of IPIP traffic
Before patch :
lpq83:~# ./netperf -H 7.7.9.84 -Cc
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.9.84 () port 0 AF_INET
Recv Send Send Utilization Service Demand
Socket Socket Message Elapsed Send Recv Send Recv
Size Size Size Time Throughput local remote local remote
bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB
87380 16384 16384 10.00 3357.88 5.09 3.70 2.983 2.167
After patch :
lpq83:~# ./netperf -H 7.7.9.84 -Cc
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.9.84 () port 0 AF_INET
Recv Send Send Utilization Service Demand
Socket Socket Message Elapsed Send Recv Send Recv
Size Size Size Time Throughput local remote local remote
bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB
87380 16384 16384 10.00 8532.40 2.55 7.73 0.588 1.781
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netdev_features.h | 2 | ||||
| -rw-r--r-- | include/linux/skbuff.h | 13 | ||||
| -rw-r--r-- | include/net/gre.h | 8 | ||||
| -rw-r--r-- | include/net/ip_tunnels.h | 3 |
4 files changed, 21 insertions, 5 deletions
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index a2a89a5c7be5..8dad68cede1c 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
| @@ -42,6 +42,7 @@ enum { | |||
| 42 | NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ | 42 | NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ |
| 43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ | 43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ |
| 44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ | 44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ |
| 45 | NETIF_F_GSO_IPIP_BIT, /* ... IPIP tunnel with TSO */ | ||
| 45 | NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ | 46 | NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ |
| 46 | NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */ | 47 | NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */ |
| 47 | /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ | 48 | /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ |
| @@ -107,6 +108,7 @@ enum { | |||
| 107 | #define NETIF_F_RXFCS __NETIF_F(RXFCS) | 108 | #define NETIF_F_RXFCS __NETIF_F(RXFCS) |
| 108 | #define NETIF_F_RXALL __NETIF_F(RXALL) | 109 | #define NETIF_F_RXALL __NETIF_F(RXALL) |
| 109 | #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) | 110 | #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) |
| 111 | #define NETIF_F_GSO_IPIP __NETIF_F(GSO_IPIP) | ||
| 110 | #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) | 112 | #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) |
| 111 | #define NETIF_F_GSO_MPLS __NETIF_F(GSO_MPLS) | 113 | #define NETIF_F_GSO_MPLS __NETIF_F(GSO_MPLS) |
| 112 | #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) | 114 | #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ba74474836c0..60729134d253 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -318,9 +318,11 @@ enum { | |||
| 318 | 318 | ||
| 319 | SKB_GSO_GRE = 1 << 6, | 319 | SKB_GSO_GRE = 1 << 6, |
| 320 | 320 | ||
| 321 | SKB_GSO_UDP_TUNNEL = 1 << 7, | 321 | SKB_GSO_IPIP = 1 << 7, |
| 322 | 322 | ||
| 323 | SKB_GSO_MPLS = 1 << 8, | 323 | SKB_GSO_UDP_TUNNEL = 1 << 8, |
| 324 | |||
| 325 | SKB_GSO_MPLS = 1 << 9, | ||
| 324 | }; | 326 | }; |
| 325 | 327 | ||
| 326 | #if BITS_PER_LONG > 32 | 328 | #if BITS_PER_LONG > 32 |
| @@ -2722,9 +2724,12 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | |||
| 2722 | /* Keeps track of mac header offset relative to skb->head. | 2724 | /* Keeps track of mac header offset relative to skb->head. |
| 2723 | * It is useful for TSO of Tunneling protocol. e.g. GRE. | 2725 | * It is useful for TSO of Tunneling protocol. e.g. GRE. |
| 2724 | * For non-tunnel skb it points to skb_mac_header() and for | 2726 | * For non-tunnel skb it points to skb_mac_header() and for |
| 2725 | * tunnel skb it points to outer mac header. */ | 2727 | * tunnel skb it points to outer mac header. |
| 2728 | * Keeps track of level of encapsulation of network headers. | ||
| 2729 | */ | ||
| 2726 | struct skb_gso_cb { | 2730 | struct skb_gso_cb { |
| 2727 | int mac_offset; | 2731 | int mac_offset; |
| 2732 | int encap_level; | ||
| 2728 | }; | 2733 | }; |
| 2729 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) | 2734 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) |
| 2730 | 2735 | ||
diff --git a/include/net/gre.h b/include/net/gre.h index 57e4afdf7879..dcd9ae3270d3 100644 --- a/include/net/gre.h +++ b/include/net/gre.h | |||
| @@ -38,7 +38,13 @@ void gre_offload_exit(void); | |||
| 38 | 38 | ||
| 39 | void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, | 39 | void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, |
| 40 | int hdr_len); | 40 | int hdr_len); |
| 41 | struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum); | 41 | |
| 42 | static inline struct sk_buff *gre_handle_offloads(struct sk_buff *skb, | ||
| 43 | bool gre_csum) | ||
| 44 | { | ||
| 45 | return iptunnel_handle_offloads(skb, gre_csum, SKB_GSO_GRE); | ||
| 46 | } | ||
| 47 | |||
| 42 | 48 | ||
| 43 | static inline int ip_gre_calc_hlen(__be16 o_flags) | 49 | static inline int ip_gre_calc_hlen(__be16 o_flags) |
| 44 | { | 50 | { |
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index a0a4a100f5c9..732f8c6ae975 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
| @@ -150,6 +150,9 @@ int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, | |||
| 150 | __be32 src, __be32 dst, __u8 proto, | 150 | __be32 src, __be32 dst, __u8 proto, |
| 151 | __u8 tos, __u8 ttl, __be16 df, bool xnet); | 151 | __u8 tos, __u8 ttl, __be16 df, bool xnet); |
| 152 | 152 | ||
| 153 | struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum, | ||
| 154 | int gso_type_mask); | ||
| 155 | |||
| 153 | static inline void iptunnel_xmit_stats(int err, | 156 | static inline void iptunnel_xmit_stats(int err, |
| 154 | struct net_device_stats *err_stats, | 157 | struct net_device_stats *err_stats, |
| 155 | struct pcpu_tstats __percpu *stats) | 158 | struct pcpu_tstats __percpu *stats) |
