From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BBCF1A0C4B; Sat, 18 Sep 2021 10:50:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4896B40041; Sat, 18 Sep 2021 10:50:23 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id B10184003D for ; Sat, 18 Sep 2021 10:50:21 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10110"; a="283945959" X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="283945959" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2021 01:50:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="699941622" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga006.fm.intel.com with ESMTP; 18 Sep 2021 01:50:20 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Sat, 18 Sep 2021 01:50:19 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Sat, 18 Sep 2021 01:50:19 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Sat, 18 Sep 2021 01:50:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mZiHHuSlYz3PxBilezLjzyg8AGubLSLpL9g/qafh6zrBVT95I8Vn/6o6G7Zn8uHbZh6vBH7XNf7DLTAywwb1yZX6trK6dEdNhRiCOXB1F+2xXOHQzqkFkLpYvu2pJFxvoTCNK9AU8kaFN+MhLl4OEeStqtUv2uCjscMKAMFJUgUmgJMKeenv4qKM22ML9u0Op9T5SajuAjXCfraic7Xsz3Mcz7QJpDP6uJEsr2+jzJEzEaNnKp1OvDNo308z/UJwwtKhQoIEggjfnr5gp1z426+jPSePla+nJi3tM0WuhH090Hgcw2vAeaFuzd3EV9iilH+uZUwnu5yIIrSfjz/z8g== 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; bh=0IHaSHysVNSzdrCQGK4+JWD7I7SUPwK4mzVO/GOaSKg=; b=I7eO10E3MzDPIF1olZmEqih3QagwU2YxdrcWOljQ/09MQhRJheM8q8nFZ0NUIwpMLZD360sXxyva4uShEeT27k99COLrRvia1FCUthTJkVSlnDOk09equSQZr62eD0EJCW/H/CadFHTQTOQHBvvjwlu/D5tHP7HgS0VQ/iL9HJcEBs5+BvXih7rb0s6c6bEX5V0HeFb+99jR1OY0lMhxZwzoNnetQdC5NXTGK/UGRLBuCErn+Ey1zXKZJwFldE53Gtf05xOOtoM2CPfRoNWVdu4rJNDj8riv4D6Gz7aIIFhpEO3YDgRIRKQ2xuGQFLi3oRB1tkkjgDDLx4iAQ0VyVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0IHaSHysVNSzdrCQGK4+JWD7I7SUPwK4mzVO/GOaSKg=; b=TCRPVs8VaNNt3ydQWHUTH880qSMpDAPy5U5TsTw/GcoxtEfFFZp0PJi2/NNyZzYHt9K6ii1sGOeNohgvRDg74c8vC0lh0MjVhR4LP4fFE+CGhew3Ilu1IJ3Au2H37Nnrc1ChO2247Xgdp7yiaVHtiSNEZHCk8PEVYeiIejHLAVw= Received: from DM6PR11MB3898.namprd11.prod.outlook.com (2603:10b6:5:19f::12) by DM6PR11MB4545.namprd11.prod.outlook.com (2603:10b6:5:2ae::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Sat, 18 Sep 2021 08:50:17 +0000 Received: from DM6PR11MB3898.namprd11.prod.outlook.com ([fe80::4ca9:17cf:64c4:ca73]) by DM6PR11MB3898.namprd11.prod.outlook.com ([fe80::4ca9:17cf:64c4:ca73%4]) with mapi id 15.20.4523.018; Sat, 18 Sep 2021 08:50:17 +0000 From: "Zhang, AlvinX" To: "Li, Xiaoyun" , "Ananyev, Konstantin" CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 1/2] app/testpmd: update forward engine beginning Thread-Index: AQHXrDpIBNoz38h820mL1r3ezKtRgKupdq6AgAACTuA= Date: Sat, 18 Sep 2021 08:50:17 +0000 Message-ID: References: <20210917013923.4004-1-alvinx.zhang@intel.com> <20210918030659.12448-1-alvinx.zhang@intel.com> In-Reply-To: Accept-Language: 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=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 14086371-c3a4-4592-72ce-08d97a8156ff x-ms-traffictypediagnostic: DM6PR11MB4545: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sv6Lm/bbTJ1o0xCOWeO4d7n+TXqILsq6f3LwzjFM9NbI0ZN+hYFS9F/+sYqTdBGfY/P8W6kEYOCnsfzSKoDwbRzFnQX3HgRXnF5h/n0hbDMQrldCHA8msgZOvCR+Aj1WgRIbfbVZFPLi51mphwOzy8e6u6auMF/kUuIGxKKS8byev/zdVSiO8EoRWf32T8O8ymt8Um1ZCrLvrqWEm81VS/r9sPsNUgbE6Wk46KO/cF4m2IMXdlX2nUNOAhFUhnAa+b8Nkr1S+g5t5UEAIfcmAA2XbX7Och5GOnjIWL2pEvnjhzv42TAs1XC66ivJHl7dHuvHKKW44dqYWUWOOee2RlyJw/sK25uHk8i/58vkFuggHepn59X6ermeCHvOWKIPgvyFVpNkkXXT1yX9ciynKInDCPhYiXDVMScBXy/UoGi2V3M1acpUzin5Sj6B+RKoDYekrX4or7PToCfpHFaQtmjvKEfjFwKX176TTICX/iZLHNgMaRTVsP6XUrHakkH2T9z+ncoqE/3T1VvEHZ2WgpLcqysvS4k1blM4Dsa97dqsgmWEqJNix8mIgQDpSqOwt5M3Btcxv3oLvMknuBK3qINKW92WlyDAPFpTdwerhwbVdQfzSiYlauysc3DljFekXCVxLcq/PcnglsII+9ufXJwRHavwOH+Hh2laRUyNILD+Lo7gpNlz5R58ltTACjU63BIYJNPlI40VQFZT5IMjfQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3898.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(366004)(136003)(396003)(122000001)(316002)(38100700002)(55016002)(2906002)(9686003)(83380400001)(4326008)(8936002)(15650500001)(38070700005)(33656002)(86362001)(6636002)(478600001)(5660300002)(7696005)(64756008)(66556008)(66946007)(66446008)(66476007)(110136005)(52536014)(71200400001)(8676002)(26005)(76116006)(53546011)(6506007)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ilkwvwkTBncAtLkRmxmaisz9iHSiXiuy1W6kLhK9e9Glg2CHQ7TA5hfJfB8i?= =?us-ascii?Q?uuR8cYuFXLjao9mAMX4+bj4IL5yr67Hi6KL9zY+KGIq+UTgwZx4kmOUUkLnF?= =?us-ascii?Q?ZfTvPzkTj5/9Xan1gJdAQ1uxoAZafnRJaelMhJpdaMKCr0cxq5zjdUeZvYQR?= =?us-ascii?Q?Z5/drHjhg5PLwnwMvDszUaKb9SVTBLN3xeIJjeBs8zLcT7PMo2UAYyTmS/O2?= =?us-ascii?Q?/x5Nx6Xm7+OB44qqbeTAbSoZYUiGNEqVpC9Z879ZM8JFWjw1vSHCZwgPQhTT?= =?us-ascii?Q?aM7Fa1dDewOiiozC/Gtl1/g4GyP+8v/pyma7mz7pS/zXqEc92/ct0+k50CcU?= =?us-ascii?Q?lWWZhtjSrZg8FJjt8R7T1+RhavC1gnzVMIFVJpsLrE/G0wkZjmpnzpbOw6gi?= =?us-ascii?Q?YedGBGGZxvM+9mWQ0g2kvy3sD0bwJPZVZ9tz0WwE6llIYqgFYFNlpJIcXWgk?= =?us-ascii?Q?tuti6BOby2GZQnDb22VnN+6+p1rRdlDVV0My0mAd3lLWjELbHFXG9q1K6pGU?= =?us-ascii?Q?NYF+rQQrTwyUJXN5Lt09fbfmMfW2gqn+XSy9WqAtbngFyKGHRNPTE+F8Hzl6?= =?us-ascii?Q?zOKoAL9yTMKIr6bXQbKPVmaDxXnjORv60x9ckArg0a6mrfFFffrg82X5F0ZW?= =?us-ascii?Q?A8PXMI9SzXcoN84pp1vWfxUHVKK1orfVrgLACFWOpFM98/l1/TUIQ2yvP4fq?= =?us-ascii?Q?a2VfI4+B1A9WTDW/juPOEhTBRSf7lWT7aDI4sVIU62+XGuLZAMKtL5vo4CPj?= =?us-ascii?Q?Nn0OykVIMs4KOk0mkk3SUTE3PkVRzI/Asg8pqxS1IXRpwGkPZ3VDhaxWh36f?= =?us-ascii?Q?PHruNNuAaVzy3YeP+3cspLIy1UhkbnTZhzYeE9OROxqb6sBAjEyPmM4Vuznx?= =?us-ascii?Q?CtF7T2ZbaDOXlKGK7SAJJIcugvsAREWgju/4h8ha9QHTUNZbFXfgWJ59zcGK?= =?us-ascii?Q?lV8RM6ZCqnijdEw5fzuw/iaI9N79df8jHwNj/sUUqGuQut43omqvYFI51g97?= =?us-ascii?Q?Lc7ZHGBMdLL4NxdS+HEbTirXuABrTCnmAfjqRfdUMqFAm7lLjABVHEyqvkFR?= =?us-ascii?Q?kdo8EQrQZENLtcRs2uahQpekv0uzzDYOR0TXvuJw6U23GxkDyDUnqIRwiMos?= =?us-ascii?Q?ZikizkjE9xYun5xYnIhh8z36ybSwBJfSedZA2ZDwM5a7XCKqf8n7s1psAUhz?= =?us-ascii?Q?k+mG2O7R+Dr75eBKhyVnbwBMCKKEVp7HH8aXAInwIqzdxQD54DFeKrnIiWcg?= =?us-ascii?Q?2KesGfMcA2skl3unPOynVE+RxtvePnYbpoSDrFVipE0xRjWC01zCj2yFGjHp?= =?us-ascii?Q?m+0=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3898.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14086371-c3a4-4592-72ce-08d97a8156ff X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2021 08:50:17.8037 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LwkiYSoBm9eLG1CP+7R1WensFpKY43M1yQvxjbGBK50h4fDIsS3ksQw1S3JuNFVQ6BTUde9wqTyS9lu+m0gqeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4545 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 1/2] app/testpmd: update forward engine beginning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: Li, Xiaoyun > Sent: Saturday, September 18, 2021 4:31 PM > To: Zhang, AlvinX ; Ananyev, Konstantin > > Cc: dev@dpdk.org > Subject: RE: [PATCH v3 1/2] app/testpmd: update forward engine beginning >=20 > Hi >=20 > > -----Original Message----- > > From: Zhang, AlvinX > > Sent: Saturday, September 18, 2021 11:07 > > To: Li, Xiaoyun ; Ananyev, Konstantin > > > > Cc: dev@dpdk.org; Zhang, AlvinX > > Subject: [PATCH v3 1/2] app/testpmd: update forward engine beginning > > > > For each forward engine, there may be some special conditions must be > > meet >=20 > met Hi Xiaoyun, Thanks for your attentively reviewing. I will update them in V4. >=20 > > before the forwarding run. >=20 > is running / runs >=20 > > > > Adding checks for these conditions in configuring is not suitable, > > because one condition may rely on multiple configurations, and the > > conditions required by each forward engine is not general. > > > > The best solution is each forward engine has a callback to check > > whether these conditions are meet, and then testpmd can call the > > callback to determine >=20 > met >=20 > > whether the forwarding can be started. > > > > There was a void callback 'port_fwd_begin' in forward engine, it did > > some initialization for forwarding, this patch updates it's return > > type, then we can add >=20 > its return value then we can >=20 > > some checks in it to confirm whether the forwarding can be started. In > > addition, this patch puts the calling part of the callback up to > > before some forwarding related status being set. >=20 > this patch calls this callback before the forwarding stats is reset and t= hen > launches the forwarding engine. >=20 > Also the cc stable issue I state in the 2nd patch. > But overall the patch looks good to me. >=20 > BRs > Xiaoyun >=20 > > > > Signed-off-by: Alvin Zhang > > --- > > app/test-pmd/flowgen.c | 3 ++- > > app/test-pmd/ieee1588fwd.c | 3 ++- > > app/test-pmd/noisy_vnf.c | 4 +++- > > app/test-pmd/testpmd.c | 38 > ++++++++++++++++++++++++++------------ > > app/test-pmd/testpmd.h | 2 +- > > app/test-pmd/txonly.c | 3 ++- > > 6 files changed, 36 insertions(+), 17 deletions(-) > > > > diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index > > 0d3664a..83234fc 100644 > > --- a/app/test-pmd/flowgen.c > > +++ b/app/test-pmd/flowgen.c > > @@ -201,10 +201,11 @@ > > get_end_cycles(fs, start_tsc); > > } > > > > -static void > > +static int > > flowgen_begin(portid_t pi) > > { > > printf(" number of flows for port %u: %d\n", pi, nb_flows_flowgen); > > + return 0; > > } > > > > struct fwd_engine flow_gen_engine =3D { diff --git > > a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index > > 034f238..81624a7 100644 > > --- a/app/test-pmd/ieee1588fwd.c > > +++ b/app/test-pmd/ieee1588fwd.c > > @@ -198,10 +198,11 @@ struct ptpv2_msg { > > port_ieee1588_tx_timestamp_check(fs->rx_port); > > } > > > > -static void > > +static int > > port_ieee1588_fwd_begin(portid_t pi) > > { > > rte_eth_timesync_enable(pi); > > + return 0; > > } > > > > static void > > diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c index > > 382a4c2..e4434be 100644 > > --- a/app/test-pmd/noisy_vnf.c > > +++ b/app/test-pmd/noisy_vnf.c > > @@ -231,7 +231,7 @@ struct noisy_config { > > rte_free(noisy_cfg[pi]); > > } > > > > -static void > > +static int > > noisy_fwd_begin(portid_t pi) > > { > > struct noisy_config *n; > > @@ -273,6 +273,8 @@ struct noisy_config { > > rte_exit(EXIT_FAILURE, > > "--noisy-lkup-memory-size must be > 0\n"); > > } > > + > > + return 0; > > } > > > > struct fwd_engine noisy_vnf_engine =3D { diff --git > > a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > > 97ae52e..0345b2e 100644 > > --- a/app/test-pmd/testpmd.c > > +++ b/app/test-pmd/testpmd.c > > @@ -2172,16 +2172,10 @@ struct extmem_param { static void > > launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore) { > > - port_fwd_begin_t port_fwd_begin; > > unsigned int i; > > unsigned int lc_id; > > int diag; > > > > - port_fwd_begin =3D cur_fwd_config.fwd_eng->port_fwd_begin; > > - if (port_fwd_begin !=3D NULL) { > > - for (i =3D 0; i < cur_fwd_config.nb_fwd_ports; i++) > > - (*port_fwd_begin)(fwd_ports_ids[i]); > > - } > > for (i =3D 0; i < cur_fwd_config.nb_fwd_lcores; i++) { > > lc_id =3D fwd_lcores_cpuids[i]; > > if ((interactive =3D=3D 0) || (lc_id !=3D rte_lcore_id())) { @@ -222= 7,10 > > +2221,35 @@ struct extmem_param { > > fprintf(stderr, "Packet forwarding already started\n"); > > return; > > } > > - test_done =3D 0; > > > > fwd_config_setup(); > > > > + port_fwd_begin =3D cur_fwd_config.fwd_eng->port_fwd_begin; > > + if (port_fwd_begin !=3D NULL) { > > + for (i =3D 0; i < cur_fwd_config.nb_fwd_ports; i++) { > > + if (port_fwd_begin(fwd_ports_ids[i])) { > > + fprintf(stderr, > > + "Packet forwarding not ready\n"); > > + return; > > + } > > + } > > + } > > + > > + if (with_tx_first) { > > + port_fwd_begin =3D tx_only_engine.port_fwd_begin; > > + if (port_fwd_begin !=3D NULL) { > > + for (i =3D 0; i < cur_fwd_config.nb_fwd_ports; i++) { > > + if (port_fwd_begin(fwd_ports_ids[i])) { > > + fprintf(stderr, > > + "Packet forwarding not > > ready\n"); > > + return; > > + } > > + } > > + } > > + } > > + > > + test_done =3D 0; > > + > > if(!no_flush_rx) > > flush_fwd_rx_queues(); > > > > @@ -2239,11 +2258,6 @@ struct extmem_param { > > > > fwd_stats_reset(); > > if (with_tx_first) { > > - port_fwd_begin =3D tx_only_engine.port_fwd_begin; > > - if (port_fwd_begin !=3D NULL) { > > - for (i =3D 0; i < cur_fwd_config.nb_fwd_ports; i++) > > - (*port_fwd_begin)(fwd_ports_ids[i]); > > - } > > while (with_tx_first--) { > > launch_packet_forwarding( > > run_one_txonly_burst_on_core); > > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index > > 5863b2f..e9d9db0 100644 > > --- a/app/test-pmd/testpmd.h > > +++ b/app/test-pmd/testpmd.h > > @@ -268,7 +268,7 @@ struct fwd_lcore { > > * Forwards packets unchanged on the same port. > > * Check that sent IEEE1588 PTP packets are timestamped by the > hardware. > > */ > > -typedef void (*port_fwd_begin_t)(portid_t pi); > > +typedef int (*port_fwd_begin_t)(portid_t pi); > > typedef void (*port_fwd_end_t)(portid_t pi); typedef void > > (*packet_fwd_t)(struct fwd_stream *fs); > > > > diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index > > aed820f..386a4ff 100644 > > --- a/app/test-pmd/txonly.c > > +++ b/app/test-pmd/txonly.c > > @@ -435,7 +435,7 @@ > > get_end_cycles(fs, start_tsc); > > } > > > > -static void > > +static int > > tx_only_begin(portid_t pi) > > { > > uint16_t pkt_data_len; > > @@ -467,6 +467,7 @@ > > timestamp_init_req++; > > /* Make sure all settings are visible on forwarding cores.*/ > > rte_wmb(); > > + return 0; > > } > > > > struct fwd_engine tx_only_engine =3D { > > -- > > 1.8.3.1 BRs Alvin