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 2F8D3A0C45; Mon, 5 Jul 2021 19:32:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A88994068C; Mon, 5 Jul 2021 19:32:14 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 5E85A40141 for ; Mon, 5 Jul 2021 19:32:13 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10036"; a="294650432" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="294650432" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 10:32:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="646898749" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga005.fm.intel.com with ESMTP; 05 Jul 2021 10:32:12 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 5 Jul 2021 10:32:12 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 5 Jul 2021 10:32:11 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Mon, 5 Jul 2021 10:32:11 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Mon, 5 Jul 2021 10:32:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K8FFlIxYrrm1e8PrjV8Jb4kQyxURFd+JpGq1dAfya/mNWqpYLUuOBwy8d1o2MFAK3iAUNotdX0TObukkedaUm1KYXdiNQFf2QyxxcTsVTME0sSGZpePnKvyEzfUi7wbtCw7ILtjqDfOfGxkPtL5BV9OWx9SvvdxgjO7G3Y9jMjffWShQfv/lIVbCYsq4oScGPLnLhhD3CsnOeOrRgInGPzxuEx+su/kGc4j4bAAM+8KZUSZ8oD7p8g6yghiN+RCpJ5nX0JuYQD5N1lGKZP7qYfwkGCa6KVU+0fq6yXvRA2XHpADvDIqvCTOKUmumsRl6cYq78xwcIZjgk+7yj/QVoA== 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=FEwGf15vgWnJm8I+x+k/rLaP+FmmoRV1A9gWAcnIJKA=; b=V76qpLq5sv1oFXro8mugvonV26cxKUL1XAInNSJYs5ndCqOlTu9p+MOt//Oin809RO+oAib2NIRuMx5RitGL8wGxEtrbDte0pmbG5q0SdgZZEFDDtIKMLjaoZVXxtm+5kzZGMZydASo1glt7vMvn4jV4dppAASohLGO9aBIt+5AHaGkF8HGTvsY3pJi4JyQAb/jMg45HUs5MLi12mTza7kLB1bO5sOnXtMxfc7WXc4dp8ltzhj9ZX4UJfjkdKPS7tkgfCuyhb5bx5ntuqR7KlBOaJlWAbNqSYyQnLEcru+fgvfMPD2KRjnfXQPqCGTqABm1T/OTojNr9jt4atBxN+g== 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=FEwGf15vgWnJm8I+x+k/rLaP+FmmoRV1A9gWAcnIJKA=; b=kJWeaVPM6FRbu+dh6IuYtuPR+CEMZ/gOjSt6+IcXsoa8lP22vZ3VHuDFY2KkyUTOqvaeMqckvbSO3LqZAqYEwLfcnoV1V26uuiyA9H9M0mx59Lh2yr/5FYfRn9XFTqk4ct7yygeJPZp1YxL1ipWD7msrYqCDBt7fQadCZkRdqKM= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3225.namprd11.prod.outlook.com (2603:10b6:5:5b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.23; Mon, 5 Jul 2021 17:32:09 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7dc4:66b0:f76b:6d48]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7dc4:66b0:f76b:6d48%7]) with mapi id 15.20.4287.033; Mon, 5 Jul 2021 17:32:09 +0000 From: "Ananyev, Konstantin" To: "Walsh, Conor" , "Medvedkin, Vladimir" , "ruifeng.wang@arm.com" , "jerinj@marvell.com" CC: "dev@dpdk.org" , "Gributs, Paulis" Thread-Topic: [PATCH] examples/l3fwd: remove useless reloads in FIB main loop Thread-Index: AQHXccAPAxqAPCZyD0CIPU7/47oR06s0o7JQ Date: Mon, 5 Jul 2021 17:32:09 +0000 Message-ID: References: <20210705170546.1002806-1-conor.walsh@intel.com> In-Reply-To: <20210705170546.1002806-1-conor.walsh@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [109.255.184.192] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cdf0ce0b-0935-4424-0c96-08d93fdad106 x-ms-traffictypediagnostic: DM6PR11MB3225: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:972; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zO0NhQULbwc2Mm5wlswQd1FwOmYsypRLsfveqzuMxyOPnrMxGTzCAL5FmB9wFZr+sr3kwcsTd4hcAukmPD1AohsMeGRWRujPQx/WlDDC2oLFZj7Xhcp3ysRXIOYJq2d+GP9NoYNPNb2G46jLGrAUV72y+JKpUu/O8NgJq3kB0qC5NhbFskAbvj7wIxedXTSHzj5dNTn9hPGGYWMthdnOq14vBkNDG9bnnfrpLYy4zXcfDDAViVlpvVxroQV5N7X3jh3PkyTYGdrEOCOwX3kPunWWQqozLcyvAfMW636x6bokCC8dgnOgNyfkKQv8YbZ8QjphvKl1L7qJ8Tp/USDBZ448U69KzBwfwA6EwmCTXcJt1q8DjbGjfCASVKWnzfoyxPOWYGBkgfqb7d5NXQZPMHaG+0m/jt3hE0cOluaxcAQUoeMTyM0bXqLAL+2Ww3YBMXVaIfdArM2JAfucPePOsixSKZG/Qzm32CxvZYUhIe5glLj51XcNGHduypUoTTOD+nYWIAYMSBEmprixGI/rey+kwoYU2brspIDirPPyp/dGErVWrAXqPHXrqYT1uzkxWDKOkGzPKuke5EC9GtzT4gLZm14dKgsT8B5fK0zi/p2c+J1J+ud7lb0RPNwBwGcgFCoqeDgQhq04+P/JFooukQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(376002)(396003)(136003)(110136005)(54906003)(71200400001)(316002)(186003)(6506007)(26005)(55016002)(55236004)(86362001)(7696005)(9686003)(2906002)(33656002)(66946007)(76116006)(83380400001)(4326008)(64756008)(8936002)(8676002)(107886003)(478600001)(38100700002)(122000001)(52536014)(66446008)(66556008)(66476007)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kMoXDbuUTnEoc92PKIw+v1IFWkqtqlv9qOJ7x8XzLHUAiAvcIFCyz3atb1tS?= =?us-ascii?Q?cEtVnfA0iX1HVPCeIE0PXNMbVdyuxE4vecQl+4N1Obn+Wa3xDugBfLERE53L?= =?us-ascii?Q?W0XsKROtl5DmDNWyer5D58F2FlN1Lk0KThNPVObVr6BKGvQ4HjBfZWR3Eo0W?= =?us-ascii?Q?mr3Mwj3XBetf5a5tkltTNScaTxHKI+psQO/H2qkTz8z4uAba5+Vo2oSOiNsb?= =?us-ascii?Q?anTjxmm+30+VbXV1T9b7FRoGTRgOBWV/CIM6fTF4pVcefmiLcxypg2QZHdJQ?= =?us-ascii?Q?Q3N1a2i62sfk1fS3tSmIj1loaTeuX3nI0nzahXs36HO4y1fqieP/qDbZDU+s?= =?us-ascii?Q?X3QQR+9sHhQazXuJZzE7CEciQrCjTWhFnFWUWtFUogafTDlgl3G7+plsquUe?= =?us-ascii?Q?FTz2qxg1mammQY/8sKcza9DWGo61lbXCNm7r5qGblrIZxrgCLDQ0k6jCmJ1H?= =?us-ascii?Q?LHpFoLYamJFQetT3lQxcBGO1P5FLdTzUdgyg35aH1yBessnxBtMjBxV+PHET?= =?us-ascii?Q?vH7lmlR9ACIvQwq6KOD+LZxrxdQNViphZgdoRdGOYt3PiUqPEGNv9RbnW8jL?= =?us-ascii?Q?AHIwxDXQwzqKzKhR2axVBJTBXgETi+lOM5w+sdvV6kW15J0a/rjMn6J++zV1?= =?us-ascii?Q?nLkYsh80MNrgC1H8ZR2x6eSpdO07UE0Bacm0p4cc9xPqSCCMnxwDMOfOjobZ?= =?us-ascii?Q?aluicTkLdS/K6WLSUKQqdBq2yUgqFz7c5NX98iOSKNPSQtxO12SiTReEife1?= =?us-ascii?Q?pOgOoH29BbKLUmBUeFFjm4wVEKmsLcIfetUgdwk8HoNGVxLBJAfIkLPdMAlf?= =?us-ascii?Q?BTg4jcKgmCWlrzomMtvMCBgAF/D545t0u8RNNX/wrP1N6USalC4ZzgC9Sd2D?= =?us-ascii?Q?P5g47XjR72UkzuuS7RMXAO9SsZM/bEaNehT9wpgo32hDNLj5/LT2nzZqUejl?= =?us-ascii?Q?A6RazpgyXfI7oapKdCNEdR/nnYfRnERIzbkISJ5h8h5EfuDsMp7W3Nax3vgz?= =?us-ascii?Q?ZpBkKJ6GkpVpq7VfHZuztP0Vj6TC0BzOhhIbTxWTEJm6pIdUheIsJmwlEXS3?= =?us-ascii?Q?BwYg4I9pY6ccupBMnbwO+gGhGNPMWFHw8dOxvolMyaXk2ajRf9PxkrmZrExg?= =?us-ascii?Q?f43IH35jcNhTz+RQ+74Ko1593T3c5e7GAR+eFMpLXvdFJ/qvMdieaMIC+PLS?= =?us-ascii?Q?4kbdvzxlp8+FwtQbrAEI2oLB2a5ahJHj4Tkv8xZ2LlnBLiTFDAYeNSk1zhax?= =?us-ascii?Q?rPv5Rwo1HrRsyZq0ALpjg+ND9Kq1aRSiZjvx/5o4uucH36TCbbhqyWnF08YV?= =?us-ascii?Q?MRPZLB96DZ/RNQhLJLroJmC6?= 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: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdf0ce0b-0935-4424-0c96-08d93fdad106 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2021 17:32:09.1051 (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: UkUgkEgIL2k61lqs7ZwK2YrxS0RO1kFWg4/7U5GsAFwlagyRUHYutoTdPKdzrOhnh2BJVf+2d7ciaj3Mv0bLu3IwrSszB3cfEbQV1IPvvmk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3225 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: remove useless reloads in FIB main loop 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" >=20 > This patch aligns the l3fwd FIB code with the changes made to LPM in > commit 74fb854a3de6 ("examples/l3fwd: remove useless reloads in LPM > main loop"). > This change ensures the compiler knows that the lcore config variables > are constant values and the compiler will then optimize the code > accordingly. >=20 > Signed-off-by: Conor Walsh > --- > examples/l3fwd/l3fwd_fib.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) >=20 > diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c > index 1787229942..d083ddfdd5 100644 > --- a/examples/l3fwd/l3fwd_fib.c > +++ b/examples/l3fwd/l3fwd_fib.c > @@ -182,14 +182,16 @@ fib_main_loop(__rte_unused void *dummy) > lcore_id =3D rte_lcore_id(); > qconf =3D &lcore_conf[lcore_id]; >=20 > - if (qconf->n_rx_queue =3D=3D 0) { > + const uint16_t n_rx_q =3D qconf->n_rx_queue; > + const uint16_t n_tx_p =3D qconf->n_tx_port; > + if (n_rx_q =3D=3D 0) { > RTE_LOG(INFO, L3FWD, "lcore %u has nothing to do\n", lcore_id); > return 0; > } >=20 > RTE_LOG(INFO, L3FWD, "entering main loop on lcore %u\n", lcore_id); >=20 > - for (i =3D 0; i < qconf->n_rx_queue; i++) { > + for (i =3D 0; i < n_rx_q; i++) { >=20 > portid =3D qconf->rx_queue_list[i].port_id; > queueid =3D qconf->rx_queue_list[i].queue_id; > @@ -207,7 +209,7 @@ fib_main_loop(__rte_unused void *dummy) > diff_tsc =3D cur_tsc - prev_tsc; > if (unlikely(diff_tsc > drain_tsc)) { >=20 > - for (i =3D 0; i < qconf->n_tx_port; ++i) { > + for (i =3D 0; i < n_tx_p; ++i) { > portid =3D qconf->tx_port_id[i]; > if (qconf->tx_mbufs[portid].len =3D=3D 0) > continue; > @@ -221,7 +223,7 @@ fib_main_loop(__rte_unused void *dummy) > } >=20 > /* Read packet from RX queues. */ > - for (i =3D 0; i < qconf->n_rx_queue; ++i) { > + for (i =3D 0; i < n_rx_q; ++i) { > portid =3D qconf->rx_queue_list[i].port_id; > queueid =3D qconf->rx_queue_list[i].queue_id; > nb_rx =3D rte_eth_rx_burst(portid, queueid, pkts_burst, > -- Acked-by: Konstantin Ananyev > 2.25.1