[v3,3/3] node/ethdev_rx: remove hardcoded node next details

Message ID 20230602162216.1868870-4-vattunuru@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series node: Introduce kernel_rx & kernel_tx nodes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Vamsi Krishna Attunuru June 2, 2023, 4:22 p.m. UTC
  For ethdev_rx node, node_next details can be populated
during node cloning time and same gets assigned to
node context structure during node initialization.

Patch removes overriding node_next details in node
init().

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
---
 lib/node/ethdev_ctrl.c | 1 +
 lib/node/ethdev_rx.c   | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
  

Comments

Nithin Dabilpuram June 5, 2023, 12:51 p.m. UTC | #1
Acked-by: Nithin Dabilpuram<ndabilpuram@marvell.com>

On Fri, Jun 2, 2023 at 9:52 PM Vamsi Attunuru <vattunuru@marvell.com> wrote:
>
> For ethdev_rx node, node_next details can be populated
> during node cloning time and same gets assigned to
> node context structure during node initialization.
>
> Patch removes overriding node_next details in node
> init().
>
> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
> ---
>  lib/node/ethdev_ctrl.c | 1 +
>  lib/node/ethdev_rx.c   | 3 ---
>  2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/lib/node/ethdev_ctrl.c b/lib/node/ethdev_ctrl.c
> index 37df0431b8..496f791cee 100644
> --- a/lib/node/ethdev_ctrl.c
> +++ b/lib/node/ethdev_ctrl.c
> @@ -82,6 +82,7 @@ rte_node_eth_config(struct rte_node_ethdev_config *conf, uint16_t nb_confs,
>                         memset(elem, 0, sizeof(ethdev_rx_node_elem_t));
>                         elem->ctx.port_id = port_id;
>                         elem->ctx.queue_id = j;
> +                       elem->ctx.cls_next = ETHDEV_RX_NEXT_PKT_CLS;
>                         elem->nid = id;
>                         elem->next = rx_node_data->head;
>                         rx_node_data->head = elem;
> diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c
> index a19237b42f..d131034991 100644
> --- a/lib/node/ethdev_rx.c
> +++ b/lib/node/ethdev_rx.c
> @@ -194,8 +194,6 @@ ethdev_rx_node_init(const struct rte_graph *graph, struct rte_node *node)
>
>         RTE_VERIFY(elem != NULL);
>
> -       ctx->cls_next = ETHDEV_RX_NEXT_PKT_CLS;
> -
>         /* Check and setup ptype */
>         return ethdev_ptype_setup(ctx->port_id, ctx->queue_id);
>  }
> @@ -215,7 +213,6 @@ static struct rte_node_register ethdev_rx_node_base = {
>
>         .nb_edges = ETHDEV_RX_NEXT_MAX,
>         .next_nodes = {
> -               /* Default pkt classification node */
>                 [ETHDEV_RX_NEXT_PKT_CLS] = "pkt_cls",
>                 [ETHDEV_RX_NEXT_IP4_LOOKUP] = "ip4_lookup",
>         },
> --
> 2.25.1
>
  

Patch

diff --git a/lib/node/ethdev_ctrl.c b/lib/node/ethdev_ctrl.c
index 37df0431b8..496f791cee 100644
--- a/lib/node/ethdev_ctrl.c
+++ b/lib/node/ethdev_ctrl.c
@@ -82,6 +82,7 @@  rte_node_eth_config(struct rte_node_ethdev_config *conf, uint16_t nb_confs,
 			memset(elem, 0, sizeof(ethdev_rx_node_elem_t));
 			elem->ctx.port_id = port_id;
 			elem->ctx.queue_id = j;
+			elem->ctx.cls_next = ETHDEV_RX_NEXT_PKT_CLS;
 			elem->nid = id;
 			elem->next = rx_node_data->head;
 			rx_node_data->head = elem;
diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c
index a19237b42f..d131034991 100644
--- a/lib/node/ethdev_rx.c
+++ b/lib/node/ethdev_rx.c
@@ -194,8 +194,6 @@  ethdev_rx_node_init(const struct rte_graph *graph, struct rte_node *node)
 
 	RTE_VERIFY(elem != NULL);
 
-	ctx->cls_next = ETHDEV_RX_NEXT_PKT_CLS;
-
 	/* Check and setup ptype */
 	return ethdev_ptype_setup(ctx->port_id, ctx->queue_id);
 }
@@ -215,7 +213,6 @@  static struct rte_node_register ethdev_rx_node_base = {
 
 	.nb_edges = ETHDEV_RX_NEXT_MAX,
 	.next_nodes = {
-		/* Default pkt classification node */
 		[ETHDEV_RX_NEXT_PKT_CLS] = "pkt_cls",
 		[ETHDEV_RX_NEXT_IP4_LOOKUP] = "ip4_lookup",
 	},