DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: fix port ID type in flow API
@ 2017-10-06 12:32 Adrien Mazarguil
  2017-10-06 14:46 ` Thomas Monjalon
  2017-10-17  7:23 ` Yang, Zhiyong
  0 siblings, 2 replies; 3+ messages in thread
From: Adrien Mazarguil @ 2017-10-06 12:32 UTC (permalink / raw)
  To: Ferruh Yigit, Zhiyong Yang; +Cc: dev

As for the testpmd flow command which uses uint16_t since the beginning by
chance, switch to portid_t for consistency.

Fixes: 14ab03825b1d ("ethdev: increase port id range")
Cc: Zhiyong Yang <zhiyong.yang@intel.com>

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 app/test-pmd/cmdline_flow.c |  6 +++---
 lib/librte_ether/rte_flow.c | 12 ++++++------
 lib/librte_ether/rte_flow.h | 12 ++++++------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 26c3e4f..b5d394d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -230,7 +230,7 @@ struct context {
 	int args_num; /**< Number of entries in args[]. */
 	uint32_t eol:1; /**< EOL has been detected. */
 	uint32_t last:1; /**< No more arguments. */
-	uint16_t port; /**< Current port ID (for completions). */
+	portid_t port; /**< Current port ID (for completions). */
 	uint32_t objdata; /**< Object-specific data. */
 	void *object; /**< Address of current object for relative offsets. */
 	void *objmask; /**< Object a full mask must be written to. */
@@ -350,7 +350,7 @@ struct token {
 /** Parser output buffer layout expected by cmd_flow_parsed(). */
 struct buffer {
 	enum index command; /**< Flow command. */
-	uint16_t port; /**< Affected port ID. */
+	portid_t port; /**< Affected port ID. */
 	union {
 		struct {
 			struct rte_flow_attr attr;
@@ -2618,7 +2618,7 @@ comp_rule_id(struct context *ctx, const struct token *token,
 
 	(void)token;
 	if (port_id_is_invalid(ctx->port, DISABLED_WARN) ||
-	    ctx->port == (uint16_t)RTE_PORT_ALL)
+	    ctx->port == (portid_t)RTE_PORT_ALL)
 		return -1;
 	port = &ports[ctx->port];
 	for (pf = port->flow_list; pf != NULL; pf = pf->next) {
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 95d9ee0..e276fb2 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -132,7 +132,7 @@ rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error)
 
 /* Check whether a flow rule can be created on a given port. */
 int
-rte_flow_validate(uint8_t port_id,
+rte_flow_validate(uint16_t port_id,
 		  const struct rte_flow_attr *attr,
 		  const struct rte_flow_item pattern[],
 		  const struct rte_flow_action actions[],
@@ -152,7 +152,7 @@ rte_flow_validate(uint8_t port_id,
 
 /* Create a flow rule on a given port. */
 struct rte_flow *
-rte_flow_create(uint8_t port_id,
+rte_flow_create(uint16_t port_id,
 		const struct rte_flow_attr *attr,
 		const struct rte_flow_item pattern[],
 		const struct rte_flow_action actions[],
@@ -172,7 +172,7 @@ rte_flow_create(uint8_t port_id,
 
 /* Destroy a flow rule on a given port. */
 int
-rte_flow_destroy(uint8_t port_id,
+rte_flow_destroy(uint16_t port_id,
 		 struct rte_flow *flow,
 		 struct rte_flow_error *error)
 {
@@ -190,7 +190,7 @@ rte_flow_destroy(uint8_t port_id,
 
 /* Destroy all flow rules associated with a port. */
 int
-rte_flow_flush(uint8_t port_id,
+rte_flow_flush(uint16_t port_id,
 	       struct rte_flow_error *error)
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
@@ -207,7 +207,7 @@ rte_flow_flush(uint8_t port_id,
 
 /* Query an existing flow rule. */
 int
-rte_flow_query(uint8_t port_id,
+rte_flow_query(uint16_t port_id,
 	       struct rte_flow *flow,
 	       enum rte_flow_action_type action,
 	       void *data,
@@ -227,7 +227,7 @@ rte_flow_query(uint8_t port_id,
 
 /* Restrict ingress traffic to the defined flow rules. */
 int
-rte_flow_isolate(uint8_t port_id,
+rte_flow_isolate(uint16_t port_id,
 		 int set,
 		 struct rte_flow_error *error)
 {
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index b1a1b97..d37b0ad 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -1168,7 +1168,7 @@ struct rte_flow_error {
  *   state (see rte_eth_dev_rx_queue_stop() and rte_eth_dev_stop()).
  */
 int
-rte_flow_validate(uint8_t port_id,
+rte_flow_validate(uint16_t port_id,
 		  const struct rte_flow_attr *attr,
 		  const struct rte_flow_item pattern[],
 		  const struct rte_flow_action actions[],
@@ -1195,7 +1195,7 @@ rte_flow_validate(uint8_t port_id,
  *   rte_flow_validate().
  */
 struct rte_flow *
-rte_flow_create(uint8_t port_id,
+rte_flow_create(uint16_t port_id,
 		const struct rte_flow_attr *attr,
 		const struct rte_flow_item pattern[],
 		const struct rte_flow_action actions[],
@@ -1222,7 +1222,7 @@ rte_flow_create(uint8_t port_id,
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 int
-rte_flow_destroy(uint8_t port_id,
+rte_flow_destroy(uint16_t port_id,
 		 struct rte_flow *flow,
 		 struct rte_flow_error *error);
 
@@ -1243,7 +1243,7 @@ rte_flow_destroy(uint8_t port_id,
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 int
-rte_flow_flush(uint8_t port_id,
+rte_flow_flush(uint16_t port_id,
 	       struct rte_flow_error *error);
 
 /**
@@ -1271,7 +1271,7 @@ rte_flow_flush(uint8_t port_id,
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 int
-rte_flow_query(uint8_t port_id,
+rte_flow_query(uint16_t port_id,
 	       struct rte_flow *flow,
 	       enum rte_flow_action_type action,
 	       void *data,
@@ -1319,7 +1319,7 @@ rte_flow_query(uint8_t port_id,
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 int
-rte_flow_isolate(uint8_t port_id, int set, struct rte_flow_error *error);
+rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error);
 
 /**
  * Generic flow representation.
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH] ethdev: fix port ID type in flow API
  2017-10-06 12:32 [dpdk-dev] [PATCH] ethdev: fix port ID type in flow API Adrien Mazarguil
@ 2017-10-06 14:46 ` Thomas Monjalon
  2017-10-17  7:23 ` Yang, Zhiyong
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-10-06 14:46 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: dev, Ferruh Yigit, Zhiyong Yang

06/10/2017 14:32, Adrien Mazarguil:
> As for the testpmd flow command which uses uint16_t since the beginning by
> chance, switch to portid_t for consistency.
> 
> Fixes: 14ab03825b1d ("ethdev: increase port id range")
> Cc: Zhiyong Yang <zhiyong.yang@intel.com>
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied with next-net pull, thanks

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

* Re: [dpdk-dev] [PATCH] ethdev: fix port ID type in flow API
  2017-10-06 12:32 [dpdk-dev] [PATCH] ethdev: fix port ID type in flow API Adrien Mazarguil
  2017-10-06 14:46 ` Thomas Monjalon
@ 2017-10-17  7:23 ` Yang, Zhiyong
  1 sibling, 0 replies; 3+ messages in thread
From: Yang, Zhiyong @ 2017-10-17  7:23 UTC (permalink / raw)
  To: Adrien Mazarguil, Yigit, Ferruh; +Cc: dev

Hi Adrien,

Thanks for your fix patch.

Zhiyong

> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Friday, October 6, 2017 8:33 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong
> <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] ethdev: fix port ID type in flow API
> 
> As for the testpmd flow command which uses uint16_t since the beginning by
> chance, switch to portid_t for consistency.
> 
> Fixes: 14ab03825b1d ("ethdev: increase port id range")
> Cc: Zhiyong Yang <zhiyong.yang@intel.com>
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---

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

end of thread, other threads:[~2017-10-17  7:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 12:32 [dpdk-dev] [PATCH] ethdev: fix port ID type in flow API Adrien Mazarguil
2017-10-06 14:46 ` Thomas Monjalon
2017-10-17  7:23 ` Yang, Zhiyong

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