From: John Daley <johndale@cisco.com>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>
Subject: [dpdk-dev] [PATCH] net/enic: remove the VLAN filter handler
Date: Sat, 24 Feb 2018 11:17:42 -0800 [thread overview]
Message-ID: <20180224191748.20908-4-johndale@cisco.com> (raw)
In-Reply-To: <20180224191748.20908-1-johndale@cisco.com>
From: Hyong Youb Kim <hyonkim@cisco.com>
VIC does not support VLAN filtering at the moment. The firmware does
accept the filter add/del commands and returns success. But, they are
no-ops. To avoid confusion, remove the filter set handler so the app
sees an error instead of silent failure.
Also during the device configure time, enicpmd_vlan_offload_set would
not print a warning message about unsupported VLAN filtering, because
the caller specifies only ETH_VLAN_STRIP_MASK. This is wrong, as we
should attempt to apply all requested offloads at the configure
time. So, pass all VLAN offload masks, which triggers a warning
message about VLAN filtering, if requested.
Finally, enicpmd_vlan_offload_set should check both mask and
rxmode.offloads, not just mask.
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
drivers/net/enic/enic_ethdev.c | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index bdbaf4cdf..e5523e311 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -318,40 +318,29 @@ static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
return enicpmd_dev_setup_intr(enic);
}
-static int enicpmd_vlan_filter_set(struct rte_eth_dev *eth_dev,
- uint16_t vlan_id, int on)
-{
- struct enic *enic = pmd_priv(eth_dev);
- int err;
-
- ENICPMD_FUNC_TRACE();
- if (on)
- err = enic_add_vlan(enic, vlan_id);
- else
- err = enic_del_vlan(enic, vlan_id);
- return err;
-}
-
static int enicpmd_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)
{
struct enic *enic = pmd_priv(eth_dev);
+ uint64_t offloads;
ENICPMD_FUNC_TRACE();
+ offloads = eth_dev->data->dev_conf.rxmode.offloads;
if (mask & ETH_VLAN_STRIP_MASK) {
- if (eth_dev->data->dev_conf.rxmode.offloads &
- DEV_RX_OFFLOAD_VLAN_STRIP)
+ if (offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
enic->ig_vlan_strip_en = 1;
else
enic->ig_vlan_strip_en = 0;
}
- if (mask & ETH_VLAN_FILTER_MASK) {
+ if ((mask & ETH_VLAN_FILTER_MASK) &&
+ (offloads & DEV_RX_OFFLOAD_VLAN_FILTER)) {
dev_warning(enic,
"Configuration of VLAN filter is not supported\n");
}
- if (mask & ETH_VLAN_EXTEND_MASK) {
+ if ((mask & ETH_VLAN_EXTEND_MASK) &&
+ (offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)) {
dev_warning(enic,
"Configuration of extended VLAN is not supported\n");
}
@@ -362,6 +351,7 @@ static int enicpmd_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)
static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
{
int ret;
+ int mask;
struct enic *enic = pmd_priv(eth_dev);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
@@ -376,7 +366,11 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
DEV_RX_OFFLOAD_CHECKSUM);
- ret = enicpmd_vlan_offload_set(eth_dev, ETH_VLAN_STRIP_MASK);
+ /* All vlan offload masks to apply the current settings */
+ mask = ETH_VLAN_STRIP_MASK |
+ ETH_VLAN_FILTER_MASK |
+ ETH_VLAN_EXTEND_MASK;
+ ret = enicpmd_vlan_offload_set(eth_dev, mask);
if (ret) {
dev_err(enic, "Failed to configure VLAN offloads\n");
return ret;
@@ -710,7 +704,7 @@ static const struct eth_dev_ops enicpmd_eth_dev_ops = {
.dev_infos_get = enicpmd_dev_info_get,
.dev_supported_ptypes_get = enicpmd_dev_supported_ptypes_get,
.mtu_set = enicpmd_mtu_set,
- .vlan_filter_set = enicpmd_vlan_filter_set,
+ .vlan_filter_set = NULL,
.vlan_tpid_set = NULL,
.vlan_offload_set = enicpmd_vlan_offload_set,
.vlan_strip_queue_set = NULL,
--
2.12.0
next prev parent reply other threads:[~2018-02-24 19:17 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-24 19:17 [dpdk-dev] [PATCH] net/enic: remove 'extern' in .h file function declarations John Daley
2018-02-24 19:17 ` [dpdk-dev] [PATCH] net/enic: allow the user to change RSS settings John Daley
2018-02-24 19:17 ` [dpdk-dev] [PATCH] net/enic: heed the requested max Rx packet size John Daley
2018-02-24 19:17 ` John Daley [this message]
2018-02-24 19:17 ` [dpdk-dev] [PATCH] net/enic: add Rx/Tx queue configuration getters John Daley
2018-02-24 19:17 ` [dpdk-dev] [PATCH] net/enic: allocate stats DMA buffer upfront during probe John Daley
2018-02-24 19:17 ` [dpdk-dev] [PATCH] net/enic: support Rx queue interrupts John Daley
2018-02-24 19:17 ` [dpdk-dev] [PATCH] doc: describe Rx bytes counter behavior for enic John Daley
2018-02-24 19:17 ` [dpdk-dev] [PATCH] net/enic: use memcpy to avoid strict aliasing warnings John Daley
2018-02-24 19:17 ` [dpdk-dev] [PATCH] net/enic: support for meson John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 00/10] enic patchset John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 01/10] net/enic: remove 'extern' in .h file function declarations John Daley
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 00/10] enic PMD patchset John Daley
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 01/10] net/enic: remove 'extern' in .h file function declarations John Daley
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 02/10] net/enic: allow the user to change RSS settings John Daley
2018-03-09 14:35 ` Ferruh Yigit
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 03/10] net/enic: heed the requested max Rx packet size John Daley
2018-03-09 15:03 ` Ferruh Yigit
2018-03-09 15:51 ` Ananyev, Konstantin
2018-03-09 15:57 ` Ferruh Yigit
2018-03-10 0:37 ` Hyong Youb Kim
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 04/10] net/enic: remove the VLAN filter handler John Daley
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 05/10] net/enic: add Rx/Tx queue configuration getters John Daley
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 06/10] net/enic: allocate stats DMA buffer upfront during probe John Daley
2018-03-08 2:46 ` [dpdk-dev] [PATCH v3 07/10] net/enic: support Rx queue interrupts John Daley
2018-03-08 2:47 ` [dpdk-dev] [PATCH v3 08/10] doc: describe Rx bytes counter behavior for enic John Daley
2018-03-08 22:14 ` Stephen Hemminger
2018-03-09 0:52 ` Hyong Youb Kim
2018-03-09 1:48 ` Stephen Hemminger
2018-03-08 2:47 ` [dpdk-dev] [PATCH v3 09/10] net/enic: use memcpy to avoid strict aliasing warnings John Daley
2018-03-08 2:47 ` [dpdk-dev] [PATCH v3 10/10] net/enic: support for meson John Daley
2018-03-08 9:49 ` Bruce Richardson
2018-03-09 16:00 ` [dpdk-dev] [PATCH v3 00/10] enic PMD patchset Ferruh Yigit
2018-03-10 0:49 ` Hyong Youb Kim
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 02/10] net/enic: allow the user to change RSS settings John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 03/10] net/enic: heed the requested max Rx packet size John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 04/10] net/enic: remove the VLAN filter handler John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 05/10] net/enic: add Rx/Tx queue configuration getters John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 06/10] net/enic: allocate stats DMA buffer upfront during probe John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 07/10] net/enic: support Rx queue interrupts John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 08/10] doc: describe Rx bytes counter behavior for enic John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 09/10] net/enic: use memcpy to avoid strict aliasing warnings John Daley
2018-03-06 1:46 ` [dpdk-dev] [PATCH v2 10/10] net/enic: support for meson John Daley
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=20180224191748.20908-4-johndale@cisco.com \
--to=johndale@cisco.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=hyonkim@cisco.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).