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 1536BA058B; Wed, 25 Mar 2020 11:40:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D6FE32C15; Wed, 25 Mar 2020 11:40:34 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 372BB2BCE for ; Wed, 25 Mar 2020 11:40:33 +0100 (CET) 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 02PAeFL4029066; Wed, 25 Mar 2020 03:40:32 -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=tzCV9/u+zskRY9a7jUnLvLpNEGiqqWDDn42QrgPpfwk=; b=qsrlwvHXzSEFJ3RBVn64vaZFP/c9zcXE/SB1aSUcQUISNlUJBGU5VtGh2GShg+4EoL3b ZQ6hf6+G8uVBgHhvwwOrLKHoXBeShhdUATpjrDcBBdKPJeqRsusSaQqWaHvHV5my4wAS wjZ73VUW+BHz2V7sV4vmfPANFVIxDqkiaamzAyn8iTxJ5dkv4L+gqMOsL00ddoyxHyeO xh0pKHqNvroh/SZ2Ur1DMRGW4jAGFd7iKiiWGQsFMXrxg5ypdisWyf2JSqh0mWLsEvWa mCEYRKQfN4O8JSLZS6Et3ShP3sAhuoL9RQ5QiLaflz6IM/GV22jlACyJnnT+bwaT6Zs+ aQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2ywg9nr1f3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 25 Mar 2020 03:40:32 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 25 Mar 2020 03:40:30 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 25 Mar 2020 03:40:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GJc5TrR9reNE1UOuqKVEVKYuvNvAGYxCxqJRvmjVEigRysdkE/kpUD/lP6hA5bNrr3UB5K+t7q1T13pCm0dfFRE+8uDgn4ciyAaZxRcZYk1TtsvlnhgVQRdDhH8xFUdfA3DYM/g4Z2vr4zbYdWUX/A1z+eSEriOvS/PVYuKjL+BsrfeTVxxIPV+zUm4VZAOBSh320MDISKineucJWe3o4TXqNjD2B/w71isP0EEyydZC/kMyJEKY7gjthxefXWhizP5c26XdNyvx4uJ6lLaVDePtOg6uGuimhU2pODBJYUyJiXqEkjSYqSh3mE4GP/bFCxPo3Hk+P30KQSzkhqDgjg== 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=tzCV9/u+zskRY9a7jUnLvLpNEGiqqWDDn42QrgPpfwk=; b=d+tzaCCLYksaJiFUnzQJregWnsBL71z6hSfOeEijOwhqjnJVQXPezVVCqnIPbL1tSfP7kC4Gi4RTELI6tGy/AwgA2Vg/CH2gtGdDqLlxpdGSby7neAprNxfUXPoD+9wVN1jPq7CaLveYzYlbp9twyOSRbd/3mxnfW5yqB7lA+IJjfdqlcbtg/NJYGcs6+yjvV7dkYEzGy02OmneoL3u0kDI3pVWHXfn/YQTT4aO8RBodZ/o4D+epNWrSj0Nc/0N1s5AzFCaip4avsEH10EbZkR2jmCPeqJINIZrgDWkfH46g6O49XsJB00dHeGZnD68VfUrt8BLy7XY5+0OLeGgRtw== 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=tzCV9/u+zskRY9a7jUnLvLpNEGiqqWDDn42QrgPpfwk=; b=c+Or9SZMviELnnsXMVvNJ9r8YI3PoYA4yRPy8YrkedhUK3WmrDQjgFi3QGDKBYvCaJC0O/EnlCj3wFHydcU1yxhLUt0voLZMSYN3yD6dXzNDpiIUgnrI+S/Pr7DU6hZWYq/UZ/Gsra3M2p+CKE5V7cAxZeH+UeQHP7THcKShIpg= Received: from BY5PR18MB3105.namprd18.prod.outlook.com (2603:10b6:a03:1a4::30) by BY5PR18MB3170.namprd18.prod.outlook.com (2603:10b6:a03:1a9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.22; Wed, 25 Mar 2020 10:40:29 +0000 Received: from BY5PR18MB3105.namprd18.prod.outlook.com ([fe80::10c9:84e8:e169:12ef]) by BY5PR18MB3105.namprd18.prod.outlook.com ([fe80::10c9:84e8:e169:12ef%5]) with mapi id 15.20.2856.019; Wed, 25 Mar 2020 10:40:29 +0000 From: Sunil Kumar Kori To: Pavan Nikhilesh Bhagavatula , "Jerin Jacob Kollanukkaran" , Marko Kovacevic , Ori Kam , Bruce Richardson , Radu Nicolau , "Akhil Goyal" , Tomasz Kantecki , Pavan Nikhilesh Bhagavatula , John McNamara CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] examples/l2fwd-event: add option to configure port pairs Thread-Index: AQHWAdijcdY9NXE3skm/I+pqDXt6vahZGxmQ Date: Wed, 25 Mar 2020 10:40:29 +0000 Message-ID: References: <20200324123446.2397-1-pbhagavatula@marvell.com> <20200324123446.2397-2-pbhagavatula@marvell.com> In-Reply-To: <20200324123446.2397-2-pbhagavatula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [171.76.151.193] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f3fed301-9be0-49d7-956c-08d7d0a8efea x-ms-traffictypediagnostic: BY5PR18MB3170: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0353563E2B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(39860400002)(346002)(376002)(366004)(55016002)(9686003)(33656002)(76116006)(66446008)(2906002)(66946007)(66476007)(64756008)(66556008)(52536014)(5660300002)(4326008)(71200400001)(316002)(7696005)(110136005)(478600001)(186003)(26005)(81166006)(6506007)(8936002)(86362001)(81156014)(8676002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR18MB3170; H:BY5PR18MB3105.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; 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: R20sglY1NaGhd4Kllc0EFj5G8kG0CZCuUF6mgs25DvuNlOBVx/9Z05cEdwOSVFPYoiHzvvKVIXphVCfLrIJL+Kiwb/8qHJDD+w2yM+z1+LEmE8OfDGX5KG0H/y5eULR2gdZlM040/w0+fYBKIpKtx+3F6sgwHXhAJCNxnZqdRcQMksnqPNLc4sZSxB1JREdn5AGVVQajaM/iQEldoxFPuYD/d3j177/ReUEHwm4azVIhLnBQr0jQvbgFfr/Y+C6VUhCnMUlOXyHb+usHxPJ61dpezHvgXTWfYmuPSyfnEd82/N+Vnj38t5Fo9a9nmUw1Ya8+g4fqjt8PEqKDkDPtGyq8es1mTRkAEVTH+6vPj+puU45VNQmRSRE2sfof7IEqdQutu8oz4yfSVezrWeMBkPeNEsxzMaZLNoY16SwhHVD1sXiG/VdeZNlUVJ9hU4F3G0jBWPBtwjzbUh9Z6nzU4IIEo1Qfly0fqp0nGbYWFLgyebgp/g6aGOxQXtfvWC4L x-ms-exchange-antispam-messagedata: HqgwlFs2n6IrmzPDKxsGdvBTBzOTWFoKInWooat5ct07Z4E5ibx06dk3piqzcp3fxWIQKxpsNg3Sj+EjQawe0dmIKAMOA3erVtpKzkRVuBhp5SGX5TjbWld12hny8ZakVKOUWH0NmEsJnf+zexCqsQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f3fed301-9be0-49d7-956c-08d7d0a8efea X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2020 10:40:29.3746 (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: n0E4P+kTtUmyibRQK88iTrp5txau9M+bAhH83tY68bl/9YrB9TLAlZaTfPunsrHvydLKaARxaeBtkhkd2N3BgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR18MB3170 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-25_04:2020-03-24, 2020-03-25 signatures=0 Subject: Re: [dpdk-dev] [PATCH] examples/l2fwd-event: add option to configure port pairs 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" Comments inline. Regards Sunil Kumar Kori >-----Original Message----- >From: pbhagavatula@marvell.com >Sent: Tuesday, March 24, 2020 6:05 PM >To: Jerin Jacob Kollanukkaran ; Marko Kovacevic >; Ori Kam ; Bruce >Richardson ; Radu Nicolau >; Akhil Goyal ; Tomasz >Kantecki ; Sunil Kumar Kori >; Pavan Nikhilesh Bhagavatula >; John McNamara > >Cc: dev@dpdk.org >Subject: [dpdk-dev] [PATCH] examples/l2fwd-event: add option to configure >port pairs > >From: Pavan Nikhilesh > >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 an= d >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=3D"(0,3)(1,4)(2,5)" > >With above config option, traffic received from portid =3D 0 gets forwarde= d to >port =3D 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 >--- >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 >+ > #include "l2fwd_event.h" > #include "l2fwd_poll.h" > >@@ -22,7 +24,9 @@ l2fwd_event_usage(const char *prgname) > " Default mode =3D eventdev\n" > " --eventq-sched: Event queue schedule type, ordered, atomic or >parallel.\n" > " Default: atomic\n" >- " Valid only if --mode=3Deventdev\n\n", >+ " Valid only if --mode=3Deventdev\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 =3D 1; > struct option lgopts[] =3D { >@@ -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 =3D argv[0]; >- char **argvopt; >+ uint16_t port_id; > int option_index; >+ char **argvopt; New line is required. >+ /* reset l2fwd_dst_ports */ >+ for (port_id =3D 0; port_id < RTE_MAX_ETHPORTS; port_id++) >+ rsrc->dst_ports[port_id] =3D UINT32_MAX; > > argvopt =3D argv;