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 1EC04A04B7; Tue, 13 Oct 2020 15:42:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 704CE1DB64; Tue, 13 Oct 2020 15:42:27 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 206091DA9F for ; Tue, 13 Oct 2020 15:42:25 +0200 (CEST) IronPort-SDR: C1bN+JmgOtp3NeqtCukhopuwbOQjLILQATC9buFAM2z9HdxTfk26JvjgVTAYpLjLHZtHHga3Fm wkQUZgWFo5Ew== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="152840726" X-IronPort-AV: E=Sophos;i="5.77,370,1596524400"; d="scan'208";a="152840726" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 06:42:23 -0700 IronPort-SDR: whYcFq7JcGIHOsvyiafUjo1BRHJzAf2OIPZ+pSHbqRMgmtKFJpXCtNKUpwZHzAdNxuUUdLgqhl 0JzrDt+lBibQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,370,1596524400"; d="scan'208";a="521036336" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2020 06:42:23 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 13 Oct 2020 06:42:22 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 13 Oct 2020 06:42:22 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 13 Oct 2020 06:42:22 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.53) 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.1713.5; Tue, 13 Oct 2020 06:42:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WO+AiwqHeVZBO05P3Zf8nZ6618FcEtf2PT0ZPBZToP05saY3eTmWN4Rbm3Y1hOy/BAKpdRBrpL5OKiTOeCIgdNAiB+7cI8K5QLhTGTVAEcI8Scd3NMThFzh6qCwCBiX1nPGx/vneDy/lvplE1GavOBjF0ku4fd7rkr8zye/twPyj7UMf/i498v067REq7IpmsfVLwV/OyIbJWJ/ribdQpfluZuXwpusEJozuEPomd3ud45JhE0HPnnzW0YzJO9fAo/3S2A75fgaez4eZ3kSAbBsaq8kfVLpgbZ8zw9U3hBFbTzCKfSrs9KanVrrFFBk+o38b5UAX8GjAb5srfvLprg== 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=Tsv1TcJo5reDVee+xEoNFQ+LpjPpVqH2yvTchWXRLig=; b=Qas7HrTxWkHGGQFT4/6wepTGalEMQy42dkTYxgwWQq2vRTG9PwTXYx+8iP6cVpOo2sLWSSc88//UNz4lxh4IrCOlThygbS7mKwUrObgx4FpgDKqUPlSakI1ol+0DoTCe2ihZHdxauPwudJj6a41xcH9gErxS5ldy0piq0f1ADkcVWhSFMeN+wF/Vqm4/28Ad9sxuq4vC+8sqV+UAnMGeM+IyM0X0EqqJiHnWONV37g32taQAsvVtWwffVf3Bw2RbOp74Xi5ZbxB3xt02ZLwTUwijuiK0ODXTnCuj0IIgKflu6GPchvrinWFZiZALQ4En7Id9xQvPVHJW3VNGZFExEQ== 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=Tsv1TcJo5reDVee+xEoNFQ+LpjPpVqH2yvTchWXRLig=; b=cmpistzhIHC8OxVwB12T3c78NrUKtGuTkPopKwhK4yyZmHUvt0omQd6VaCwpvG1Ufkuz1wvqAxKeNEubxWSjy3joZyiDM2CtrNXkd5m0Ci753WExpLQE/g5A/SYToYtLL/qBVcix4sCWs3+OQrZk30TpmEsqNucW5zeklTfjsJY= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BY5PR11MB3895.namprd11.prod.outlook.com (2603:10b6:a03:18e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Tue, 13 Oct 2020 13:42:14 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b%3]) with mapi id 15.20.3455.030; Tue, 13 Oct 2020 13:42:13 +0000 From: "Ananyev, Konstantin" To: "Power, Ciara" , "dev@dpdk.org" CC: "viktorin@rehivetech.com" , "ruifeng.wang@arm.com" , "jerinj@marvell.com" , "drc@linux.vnet.ibm.com" , "Richardson, Bruce" , Nithin Dabilpuram , Pavan Nikhilesh , "Kiran Kumar K" Thread-Topic: [PATCH v5 17/17] node: choose vector path at runtime Thread-Index: AQHWoVDHCrlHNZnS2EOsGc6JWYVDrKmVijqw Date: Tue, 13 Oct 2020 13:42:12 +0000 Message-ID: References: <20200807155859.63888-1-ciara.power@intel.com> <20201013110437.309110-1-ciara.power@intel.com> <20201013110437.309110-18-ciara.power@intel.com> In-Reply-To: <20201013110437.309110-18-ciara.power@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: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 887ad2fc-5ee4-4447-7ee1-08d86f7dcad6 x-ms-traffictypediagnostic: BY5PR11MB3895: 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:2733; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: migMu/x/qFAcJnNCgJgI5K/4r8fE11CyvlR2o5OwxAFsH4eLPH8YwG3OhN4lOv0iTgd+9bBpmSsHwrfr+cCXN9L1O4RLOhh6U9VtzCvLX8NOpduAckuMy/HfbHbKMATDDwGdq0lO2AvWa2XeklDsN+3qLxer5+FSpygoDRMrAPtmIXpTvNSSV3K1yH7fO/ZY9U353pJJ6xnJIZfxKTSL8h7tnVXx1z2V4I/Ex0QfXAsnfS4EOC2beHA6sWYs4LBl8Y5+6tbA9n0Rg6yXz61xAT7QKuh66wLYeLW0n/Ta1y2kNB92ya+tA1ta3EXmmS/OffAmtTMKrjTHYoM8KMlo9g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(396003)(136003)(366004)(39860400002)(54906003)(9686003)(110136005)(2906002)(4326008)(5660300002)(478600001)(33656002)(55016002)(7696005)(52536014)(316002)(71200400001)(6506007)(83380400001)(66476007)(66556008)(66446008)(26005)(8936002)(64756008)(66946007)(186003)(86362001)(76116006)(8676002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: bxFqCti5DzZjolmAoUlx80NMSO3SftmdvoHjRfpXKqCVptGHVpsW97GxI2mUY/fl65Vf0cezXFTVLc/QIG+EAoigynvVDhec+qiIhFOrPbkloYCAXBFIPBBf6MipZbRHjGlt339zwcbtyoZ0lANNPjICu9HvlRzq5lBcY8CzJQImPW+26rFmL1gNQ3jS7xfirr3x8b8bxx23WkWSCGYABXIO7mDTGkMUAH+m6e9DNY5DVsj7ej9SFZUX+9CiZ8iPMOvLJDuruQ3Mo84ny7QJAirs7zM/POZ05jZ1wXps+QJBtgFY6FKsLzRK+3ejNzPSrV0AFxbEEVkmwYtt/u+PEVQ03mwssyM7ZjqhtnEeOiBsnkgsKpPub9Q4pZ8BkC/Wm5kA/drWb2QQPlELHwJWWuXBBE/xCwJFUBBirF/mPvj1hruuokY16KfCXE0Y2CyEI4Icyjf5Enr2/6Dt3J/RlFPbjVNuMxHlX3pLEiQiAXAEmlT9s2hJt2w6bkvB5ZkM4+Dc6rLts/KkNMIkLdQ2bqhTpLYoHs5TBRfb5vjyfEXP4A1iwQGh6N7mqYbajO6pob/nqte2F6aU5gR57c6U3URb4zbDqK2npIEZ9vJkPwSqMx5pZOOWbe5k0vZhmVGt83v2nhUPLKeX1GMZnQYa5w== 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: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 887ad2fc-5ee4-4447-7ee1-08d86f7dcad6 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2020 13:42:12.6591 (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: KTE5ueUNsEYwz3tZ0Tns6DMV0nsBxEMSLz4Wn3FJZL8oxFSBJ0BQ0DhKyVUw6im6CatulpuFLDt5gjL3oQdC4GumwXd8Jln630c+DrN5CPM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB3895 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 17/17] node: choose vector path at runtime 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" > When choosing the vector path, max SIMD bitwidth is now checked to > ensure the vector path is suitable. To do this, rather than the > scalar/vector lookup functions being called directly from the apps, a > generic function is called which will then call the scalar or vector > lookup function. >=20 > Cc: Nithin Dabilpuram > Cc: Pavan Nikhilesh > Cc: Jerin Jacob > Cc: Kiran Kumar K >=20 > Signed-off-by: Ciara Power > --- > lib/librte_node/ip4_lookup.c | 13 +++++++++++-- > lib/librte_node/ip4_lookup_neon.h | 2 +- > lib/librte_node/ip4_lookup_sse.h | 2 +- > 3 files changed, 13 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/librte_node/ip4_lookup.c b/lib/librte_node/ip4_lookup.c > index 293c77f39e..b3edbc1f4d 100644 > --- a/lib/librte_node/ip4_lookup.c > +++ b/lib/librte_node/ip4_lookup.c > @@ -34,10 +34,10 @@ static struct ip4_lookup_node_main ip4_lookup_nm; > #include "ip4_lookup_neon.h" > #elif defined(RTE_ARCH_X86) > #include "ip4_lookup_sse.h" > -#else > +#endif >=20 > static uint16_t > -ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node, > +ip4_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node = *node, > void **objs, uint16_t nb_objs) > { > struct rte_ipv4_hdr *ipv4_hdr; > @@ -109,7 +109,16 @@ ip4_lookup_node_process(struct rte_graph *graph, str= uct rte_node *node, > return nb_objs; > } >=20 > +static uint16_t > +ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node, > + void **objs, uint16_t nb_objs) > +{ > +#if defined(RTE_MACHINE_CPUFLAG_NEON) || defined(RTE_ARCH_X86) > + if (rte_get_max_simd_bitwidth() >=3D RTE_SIMD_128) > + return ip4_lookup_node_process_vec(graph, node, objs, nb_objs); > #endif > + return ip4_lookup_node_process_scalar(graph, node, objs, nb_objs); > +} Just wonder can't this selection be done once at ip4_lookup_node_init()? >=20 > int > rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop, > diff --git a/lib/librte_node/ip4_lookup_neon.h b/lib/librte_node/ip4_look= up_neon.h > index 5e5a7d87be..0ad2763b82 100644 > --- a/lib/librte_node/ip4_lookup_neon.h > +++ b/lib/librte_node/ip4_lookup_neon.h > @@ -7,7 +7,7 @@ >=20 > /* ARM64 NEON */ > static uint16_t > -ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node, > +ip4_lookup_node_process_vec(struct rte_graph *graph, struct rte_node *no= de, > void **objs, uint16_t nb_objs) > { > struct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts; > diff --git a/lib/librte_node/ip4_lookup_sse.h b/lib/librte_node/ip4_looku= p_sse.h > index a071cc5919..264c986071 100644 > --- a/lib/librte_node/ip4_lookup_sse.h > +++ b/lib/librte_node/ip4_lookup_sse.h > @@ -7,7 +7,7 @@ >=20 > /* X86 SSE */ > static uint16_t > -ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node, > +ip4_lookup_node_process_vec(struct rte_graph *graph, struct rte_node *no= de, > void **objs, uint16_t nb_objs) > { > struct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts; > -- > 2.22.0