DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix pf/vf check of flow director
@ 2016-10-10  2:47 Wenzhuo Lu
  2016-10-17 20:02 ` De Lara Guarch, Pablo
  2016-10-19  1:12 ` [dpdk-dev] [PATCH v2] app/testpmd: fix PF/VF " Wenzhuo Lu
  0 siblings, 2 replies; 4+ messages in thread
From: Wenzhuo Lu @ 2016-10-10  2:47 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Parameters pf & vf are added into most of flow director
filter CLIs.
But mac-valn and tunnel filters don't have these parameters,
the parameters should not be checked for mac-vlan and tunnel
filters.

Fixes: e6a68c013353 ("app/testpmd: extend commands for flow director in VF")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 app/test-pmd/cmdline.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f90befc..2580f27 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8502,24 +8502,28 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 	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) {
+	if (fdir_conf.mode !=  RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
+	    fdir_conf.mode !=  RTE_FDIR_MODE_PERFECT_TUNNEL) {
+		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;
 		}
-		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 */
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix pf/vf check of flow director
  2016-10-10  2:47 [dpdk-dev] [PATCH] app/testpmd: fix pf/vf check of flow director Wenzhuo Lu
@ 2016-10-17 20:02 ` De Lara Guarch, Pablo
  2016-10-19  1:12 ` [dpdk-dev] [PATCH v2] app/testpmd: fix PF/VF " Wenzhuo Lu
  1 sibling, 0 replies; 4+ messages in thread
From: De Lara Guarch, Pablo @ 2016-10-17 20:02 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Sunday, October 09, 2016 7:47 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo
> Subject: [dpdk-dev] [PATCH] app/testpmd: fix pf/vf check of flow director
> 
> Parameters pf & vf are added into most of flow director
> filter CLIs.
> But mac-valn and tunnel filters don't have these parameters,
> the parameters should not be checked for mac-vlan and tunnel
> filters.
> 
> Fixes: e6a68c013353 ("app/testpmd: extend commands for flow director in
> VF")
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Check-git-log script throws a couple of errors:

Wrong headline lowercase:
        app/testpmd: fix pf/vf check of flow director -> PF/VF
Missing blank line after 'Fixes' tag:
        Fixes: e6a68c013353 ("app/testpmd: extend commands for flow director in VF")

Apart from this:
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v2] app/testpmd: fix PF/VF check of flow director
  2016-10-10  2:47 [dpdk-dev] [PATCH] app/testpmd: fix pf/vf check of flow director Wenzhuo Lu
  2016-10-17 20:02 ` De Lara Guarch, Pablo
@ 2016-10-19  1:12 ` Wenzhuo Lu
  2016-10-25 21:08   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Wenzhuo Lu @ 2016-10-19  1:12 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Parameters pf & vf are added into most of flow director
filter CLIs.
But mac-valn and tunnel filters don't have these parameters,
the parameters should not be checked for mac-vlan and tunnel
filters.

Fixes: e6a68c013353 ("app/testpmd: extend commands for flow director in VF")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
v2:
- Reword the title and commit log.

 app/test-pmd/cmdline.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index a1da8b8..6e95ca2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8618,24 +8618,28 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 	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) {
+	if (fdir_conf.mode !=  RTE_FDIR_MODE_PERFECT_MAC_VLAN &&
+	    fdir_conf.mode !=  RTE_FDIR_MODE_PERFECT_TUNNEL) {
+		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;
 		}
-		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 */
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] app/testpmd: fix PF/VF check of flow director
  2016-10-19  1:12 ` [dpdk-dev] [PATCH v2] app/testpmd: fix PF/VF " Wenzhuo Lu
@ 2016-10-25 21:08   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-10-25 21:08 UTC (permalink / raw)
  To: Wenzhuo Lu; +Cc: dev

2016-10-19 09:12, Wenzhuo Lu:
> Parameters pf & vf are added into most of flow director
> filter CLIs.
> But mac-valn and tunnel filters don't have these parameters,
> the parameters should not be checked for mac-vlan and tunnel
> filters.
> 
> Fixes: e6a68c013353 ("app/testpmd: extend commands for flow director in VF")
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

This bug was reported and fixed by Frederico Cadete:
	http://dpdk.org/patch/15264
We have waited long to have a review saying it requires
an optional parameter in the command line.
And finally you re-post a fixed version of the same approach
without any comment to the original thread or a reference here.
Please be more careful with occasional contributors.

Applied with
Reported-by: Frederico Cadete <frederico.cadete-ext@oneaccess-net.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-25 21:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-10  2:47 [dpdk-dev] [PATCH] app/testpmd: fix pf/vf check of flow director Wenzhuo Lu
2016-10-17 20:02 ` De Lara Guarch, Pablo
2016-10-19  1:12 ` [dpdk-dev] [PATCH v2] app/testpmd: fix PF/VF " Wenzhuo Lu
2016-10-25 21:08   ` Thomas Monjalon

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).