DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shaopeng He <shaopeng.he@intel.com>
To: dev@dpdk.org
Cc: Shaopeng He <shaopeng.he@intel.com>
Subject: [dpdk-dev] [PATCH v3 3/3] fm10k: update VLAN offload features
Date: Thu, 18 Jun 2015 15:21:21 +0800	[thread overview]
Message-ID: <1434612081-8982-4-git-send-email-shaopeng.he@intel.com> (raw)
In-Reply-To: <1434612081-8982-1-git-send-email-shaopeng.he@intel.com>

Fm10k PF/VF does not support QinQ; VLAN strip and filter are always on
for PF/VF ports.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 7925cb7..f9584e5 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -787,10 +787,12 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
 	dev_info->max_vfs            = FM10K_MAX_VF_NUM;
 	dev_info->max_vmdq_pools     = ETH_64_POOLS;
 	dev_info->rx_offload_capa =
+		DEV_RX_OFFLOAD_VLAN_STRIP |
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM  |
 		DEV_RX_OFFLOAD_TCP_CKSUM;
-	dev_info->tx_offload_capa    = 0;
+	dev_info->tx_offload_capa =
+		DEV_TX_OFFLOAD_VLAN_INSERT;
 	dev_info->reta_size = FM10K_MAX_RSS_INDICES;
 
 	dev_info->default_rxconf = (struct rte_eth_rxconf) {
@@ -892,6 +894,27 @@ fm10k_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 	return 0;
 }
 
+static void
+fm10k_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, int mask)
+{
+	if (mask & ETH_VLAN_STRIP_MASK) {
+		if (!dev->data->dev_conf.rxmode.hw_vlan_strip)
+			PMD_INIT_LOG(ERR, "VLAN stripping is "
+					"always on in fm10k");
+	}
+
+	if (mask & ETH_VLAN_EXTEND_MASK) {
+		if (dev->data->dev_conf.rxmode.hw_vlan_extend)
+			PMD_INIT_LOG(ERR, "VLAN QinQ is not "
+					"supported in fm10k");
+	}
+
+	if (mask & ETH_VLAN_FILTER_MASK) {
+		if (!dev->data->dev_conf.rxmode.hw_vlan_filter)
+			PMD_INIT_LOG(ERR, "VLAN filter is always on in fm10k");
+	}
+}
+
 /* Add/Remove a MAC address, and update filters */
 static void
 fm10k_MAC_filter_set(struct rte_eth_dev *dev, const u8 *mac, bool add)
@@ -1810,6 +1833,7 @@ static const struct eth_dev_ops fm10k_eth_dev_ops = {
 	.link_update		= fm10k_link_update,
 	.dev_infos_get		= fm10k_dev_infos_get,
 	.vlan_filter_set	= fm10k_vlan_filter_set,
+	.vlan_offload_set	= fm10k_vlan_offload_set,
 	.mac_addr_add		= fm10k_macaddr_add,
 	.mac_addr_remove	= fm10k_macaddr_remove,
 	.rx_queue_start		= fm10k_dev_rx_queue_start,
-- 
1.9.3

  parent reply	other threads:[~2015-06-18  7:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02  2:58 [dpdk-dev] [PATCH 0/3] fm10k: update MAC/VLAN filter and " Shaopeng He
2015-06-02  2:58 ` [dpdk-dev] [PATCH 1/3] fm10k: update VLAN filter Shaopeng He
2015-06-09  2:54   ` Chen, Jing D
2015-06-09  7:18     ` He, Shaopeng
2015-06-09 15:51   ` Qiu, Michael
2015-06-10  5:52     ` He, Shaopeng
2015-06-02  2:58 ` [dpdk-dev] [PATCH 2/3] fm10k: add MAC filter Shaopeng He
2015-06-09  3:25   ` Chen, Jing D
2015-06-09  8:31     ` He, Shaopeng
2015-06-09 15:59   ` Qiu, Michael
2015-06-10  1:03     ` He, Shaopeng
2015-06-02  2:58 ` [dpdk-dev] [PATCH 3/3] fm10k: update VLAN offload features Shaopeng He
2015-06-09  3:27   ` Chen, Jing D
2015-06-09  8:55     ` He, Shaopeng
2015-06-09 15:40     ` Qiu, Michael
2015-06-10  6:03       ` He, Shaopeng
2015-06-15  1:23 ` [dpdk-dev] [PATCH v2 0/3] fm10k: update MAC/VLAN filter and " Shaopeng He
2015-06-15  1:23   ` [dpdk-dev] [PATCH v2 1/3] fm10k: update VLAN filter Shaopeng He
2015-06-15  1:23   ` [dpdk-dev] [PATCH v2 2/3] fm10k: add MAC filter Shaopeng He
2015-06-16 12:38     ` Qiu, Michael
2015-06-15  1:23   ` [dpdk-dev] [PATCH v2 3/3] fm10k: update VLAN offload features Shaopeng He
2015-06-18  7:21   ` [dpdk-dev] [PATCH v3 0/3] fm10k: update MAC/VLAN filter and " Shaopeng He
2015-06-18  7:21     ` [dpdk-dev] [PATCH v3 1/3] fm10k: update VLAN filter Shaopeng He
2015-06-18  7:21     ` [dpdk-dev] [PATCH v3 2/3] fm10k: add MAC filter Shaopeng He
2015-06-18  7:21     ` Shaopeng He [this message]
2015-06-18  8:23     ` [dpdk-dev] [PATCH v3 0/3] fm10k: update MAC/VLAN filter and VLAN offload features Chen, Jing D
2015-06-22 14:21       ` Thomas Monjalon

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=1434612081-8982-4-git-send-email-shaopeng.he@intel.com \
    --to=shaopeng.he@intel.com \
    --cc=dev@dpdk.org \
    /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).