From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 44CE0A00BE; Mon, 27 Apr 2020 18:38:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4EE41D516; Mon, 27 Apr 2020 18:38:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 214621D514 for ; Mon, 27 Apr 2020 18:38:44 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03RGQcie025572; Mon, 27 Apr 2020 09:38:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=SxSI7BXpN6ulXr8qPuWwlWFxc/22GemYVAjbJmKkMGg=; b=VxPVOxUpC1kLrKhyZ88PHn/+6CnpLAOEaX62XpAyhXZ40QbU+vvwTJgkue78XsrvOcGl u+MTKDgTTAGQu+gXwc9vZT6mlMKhrJ/fMeRvHk8Zs1BU7XMiQZakLvzaCfLK0GtEYSRr e0YHvVlZ85IL/GaHmN2liOloIBfFfsW/JEcOupS7QAhrhsONVMNMiv0egGppACcjyApt l0daiIr7F8aySE1TfhG5PuEvciODr32mcjyEdIlL6QYfbZ99Pcjsx05FY4dJAd0YMeQJ vFIp1fne+JgzS06KxhewS+uM5KcCzA4AgGT+8HhRKwXNZlbEQBOLBWTCptWs0aQI1dyu Mg== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 30mjjq8ccd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 27 Apr 2020 09:38:43 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 27 Apr 2020 09:38:42 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 27 Apr 2020 09:38:41 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.59) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 27 Apr 2020 09:38:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YQZuHPCWhnOByi8mWjNUQj+4SOLQQkqR05rnX8lt+9YYy5yfdmXvBKRDNPJPy7CM5iTZH/YXd+uuQ2be6YyE7StNkho8Vnczyw0uRXQuz6lPt0ywLvz3kRUvs6nUB3wHaJ1VY+dCJkd5r9FjUsdJVEzkgBDlKV7sqHkgFpm8ckEsZafhsPv3IHt9L5ptd4J9XeEIs7SSNOmZuY8d+uUZZuOT4UmsMrAsZq2eUlbreTSfCpcrEybqSdO4eToKdYjDScJDd9K/xRCaTP59+YZDzO6HH+zKbT3ukYRM2QMm1y7QM5/deidBy9AzRLMvKrBtoSuVOJzOKNlceQKiW57ADg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SxSI7BXpN6ulXr8qPuWwlWFxc/22GemYVAjbJmKkMGg=; b=OfpOeMHY3tAilhalLRe/Q0G4UyE5THHYt3wrNv8pUf2wCDrzFCnMqxnPQ8L9t1ZsXsXN+UmQpVWHY2+BLFQXON3T/ZkOgQcsqAhgWL53R5/1tjpPN0h7QBnRPJseAusHwAvWBi5yr/32mvSBzIZUkJr1C9oKr/KB2PGK+f7qlnlHPpfmr1H72dTh7yTq9rqKVPg4SunWIZEX2D1+uBVPKd9x2Q/LBznzQpTGrXLL51oFeTQf4MfRj3xqxXgI/EnvmdJAVxE3Zua/l14XWTYngbrIIhFJUMdmhuYg7UNwgcDNfaI/J440TCQTCuX3J6uZcZFDqXJQUAnUs1OXWBawfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SxSI7BXpN6ulXr8qPuWwlWFxc/22GemYVAjbJmKkMGg=; b=WT9ybD3lJPgdtdF3FiZtVTGuJk87FR3yPq0xKkT66wd2LYS/9N4Ej3ASqp8CUsrat1pedCNDczmqFmqe6a+PglinkCmYxt7Od6b3gD5OszErdNPD5jbGSfCRL5RGE3HgtZU1ou49Erc/7j/MCH/5gbDXF2jc+05xNg9OqhyPWco= Received: from BYAPR18MB2518.namprd18.prod.outlook.com (2603:10b6:a03:13b::18) by BYAPR18MB2776.namprd18.prod.outlook.com (2603:10b6:a03:107::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 16:38:40 +0000 Received: from BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289]) by BYAPR18MB2518.namprd18.prod.outlook.com ([fe80::fca4:5e00:46d9:a289%3]) with mapi id 15.20.2937.023; Mon, 27 Apr 2020 16:38:40 +0000 From: Pavan Nikhilesh Bhagavatula To: Sunil Kumar Kori , Jerin Jacob Kollanukkaran , "thomas@monjalon.net" , "John McNamara" , Marko Kovacevic , Ori Kam , Bruce Richardson , Radu Nicolau , "Akhil Goyal" , Tomasz Kantecki CC: "Andrzej Ostruszka [C]" , "dev@dpdk.org" , Vamsi Krishna Attunuru Thread-Topic: [dpdk-dev] [PATCH v3] examples/l2fwd: add cmdline option for forwarding port info Thread-Index: AQHWHGnaSpzhjAjzSEOsH97Yg9GXXqiMsP6AgAB46QA= Date: Mon, 27 Apr 2020 16:38:40 +0000 Message-ID: References: <20200405035243.8726-1-vattunuru@marvell.com> <20200427075944.1314-1-pbhagavatula@marvell.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [223.226.86.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cdf274be-b19f-496b-3ac0-08d7eac9712a x-ms-traffictypediagnostic: BYAPR18MB2776: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0386B406AA x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2518.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(396003)(346002)(39850400004)(136003)(376002)(107886003)(55236004)(81156014)(54906003)(55016002)(8936002)(9686003)(52536014)(33656002)(478600001)(8676002)(6506007)(2906002)(66446008)(76116006)(316002)(86362001)(4326008)(71200400001)(7696005)(66556008)(66946007)(64756008)(5660300002)(186003)(66476007)(110136005)(26005)(921003); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: m60Il+hhd3NA93ZGbj5Hwo53Wzg65H4q81F9Qs98/FwFspVC5h4V8HC+xwSbeNqoNox5MVf6ja2aPDyB7523aVwtUx9WuMeSnJSUisyyjGVXqyijkx0NmDtLMlseTZnmrLft5DO/kX2Lz4DedPjxa4IvVLF/0YL+7HxdS6Sl5N2qwo9/y8vqOY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NHz6Zsgd+XCobfkHEkByprnqk69PGtjZjNHt7yz/0s9o+7M3D9EqJ/n2NGL1hH7Y= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cdf274be-b19f-496b-3ac0-08d7eac9712a X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2020 16:38:40.2434 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: caoY6R4rWQPtBoc4uj6mX1WxazxyCr97Mze2ZCHnBY1vXoZ6PjzZU140HW47e8p5zbik9z73tCmqlcsCfj9LAjYMpeT9bkROpQeexFq9e1k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2776 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-27_12:2020-04-27, 2020-04-27 signatures=0 Subject: Re: [dpdk-dev] [PATCH v3] examples/l2fwd: add cmdline option for forwarding port info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >>diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst >>b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst >>index 39d6b0067..b54321b5b 100644 >>--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst >>+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst >>@@ -91,7 +91,10 @@ The application requires a number of command >line >>options: >> >> .. code-block:: console >> >>- ./build/l2fwd [EAL options] -- -p PORTMASK [-q NQ] --[no-]mac- >updating >>+ ./build/l2fwd [EAL options] -- -p PORTMASK >>+ [-q NQ] >>+ --[no-]mac-updating >>+ --portmap=3D"(port, port)[,(port, por= t)]" > >Will it be better to represent as [--portmap=3D"(port, port)[,(port, port)= ]] >as it is a optional parameter ? > Will change in v4. >> >> where, >> >>@@ -99,7 +102,10 @@ where, >> >> * q NQ: A number of queues (=3Dports) per lcore (default is 1) >> >>-* --[no-]mac-updating: Enable or disable MAC addresses updating >(enabled >>by default). >>+* --[no-]mac-updating: Enable or disable MAC addresses updating >(enabled >>by default) >>+ >>+* --portmap=3D"(port,port)[,(port,port)]": Determines which ports are >>mapped to >>+ which ports for packet forwarding. > >May be rephrased a bit shorter as "Determines forwarding ports >mapping". Will change in v4. >> >> To run the application in linux environment with 4 lcores, 16 ports and >8 RX >>queues per lcore and MAC address updating enabled, issue the >command: >>@@ -108,6 +114,14 @@ updating enabled, issue the command: >> >> $ ./build/l2fwd -l 0-3 -n 4 -- -q 8 -p ffff >> >>+To run the application in linux environment with 4 lcores, 4 ports, 8 >>+RX queues per lcore and MAC address updating enabled, to forward >RX >>+traffic of ports 0 & 1 on ports 2 & 3 respectively and vice versa, issue >the >>command: > >IMO, No need to mentioned information about MAC address update >enabled because it >is enabled by default and no param is passed in below command. So >information is not >relevant here. > Will change in v4. >>+ >>+.. code-block:: console >>+ >>+ $ ./build/l2fwd -l 0-3 -n 4 -- -q 8 -p f --portmap=3D"(0,2)(1,3)" >It looks like comma is missed in between two port map information. >>+ >> Refer to the *DPDK Getting Started Guide* for general information >on running >>applications and the Environment Abstraction Layer (EAL) options. >> >>diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index >>88ddfe589..81861a22a 100644 >>--- a/examples/l2fwd/main.c >>+++ b/examples/l2fwd/main.c >>@@ -38,6 +38,7 @@ >> #include >> #include >> #include >>+#include >> >> static volatile bool force_quit; >> >>@@ -67,6 +68,15 @@ static uint32_t l2fwd_enabled_port_mask =3D 0; >> /* list of enabled ports */ >> static uint32_t l2fwd_dst_ports[RTE_MAX_ETHPORTS]; >> >>+struct port_pair_params { >>+#define NUM_PORTS 2 >>+ uint16_t port[NUM_PORTS]; >>+} __rte_cache_aligned; > >Is there any specific reason to use this syntax to declare two ports >instead of following >struct port_pair_params { > uint16_t port1; > uint16_t port2; >}; > It was done to reduce code duplication. Will leave as is. >>+ >>+static struct port_pair_params >>+port_pair_params_array[RTE_MAX_ETHPORTS]; >Should not be RTE_MAX_ETHPORTS/2 if only 1:1 mapping is allowed ? >As I understood it is used to store CLI port mapping,=20 RTE_MAX_ETHPORTS/2 will be sufficient. >I think it is better to >Use any other MACRO which define maximum number of port map >parameter. >If you consider it, then it can also be updated in documentation. > >>+static struct port_pair_params *port_pair_params; static uint16_t >>+nb_port_pair_params; >>+ >> static unsigned int l2fwd_rx_queue_per_lcore =3D 1; >> >> #define MAX_RX_QUEUE_PER_LCORE 16 >>@@ -294,11 +304,13 @@ l2fwd_usage(const char *prgname) >> printf("%s [EAL options] -- -p PORTMASK [-q NQ]\n" >> " -p PORTMASK: hexadecimal bitmask of ports to >configure\n" >> " -q NQ: number of queue (=3Dports) per lcore (default is >1)\n" >>- " -T PERIOD: statistics will be refreshed each PERIOD >>seconds (0 to disable, 10 default, 86400 maximum)\n" >>- " --[no-]mac-updating: Enable or disable MAC >addresses >>updating (enabled by default)\n" >>- " When enabled:\n" >>- " - The source MAC address is replaced by the TX >port >>MAC address\n" >>- " - The destination MAC address is replaced by >>02:00:00:00:00:TX_PORT_ID\n", >>+ " -T PERIOD: statistics will be refreshed each PERIOD >seconds (0 to >>disable, 10 default, 86400 maximum)\n" >>+ " --[no-]mac-updating: Enable or disable MAC addresses >updating >>(enabled by default)\n" >>+ " When enabled:\n" >>+ " - The source MAC address is replaced by the TX port >MAC >>address\n" >>+ " - The destination MAC address is replaced by >>02:00:00:00:00:TX_PORT_ID\n" >>+ " --portmap: Configure forwarding port pair mapping\n" >>+ " Default: alternate port pairs\n\n", > >IMO, Indentation changes for other parameters should in separate >patch. It's not a functionality change it just minor code formatting change and do= esn't=20 deserve a separate patch. >> prgname); >> } >> >>@@ -319,6 +331,61 @@ l2fwd_parse_portmask(const char >*portmask) >> return pm; >> } >>