[dpdk-dev,v2,2/2] net/sfc: do not drop TSO on device configure

Message ID 1490806759-17457-2-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Andrew Rybchenko March 29, 2017, 4:59 p.m. UTC
  If Tx datapath does not support TSO, TSO was dropped on device configure.
It is incorrect to change advertised offloads.

Fixes: 960b980fc712 ("net/sfc: make TSO a datapath-dependent feature")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc.c    | 9 ++++++---
 drivers/net/sfc/sfc_tx.c | 3 ---
 2 files changed, 6 insertions(+), 6 deletions(-)
  

Comments

Ferruh Yigit March 31, 2017, 3:17 p.m. UTC | #1
On 3/29/2017 5:59 PM, Andrew Rybchenko wrote:
> If Tx datapath does not support TSO, TSO was dropped on device configure.
> It is incorrect to change advertised offloads.
> 
> Fixes: 960b980fc712 ("net/sfc: make TSO a datapath-dependent feature")
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Applied to dpdk-next-net/master, thanks.

(Instead of squash, applied as separate patch, "Fixes" commit needs to
be fixed when merged into main repo)
  

Patch

diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index eda426c..181d87a 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -588,9 +588,12 @@  sfc_attach(struct sfc_adapter *sa)
 
 	encp = efx_nic_cfg_get(sa->nic);
 
-	sa->tso = encp->enc_fw_assisted_tso_v2_enabled;
-	if (!sa->tso)
-		sfc_warn(sa, "TSO support isn't available on this adapter");
+	if (sa->dp_tx->features & SFC_DP_TX_FEAT_TSO) {
+		sa->tso = encp->enc_fw_assisted_tso_v2_enabled;
+		if (!sa->tso)
+			sfc_warn(sa,
+				 "TSO support isn't available on this adapter");
+	}
 
 	sfc_log_init(sa, "estimate resource limits");
 	rc = sfc_estimate_resource_limits(sa);
diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index d1a064e..37f25a3 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -305,9 +305,6 @@  sfc_tx_init(struct sfc_adapter *sa)
 		goto fail_tx_dma_desc_boundary;
 	}
 
-	if (~sa->dp_tx->features & SFC_DP_TX_FEAT_TSO)
-		sa->tso = B_FALSE;
-
 	rc = sfc_tx_check_mode(sa, &dev_conf->txmode);
 	if (rc != 0)
 		goto fail_check_mode;