Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53481da3 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents b917eb15 117401ee
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -12260,10 +12260,12 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
		NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_GRO |
		NETIF_F_RXHASH | NETIF_F_HW_VLAN_CTAG_TX;
	if (!CHIP_IS_E1x(bp)) {
		dev->hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL;
		dev->hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL |
				    NETIF_F_GSO_IPIP;
		dev->hw_enc_features =
			NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SG |
			NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
			NETIF_F_GSO_IPIP |
			NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL;
	}

+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ enum {
	NETIF_F_TSO6_BIT,		/* ... TCPv6 segmentation */
	NETIF_F_FSO_BIT,		/* ... FCoE segmentation */
	NETIF_F_GSO_GRE_BIT,		/* ... GRE with TSO */
	NETIF_F_GSO_IPIP_BIT,		/* ... IPIP tunnel with TSO */
	NETIF_F_GSO_UDP_TUNNEL_BIT,	/* ... UDP TUNNEL with TSO */
	NETIF_F_GSO_MPLS_BIT,		/* ... MPLS segmentation */
	/**/NETIF_F_GSO_LAST =		/* last bit, see GSO_MASK */
@@ -107,6 +108,7 @@ enum {
#define NETIF_F_RXFCS		__NETIF_F(RXFCS)
#define NETIF_F_RXALL		__NETIF_F(RXALL)
#define NETIF_F_GSO_GRE		__NETIF_F(GSO_GRE)
#define NETIF_F_GSO_IPIP	__NETIF_F(GSO_IPIP)
#define NETIF_F_GSO_UDP_TUNNEL	__NETIF_F(GSO_UDP_TUNNEL)
#define NETIF_F_GSO_MPLS	__NETIF_F(GSO_MPLS)
#define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER)
+9 −4
Original line number Diff line number Diff line
@@ -318,9 +318,11 @@ enum {

	SKB_GSO_GRE = 1 << 6,

	SKB_GSO_UDP_TUNNEL = 1 << 7,
	SKB_GSO_IPIP = 1 << 7,

	SKB_GSO_MPLS = 1 << 8,
	SKB_GSO_UDP_TUNNEL = 1 << 8,

	SKB_GSO_MPLS = 1 << 9,
};

#if BITS_PER_LONG > 32
@@ -2722,9 +2724,12 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
/* Keeps track of mac header offset relative to skb->head.
 * It is useful for TSO of Tunneling protocol. e.g. GRE.
 * For non-tunnel skb it points to skb_mac_header() and for
 * tunnel skb it points to outer mac header. */
 * tunnel skb it points to outer mac header.
 * Keeps track of level of encapsulation of network headers.
 */
struct skb_gso_cb {
	int	mac_offset;
	int	encap_level;
};
#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb)

+7 −1
Original line number Diff line number Diff line
@@ -38,7 +38,13 @@ void gre_offload_exit(void);

void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
		      int hdr_len);
struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum);

static inline struct sk_buff *gre_handle_offloads(struct sk_buff *skb,
						  bool gre_csum)
{
	return iptunnel_handle_offloads(skb, gre_csum, SKB_GSO_GRE);
}


static inline int ip_gre_calc_hlen(__be16 o_flags)
{
+3 −0
Original line number Diff line number Diff line
@@ -150,6 +150,9 @@ int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb,
		  __be32 src, __be32 dst, __u8 proto,
		  __u8 tos, __u8 ttl, __be16 df, bool xnet);

struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum,
					 int gso_type_mask);

static inline void iptunnel_xmit_stats(int err,
				       struct net_device_stats *err_stats,
				       struct pcpu_tstats __percpu *stats)
Loading