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 288AAA0C4B; Sat, 18 Sep 2021 10:31:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D73DC40041; Sat, 18 Sep 2021 10:31:29 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 80F504003D for ; Sat, 18 Sep 2021 10:31:28 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10110"; a="308471116" X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="308471116" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2021 01:31:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,303,1624345200"; d="scan'208";a="453525643" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga002.jf.intel.com with ESMTP; 18 Sep 2021 01:31:27 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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:31:26 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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:31:26 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by edgegateway.intel.com (192.55.55.68) 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:31:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lagGVPfS73wDsoH6Ix8trtARSj6UwM94dSJNhyevZYohHELYvWj8Yf4UwnvOdeYTqcxiwvO85nx9h5M+qmAyTYEfeZ29Euvw+xuV9FN2zymdSwSg3scQ3ceSw9KgYiCzFg+DU3ee6cAvpXyZl1Avx8K2gQ7cdsa68aV4lYc8MLAahGba9tDT7MdSS53X6EMvmgkaLmPht4YdfZ9gTzGRQjLZr+KihNHGjEZ5Zkqd/8na5ExM0wPVqZohs/cez4aaKvlj1VGFQJd+PQpK7OQSlmiczn6699xBQZRoO7Y3ldXXpbvsyHpkW0u3wfDNlqFacmx0O4pLOM9konNSLYeZsw== 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=trCVU3D5vgKdIkfpfc2U9QCDaeVCAoHBUbT7JCBeKfk=; b=QGg76/Qr/8yL3KnsOxnOINFO4zpDctcCjCnsEwdlXauf1/nqpda5SoBWtphRvgMIFqMGIQZr4OOeVtE3N3gay7DWuMPmqZiUCVfu0AMIYXJ3OlVTibrvgOf7I8ePqtRwMuXc7pX1bs5YAK83qy7ieir1witxv6ZTOUC8e9wBaRm8YTEWkllxr4qg94aPycFNiyYFi2+tIxHW98nZm2N3yZLFDAcrRFf02qHNhOY05IqMhYLY+XGJ44E9HQdLsiSTyOzXq9XgVxg+KBNY93d3zdSqmnAHVyPhWq8CTB+R1cCi9x+3pmmMMDWfHVxEhowmf5uTv23vf/3ZBx68VC1dqg== 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=trCVU3D5vgKdIkfpfc2U9QCDaeVCAoHBUbT7JCBeKfk=; b=rgf56hRtP20XHStzM4ym0SbP2wZsRi18SO1B8FXypPaJOsbFcy/Gz2mkcKBujT16TrtQ8F9WWgsDJr4lczpeFxdmicXwN1IDlfdKuJxDltqcHURoN+5SmROnrhLGEgpbUjie7oGawCWbSSmesw34mV1OrGLlj8n3O0LNhNufmpk= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM5PR1101MB2092.namprd11.prod.outlook.com (2603:10b6:4:5a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.17; Sat, 18 Sep 2021 08:31:25 +0000 Received: from DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3]) by DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3%3]) with mapi id 15.20.4523.018; Sat, 18 Sep 2021 08:31:25 +0000 From: "Li, Xiaoyun" To: "Zhang, AlvinX" , "Ananyev, Konstantin" CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 1/2] app/testpmd: update forward engine beginning Thread-Index: AQHXrDpI95njbDx6w0+I6x9RFfZZDKupc5dg Date: Sat, 18 Sep 2021 08:31:25 +0000 Message-ID: References: <20210917013923.4004-1-alvinx.zhang@intel.com> <20210918030659.12448-1-alvinx.zhang@intel.com> In-Reply-To: <20210918030659.12448-1-alvinx.zhang@intel.com> 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: 86beddf3-44dd-431a-ea2a-08d97a7eb3fb x-ms-traffictypediagnostic: DM5PR1101MB2092: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JC6p8WR0YifbeScAFD1ZteaDvvf2Ktl8UWUSyzBueYTCPSjCqcbUkp0/tHcQDA8B3rzvv/L7CNFT0hGv3r/B+bBaA3CumUadJ6kv4L9dEuoTVRcFuLGX29GUkhNw1UYwjda+ZYdi3WWXW//mZZ17QEvacDSWfwFp1MNa/WruabSfCtijJSt/CaPtI7DJG/UmISy3nwx7vM4p1TsBKsJgPEbaT7IUjdSuNg/l5H2ydUlqp7WhZBcUKysNhBJbUCeh3Ev6TxppL8iDAagENdd+C9eG4Yx+dWnFGy1yVYRYwaEQklC7h/dgYyeK0PoLzXBpkv1yYzKfL65tJlI4O8zCG5/0IY/Ij1uu8p9gfg3Y37IaYPRCfL82b54o8mT/a4J05Q7juNblN07znJFMd7zG2lSKM7C0HKpmOqKUA4kSTpmkRiIo+/+csahUsN3+ufuFvYkYqw/6q9gMTZ6zv+Rz3GSd/1BglSfUbA8T+PzROU4NNknmU9uH2dp1TKZXz2y9qvlsybZ7n56CM2+GdNLcq7f3ZwAw6OneHstKAsjSBXDstjobVJ7MA7nhmH6jRE4zzPRXyL3ishNj/+0lZQx0Fu5JiKU4+fgi7iMBcwlvTgk6+T7CIeE5qnuD6uJs9RIrxmXNbgsOkQBoioiJGhSO+cp2E6+bCEkCJkrDfGU426Fkga2ilE1i8cQklXJSokga/GoUcyJckW1fzRYyxhCN0A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5534.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(26005)(4326008)(66446008)(316002)(9686003)(8936002)(8676002)(55016002)(66946007)(110136005)(71200400001)(38070700005)(76116006)(66476007)(66556008)(64756008)(53546011)(6506007)(7696005)(6636002)(83380400001)(2906002)(186003)(38100700002)(5660300002)(508600001)(15650500001)(52536014)(122000001)(86362001)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?zUGAWIkKXympBelzjglM+VKiW+TZ4jjz4kcMPbUQIQdDafWno9Asd50TH2mq?= =?us-ascii?Q?N283+gF1g53TxNsUK9tK9WkLA+GfjE9tOKyQOMPZT1hOGZzkHIjpTn/qKtUV?= =?us-ascii?Q?uoK/GXMTjCkQYPugeHkUvXk31ZFqrMakwUktkW8ltmt2tBvQ133nkdCYmyz9?= =?us-ascii?Q?G2Ytf7r8plGQm7ws3leJg60XLCGCILxv3PhO0s/emjUL643vKqZTZwR+ESDc?= =?us-ascii?Q?aHifH2E2IOmlSkN7eCiTmkbWH6hU8WvafIm7qxRE70zmbZ53QsnshCIAOh/T?= =?us-ascii?Q?F2SaRNLbOyKpgjr9BVgrmnSHSmzZ6bSgvs89khxX0EifVJqUypvhZ/325jj+?= =?us-ascii?Q?Hl8voH/FlAMD5qJK/0dzEelCVnIu3UkD9NUWh0PMWWwOrG0ALvZFOdWck4G/?= =?us-ascii?Q?CEmNQoLNFjAGIJ5cX6MeJKIIbV2BkGME37notC7bCZW6nSxSYG6l3Q6Puc7x?= =?us-ascii?Q?Un02nTL+1qvpAveCd7RazRfUKx1E6XVI12dy5Zd9RZH1EQ3kjlQJxmw52QO0?= =?us-ascii?Q?4R0bjqQjD816XXEmscQbIMyGV7qgS7u0pbTfSHTMlpqdGuu/eBXDn/7HW23n?= =?us-ascii?Q?udmMx0bWKAqIFASX77A3RQoNuxz/VOF3ctAK0EyvIKc6mhqhNisRvlgiHTuG?= =?us-ascii?Q?e8U0B+wc94lQJCXt6NFPsW/FmXklxZNllWLJ8wVjWIpaK+mMbCHYneUNWiGR?= =?us-ascii?Q?zOs+/uce2y87/4be+KPXFmHnNdmvRGnFFgO/zz5KSgv6A35nb1+6mwL4U92Y?= =?us-ascii?Q?KHrq6+S+CA7nTeCA+Tx01+9vXNjcUEj/6s4WaAKipOUCmXCHOUkJKAMPDkAB?= =?us-ascii?Q?uvE+6o4pethd02wdy+91k8K7Ug4HPxOMgC9IFozoh8cJBy/+9yrCOiQQEmKD?= =?us-ascii?Q?Bz56aZ3seBH2Tx+SHl66Y1xSZIaMAzVcB4tynk7G1+jtd6AOxtVpsAGIUC2h?= =?us-ascii?Q?3uPYUyU7VYuOo4pEw++BpDKJra2Nl+HoCiqghxGQpUqgUSaWuM4sHa3p7B8h?= =?us-ascii?Q?fVy/YYAg7CkWd+URxwJo9kV5tT/8Q0rO5ttXhk606ix3mnvGFT1Cu4HHdPcp?= =?us-ascii?Q?tmANbNMVFUY65We0jLbgkBr5mZ4M5Le4ov8hT/RPGxvhj1g1tijMz5MJkSOf?= =?us-ascii?Q?gubw9mwyYPbqSsLh4lhfO/+RlmM3Z4b22dRoZ10BNUuZOmIaj4wZ3RP3zoce?= =?us-ascii?Q?9z7s1E4zMAjs/H2/g+HXvfUk84UbdMCAnuE14A/fuqOc4y3twgAWnVuW475W?= =?us-ascii?Q?gxyr50zHWluD1C1p4+P8TdCeUk/w3FAdqAv55flxIJe+pVplc8qcjaq7O2IA?= =?us-ascii?Q?wkaQoI1tcSql61fnyV9fydy/?= 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: DM4PR11MB5534.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86beddf3-44dd-431a-ea2a-08d97a7eb3fb X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2021 08:31:25.2799 (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: lTSHq+1j2iwIh/+ROcO92IG7zj+5ot1Ys1tu5p+AJGLTB5NVur0bFt60XBRY0eE9/7YHii2rdIb+aFiDeZtMWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2092 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" Hi > -----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 >=20 > For each forward engine, there may be some special conditions must be mee= t met > before the forwarding run. is running / runs >=20 > Adding checks for these conditions in configuring is not suitable, becaus= e one > condition may rely on multiple configurations, and the conditions require= d by > each forward engine is not general. >=20 > 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 met > whether the forwarding can be started. >=20 > 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 its return value then we can > some checks in it to confirm whether the forwarding can be started. In ad= dition, > this patch puts the calling part of the callback up to before some forwar= ding > related status being set. this patch calls this callback before the forwarding stats is reset and the= n launches the forwarding engine. Also the cc stable issue I state in the 2nd patch. But overall the patch looks good to me. 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(-) >=20 > 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); > } >=20 > -static void > +static int > flowgen_begin(portid_t pi) > { > printf(" number of flows for port %u: %d\n", pi, nb_flows_flowgen); > + return 0; > } >=20 > struct fwd_engine flow_gen_engine =3D { > diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c inde= x > 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); > } >=20 > -static void > +static int > port_ieee1588_fwd_begin(portid_t pi) > { > rte_eth_timesync_enable(pi); > + return 0; > } >=20 > 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]); > } >=20 > -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; > } >=20 > 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; >=20 > - 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())) { @@ -2227,= 10 > +2221,35 @@ struct extmem_param { > fprintf(stderr, "Packet forwarding already started\n"); > return; > } > - test_done =3D 0; >=20 > fwd_config_setup(); >=20 > + 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(); >=20 > @@ -2239,11 +2258,6 @@ struct extmem_param { >=20 > 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 hardw= are. > */ > -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); >=20 > 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); > } >=20 > -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; > } >=20 > struct fwd_engine tx_only_engine =3D { > -- > 1.8.3.1