diff mbox series

[1/2] net/sfc: improve tunnel TSO mask calculation

Message ID 20210311122539.3319497-1-andrew.rybchenko@oktetlabs.ru (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series [1/2] net/sfc: improve tunnel TSO mask calculation | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko March 11, 2021, 12:25 p.m. UTC
Corresponding tunnel TSO is not supported if the tunnel is not
supported.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_tx.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Ferruh Yigit March 22, 2021, 5:06 p.m. UTC | #1
On 3/11/2021 12:25 PM, Andrew Rybchenko wrote:
> Corresponding tunnel TSO is not supported if the tunnel is not
> supported.
> 
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Series applied to dpdk-next-net/main, thanks.
diff mbox series

Patch

diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 4db39415de..28d696de61 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -49,9 +49,15 @@  sfc_tx_get_offload_mask(struct sfc_adapter *sa)
 	if (!sa->tso)
 		no_caps |= DEV_TX_OFFLOAD_TCP_TSO;
 
-	if (!sa->tso_encap)
-		no_caps |= (DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
-			    DEV_TX_OFFLOAD_GENEVE_TNL_TSO);
+	if (!sa->tso_encap ||
+	    (encp->enc_tunnel_encapsulations_supported &
+	     (1u << EFX_TUNNEL_PROTOCOL_VXLAN)) == 0)
+		no_caps |= DEV_TX_OFFLOAD_VXLAN_TNL_TSO;
+
+	if (!sa->tso_encap ||
+	    (encp->enc_tunnel_encapsulations_supported &
+	     (1u << EFX_TUNNEL_PROTOCOL_GENEVE)) == 0)
+		no_caps |= DEV_TX_OFFLOAD_GENEVE_TNL_TSO;
 
 	return ~no_caps;
 }