All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] bonding: handle more gso types
@ 2015-01-23 13:57 Eric Dumazet
  2015-01-23 18:33 ` Tom Herbert
  2015-01-26  7:27 ` [PATCH v2 " Eric Dumazet
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2015-01-23 13:57 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Or Gerlitz

From: Eric Dumazet <edumazet@google.com>

In commit 5a7baa78851b ("bonding: Advertize vxlan offload features when
supported"), Or Gerlitz added support conditional vxlan offload.

In this patch I also add support for GRE, IPIP and SIT tunnels,
but we allow a bonding device to not require segmentation,
as it is always better to make this segmentation at the very last stage,
if a particular slave device requires it.

Tested:

ethtool -K bond0 tx-gre-segmentation off

super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
7538.32

ethtool -K bond0 tx-gre-segmentation on 

super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
10200.5

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/bonding/bond_main.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 0dceba1a2ba15f4706922a5423f680e7cd17ef77..1e837fceb3fb7b739c543b0d5babc4da4797caf3 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -998,7 +998,10 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
 				 NETIF_F_HIGHDMA | NETIF_F_LRO)
 
 #define BOND_ENC_FEATURES	(NETIF_F_ALL_CSUM | NETIF_F_SG | NETIF_F_RXCSUM |\
-				 NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL)
+				 NETIF_F_TSO)
+
+#define BOND_ENC_ALWAYS		(NETIF_F_GSO_GRE | NETIF_F_GSO_IPIP | \
+				 NETIF_F_GSO_SIT | NETIF_F_GSO_UDP_TUNNEL)
 
 static void bond_compute_features(struct bonding *bond)
 {
@@ -1034,7 +1037,7 @@ static void bond_compute_features(struct bonding *bond)
 
 done:
 	bond_dev->vlan_features = vlan_features;
-	bond_dev->hw_enc_features = enc_features;
+	bond_dev->hw_enc_features = enc_features | BOND_ENC_ALWAYS;
 	bond_dev->hard_header_len = max_hard_header_len;
 	bond_dev->gso_max_segs = gso_max_segs;
 	netif_set_gso_max_size(bond_dev, gso_max_size);
@@ -4010,7 +4013,7 @@ void bond_setup(struct net_device *bond_dev)
 				NETIF_F_HW_VLAN_CTAG_FILTER;
 
 	bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
-	bond_dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
+	bond_dev->hw_features |= BOND_ENC_ALWAYS;
 	bond_dev->features |= bond_dev->hw_features;
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bonding: handle more gso types
  2015-01-23 13:57 [PATCH net-next] bonding: handle more gso types Eric Dumazet
@ 2015-01-23 18:33 ` Tom Herbert
  2015-01-23 18:56   ` Eric Dumazet
  2015-01-26  7:27 ` [PATCH v2 " Eric Dumazet
  1 sibling, 1 reply; 5+ messages in thread
From: Tom Herbert @ 2015-01-23 18:33 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev, Or Gerlitz

On Fri, Jan 23, 2015 at 5:57 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> In commit 5a7baa78851b ("bonding: Advertize vxlan offload features when
> supported"), Or Gerlitz added support conditional vxlan offload.
>
> In this patch I also add support for GRE, IPIP and SIT tunnels,
> but we allow a bonding device to not require segmentation,
> as it is always better to make this segmentation at the very last stage,
> if a particular slave device requires it.
>
> Tested:
>
> ethtool -K bond0 tx-gre-segmentation off
>
> super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
> 7538.32
>
> ethtool -K bond0 tx-gre-segmentation on
>
> super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
> 10200.5
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Or Gerlitz <ogerlitz@mellanox.com>
> ---
>  drivers/net/bonding/bond_main.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 0dceba1a2ba15f4706922a5423f680e7cd17ef77..1e837fceb3fb7b739c543b0d5babc4da4797caf3 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -998,7 +998,10 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
>                                  NETIF_F_HIGHDMA | NETIF_F_LRO)
>
>  #define BOND_ENC_FEATURES      (NETIF_F_ALL_CSUM | NETIF_F_SG | NETIF_F_RXCSUM |\
> -                                NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL)
> +                                NETIF_F_TSO)
> +
Is there any reason not to add NETIF_F_GSO_UDP_TUNNEL_CSUM and
NETIF_F_GSO_UDP_REMCSUM also?

> +#define BOND_ENC_ALWAYS                (NETIF_F_GSO_GRE | NETIF_F_GSO_IPIP | \
> +                                NETIF_F_GSO_SIT | NETIF_F_GSO_UDP_TUNNEL)
>
>  static void bond_compute_features(struct bonding *bond)
>  {
> @@ -1034,7 +1037,7 @@ static void bond_compute_features(struct bonding *bond)
>
>  done:
>         bond_dev->vlan_features = vlan_features;
> -       bond_dev->hw_enc_features = enc_features;
> +       bond_dev->hw_enc_features = enc_features | BOND_ENC_ALWAYS;
>         bond_dev->hard_header_len = max_hard_header_len;
>         bond_dev->gso_max_segs = gso_max_segs;
>         netif_set_gso_max_size(bond_dev, gso_max_size);
> @@ -4010,7 +4013,7 @@ void bond_setup(struct net_device *bond_dev)
>                                 NETIF_F_HW_VLAN_CTAG_FILTER;
>
>         bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
> -       bond_dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
> +       bond_dev->hw_features |= BOND_ENC_ALWAYS;
>         bond_dev->features |= bond_dev->hw_features;
>  }
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bonding: handle more gso types
  2015-01-23 18:33 ` Tom Herbert
@ 2015-01-23 18:56   ` Eric Dumazet
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2015-01-23 18:56 UTC (permalink / raw)
  To: Tom Herbert; +Cc: David Miller, netdev, Or Gerlitz

On Fri, 2015-01-23 at 10:33 -0800, Tom Herbert wrote:

> Is there any reason not to add NETIF_F_GSO_UDP_TUNNEL_CSUM and
> NETIF_F_GSO_UDP_REMCSUM also?

I guess there is no reasons, others than me not catching with all these
extra features, and me not being able to test them.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 net-next] bonding: handle more gso types
  2015-01-23 13:57 [PATCH net-next] bonding: handle more gso types Eric Dumazet
  2015-01-23 18:33 ` Tom Herbert
@ 2015-01-26  7:27 ` Eric Dumazet
  2015-01-26  7:34   ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2015-01-26  7:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Or Gerlitz

From: Eric Dumazet <edumazet@google.com>

In commit 5a7baa78851b ("bonding: Advertize vxlan offload features when
supported"), Or Gerlitz added support conditional vxlan offload.

In this patch I also add support for all kind of tunnels,
but we allow a bonding device to not require segmentation,
as it is always better to make this segmentation at the very last stage,
if a particular slave device requires it.

Tested:

 Setup a GRE tunnel,
 on a physical NIC not having tx-gre-segmentation.
 Results on bnx2x are even better, as we no longer have to segment
 in software.

ethtool -K bond0 tx-gre-segmentation off

super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
7538.32

ethtool -K bond0 tx-gre-segmentation on 

super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
10200.5

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
---
v2: use NETIF_F_GSO_ENCAP_ALL instead of a private definition.

 drivers/net/bonding/bond_main.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 0dceba1a2ba15f4706922a5423f680e7cd17ef77..f47bc433407a176ed31a09e0010c87273c303a85 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -998,7 +998,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
 				 NETIF_F_HIGHDMA | NETIF_F_LRO)
 
 #define BOND_ENC_FEATURES	(NETIF_F_ALL_CSUM | NETIF_F_SG | NETIF_F_RXCSUM |\
-				 NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL)
+				 NETIF_F_TSO)
 
 static void bond_compute_features(struct bonding *bond)
 {
@@ -1034,7 +1034,7 @@ static void bond_compute_features(struct bonding *bond)
 
 done:
 	bond_dev->vlan_features = vlan_features;
-	bond_dev->hw_enc_features = enc_features;
+	bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
 	bond_dev->hard_header_len = max_hard_header_len;
 	bond_dev->gso_max_segs = gso_max_segs;
 	netif_set_gso_max_size(bond_dev, gso_max_size);
@@ -4010,7 +4010,7 @@ void bond_setup(struct net_device *bond_dev)
 				NETIF_F_HW_VLAN_CTAG_FILTER;
 
 	bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
-	bond_dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
+	bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
 	bond_dev->features |= bond_dev->hw_features;
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 net-next] bonding: handle more gso types
  2015-01-26  7:27 ` [PATCH v2 " Eric Dumazet
@ 2015-01-26  7:34   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2015-01-26  7:34 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, ogerlitz

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 25 Jan 2015 23:27:14 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> In commit 5a7baa78851b ("bonding: Advertize vxlan offload features when
> supported"), Or Gerlitz added support conditional vxlan offload.
> 
> In this patch I also add support for all kind of tunnels,
> but we allow a bonding device to not require segmentation,
> as it is always better to make this segmentation at the very last stage,
> if a particular slave device requires it.
> 
> Tested:
> 
>  Setup a GRE tunnel,
>  on a physical NIC not having tx-gre-segmentation.
>  Results on bnx2x are even better, as we no longer have to segment
>  in software.
> 
> ethtool -K bond0 tx-gre-segmentation off
> 
> super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
> 7538.32
> 
> ethtool -K bond0 tx-gre-segmentation on 
> 
> super_netperf 50 --google-pacing-rate 30000000 -H 10.7.8.152 -l 15
> 10200.5
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-26  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23 13:57 [PATCH net-next] bonding: handle more gso types Eric Dumazet
2015-01-23 18:33 ` Tom Herbert
2015-01-23 18:56   ` Eric Dumazet
2015-01-26  7:27 ` [PATCH v2 " Eric Dumazet
2015-01-26  7:34   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.