DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sunil Kumar Kori <skori@marvell.com>
To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>,
	"Jerin Jacob Kollanukkaran" <jerinj@marvell.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	Ori Kam <orika@mellanox.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Radu Nicolau <radu.nicolau@intel.com>,
	"Akhil Goyal" <akhil.goyal@nxp.com>,
	Tomasz Kantecki <tomasz.kantecki@intel.com>,
	Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>,
	John McNamara <john.mcnamara@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] examples/l2fwd-event: add option to configure port pairs
Date: Wed, 25 Mar 2020 10:40:29 +0000	[thread overview]
Message-ID: <BY5PR18MB31055C69E638DA2CF0186FEEB4CE0@BY5PR18MB3105.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20200324123446.2397-2-pbhagavatula@marvell.com>

Comments inline.

Regards
Sunil Kumar Kori

>-----Original Message-----
>From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
>Sent: Tuesday, March 24, 2020 6:05 PM
>To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Marko Kovacevic
><marko.kovacevic@intel.com>; Ori Kam <orika@mellanox.com>; Bruce
>Richardson <bruce.richardson@intel.com>; Radu Nicolau
><radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; Tomasz
>Kantecki <tomasz.kantecki@intel.com>; Sunil Kumar Kori
><skori@marvell.com>; Pavan Nikhilesh Bhagavatula
><pbhagavatula@marvell.com>; John McNamara
><john.mcnamara@intel.com>
>Cc: dev@dpdk.org
>Subject: [dpdk-dev] [PATCH] examples/l2fwd-event: add option to configure
>port pairs
>
>From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
>Current l2fwd-event application statically configures adjacent ports as
>destination ports for forwarding the traffic.
>
>Add a config option to pass the forwarding port pair mapping which allows
>the user to configure forwarding port mapping.
>
>If no config argument is specified, destination port map is not changed and
>traffic gets forwarded with existing mapping.
>
>To align port/queue configuration of each lcore with destination port map,
>port/queue configuration of each lcore gets modified when config option is
>specificed.
>
>Ex: ./l2fwd-event -c 0xff -- -p 0x3f -q 2 --config="(0,3)(1,4)(2,5)"
>
>With above config option, traffic received from portid = 0 gets forwarded to
>port = 3 and vice versa, similarly traffic gets forwarded on other port pairs
>(1,4) and (2,5).
>
Is this config required to be updated for l2fwd also ?

>Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>---
>updating enabled, diff --git a/examples/l2fwd-event/l2fwd_common.h
>b/examples/l2fwd-event/l2fwd_common.h
>index 7e33ee749..4e8b2fe14 100644
>--- a/examples/l2fwd-event/l2fwd_common.h
>+++ b/examples/l2fwd-event/l2fwd_common.h
>@@ -69,6 +69,7 @@ struct l2fwd_resources {
> 	uint8_t sched_type;
> 	uint8_t mac_updating;
> 	uint8_t rx_queue_per_lcore;
>+	uint8_t port_pairs;
It can be changed to bool.

> 	uint16_t nb_rxd;
> 	uint16_t nb_txd;
> 	uint32_t enabled_port_mask;
>diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c
>index 89a6bb9a4..92890d1ae 100644
>--- a/examples/l2fwd-event/main.c
>+++ b/examples/l2fwd-event/main.c
>@@ -2,6 +2,8 @@
>  * Copyright(C) 2019 Marvell International Ltd.
>  */
>
>+#include <rte_string_fns.h>
>+
> #include "l2fwd_event.h"
> #include "l2fwd_poll.h"
>
>@@ -22,7 +24,9 @@ l2fwd_event_usage(const char *prgname)
> 	       "          Default mode = eventdev\n"
> 	       "  --eventq-sched: Event queue schedule type, ordered, atomic or
>parallel.\n"
> 	       "                  Default: atomic\n"
>-	       "                  Valid only if --mode=eventdev\n\n",
>+	       "                  Valid only if --mode=eventdev\n"
>+	       "  --config: Configure forwarding port pair mapping\n"
>+	       "	    Default: alternate port pairs\n\n",
> 	       prgname);
> }
>
>+l2fwd_event_parse_args(int argc, char **argv, struct l2fwd_resources
>+*rsrc)
> {
> 	int mac_updating = 1;
> 	struct option lgopts[] = {
>@@ -134,12 +202,18 @@ l2fwd_event_parse_args(int argc, char **argv,
>
>	CMD_LINE_OPT_MODE_NUM},
> 		{ CMD_LINE_OPT_EVENTQ_SCHED, required_argument, NULL,
>
>	CMD_LINE_OPT_EVENTQ_SCHED_NUM},
>+		{ CMD_LINE_OPT_PORT_PAIR_CONF, required_argument,
>NULL,
>+
>	CMD_LINE_OPT_PORT_PAIR_CONF_NUM},
> 		{NULL, 0, 0, 0}
> 	};
> 	int opt, ret, timer_secs;
> 	char *prgname = argv[0];
>-	char **argvopt;
>+	uint16_t port_id;
> 	int option_index;
>+	char **argvopt;
New line is required.

>+	/* reset l2fwd_dst_ports */
>+	for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++)
>+		rsrc->dst_ports[port_id] = UINT32_MAX;
>
> 	argvopt = argv;

  reply	other threads:[~2020-03-25 10:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 12:34 [dpdk-dev] [PATCH] example/l2fwd-event: add option to configure forwarding info pbhagavatula
2020-03-24 12:34 ` [dpdk-dev] [PATCH] examples/l2fwd-event: add option to configure port pairs pbhagavatula
2020-03-25 10:40   ` Sunil Kumar Kori [this message]
2020-03-26  6:37     ` Pavan Nikhilesh Bhagavatula
2020-03-26  6:42   ` [dpdk-dev] [dpdk-dev v2] " pbhagavatula
2020-03-31 10:23     ` Andrzej Ostruszka
2020-03-31 12:17       ` Pavan Nikhilesh Bhagavatula
2020-03-31 12:53     ` [dpdk-dev] [PATCH v3] " pbhagavatula
2020-03-31 17:07       ` Andrzej Ostruszka
2020-04-04 16:10         ` Jerin Jacob

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=BY5PR18MB31055C69E638DA2CF0186FEEB4CE0@BY5PR18MB3105.namprd18.prod.outlook.com \
    --to=skori@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=orika@mellanox.com \
    --cc=pbhagavatula@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=tomasz.kantecki@intel.com \
    /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).