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 9447EA04DB; Thu, 15 Oct 2020 13:19:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7229C1E4B2; Thu, 15 Oct 2020 13:19:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id AD04E1E4B2 for ; Thu, 15 Oct 2020 13:19:16 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09FBFQVY004583; Thu, 15 Oct 2020 04:19:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pfpt0220; bh=8WOPLzcVoBpZU6GIkwr+Oi5WTVoDuFIPew0IwIp0VvA=; b=ZYF/4Jj7L5mDzFnCNNv7Iea4Xje1Pm2O3t23TXNDWXBt6XWJexZlocw1ddELK4ghkCd+ d8UwsKS2/vE5AK+7MnQSM4hJn3gbY50lrJPskFhDHPvaq2sjZ/U3xQ9oQjFJyLUPsMVu LAvNt+LB91w+t5Jogl82h1G2cKpNuOTosOls8KWbFM+dAUZ6vPo2u6nEFJYxUkcCuA9p TDPPdmLKZYNyTGetfhBZr+5VoTxnI/B+ainQSvi5q8uOg+wVFDlpSuIAYCYMW5QQuJkA NiskrV44r23vnISqm68GMq5Rr625JPgrZ8hGsHX3x9mT42MqaNQKLvMYY0xsygCgmSoB +w== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 343aanudq2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 15 Oct 2020 04:19:12 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Oct 2020 04:19:11 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Oct 2020 04:19:10 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 15 Oct 2020 04:19:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SBxE02hSNfd2yXMj4EOJ5cS0oW2vf0x3WgpT1jF8OD/zQu7fWO5S/nRLj2rDEhSOLKbuEqr7glLtPQBWER8M9iAqtQG9Z4ApB9i9WP/umLeDHwCB/Q5vuBOMMhD+OZxHqOfk0CI0rjuZE4Y01cjEVO5pvOsdFA3bi9AW6UwbnfbaJ6zD+Q4E1+emmNlPx2Sx3H116lqh0+vVjjD+7hgOALEsthbUfPeTTQd6KXFvXV+oPq4VtbVO4BBx6n2mjoM4pl40i/pobYJuDYvm2H7LHndnqdOEOlhxOEb7lxSxOjWRCDFHTMSjLClBHgimDiCaaOKZPWZP7eFSItkaRy5/sg== 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=8WOPLzcVoBpZU6GIkwr+Oi5WTVoDuFIPew0IwIp0VvA=; b=jtFkWAO9AliQkNIA71obSXwYVqdDVr55Y1xTmisa6pIVHZl+6f8BYQTguZC0JyxryiZ4V2E2FvBUlaxNSmnWbFEeayZgVzxex0bCFV7EPlY3dhNRF6D5m61wVUcBw6athtue2IIvDw02MEvbEwCFbH5N3DK81CUp26/geG6YR9CmOPjMn4IeoqtZsvCnqQkPAu2L4Q31BvCXjATxRapROOpUvBFFxnmTOxvI5YjhNV11WLEomyMC1GGcfrrrccEXYe8FpyefF3NQqsA5sAu3dslf2GoCiF3d5+CDGywfh8TB2+35S2iqPEhDUpz42x1Ctzs9grSZSwDgpyMN2F9u1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8WOPLzcVoBpZU6GIkwr+Oi5WTVoDuFIPew0IwIp0VvA=; b=ZFgCKMO3tjRywtLCFNAyNVL2R/ExzTazErx/Shtx31dTH16QfTMQSRRy+64AIg7uwC0NgNS91Ka8ty6GLmg53rkuBorHP+br/fJPyqK5y9EEpeEWjuYc9gBMAYI01wHz1HIxkfxOwoQjk8i9UOQoPjbM3uEzCOyQNZT1YJkeM0E= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=marvell.com; Received: from BN8PR18MB2386.namprd18.prod.outlook.com (2603:10b6:408:68::25) by BN8PR18MB2531.namprd18.prod.outlook.com (2603:10b6:408:9f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Thu, 15 Oct 2020 11:19:09 +0000 Received: from BN8PR18MB2386.namprd18.prod.outlook.com ([fe80::25af:7baf:528d:1dab]) by BN8PR18MB2386.namprd18.prod.outlook.com ([fe80::25af:7baf:528d:1dab%5]) with mapi id 15.20.3455.035; Thu, 15 Oct 2020 11:19:09 +0000 Date: Thu, 15 Oct 2020 16:48:52 +0530 From: Nithin Dabilpuram To: Ciara Power CC: , , , , , , , Pavan Nikhilesh , Kiran Kumar K Message-ID: <20201015111852.GA15756@outlook.office365.com> References: <20200807155859.63888-1-ciara.power@intel.com> <20201015103814.253636-1-ciara.power@intel.com> <20201015103814.253636-18-ciara.power@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201015103814.253636-18-ciara.power@intel.com> User-Agent: Mutt/1.12.2 (34cd43c) (2019-09-21) X-Originating-IP: [1.6.215.26] X-ClientProxiedBy: BM1PR01CA0083.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::23) To BN8PR18MB2386.namprd18.prod.outlook.com (2603:10b6:408:68::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from outlook.office365.com (1.6.215.26) by BM1PR01CA0083.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Thu, 15 Oct 2020 11:19:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58dffd93-518d-4ba4-19a8-08d870fc22c3 X-MS-TrafficTypeDiagnostic: BN8PR18MB2531: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HUcpOxA+GBzgsGVNHJPeTxL2Z9YC2vwkfl8yaVvTzi024XHilIwvTfLMNZltr6JVAsKoPI6DKI+CVOSvtmpofIaZ0RspL7EdBLyzOe8LQIJ9GBgflh2xQKnN1+OVP/yQXL86PqZ2INl3DhsQChcDb+xxL57Y65RDo6jdE5bZ/8wZXhy/d8OJnbCma3jTHhRaxzvEadpTNOvqu7fz1A8yf0HCZ0mSJ1ypXe1TFYpshLM/KHKhk3y+zorBIIJ04jHiIHJGAJzMKOYUQUpdWEAPFyxA8gKJUZG/H9nAiDR4/cu0sQV2WFMidZDFdOWoZ3DTNG9lTM8zBvGnp90JzN7NMLECvsjzh6Hm3c9uQO0QaE/R8vLbMOkTVXxY/rkz3njiUd4jpHktSlFHPxcUnu2Id069K15AyDwkLFd34PxtXkI7aJqf2eZcNrKixtiL9+eT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR18MB2386.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(39860400002)(376002)(136003)(346002)(6666004)(6506007)(8676002)(9686003)(186003)(16526019)(956004)(1006002)(6916009)(26005)(2906002)(66556008)(66946007)(107886003)(34490700002)(33656002)(66476007)(8936002)(54906003)(1076003)(4326008)(83380400001)(5660300002)(316002)(7696005)(52116002)(478600001)(55016002)(86362001)(36456003)(42976004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: x3aFk1sa3Egzq9UMt62c7sSo8qt2rImIpSTlNd2onX6s/k2iRtx8YTYHtioSUQG0Vdnax596zj/rubV3O7vaWu6BaqdMAON999bXwdh6pLlegUlu1Oe9XNx3DwffNJxcsrCVPkbJFjc1XlsRT6uvNQRp7d4/+7jHoPvN64PNKnoj59dGynQqCSf6Lhde2X9cQN4xpuijRqyFivwGn88oVSx08BmzgQA4gz52AkgbHO2jNX4GmK1UavLiceODyx4bGuuWD8AmY/toLYwyAbZuVOrhqBCcxT2G4n9M/FnymxaWhkp42jWA27tI/TS+Vp5jYQm5Wlj/YiSKp4JQ4rYYFAdyvTRkJCY0yjF5E27SfKxi4/b0dSiQ80kDYsKwSit2unwsjpj26Rwm3emqvxe6BP6KO3TLQZyx3YFu7AUqTtk/+XNQcGWssWOI3QZ1M1QkT0Kj423uP76o4avPnfmbRfWJblFtZ/7FKhRNBe006tMpgdap37HjQJYadzVuZ063tgETa7uwiVqwOstVzoKxwzBqoh3lElpv1YIetIs8pok0oTqAPKbBYaqdPAGTAJXkBzjjktMLU0GOh4lsC5Gy1XX0eGhRbzuejTLkaSnBj/bWvGV/EYsXZMQM4RwyzndhGa99YX4TO0YhwLSABHrvpA== X-MS-Exchange-CrossTenant-Network-Message-Id: 58dffd93-518d-4ba4-19a8-08d870fc22c3 X-MS-Exchange-CrossTenant-AuthSource: BN8PR18MB2386.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 11:19:09.4573 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Hd3jA8Kpr0kDK26TUEGQJPYfx3bFHJP03cCHcUA26ZnL+yAreMI9mvvG5E6om4Dd9k9nja/nYdwyyzIZzks00A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR18MB2531 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-15_07:2020-10-14, 2020-10-15 signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH v6 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" On Thu, Oct 15, 2020 at 11:38:13AM +0100, Ciara Power wrote: > External Email > > ---------------------------------------------------------------------- > 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 updated to the vector version if supported, and > if it is within the max SIMD bitwidth 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. > --- Acked-by: Nithin Dabilpuram > 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 > index 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 = 1; > } > *lpm_p = ip4_lookup_nm.lpm_tbl[graph->socket]; > + > +#if defined(__ARM_NEON) || defined(RTE_ARCH_X86) > + if (rte_get_max_simd_bitwidth() >= RTE_SIMD_128) > + node->process = ip4_lookup_node_process_vec; > +#endif > + > node_dbg("ip4_lookup", "Initialized ip4_lookup node"); > > return 0; > } > > static struct rte_node_register ip4_lookup_node = { > - .process = ip4_lookup_node_process, > + .process = ip4_lookup_node_process_scalar, > .name = "ip4_lookup", > > .init = 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 >