DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH v2 09/13] net/sfc: make VLAN insertion a datapath-dependent feature
Date: Mon, 20 Mar 2017 10:15:15 +0000	[thread overview]
Message-ID: <1490004919-2177-10-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1490004919-2177-1-git-send-email-arybchenko@solarflare.com>

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc_dp_tx.h  |  2 ++
 drivers/net/sfc/sfc_ethdev.c |  3 ++-
 drivers/net/sfc/sfc_tx.c     | 14 +++++++++++---
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index 1f922e5..1a6d6c1 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -116,6 +116,8 @@ typedef void (sfc_dp_tx_qreap_t)(struct sfc_dp_txq *dp_txq);
 struct sfc_dp_tx {
 	struct sfc_dp			dp;
 
+	unsigned int			features;
+#define SFC_DP_TX_FEAT_VLAN_INSERT	0x1
 	sfc_dp_tx_qcreate_t		*qcreate;
 	sfc_dp_tx_qdestroy_t		*qdestroy;
 	sfc_dp_tx_qstart_t		*qstart;
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index d1ef269..b064d0a 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -135,7 +135,8 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_TX_OFFLOAD_TCP_CKSUM;
 
 	dev_info->default_txconf.txq_flags = ETH_TXQ_FLAGS_NOXSUMSCTP;
-	if (!encp->enc_hw_tx_insert_vlan_enabled)
+	if ((~sa->dp_tx->features & SFC_DP_TX_FEAT_VLAN_INSERT) ||
+	    !encp->enc_hw_tx_insert_vlan_enabled)
 		dev_info->default_txconf.txq_flags |= ETH_TXQ_FLAGS_NOVLANOFFL;
 	else
 		dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 442d16c..225a3a6 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -84,9 +84,16 @@ sfc_tx_qcheck_conf(struct sfc_adapter *sa, uint16_t nb_tx_desc,
 		rc = EINVAL;
 	}
 
-	if (!encp->enc_hw_tx_insert_vlan_enabled &&
-	    (flags & ETH_TXQ_FLAGS_NOVLANOFFL) == 0) {
-		sfc_err(sa, "VLAN offload is not supported");
+	if ((flags & ETH_TXQ_FLAGS_NOVLANOFFL) == 0) {
+		if (!encp->enc_hw_tx_insert_vlan_enabled) {
+			sfc_err(sa, "VLAN offload is not supported");
+			rc = EINVAL;
+		} else if (~sa->dp_tx->features & SFC_DP_TX_FEAT_VLAN_INSERT) {
+			sfc_err(sa,
+				"VLAN offload is not supported by %s datapath",
+				sa->dp_tx->dp.name);
+			rc = EINVAL;
+		}
 		rc = EINVAL;
 	}
 
@@ -925,6 +932,7 @@ struct sfc_dp_tx sfc_efx_tx = {
 		.type		= SFC_DP_TX,
 		.hw_fw_caps	= 0,
 	},
+	.features		= SFC_DP_TX_FEAT_VLAN_INSERT,
 	.qcreate		= sfc_efx_tx_qcreate,
 	.qdestroy		= sfc_efx_tx_qdestroy,
 	.qstart			= sfc_efx_tx_qstart,
-- 
2.9.3

  parent reply	other threads:[~2017-03-20 10:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  7:07 [dpdk-dev] [PATCH 00/13] Improve Solarflare PMD performance Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 01/13] net/sfc: callbacks should depend on EvQ usage Andrew Rybchenko
2017-03-04 21:04   ` Ferruh Yigit
2017-03-02  7:07 ` [dpdk-dev] [PATCH 02/13] net/sfc: emphasis that RSS hash flag is an Rx queue flag Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 03/13] net/sfc: do not use Rx queue control state on datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 04/13] net/sfc: factor out libefx-based Rx datapath Andrew Rybchenko
2017-03-04 21:05   ` Ferruh Yigit
2017-03-13 13:12     ` Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 05/13] net/sfc: Rx scatter is a datapath-dependent feature Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 06/13] net/sfc: implement EF10 native Rx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 07/13] net/sfc: factory out libefx-based Tx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 08/13] net/sfc: VLAN insertion is a datapath dependent feature Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 09/13] net/sfc: TSO " Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 10/13] net/sfc: implement EF10 native Tx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 11/13] net/sfc: multi-segment support as is Tx datapath features Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 12/13] net/sfc: implement simple EF10 native Tx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 13/13] net/sfc: support Rx packed stream EF10-specific datapath Andrew Rybchenko
2017-03-04 21:07 ` [dpdk-dev] [PATCH 00/13] Improve Solarflare PMD performance Ferruh Yigit
2017-03-20 10:15 ` [dpdk-dev] [PATCH v2 " Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 01/13] net/sfc: use different callbacks for event queues Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 02/13] net/sfc: emphasis that RSS hash flag is an Rx queue flag Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 03/13] net/sfc: do not use Rx queue control state on datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 04/13] net/sfc: factor out libefx-based Rx datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 05/13] net/sfc: make Rx scatter a datapath-dependent feature Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 06/13] net/sfc: remove few conditions in Rx queue refill Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 07/13] net/sfc: implement EF10 native Rx datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 08/13] net/sfc: factor out libefx-based Tx datapath Andrew Rybchenko
2017-03-20 10:15   ` Andrew Rybchenko [this message]
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 10/13] net/sfc: make TSO a datapath-dependent feature Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 11/13] net/sfc: implement EF10 native Tx datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 12/13] net/sfc: make multi-segment support a Tx datapath feature Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 13/13] net/sfc: implement simple EF10 native Tx datapath Andrew Rybchenko
2017-03-20 15:37   ` [dpdk-dev] [PATCH v2 00/13] Improve Solarflare PMD performance Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490004919-2177-10-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).