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 520E2A04AD; Fri, 1 May 2020 17:14:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1CF7A1D6A7; Fri, 1 May 2020 17:14:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id EBF9F1D6A6 for ; Fri, 1 May 2020 17:14:22 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 041FBVMl011247; Fri, 1 May 2020 08:14:22 -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=aqRybfPdExN3ZFneyTfz4sTMZKbyNJyhXKwGC7EKMqA=; b=b7cKbPOEuwj43GnLZDNlsfvE+8diG37jVK7sbJbOsmc0EQHDYl9ZQiAKcJWc7KmZf3f0 mRjMxex8l77muav5ltdvOKgJbtJ81DnyM+KlP9aaJ2FcdCv/PEZxbGutbtjYl2qrStwT ZF8jWGdXbhEjkBIoAhXTrwteq6T7U2w5EXLK98Jedg0D5vIS1FYfSnwZL8VTQ//sfu17 dJmt9hSqYqGWr8/o6ZHdncRCBXcmPNnxrokjKcbm1kKwwaiK1Hfl/9gKpaHkMVREbK+1 /Z4877G1fRSSpEQiL1JopSuXLp5bEfgzMwMaGX3CEBcfHBNajb2pn9eV5ap1HG8xfShS MQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 30r7e8k3e6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 01 May 2020 08:14:22 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 1 May 2020 08:14:19 -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; Fri, 1 May 2020 08:14:18 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.52) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 1 May 2020 08:14:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KZmUinJ/3nPjVRwiMeFFRXbNSgatW59mvq4b04WUDPB433RuYy9UNc5dz4MuKsV8QijcvwibwYc0ORF9+jqb8lpJrdEEA/qhoMEGGBoOLJW/0pfPXBoLno27T8vl9s6LWyc6oEy0E/nluY+8nzZiWV37hbtZgD1mrFGAuqI+zFNvQHkgzsmk4E9+1V06ESX9yGLAUJJVUVRsWsUJeAD4SnP3ucHyN2RpCNuu84j+s4HcuGINEfjlXDnwtR+5+DbZ0bLS4Nq+cyVDe2ox5ConHqIAVbxL1hf9Q5AfGJKGEE0aUXgsF4QWeOL0rK/e3hmkbf18Gjia2S6Sv68kXZBxkA== 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=aqRybfPdExN3ZFneyTfz4sTMZKbyNJyhXKwGC7EKMqA=; b=R0mNaqKsGBcNT+1kxeZ/dw9GLZXVqjpDQVKVSV1C3O0aQ8cnG3iIgi4422CIian2u/RmhH1B5qz4od50XkWLXkGUvwf4YQbQPgeETXF2vbANtt+9Ih8bOwIiNG2pLrFf/1Ti3sZzDydA+De8P7mTunuw65lH9Jddf8dTLmADCw3+aRpN7JyJpku4vcyMRuokc3WifT7NN2uUzk7PsVU5MHkGWbs3TJfvFQC7NRNQdJqesiQNPj3dsJX24fxqxLWKbh+W1EGnjUnyD7A6srNMWFA+8dbAtTDJJ0n3xGCsXbe6gD73I3LiTcg2IC+NEDODzTLs31PKJgswylqqRU0g/A== 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=aqRybfPdExN3ZFneyTfz4sTMZKbyNJyhXKwGC7EKMqA=; b=kaG3NIDdSiqCzSazhYpmzhim/s18XmyIn4pms3dW+SNoujMeHBhI94BTd1MZZXKJFzBht5Qf3eWSEaTNsfvtyzurU5OFpUvVv0BM2RZ8jJ+QxstbMR2EDAFN6/Am8j6HZL6rOVE3DQGOcv7ZPJJDpN4Y9co9RxloOzoW/qkTcLc= Received: from BYAPR18MB2518.namprd18.prod.outlook.com (2603:10b6:a03:13b::18) by BYAPR18MB2518.namprd18.prod.outlook.com (2603:10b6:a03:13b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Fri, 1 May 2020 15:14:17 +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.028; Fri, 1 May 2020 15:14:17 +0000 From: Pavan Nikhilesh Bhagavatula To: "Varghese, Vipin" , Jerin Jacob Kollanukkaran , "thomas@monjalon.net" , "Mcnamara, John" , "Kovacevic, Marko" , Ori Kam , "Richardson, Bruce" , "Nicolau, Radu" , Akhil Goyal , "Kantecki, Tomasz" , Sunil Kumar Kori CC: "Andrzej Ostruszka [C]" , "dev@dpdk.org" , Vamsi Krishna Attunuru Thread-Topic: [dpdk-dev] [PATCH v4] examples/l2fwd: add cmdline option for forwarding port info Thread-Index: AQHWH8Dm5XDIObU5EUKG5ieBor95p6iTUxpQ Date: Fri, 1 May 2020 15:14:17 +0000 Message-ID: References: <20200427075944.1314-1-pbhagavatula@marvell.com> <20200427183118.3315-1-pbhagavatula@marvell.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D4BB66C@BGSMSX101.gar.corp.intel.com> In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D4BB66C@BGSMSX101.gar.corp.intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [223.226.86.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c40496ed-7524-4801-8850-08d7ede25123 x-ms-traffictypediagnostic: BYAPR18MB2518: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0390DB4BDA 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)(396003)(346002)(136003)(376002)(39850400004)(366004)(66556008)(66446008)(26005)(52536014)(66946007)(55016002)(8936002)(76116006)(107886003)(9686003)(5660300002)(4326008)(186003)(33656002)(2906002)(316002)(71200400001)(86362001)(66476007)(64756008)(54906003)(6506007)(55236004)(7696005)(110136005)(478600001)(7416002)(6636002)(921003); DIR:OUT; SFP:1101; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5G1X3bgAZpnCRFe82VwncV3K88wHGtNQUdX2z1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Slu6jPrnTRE8gpTi6EarANgvUjGy1PX0X423BxJcACBsVba1sRkEqCB3d9w6XAKM4bTBVAqmsQYUwiDYJAxszDx/2QuFTWxLVMcpJUyp/WVm2U7lPS0cV3Fapb2R78ThPi+O2XOtcKc2e6CQkf1sjhgkSP5qkW4sO+yAcn6S0CoNrIAI7iHgildEh2XZIQHdPmOyPtx7Q0Uk3PVar30= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c40496ed-7524-4801-8850-08d7ede25123 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 May 2020 15:14:17.4100 (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: Ymu2LhntC/rxVahJm8qriONkEqbY8SOXmWWevsxhSrelQ6E7GEofoB46pbEU0XrBpCUZyiUBYBZiil/mFhB3keFeMG+2oraDjx5DTtfJYqs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2518 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-01_09:2020-05-01, 2020-05-01 signatures=0 Subject: Re: [dpdk-dev] [PATCH v4] 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" >Hi Vamsi & Pavan, > >I like this idea, couple of queries > >snipped >> +static int >> +check_port_pair_config(void) >> +{ >> + uint32_t port_pair_config_mask =3D 0; >> + uint32_t port_pair_mask =3D 0; >> + uint16_t index, i, portid; >> + >> + for (index =3D 0; index < nb_port_pair_params; index++) { >> + port_pair_mask =3D 0; >> + >> + for (i =3D 0; i < NUM_PORTS; i++) { >> + portid =3D port_pair_params[index].port[i]; >> + if ((l2fwd_enabled_port_mask & (1 << portid)) >=3D=3D 0) { >> + printf("port %u is not enabled in port >> mask\n", >> + portid); >> + return -1; >> + } >> + if (!rte_eth_dev_is_valid_port(portid)) { >> + printf("port %u is not present on the >> board\n", >> + portid); >> + return -1; >> + } >> + > >Should we check & warn the user if >1. port speed mismatch >2. on different NUMA >3. port pairs are physical and vdev like tap, and KNI (performance). > Sure, it can be a separate patch as it will be applicable for multiple exam= ples. >> + port_pair_mask |=3D 1 << portid; >> + } >> + > >snipped > > >> >> + if (port_pair_params !=3D NULL) { >> + if (check_port_pair_config() < 0) >> + rte_exit(EXIT_FAILURE, "Invalid port pair >config\n"); >> + } >> + >> /* check port mask to possible port mask */ >> if (l2fwd_enabled_port_mask & ~((1 << nb_ports) - 1)) >> rte_exit(EXIT_FAILURE, "Invalid portmask; possible >(0x%x)\n", >> @@ -565,26 +689,35 @@ main(int argc, char **argv) >> l2fwd_dst_ports[portid] =3D 0; >> last_port =3D 0; >> > >Should not the check_port_pair be after this? If the port is not enabled >in port_mask will you skip that pair? or skip RX-TX from that port? We check every port pair against l2fwd_enabled_port_mask in=20 check_port_pair_config() > >> - /* >> - * Each logical core is assigned a dedicated TX queue on each >port. >> - */ >> - RTE_ETH_FOREACH_DEV(portid) { >> - /* skip ports that are not enabled */ >> - if ((l2fwd_enabled_port_mask & (1 << portid)) =3D=3D 0) >> - continue; >> + /* populate destination port details */ >> + if (port_pair_params !=3D NULL) { >> + uint16_t idx, p; >> >> - if (nb_ports_in_mask % 2) { >> - l2fwd_dst_ports[portid] =3D last_port; >> - l2fwd_dst_ports[last_port] =3D portid; >> + for (idx =3D 0; idx < (nb_port_pair_params << 1); idx++) { >> + p =3D idx & 1; >> + portid =3D port_pair_params[idx >> 1].port[p]; >> + l2fwd_dst_ports[portid] =3D >> + port_pair_params[idx >> 1].port[p ^ 1]; >> } >> - else >> - last_port =3D portid; >> + } else { >> + RTE_ETH_FOREACH_DEV(portid) { >> + /* skip ports that are not enabled */ >> + if ((l2fwd_enabled_port_mask & (1 << portid)) >=3D=3D 0) >> + continue; >> >> - nb_ports_in_mask++; >> - } >> - if (nb_ports_in_mask % 2) { >> - printf("Notice: odd number of ports in portmask.\n"); >> - l2fwd_dst_ports[last_port] =3D last_port; >> + if (nb_ports_in_mask % 2) { >> + l2fwd_dst_ports[portid] =3D last_port; >> + l2fwd_dst_ports[last_port] =3D portid; >> + } else { >> + last_port =3D portid; >> + } >> + >> + nb_ports_in_mask++; >> + } >> + if (nb_ports_in_mask % 2) { >> + printf("Notice: odd number of ports in >portmask.\n"); >> + l2fwd_dst_ports[last_port] =3D last_port; >> + } >> } > >As mentioned above there can ports in mask which might be disabled >for port pair. Should not that be skipped rather than setting last port rx= - >tx loopback? There could be scenarios where user might want to test 2x10G and 1x40G=20 Why force the user to explicitly mention 1x40G as port pair of itself in th= e=20 portpair config? > >> >> rx_lcore_id =3D 0; >> @@ -613,7 +746,8 @@ main(int argc, char **argv) >> >> qconf->rx_port_list[qconf->n_rx_port] =3D portid; >> qconf->n_rx_port++; >> - printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); >> + printf("Lcore %u: RX port %u TX port %u\n", >rx_lcore_id, >> + portid, l2fwd_dst_ports[portid]); >> } >> >> nb_mbufs =3D RTE_MAX(nb_ports * (nb_rxd + nb_txd + >> MAX_PKT_BURST + >> -- >> 2.17.1