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 2A58BA04DB; Thu, 15 Oct 2020 17:33:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A1F91EB42; Thu, 15 Oct 2020 17:32:46 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 1E80E1EB3E for ; Thu, 15 Oct 2020 17:32:42 +0200 (CEST) IronPort-SDR: GXFAyk237guhnV8EwfbvZaSJNARMTZrWbZqh4qYixUWDq6+bq2kK9/zJOAvFHgP4MVLTbvB9ta LJR91htYXyGg== X-IronPort-AV: E=McAfee;i="6000,8403,9775"; a="146239452" X-IronPort-AV: E=Sophos;i="5.77,379,1596524400"; d="scan'208";a="146239452" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2020 08:32:42 -0700 IronPort-SDR: ANhWci1oOSJ5iDs43TBlLNOhhXyjcqeBJCQ+L7Au8adQWDRrqTmo/U5f3qEsJOo+5fpd73UtLk S6XPmwIx+r6w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,379,1596524400"; d="scan'208";a="319070751" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 15 Oct 2020 08:32:41 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 15 Oct 2020 08:32:41 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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; Thu, 15 Oct 2020 08:32:40 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 15 Oct 2020 08:32:40 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.51) 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; Thu, 15 Oct 2020 08:32:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DRO2NH6UJ4gLMDYT+Nqa6mNiLe6MW0ZQ6jG/ZpdjVIrP23U9NJ2QLc5KC6z42otzf+5xCi+YO9J6i7/ig8ErBtEHoofHbzdwUK4qB08M6SnzAa4aNu3PCK/CgwExS8Ubu3YaKh3czGU7ewNWsUjShJ3lZrNSbiA3uLWe7WG6lh3OHdIKaFjlKui5tjBEnelnXJpsqaIgwl6idI0UXgE3tLxS+cWBqpZRJGoSxkhRrRCdTIO+D/ZSy8vvCRYMSoexhcW9C+gMeChnJfMhiwcw60j7v5mZyakNq1knF3ExOR6ah3JCnAWD4kggg3r5bhyKrsoMHB8s6tV0rbrM0PU5Qg== 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=K2pdljRgJYHNTar0GtbjirPHFYSBt1m9Dcn7wgGzPe8=; b=kZUgv6ff/ehsbE79k4Gr6TL+WaMTJC9SzTfm4xfdC4pknYaBarEGD2BJFRbweEybtYPndt/BdZvQEBBfXJEuHdCUd2eeezj3A1fLSBIuim6Ul2orDXHc96S3yX+vAf4RIM964IIelLbg1GdPqNTDL42Mq1fTyWP7vnTon2MkCeB0XyEnJLPugUc3urI3nxch64WNUvthlZP2PJ1wCPBuog/R8eZzJs0zryP2Z8syc9cSba4HO8VkvBQicDLMrq64m4ttfHcqZnvzN3B3Rh+UWjwhgOTSfgciGCvntObq+Opy3cnPQOcztN46uoECA+f3pYoCC+AMZMmC+9lZuzcd1A== 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=K2pdljRgJYHNTar0GtbjirPHFYSBt1m9Dcn7wgGzPe8=; b=b/4eKIsDXmhLxEnVUgPkJJVwpJHIxmAaXzI9xPXneJr3pqGJ5P4iwoPNb7RqoaDggmCPPFg6jaJ+Z58FtGhEVNVmEXKHXVnWkpPYmMgJtqsGplWiUXxw+gX5ll+cTHdIQuLU4jKqZVwcgkf4D/Jkk3yEObYQr0PSlQbCCoCs8U4= Received: from DM6PR11MB2555.namprd11.prod.outlook.com (2603:10b6:5:c5::33) by DM6PR11MB2553.namprd11.prod.outlook.com (2603:10b6:5:bf::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Thu, 15 Oct 2020 15:32:37 +0000 Received: from DM6PR11MB2555.namprd11.prod.outlook.com ([fe80::78d4:d670:95af:773d]) by DM6PR11MB2555.namprd11.prod.outlook.com ([fe80::78d4:d670:95af:773d%5]) with mapi id 15.20.3433.043; Thu, 15 Oct 2020 15:32:37 +0000 From: "Power, Ciara" To: "dev@dpdk.org" CC: "viktorin@rehivetech.com" , "ruifeng.wang@arm.com" , "jerinj@marvell.com" , "drc@linux.vnet.ibm.com" , "Richardson, Bruce" , "Ananyev, Konstantin" , "david.marchand@redhat.com" , Nithin Dabilpuram , Pavan Nikhilesh , Kiran Kumar K Thread-Topic: [PATCH v7 17/18] node: choose vector path at runtime Thread-Index: AQHWowdO7ZkJR8vu/E+R2k3+gSgyQamYynpw Date: Thu, 15 Oct 2020 15:32:36 +0000 Message-ID: References: <20200807155859.63888-1-ciara.power@intel.com> <20201015152259.97562-1-ciara.power@intel.com> <20201015152259.97562-18-ciara.power@intel.com> In-Reply-To: <20201015152259.97562-18-ciara.power@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=intel.com; x-originating-ip: [37.228.239.233] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 53d17a9a-1969-4ae4-32f7-08d8711f8b83 x-ms-traffictypediagnostic: DM6PR11MB2553: 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:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3foSPjkekOj6PEv/sjrs9Sd6l+CDIHEK6QqwCNJfv0kLkFnXWp/GPwGWIzczHFbone0A8AUlGOte7cYuojpPAxA47IrEjrbx9IPxlNvJ8eAFe20hRSOH6oriDQeXLuJhUafpFW3sN1AGhuY4kBkh4uTRj0Dgo4OLLhjyuvzcQ3QWccdn+I9H5gpNTz2taZmCEFfWsxp4Isw6Fi6wVzMmbLmQOe3KbRvHEmRcdp/kicsXvhgvy2CZMy2BpR5cNJdQN3mDwvFjf4w6MMBUQo4atIuB6SIt8PdI150pUqg0xiT7/NHIYgJTckd+IexmsSr2WkE/M4SsGvPLMaW5Eh3RqA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2555.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(136003)(376002)(366004)(346002)(5660300002)(4326008)(86362001)(66556008)(64756008)(55016002)(316002)(8676002)(66476007)(33656002)(83380400001)(76116006)(6506007)(71200400001)(66946007)(9686003)(26005)(6916009)(54906003)(186003)(7696005)(66446008)(52536014)(478600001)(2906002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: WaOJIpn+2AwDJhqdFQGbYQW45NC9Tzx0lteMz1S/AODtbPiD6NcSzVMNGkhb7zHkEXO3jLvM2y26aA9jWo8ePRUbtYNEKyZFmKfhjQWZw5M90yuqu1mRFpwtsklUAJTEQWesy26+I0K6CuF2hluZXVP0I0DlF4LKWGcvUtXmoIwPj9Hu9BLqFGm+R1O6MfaFdqoqf32ciPgZZAUuP+O7cgPpTwTXJeiav+kdUp7++RJlowzzOu/FSzdjvicGgLDgOK9f5hg5OMyMmXwGjrod7Ac7Vz5mXJZUHTLSdu+Q5W8tGi1L12mPXj55gU0NMHxdYIJlJ4JEpY9oaZ9K4FhF6qK1Pi9Mhdn0soyXv/xS2LBOrUMAeUwuSzZ/gpycRVqVBRUhM2gzSQU4wFA5yf0Lix2E2iBVSHGLJAykCuCV0NgEmCc3KMrzLIDxBlJOdVRzHMn4CUBG9qQCmWiTao8CRrqJdndGh9Mjtg16suOay4WtmEvCMDnqTPow+Qb3oDQHp9Q4PciyJKnrDCLDRUJzwGam6Shm1lXvXXGKfk6npS0mUMihQ454tH91FH1qz+RNQo3lwg10pj4GX/JGxR3/uvfOO55v1vtHoC6fGjq4t3CF48c3dGZJqEKZES7+irRbNGPygcKoBQzIAD0Lo++xyQ== 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: DM6PR11MB2555.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53d17a9a-1969-4ae4-32f7-08d8711f8b83 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2020 15:32:36.9642 (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: 0J4ZzFwbiia69YpLsBTmzNzvvQhuO+W+9TLrOJfPEJ18htzM6v86zI0yO6yGyskZFihKZyntrnKp7xCtlObrhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2553 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 17/18] 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" >-----Original Message----- >From: Power, Ciara >Sent: Thursday 15 October 2020 16:23 >To: dev@dpdk.org >Cc: viktorin@rehivetech.com; ruifeng.wang@arm.com; jerinj@marvell.com; >drc@linux.vnet.ibm.com; Richardson, Bruce ; >Ananyev, Konstantin ; >david.marchand@redhat.com; Power, Ciara ; Nithin >Dabilpuram ; Pavan Nikhilesh >; Kiran Kumar K >Subject: [PATCH v7 17/18] node: choose vector path at runtime > >When choosing the vector path, max SIMD bitwidth is now checked to ensure >the vector path is suitable. To do this, the scalar function is chosen by = default >in the struct, but at node initialisation time, this function pointer is u= pdated >to the vector version if supported, and if it is within the max SIMD bitwi= dth >limit. > >Cc: Nithin Dabilpuram >Cc: Pavan Nikhilesh >Cc: Jerin Jacob >Cc: Kiran Kumar K > >Signed-off-by: Ciara Power > >--- >v6: > - Removed generic process function. > - Change the process function pointer at node init time to vector > function if suitable. >--- > lib/librte_node/ip4_lookup.c | 14 +++++++++----- > lib/librte_node/ip4_lookup_neon.h | 2 +- lib/librte_node/ip4_lookup_sse= .h >| 2 +- > 3 files changed, 11 insertions(+), 7 deletions(-) > >diff --git a/lib/librte_node/ip4_lookup.c b/lib/librte_node/ip4_lookup.c i= ndex >293c77f39e..934a6d7eab 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 > > 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,8 +109,6 @@ ip4_lookup_node_process(struct rte_graph *graph, >struct rte_node *node, > return nb_objs; > } > >-#endif >- > int > rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop, > enum rte_node_ip4_lookup_next next_node) @@ - >194,13 +192,19 @@ ip4_lookup_node_init(const struct rte_graph *graph, >struct rte_node *node) > init_once =3D 1; > } > *lpm_p =3D ip4_lookup_nm.lpm_tbl[graph->socket]; >+ >+#if defined(__ARM_NEON) || defined(RTE_ARCH_X86) >+ if (rte_get_max_simd_bitwidth() >=3D RTE_SIMD_128) >+ node->process =3D ip4_lookup_node_process_vec; #endif >+ > node_dbg("ip4_lookup", "Initialized ip4_lookup node"); > > return 0; > } > > static struct rte_node_register ip4_lookup_node =3D { >- .process =3D ip4_lookup_node_process, >+ .process =3D ip4_lookup_node_process_scalar, > .name =3D "ip4_lookup", > > .init =3D ip4_lookup_node_init, >diff --git a/lib/librte_node/ip4_lookup_neon.h >b/lib/librte_node/ip4_lookup_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 @@ > > /* 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 >+*node, > 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_lookup_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 @@ > > /* 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 >+*node, > void **objs, uint16_t nb_objs) > { > struct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts; >-- >2.22.0 Adding Ack missed from v6: Acked-by: Nithin Dabilpuram