From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org
Cc: beilei.xing@intel.com, qi.zhang@intel.com,
Bernard Iremonger <bernard.iremonger@intel.com>,
stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2] app/testpmd: check port is stopped for QinQ setup
Date: Mon, 24 Apr 2017 11:24:37 +0100 [thread overview]
Message-ID: <1493029477-27106-1-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1492701258-7968-1-git-send-email-bernard.iremonger@intel.com>
Check port is stopped before configuring it for QinQ,
with the "vlan set qinq on <port_id>" command.
The above command sets the hw_vlan_extend flag.
When the port is started it calls the
i40e_rx_vec_dev_conf_condition_check_default function to
decide whether or not to select the vector mode driver
depending on the state of the hw_vlan_extend flag.
Fixes: a47aa8b97afe ("app/testpmd: add vlan offload support")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
---
Changes in v2:
Rebased to latest dpdk-next-net
revised commit message.
add Fixes and Cc lines.
app/test-pmd/cmdline.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f6bd75b78..a96b8b67c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
* Copyright(c) 2014 6WIND S.A.
* All rights reserved.
*
@@ -3036,6 +3036,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
int i, len = 0;
portid_t port_id = 0;
unsigned int tmp;
+ struct rte_port *port;
str = res->port_id;
len = strnlen(str, STR_TOKEN_SIZE);
@@ -3053,6 +3054,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
if(tmp >= RTE_MAX_ETHPORTS)
return;
port_id = (portid_t)tmp;
+ port = &ports[port_id];
if (!strcmp(res->on, "on"))
on = 1;
@@ -3079,9 +3081,13 @@ cmd_vlan_offload_parsed(void *parsed_result,
}
else if (!strcmp(res->what, "filter"))
rx_vlan_filter_set(port_id, on);
- else
+ else {
+ if (port->port_status != RTE_PORT_STOPPED) {
+ printf("Please stop port %d first\n", port_id);
+ return;
+ }
vlan_extend_set(port_id, on);
-
+ }
return;
}
--
2.11.0
next parent reply other threads:[~2017-04-24 10:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1492701258-7968-1-git-send-email-bernard.iremonger@intel.com>
2017-04-24 10:24 ` Bernard Iremonger [this message]
2017-04-25 8:55 ` [dpdk-stable] [dpdk-dev] " Wu, Jingjing
2017-04-25 15:50 ` Iremonger, Bernard
2017-04-27 5:28 ` Wu, Jingjing
2017-04-27 8:11 ` Iremonger, Bernard
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=1493029477-27106-1-git-send-email-bernard.iremonger@intel.com \
--to=bernard.iremonger@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=qi.zhang@intel.com \
--cc=stable@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).