From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/4] testpmd: extend commands
Date: Tue, 22 Sep 2015 11:45:32 +0800 [thread overview]
Message-ID: <1442893533-32546-4-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1442893533-32546-1-git-send-email-jingjing.wu@intel.com>
This patch extends commands to support filtering in VFs of flow director.
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
app/test-pmd/cmdline.c | 41 +++++++++++++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0f8f48f..22476f5 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -631,7 +631,8 @@ static void cmd_help_long_parsed(void *parsed_result,
" flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)"
" src (src_ip_address) dst (dst_ip_address)"
" vlan (vlan_value) flexbytes (flexbytes_value)"
- " (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n"
+ " (drop|fwd) pf|vf(vf_id) queue (queue_id)"
+ " fd_id (fd_id_value)\n"
" Add/Del an IP type flow director filter.\n\n"
"flow_director_filter (port_id) (add|del|update)"
@@ -639,7 +640,8 @@ static void cmd_help_long_parsed(void *parsed_result,
" src (src_ip_address) (src_port)"
" dst (dst_ip_address) (dst_port)"
" vlan (vlan_value) flexbytes (flexbytes_value)"
- " (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n"
+ " (drop|fwd) pf|vf(vf_id) queue (queue_id)"
+ " fd_id (fd_id_value)\n"
" Add/Del an UDP/TCP type flow director filter.\n\n"
"flow_director_filter (port_id) (add|del|update)"
@@ -648,13 +650,13 @@ static void cmd_help_long_parsed(void *parsed_result,
" dst (dst_ip_address) (dst_port)"
" tag (verification_tag) vlan (vlan_value)"
" flexbytes (flexbytes_value) (drop|fwd)"
- " queue (queue_id) fd_id (fd_id_value)\n"
+ " pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del a SCTP type flow director filter.\n\n"
"flow_director_filter (port_id) (add|del|update)"
" flow l2_payload ether (ethertype)"
" flexbytes (flexbytes_value) (drop|fwd)"
- " queue (queue_id) fd_id (fd_id_value)\n"
+ " pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del a l2 payload type flow director filter.\n\n"
"flush_flow_director (port_id)\n"
@@ -7742,6 +7744,7 @@ struct cmd_flow_director_result {
uint16_t vlan_value;
cmdline_fixed_string_t flexbytes;
cmdline_fixed_string_t flexbytes_value;
+ cmdline_fixed_string_t pf_vf;
cmdline_fixed_string_t drop;
cmdline_fixed_string_t queue;
uint16_t queue_id;
@@ -7848,6 +7851,8 @@ cmd_flow_director_filter_parsed(void *parsed_result,
struct cmd_flow_director_result *res = parsed_result;
struct rte_eth_fdir_filter entry;
uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];
+ char *end;
+ unsigned long vf_id;
int ret = 0;
ret = rte_eth_dev_filter_supported(res->port_id, RTE_ETH_FILTER_FDIR);
@@ -7941,6 +7946,27 @@ cmd_flow_director_filter_parsed(void *parsed_result,
entry.action.behavior = RTE_ETH_FDIR_REJECT;
else
entry.action.behavior = RTE_ETH_FDIR_ACCEPT;
+
+ if (!strcmp(res->pf_vf, "pf"))
+ entry.input.flow_ext.is_vf = 0;
+ else if (!strncmp(res->pf_vf, "vf", 2)) {
+ struct rte_eth_dev_info dev_info;
+
+ memset(&dev_info, 0, sizeof(dev_info));
+ rte_eth_dev_info_get(res->port_id, &dev_info);
+ errno = 0;
+ vf_id = strtoul(res->pf_vf + 2, &end, 10);
+ if (errno != 0 || *end != '\0' || vf_id >= dev_info.max_vfs) {
+ printf("invalid parameter %s.\n", res->pf_vf);
+ return;
+ }
+ entry.input.flow_ext.is_vf = 1;
+ entry.input.flow_ext.dst_id = (uint16_t)vf_id;
+ } else {
+ printf("invalid parameter %s.\n", res->pf_vf);
+ return;
+ }
+
/* set to report FD ID by default */
entry.action.report_status = RTE_ETH_FDIR_REPORT_ID;
entry.action.rx_queue = res->queue_id;
@@ -8020,6 +8046,9 @@ cmdline_parse_token_string_t cmd_flow_director_flexbytes_value =
cmdline_parse_token_string_t cmd_flow_director_drop =
TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
drop, "drop#fwd");
+cmdline_parse_token_string_t cmd_flow_director_pf_vf =
+ TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+ pf_vf, NULL);
cmdline_parse_token_string_t cmd_flow_director_queue =
TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
queue, "queue");
@@ -8052,6 +8081,7 @@ cmdline_parse_inst_t cmd_add_del_ip_flow_director = {
(void *)&cmd_flow_director_flexbytes,
(void *)&cmd_flow_director_flexbytes_value,
(void *)&cmd_flow_director_drop,
+ (void *)&cmd_flow_director_pf_vf,
(void *)&cmd_flow_director_queue,
(void *)&cmd_flow_director_queue_id,
(void *)&cmd_flow_director_fd_id,
@@ -8081,6 +8111,7 @@ cmdline_parse_inst_t cmd_add_del_udp_flow_director = {
(void *)&cmd_flow_director_flexbytes,
(void *)&cmd_flow_director_flexbytes_value,
(void *)&cmd_flow_director_drop,
+ (void *)&cmd_flow_director_pf_vf,
(void *)&cmd_flow_director_queue,
(void *)&cmd_flow_director_queue_id,
(void *)&cmd_flow_director_fd_id,
@@ -8112,6 +8143,7 @@ cmdline_parse_inst_t cmd_add_del_sctp_flow_director = {
(void *)&cmd_flow_director_flexbytes,
(void *)&cmd_flow_director_flexbytes_value,
(void *)&cmd_flow_director_drop,
+ (void *)&cmd_flow_director_pf_vf,
(void *)&cmd_flow_director_queue,
(void *)&cmd_flow_director_queue_id,
(void *)&cmd_flow_director_fd_id,
@@ -8135,6 +8167,7 @@ cmdline_parse_inst_t cmd_add_del_l2_flow_director = {
(void *)&cmd_flow_director_flexbytes,
(void *)&cmd_flow_director_flexbytes_value,
(void *)&cmd_flow_director_drop,
+ (void *)&cmd_flow_director_pf_vf,
(void *)&cmd_flow_director_queue,
(void *)&cmd_flow_director_queue_id,
(void *)&cmd_flow_director_fd_id,
--
2.4.0
next prev parent reply other threads:[~2015-09-22 3:45 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 3:45 [dpdk-dev] [PATCH 0/4] extend flow director to support VF filtering in i40e driver Jingjing Wu
2015-09-22 3:45 ` [dpdk-dev] [PATCH 1/4] ethdev: extend struct to support flow director in VFs Jingjing Wu
2015-10-27 7:52 ` Zhang, Helin
2015-09-22 3:45 ` [dpdk-dev] [PATCH 2/4] i40e: extend flow diretcor to support filtering " Jingjing Wu
2015-10-27 7:52 ` Zhang, Helin
2015-09-22 3:45 ` Jingjing Wu [this message]
2015-10-27 7:53 ` [dpdk-dev] [PATCH 3/4] testpmd: extend commands Zhang, Helin
2015-09-22 3:45 ` [dpdk-dev] [PATCH 4/4] doc: extend commands in testpmd and remove related ABI deprecation Jingjing Wu
2015-10-27 7:54 ` Zhang, Helin
2015-10-27 9:35 ` Thomas Monjalon
2015-10-28 2:06 ` Wu, Jingjing
2015-10-28 8:41 ` [dpdk-dev] [PATCH v2 0/4] extend flow director to support VF filtering in i40e driver Jingjing Wu
2015-10-28 8:41 ` [dpdk-dev] [PATCH v2 1/4] ethdev: extend struct to support flow director in VFs Jingjing Wu
2015-10-28 8:41 ` [dpdk-dev] [PATCH v2 2/4] i40e: extend flow diretcor to support filtering " Jingjing Wu
2015-10-28 8:41 ` [dpdk-dev] [PATCH v2 3/4] testpmd: extend commands Jingjing Wu
2015-10-28 8:41 ` [dpdk-dev] [PATCH v2 4/4] doc: extend commands in testpmd and update release note Jingjing Wu
2015-10-30 7:42 ` [dpdk-dev] [PATCH v2 0/4] extend flow director to support VF filtering in i40e driver Zhang, Helin
2015-10-31 16:24 ` [dpdk-dev] [PATCH v3 0/3] " Jingjing Wu
2015-10-31 16:24 ` [dpdk-dev] [PATCH v3 1/3] ethdev: extend struct to support flow director in VFs Jingjing Wu
2015-11-01 14:27 ` Thomas Monjalon
2015-11-01 14:33 ` Wu, Jingjing
2015-11-01 14:55 ` Thomas Monjalon
2015-11-02 5:24 ` Wu, Jingjing
2015-10-31 16:24 ` [dpdk-dev] [PATCH v3 2/3] i40e: extend flow diretcor to support filtering " Jingjing Wu
2015-11-01 14:28 ` Thomas Monjalon
2015-10-31 16:24 ` [dpdk-dev] [PATCH v3 3/3] testpmd: extend commands Jingjing Wu
2015-11-01 14:45 ` Thomas Monjalon
2015-11-01 14:22 ` [dpdk-dev] [PATCH v3 0/3] extend flow director to support VF filtering in i40e driver Thomas Monjalon
2015-11-04 3:29 ` [dpdk-dev] [PATCH v4 0/3] extend flow drector " Jingjing Wu
2015-11-04 3:29 ` [dpdk-dev] [PATCH v4 1/3] ethdev: extend struct to support flow director in VFs Jingjing Wu
2015-11-04 3:29 ` [dpdk-dev] [PATCH v4 2/3] i40e: extend flow diretcor to support filtering " Jingjing Wu
2015-11-04 3:29 ` [dpdk-dev] [PATCH v4 3/3] testpmd: extend commands Jingjing Wu
2015-11-04 12:41 ` [dpdk-dev] [PATCH v4 0/3] extend flow drector to support VF filtering in i40e driver 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=1442893533-32546-4-git-send-email-jingjing.wu@intel.com \
--to=jingjing.wu@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).