[dpdk-dev] examples/flow_classify: fix failure in port_init function

Message ID 1525095834-10386-1-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Iremonger, Bernard April 30, 2018, 1:43 p.m. UTC
  The port_init function calls the rte_eth_dev_is_valid_port function.
This function now returns 1 if the port state is attached.
A return value of 1 now means a valid port.

Fixes: a9dbe1802226 ("fix ethdev port id validation")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 examples/flow_classify/flow_classify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon April 30, 2018, 1:46 p.m. UTC | #1
30/04/2018 15:43, Bernard Iremonger:
> The port_init function calls the rte_eth_dev_is_valid_port function.
> This function now returns 1 if the port state is attached.
> A return value of 1 now means a valid port.
> 
> Fixes: a9dbe1802226 ("fix ethdev port id validation")
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

My mistake.

Applied, thanks
  

Patch

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 3b087ce..6412fe4 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -200,7 +200,7 @@  struct rte_flow_query_count count = {
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_txconf txconf;
 
-	if (rte_eth_dev_is_valid_port(port))
+	if (!rte_eth_dev_is_valid_port(port))
 		return -1;
 
 	rte_eth_dev_info_get(port, &dev_info);