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 9CDFBA0560; Mon, 17 Oct 2022 14:06:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D7ED40A84; Mon, 17 Oct 2022 14:06:42 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id C9C1240E5A for ; Mon, 17 Oct 2022 14:06:40 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29GNeGni003016; Mon, 17 Oct 2022 05:06:38 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3k7vcp5yme-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Oct 2022 05:06:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KZGE9kOtDnz3AGBgRddTFK/WErPrSWGjPP1gkxaYlL1m/oyNNkIu2ALIp79Lw7vtVUh7U26JRQiRPV0TQUPy9cZuuk7K1xaBq4XE+TfxFUJG1oktCSyboebmAgUqMK9+Goa7PjiqyqjcZaxxJRi9x7fzse2F0ggu7+fWsfAp2gYduCtA5ZdScBQTXrzM9/JnZtjNCf+i/3ulOAmJPrr5JImXz5d/rwjV2d2USGMKh9+m3ls3PF3cqN7xB9NN/TLB3wsLnBWEgV384tZ7CSEJK6UEsF1MyW3Mp2qEA+2lFHuDFfMfpk3G6oIKicBrS310L3at7t5VDoEeq0Q4lxMGLA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v9Y3Dw9hva5o0eQTHTZsoeEF5X7jfkfc2402wVJkOa8=; b=Q3RWS2YUxZx0FYvp/5UAQd4rh22xIdY9EjiBmBHvJIH0HPkTlG++2EGAG25NVWBw8ICX4asXqHPIlvqZG/+1W05oMzbn9cOCULkZPZG89lR6RhafXmRP0mPpEu97WQAWYzZgjTfiEZMKyGHHRB0d9REjQghqPMfwqZGz5c6PyjQyxYx05BzAcSRqvzsOjyqFFHEQYMKCT79yu/IH1EuYRpw46RcNk54r5iTSyaef/mH1R3XN2fDigZjzgSuMD7OcIqtMOaByQlKKvokXp46yaBl6sEZCtBLuAoTLYG1kLGwO2GcWMqZyMbYpVWZnstNFLFJwjpUhEQ/8EDm7nlE07A== 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=v9Y3Dw9hva5o0eQTHTZsoeEF5X7jfkfc2402wVJkOa8=; b=n7Q+uoYpR/v/sg2m/j0Igyg9GQ30S5CfFF+bioLznDxvUlDiDv/Gx3Bsy3UtA8sPE5eftqHPvEIo2UCkAz3lixya7seUyCq4iLiKFbNtStnEjJHUhpOa1MXBSo4jVoSRQYWPCL2g8rHBxCo5ZFSIyH6L68jN1QJzQaS9kR9ZQt0= Received: from PH0PR18MB4425.namprd18.prod.outlook.com (2603:10b6:510:ef::13) by SA1PR18MB4565.namprd18.prod.outlook.com (2603:10b6:806:1e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Mon, 17 Oct 2022 12:06:36 +0000 Received: from PH0PR18MB4425.namprd18.prod.outlook.com ([fe80::16f8:9275:a441:cfec]) by PH0PR18MB4425.namprd18.prod.outlook.com ([fe80::16f8:9275:a441:cfec%6]) with mapi id 15.20.5723.033; Mon, 17 Oct 2022 12:06:36 +0000 From: Shijith Thotton To: Pavan Nikhilesh Bhagavatula , Jerin Jacob Kollanukkaran , David Christensen , Ruifeng Wang , Bruce Richardson , Konstantin Ananyev CC: "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula Subject: RE: [EXT] [PATCH v5 3/5] examples/l3fwd: use lpm vector path for event vector Thread-Topic: [EXT] [PATCH v5 3/5] examples/l3fwd: use lpm vector path for event vector Thread-Index: AQHY3Vn4+UwjrLNAdkOWGH2P1fuoiK4Shwew Date: Mon, 17 Oct 2022 12:06:36 +0000 Message-ID: References: <20221011090805.3602-1-pbhagavatula@marvell.com> <20221011101207.4489-1-pbhagavatula@marvell.com> <20221011101207.4489-3-pbhagavatula@marvell.com> In-Reply-To: <20221011101207.4489-3-pbhagavatula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB4425:EE_|SA1PR18MB4565:EE_ x-ms-office365-filtering-correlation-id: ed3f2033-f5c5-44ee-bd07-08dab0380a4b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Fcb1tGbj7Qooer77fnsBQV6ECceozXrfpLK5kxTDUG+vZNrBRFviizB8TxqTNgovMMTK1XV3rndaPnvabwLiELMn8V+UmmSaUpKw5kF0vzRkvX83aNouCEA4zah1oFPpeOq4GbBh/YqzFMypAMJ+IYbUWog5+6nvAfL9vLm5U3jIwqO7yq5tmfpeEvQhdGNR8ZxNteFnktPb5E+OPNHNz52cxwzPe7+J//ISKPU/25r5Zcc1rwHUP0qLEzx6Bs0lt812qK76C8GvnJEub1TkFYa9xySnp6NAPUZyHW5EoULo0ljqHeNklnc6WlxvFG2lGMLDBtbtfhvwu++goAp2VvY57NDpJKGkvHMLz+5+6fwBSfANJ/mMpsPLPkrCZrAKQKdzGJapGse6UZ1P5oolxX0PikYpDfKza6AzhWe4lMVJaCYsPjFUnblssnosDBLlWD5Fx/7VhVZ/7k85s/2ycglAfZ91BCUPa45T2zv0ztwVMmIQ3FTEFINrmi7mccDo5HFL5HlAaRuh4/lcKo41g5OKJ3R4woXVF0H+QnqtpvAk4GnHW1tWOXWsnl6RsY976lu3y7a1wtbR2y9zv6C4JGzLbrgdRs0VS1MSn6k/39KelDJiKaD24EtQz7D5857rRylQe6AtA+XMkWF5tLVH7Czub9dh8meW0k+vmpl4We/b7XkC/0qbWlKb7J5eghB6kMlj8vMBvF6B4zVIayX90Fc1wKfS8Dk1eNPkE/vhW3R9pi4/hcsSUYNR+UwnDG8veJ+ByVUUw2jVB6bKikglNQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4425.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(366004)(346002)(376002)(39860400002)(396003)(451199015)(6506007)(54906003)(110136005)(316002)(8936002)(5660300002)(55016003)(86362001)(64756008)(52536014)(9686003)(33656002)(186003)(26005)(2906002)(66946007)(76116006)(4326008)(107886003)(8676002)(66446008)(83380400001)(7696005)(66556008)(66476007)(41300700001)(122000001)(478600001)(38070700005)(38100700002)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XCUN76GHhCgj7cfotwLtgt9xgL3lGYgiPBejXkX7HOExVEfGwp7lzhRf367E?= =?us-ascii?Q?K2nrw+VozbAzkL337K3jx35vVT/xzxF9HwwMBuNT8fCehXSz1rGqGp7PYKfH?= =?us-ascii?Q?SgAhWhcReQlVzDwiaby40cB54q+6hKLVaifvTbH2VFXUzbxPKzs/fhGIVywU?= =?us-ascii?Q?xIfZ5aQlfAc3F635UBhUrqci2TvsZ4dHq470WUZUclwo8Gqby1FwRTcnktUl?= =?us-ascii?Q?Pq0UOpKulZV7HbaioAJqnNm/zqjEG7Re+A/o54DJl4vXoOUzFxwDF4rfkgCJ?= =?us-ascii?Q?VFw+hxdyZEE6ATzPjpStLtE1aO50EphZqg/SiLFcUDbBYr8hPnGb8svrhow+?= =?us-ascii?Q?E/71gNHlHPRG83de6qZVgcQT1uNmpWnz+9H47igzsvItuwxY2UL5Ye06B6G4?= =?us-ascii?Q?mRoo3pw1wQ8prMuCQICof6uOzJu4QoL1BWeMv263lIaWWGxMqRDbO9qaEbjt?= =?us-ascii?Q?mtLx96Lnth7z5DxCOst8l0Mm/fjU1luNdhAH9RpD50qL/ZrfXpzoukWDNb2Y?= =?us-ascii?Q?azvfpCIMUyn4UjvpDrj0hnSJ01TFX3A9lUOSi6TpeQ23YDq2Y26gPDq8dVwd?= =?us-ascii?Q?sNkogqlPv0GbO0eRAhJBuwcuPP05lsGd9+IXt4/ts1+noUear+haZ9EE/7wk?= =?us-ascii?Q?1NOsq9uDAEBz3I5N0ptPyBZfiZ4jUwRC2ORQJg9WFG2BOyNvIRqapWA5tyQi?= =?us-ascii?Q?SdeI+74dQ2bPOisUO4DS1gBGCAtO3PSXQQZuTGpLDVL7jsRvskuGIREZWYUw?= =?us-ascii?Q?JFX5FAqF9XMUlzs2yq0gvHrRJhKYNWgXWFT4ZjHGcJXRqzMl5m3yFkoZ167C?= =?us-ascii?Q?Ct6pJ2BZDWOoT+IMrJPjis4u9QASkDj5DiIdt1/swZ+L7GipVStC4CtTn9/d?= =?us-ascii?Q?117P3TuiZZRC+EyIIANvA8jq2qHAvtQQdwAbWh5sWTkQuuav1Q6WbYxxj9Tv?= =?us-ascii?Q?egeMdVxB+oMH9VCKXXEA9elWyp0p57vM2Eeu/r+ON8weW7Lt0/8L0gwb1dih?= =?us-ascii?Q?dWHiZnYvLcnGXsR9D9tDvWj8BccCiMCMbnhZaoZKqjAsxGO4TIBhmc8Kd4Hv?= =?us-ascii?Q?Rqwl/g2R/+/Zzl/ugHl7Gq5bb1ZQ/853V1piPvXTI58pVZWIhP8uSPud1Hcz?= =?us-ascii?Q?nUBQFIEeakD0fwpM7dtlV9AejB4sqYqu8lIV5tyfomhn8dYM0IjHIi6jX8Kb?= =?us-ascii?Q?9pwf60lo5/xVUyZ+fNEHQcHA+F6/bSXQBAhRlzzAEExvOYTs6x9bjODW+J8e?= =?us-ascii?Q?37WIwoTfjXiSB7ZLvWMqMakKcJZfI+wK6I5KXIivy8bqLljj4zzEX7I5Bqr3?= =?us-ascii?Q?xwZG8pue/udU4J/+x+KvbkuB3dpTCvEgacVWmT6Xl2TNQosWnyrxkK/1ADGn?= =?us-ascii?Q?h9cSuB0bPzCH5PtPaWJiC5SUkJsWSvbKqqvC/SaTGmv6IDXevFw7RdHZKaSG?= =?us-ascii?Q?ctq4hXbUtDnK+1gFS77LSu++wbJ/dj0pYFOm3frmFS6QUlRjPgXJ96eoqsfy?= =?us-ascii?Q?WzQ+ZPnUtWzJjv0eAPCK2Qq1r9db0yE/9rx//YMFzjCckQadHmtb9B7ZoXt8?= =?us-ascii?Q?mDrj6CViezuFTm7MLOKwC34aLdTP9aDWa3nfe8OV?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4425.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed3f2033-f5c5-44ee-bd07-08dab0380a4b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2022 12:06:36.3114 (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: r56F1gnwTES7YREHt5gsx38qKfHk9ImcRpRBZIByUI0RJZubKw1FV+3MOwXuv6KBcewqSbCWGsJJ6T6VuKUedA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR18MB4565 X-Proofpoint-ORIG-GUID: WbuP5FLQUHdtN0YJeNrv7Qcb73QLqRVb X-Proofpoint-GUID: WbuP5FLQUHdtN0YJeNrv7Qcb73QLqRVb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-17_09,2022-10-17_02,2022-06-22_01 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 > >Use lpm vector path to process event vector. > >Signed-off-by: Pavan Nikhilesh Acked-by: Shijith Thotton >--- > examples/l3fwd/l3fwd_altivec.h | 29 ++++++++++++++ > examples/l3fwd/l3fwd_event.h | 71 >++++++++++++++++++++++++++++++++++ > examples/l3fwd/l3fwd_lpm.c | 39 +++++++++++-------- > examples/l3fwd/l3fwd_neon.h | 47 ++++++++++++++++++++++ > examples/l3fwd/l3fwd_sse.h | 44 +++++++++++++++++++++ > 5 files changed, 214 insertions(+), 16 deletions(-) > >diff --git a/examples/l3fwd/l3fwd_altivec.h b/examples/l3fwd/l3fwd_altivec= .h >index 87018f5dbe..e45e138e59 100644 >--- a/examples/l3fwd/l3fwd_altivec.h >+++ b/examples/l3fwd/l3fwd_altivec.h >@@ -222,4 +222,33 @@ send_packets_multi(struct lcore_conf *qconf, struct >rte_mbuf **pkts_burst, > } > } > >+static __rte_always_inline uint16_t >+process_dst_port(uint16_t *dst_ports, uint16_t nb_elem) >+{ >+ uint16_t i =3D 0, res; >+ >+ while (nb_elem > 7) { >+ __vector unsigned short dp1; >+ __vector unsigned short dp; >+ >+ dp =3D (__vector unsigned short)vec_splats((short)dst_ports[0]); >+ dp1 =3D *((__vector unsigned short *)&dst_ports[i]); >+ res =3D vec_all_eq(dp1, dp); >+ if (!res) >+ return BAD_PORT; >+ >+ nb_elem -=3D 8; >+ i +=3D 8; >+ } >+ >+ while (nb_elem) { >+ if (dst_ports[i] !=3D dst_ports[0]) >+ return BAD_PORT; >+ nb_elem--; >+ i++; >+ } >+ >+ return dst_ports[0]; >+} >+ > #endif /* _L3FWD_ALTIVEC_H_ */ >diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h >index b93841a16f..3fe38aada0 100644 >--- a/examples/l3fwd/l3fwd_event.h >+++ b/examples/l3fwd/l3fwd_event.h >@@ -82,6 +82,27 @@ struct l3fwd_event_resources { > uint64_t vector_tmo_ns; > }; > >+#if defined(RTE_ARCH_X86) >+#include "l3fwd_sse.h" >+#elif defined __ARM_NEON >+#include "l3fwd_neon.h" >+#elif defined(RTE_ARCH_PPC_64) >+#include "l3fwd_altivec.h" >+#else >+static inline uint16_t >+process_dst_port(uint16_t *dst_ports, uint16_t nb_elem) >+{ >+ int i; >+ >+ for (i =3D 0; i < nb_elem; i++) { >+ if (dst_ports[i] !=3D dst_ports[0]) >+ return BAD_PORT; >+ } >+ >+ return dst_ports[0]; >+} >+#endif >+ > static inline void > event_vector_attr_validate(struct rte_event_vector *vec, struct rte_mbuf >*mbuf) > { >@@ -103,7 +124,57 @@ event_vector_txq_set(struct rte_event_vector *vec, >uint16_t txq) > } > } > >+static inline uint16_t >+filter_bad_packets(struct rte_mbuf **mbufs, uint16_t *dst_port, >+ uint16_t nb_pkts) >+{ >+ uint16_t *des_pos, free =3D 0; >+ struct rte_mbuf **pos; >+ int i; >+ >+ /* Filter out and free bad packets */ >+ for (i =3D 0; i < nb_pkts; i++) { >+ if (dst_port[i] =3D=3D BAD_PORT) { >+ rte_pktmbuf_free(mbufs[i]); >+ if (!free) { >+ pos =3D &mbufs[i]; >+ des_pos =3D &dst_port[i]; >+ } >+ free++; >+ continue; >+ } >+ >+ if (free) { >+ *pos =3D mbufs[i]; >+ pos++; >+ *des_pos =3D dst_port[i]; >+ des_pos++; >+ } >+ } > >+ return nb_pkts - free; >+} >+ >+static inline void >+process_event_vector(struct rte_event_vector *vec, uint16_t *dst_port) >+{ >+ uint16_t port, i; >+ >+ vec->nb_elem =3D filter_bad_packets(vec->mbufs, dst_port, vec- >>nb_elem); >+ /* Verify destination array */ >+ port =3D process_dst_port(dst_port, vec->nb_elem); >+ if (port =3D=3D BAD_PORT) { >+ vec->attr_valid =3D 0; >+ for (i =3D 0; i < vec->nb_elem; i++) { >+ vec->mbufs[i]->port =3D dst_port[i]; >+ rte_event_eth_tx_adapter_txq_set(vec->mbufs[i], 0); >+ } >+ } else { >+ vec->attr_valid =3D 1; >+ vec->port =3D port; >+ vec->queue =3D 0; >+ } >+} > > struct l3fwd_event_resources *l3fwd_get_eventdev_rsrc(void); > void l3fwd_event_resource_setup(struct rte_eth_conf *port_conf); >diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c >index 22d7f61a42..5172979c72 100644 >--- a/examples/l3fwd/l3fwd_lpm.c >+++ b/examples/l3fwd/l3fwd_lpm.c >@@ -425,24 +425,27 @@ lpm_event_main_loop_tx_q_burst(__rte_unused void >*dummy) > } > > static __rte_always_inline void >-lpm_process_event_vector(struct rte_event_vector *vec, struct lcore_conf >*lconf) >+lpm_process_event_vector(struct rte_event_vector *vec, struct lcore_conf >*lconf, >+ uint16_t *dst_port) > { > struct rte_mbuf **mbufs =3D vec->mbufs; > int i; > >- /* Process first packet to init vector attributes */ >- lpm_process_event_pkt(lconf, mbufs[0]); >+#if defined RTE_ARCH_X86 || defined __ARM_NEON || defined >RTE_ARCH_PPC_64 > if (vec->attr_valid) { >- if (mbufs[0]->port !=3D BAD_PORT) >- vec->port =3D mbufs[0]->port; >- else >- vec->attr_valid =3D 0; >+ l3fwd_lpm_process_packets(vec->nb_elem, mbufs, vec->port, >+ dst_port, lconf, 1); >+ } else { >+ for (i =3D 0; i < vec->nb_elem; i++) >+ l3fwd_lpm_process_packets(1, &mbufs[i], mbufs[i]->port, >+ &dst_port[i], lconf, 1); > } >+#else >+ for (i =3D 0; i < vec->nb_elem; i++) >+ dst_port[i] =3D lpm_process_event_pkt(lconf, mbufs[i]); >+#endif > >- for (i =3D 1; i < vec->nb_elem; i++) { >- lpm_process_event_pkt(lconf, mbufs[i]); >- event_vector_attr_validate(vec, mbufs[i]); >- } >+ process_event_vector(vec, dst_port); > } > > /* Same eventdev loop for single and burst of vector */ >@@ -458,6 +461,7 @@ lpm_event_loop_vector(struct l3fwd_event_resources >*evt_rsrc, > struct rte_event events[MAX_PKT_BURST]; > int i, nb_enq =3D 0, nb_deq =3D 0; > struct lcore_conf *lconf; >+ uint16_t *dst_port_list; > unsigned int lcore_id; > > if (event_p_id < 0) >@@ -465,7 +469,11 @@ lpm_event_loop_vector(struct l3fwd_event_resources >*evt_rsrc, > > lcore_id =3D rte_lcore_id(); > lconf =3D &lcore_conf[lcore_id]; >- >+ dst_port_list =3D >+ rte_zmalloc("", sizeof(uint16_t) * evt_rsrc->vector_size, >+ RTE_CACHE_LINE_SIZE); >+ if (dst_port_list =3D=3D NULL) >+ return; > RTE_LOG(INFO, L3FWD, "entering %s on lcore %u\n", __func__, lcore_id); > > while (!force_quit) { >@@ -483,10 +491,8 @@ lpm_event_loop_vector(struct l3fwd_event_resources >*evt_rsrc, > events[i].op =3D RTE_EVENT_OP_FORWARD; > } > >- lpm_process_event_vector(events[i].vec, lconf); >- >- if (flags & L3FWD_EVENT_TX_DIRECT) >- event_vector_txq_set(events[i].vec, 0); >+ lpm_process_event_vector(events[i].vec, lconf, >+ dst_port_list); > } > > if (flags & L3FWD_EVENT_TX_ENQ) { >@@ -510,6 +516,7 @@ lpm_event_loop_vector(struct l3fwd_event_resources >*evt_rsrc, > > l3fwd_event_worker_cleanup(event_d_id, event_p_id, events, nb_enq, > nb_deq, 1); >+ rte_free(dst_port_list); > } > > int __rte_noinline >diff --git a/examples/l3fwd/l3fwd_neon.h b/examples/l3fwd/l3fwd_neon.h >index ce515e0bc4..bf365341fb 100644 >--- a/examples/l3fwd/l3fwd_neon.h >+++ b/examples/l3fwd/l3fwd_neon.h >@@ -194,4 +194,51 @@ send_packets_multi(struct lcore_conf *qconf, struct >rte_mbuf **pkts_burst, > } > } > >+static __rte_always_inline uint16_t >+process_dst_port(uint16_t *dst_ports, uint16_t nb_elem) >+{ >+ uint16_t i =3D 0; >+ >+#if defined(RTE_ARCH_ARM64) >+ uint16_t res; >+ >+ while (nb_elem > 7) { >+ uint16x8_t dp =3D vdupq_n_u16(dst_ports[0]); >+ uint16x8_t dp1; >+ >+ dp1 =3D vld1q_u16(&dst_ports[i]); >+ dp1 =3D vceqq_u16(dp1, dp); >+ res =3D vminvq_u16(dp1); >+ if (!res) >+ return BAD_PORT; >+ >+ nb_elem -=3D 8; >+ i +=3D 8; >+ } >+ >+ while (nb_elem > 3) { >+ uint16x4_t dp =3D vdup_n_u16(dst_ports[0]); >+ uint16x4_t dp1; >+ >+ dp1 =3D vld1_u16(&dst_ports[i]); >+ dp1 =3D vceq_u16(dp1, dp); >+ res =3D vminv_u16(dp1); >+ if (!res) >+ return BAD_PORT; >+ >+ nb_elem -=3D 4; >+ i +=3D 4; >+ } >+#endif >+ >+ while (nb_elem) { >+ if (dst_ports[i] !=3D dst_ports[0]) >+ return BAD_PORT; >+ nb_elem--; >+ i++; >+ } >+ >+ return dst_ports[0]; >+} >+ > #endif /* _L3FWD_NEON_H_ */ >diff --git a/examples/l3fwd/l3fwd_sse.h b/examples/l3fwd/l3fwd_sse.h >index 0f0d0323a2..083729cdef 100644 >--- a/examples/l3fwd/l3fwd_sse.h >+++ b/examples/l3fwd/l3fwd_sse.h >@@ -194,4 +194,48 @@ send_packets_multi(struct lcore_conf *qconf, struct >rte_mbuf **pkts_burst, > } > } > >+static __rte_always_inline uint16_t >+process_dst_port(uint16_t *dst_ports, uint16_t nb_elem) >+{ >+ uint16_t i =3D 0, res; >+ >+ while (nb_elem > 7) { >+ __m128i dp =3D _mm_set1_epi16(dst_ports[0]); >+ __m128i dp1; >+ >+ dp1 =3D _mm_loadu_si128((__m128i *)&dst_ports[i]); >+ dp1 =3D _mm_cmpeq_epi16(dp1, dp); >+ res =3D _mm_movemask_epi8(dp1); >+ if (res !=3D 0xFFFF) >+ return BAD_PORT; >+ >+ nb_elem -=3D 8; >+ i +=3D 8; >+ } >+ >+ while (nb_elem > 3) { >+ __m128i dp =3D _mm_set1_epi16(dst_ports[0]); >+ __m128i dp1; >+ >+ dp1 =3D _mm_loadu_si128((__m128i *)&dst_ports[i]); >+ dp1 =3D _mm_cmpeq_epi16(dp1, dp); >+ dp1 =3D _mm_unpacklo_epi16(dp1, dp1); >+ res =3D _mm_movemask_ps((__m128)dp1); >+ if (res !=3D 0xF) >+ return BAD_PORT; >+ >+ nb_elem -=3D 4; >+ i +=3D 4; >+ } >+ >+ while (nb_elem) { >+ if (dst_ports[i] !=3D dst_ports[0]) >+ return BAD_PORT; >+ nb_elem--; >+ i++; >+ } >+ >+ return dst_ports[0]; >+} >+ > #endif /* _L3FWD_SSE_H_ */ >-- >2.25.1