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 15DDFA0547; Wed, 12 Oct 2022 10:58:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4E2742D86; Wed, 12 Oct 2022 10:58:01 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 9FA6342D6E for ; Wed, 12 Oct 2022 10:58:00 +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 29C8f2SC011100 for ; Wed, 12 Oct 2022 01:57:59 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3k5t92r1vu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 12 Oct 2022 01:57:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aKrxst6WL6XPwZmn0swdAF/MY2Tfv3Ztis4m4rWyXQ6b+z4WmB5ahef1U+BdIX5PRpRunaOZDg/ReQSKlidk+bpK0p5Zl1AwdPSwBUuwtJGTeKRHWuUBwzQ6UrVGJErd51ccRs+yMMrReIPVr4p9p3Pn2ioxMlCijQw4V67uiCEVbb/Nvu1PATYZcGKZ4l2/vN5qcrzUmWoaYBI/P4kOk6gLGgdyPcbNe5BdRzUiH8w8mICmBzSptLoFuqk7fy5a2BKugbgd1+HOVlDLonL3zvd0hITU1J7vcoTCrLBx0WV5WysRbGdBlAgBr9M6Oo/RECcAHNT6zJcMS0Wk35Daxg== 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=lFmKfz1Uc7ACBldSu2oEv/r57mpryeK6AZbXgYFgGqY=; b=d5x9xyug+/a60ikQMTcEoeqIVKxleITSglkhjKiaGf0O8b9EcsuKhZGOTXPBVQZA52RqoyOw31XuntTfO5hMBJ1FL4s0OavrJIq7Cezc840v8Yx9tkzK35asRI9QMh18XH9jblFXOY6lqT7KOfjo0wOccCp+I8nIMhpYHBXuP91DX1DiqhzE+LuyGCiL9PD3KZnth+m4aGlkQpqervR+wYT2pDUQaC2sdBA/b7yzr01acKw2yp1MKBZoUx0bxYTvz0qlEyLI/y0riWJW5aaMqFuMLlqKXfLLHEnq5jpJj8QFhZE80eF8yJGvge9/j0HGnbrNmi+xFIn+rEkW/AIPMg== 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=lFmKfz1Uc7ACBldSu2oEv/r57mpryeK6AZbXgYFgGqY=; b=OjYK1ilHcl7iP67gsiBfz6iXYS8kcWZzTxKSLL1C82K+7LHrUBvK/lf7zMEKVB+ybYlBml6t/xDnR1dY1A/8DPkEJ7danHxRm0RLCD2t01edrWRYzbyD3Lib1KuS+QohxNuX9dUv65M17sQ6u83crNYKy2wHqigEr7Ct0q2Jb2o= Received: from PH0PR18MB4425.namprd18.prod.outlook.com (2603:10b6:510:ef::13) by SJ0PR18MB5038.namprd18.prod.outlook.com (2603:10b6:a03:43e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Wed, 12 Oct 2022 08:57:55 +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.5709.015; Wed, 12 Oct 2022 08:57:55 +0000 From: Shijith Thotton To: Pavan Nikhilesh Bhagavatula , Jerin Jacob Kollanukkaran CC: "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula Subject: RE: [EXT] [PATCH v5 5/5] examples/l3fwd: use em vector path for event vector Thread-Topic: [EXT] [PATCH v5 5/5] examples/l3fwd: use em vector path for event vector Thread-Index: AQHY3Vn+esrbKk1BdEihPZMNGcFUza4Kdm6Q Date: Wed, 12 Oct 2022 08:57:55 +0000 Message-ID: References: <20221011090805.3602-1-pbhagavatula@marvell.com> <20221011101207.4489-1-pbhagavatula@marvell.com> <20221011101207.4489-5-pbhagavatula@marvell.com> In-Reply-To: <20221011101207.4489-5-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_|SJ0PR18MB5038:EE_ x-ms-office365-filtering-correlation-id: 12370b08-4294-471a-47e7-08daac2fdab0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NYOTM4bzoTQfPtEINfJ1R3pHYJMD13zZwAF4/3L+jCyFNi8EPFOt+jVmOskSARhq5IFeFonP07kac8iq3dDMo+Gf3Q/yth6dNkysXvIGFttDudMe4eoc0ex1cTKIsleg5l5NqezPKMJ/gkej+NABAgET5/DNGBplE1/Oc4IrtBNodhPFQzom40ktjQTD9ZLTgNrnqi3xYFS91LC4HkuWI5knBxyylwpHAnhanNyO4ycky+/qlfWM8IBE5cIDvlXL2vtlPJLkG7TnHbss8IP6r7AjTv/woaOL8d9ieq1COHgPU86auGKd0p3Kl03xES9iyPxRoUgVIbYUK9w3k5to3+uVUcI2CCBs2HJuHz23IjshioYRqoBIAxSpi0SSknMN0Tg+4Wt+iSzhdqK9BzNpk0LoN4omS9aVQV9IEcf5lGKQfOe10PpgKyaNB2pcFuHvkLVjtJYGh3s8csMSWqMTWnKa6RaPRIYfyQYE6vTo7jOeGX4eoLvOcNWc+YCD/T3wMT0IIAuxOlj69ByTajG4/LoJZlj81ZN+nXlP0GNs/nweBG9LmMuJaHaOp3PWplB78DjzsdVtq4lDFE2Q+FI93bDoH++As7fUTjvwYXhLptLrNYiQlaPm/LXQ88jESTLKeOhOfANpfBd/8SSDg8rMLrQrSv+4yNRbdW5o8LJxY7m/2K8w/NchmDPJ36eCau9uMF47Sq4RZBwMqC53jxz1cx1Bf5QgoMjUQWwsl/jw8ZwzsFEB1DxqT0YERsfbdDiTjYKtX/QSeWEqIwIXFMRw8g== 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)(346002)(366004)(376002)(136003)(396003)(39860400002)(451199015)(26005)(7696005)(6506007)(122000001)(38100700002)(66556008)(316002)(55016003)(8676002)(66446008)(66946007)(71200400001)(76116006)(4326008)(64756008)(66476007)(38070700005)(86362001)(33656002)(186003)(83380400001)(478600001)(2906002)(54906003)(107886003)(5660300002)(41300700001)(8936002)(9686003)(6636002)(52536014)(110136005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?f4L0PuTDdQg++583E1RXbzRCJzsog5gtgSdgE/uP5XL1ZGPUHQiKkkXfXceZ?= =?us-ascii?Q?8MJz0pHU3O+m1KDmTJC5r6N/l720tfioVdmAn7zPHz45yMcCLXuvg9rOK9F7?= =?us-ascii?Q?yCXKZ+pjtMrRwPdt5Gyk3JHV1eCWMFgDh0bY3OKCSvW8ZwDRAtDcSou2RPxo?= =?us-ascii?Q?nxG3PXTPR3tuoGPnPkli6QFPc245ThVmxgBAb+H5lo1aaysWdhsgQbq/4XQG?= =?us-ascii?Q?AzPXnMAjGnx82doJYdVfHRt8zZPpo38MMsFs+dEZY5lw8216llwT8GLZbx9H?= =?us-ascii?Q?Y0ID155vsFq5B0FttIW0nOOTYqq5NKQ0ho6Q6bG9WuS+X1GuwvR1h7WjH2sn?= =?us-ascii?Q?nBrpH+b278L/hyYfYWWjtS8Vq5XkYTluVhW1SUmTUkoqeCgCycmuoMcTyvQt?= =?us-ascii?Q?pKkuHA0NOf/KZpOKzUd+9HiKHoyPXMBMfFVt3ZOOw7TL/uEt4cHiEBPXni39?= =?us-ascii?Q?Y39rUn9bzDfLZ7TIAEqUnBAGyes9J6E7eHqPQID4PnJ/rUJTyB4U5u2ZzkcI?= =?us-ascii?Q?WuJobceKNDuPY+Zq1WJEEhWHBB2nbSqoP1+BQ/6/hwcXYWrtNs33rOlA/u5s?= =?us-ascii?Q?4qjjiQ71EH653QMSfYLQvcMaNCF09RwZ6aL/pJC6J13UuOiaD43pIyMf/Vu1?= =?us-ascii?Q?0W/+f7qxBBBKA8m0kAVqyx3rrxADlxsoCS0FV94o5+7AmLG04UZOz4mcAqiq?= =?us-ascii?Q?QYZoeTSDBCzOY45JSfOJ/bAK304ZGdspp/hIf1lHaLNfTkvjqxg6d2zBMipX?= =?us-ascii?Q?lUXYzjF++ZpqVeg5AXnMNkkSX2Ko6ByU18dYkpvNi9iYf29tJVQT6zaB46tM?= =?us-ascii?Q?hgCZg3IAynZwdu1eYkrbSTJWvea232B0XSrS7rvfKJgtqjhu1uP+NoHiTYJ8?= =?us-ascii?Q?qX+x0NJvCPIN0xiM/EE/y6lfcqgZhML8NFSxwNoldsXBq+9F+wmjpVIMZluC?= =?us-ascii?Q?rZCCkxkYMVBxTRjTBC1iwjpGRbWJUyJf8l6xqTURL+1tE1L6Fiw+3MJlnbUq?= =?us-ascii?Q?3w4tsqR/nXWgxbJDzE9xw3uQhYq9YogVgCor+ZS8iQjzldIKS2ouPQ+veGph?= =?us-ascii?Q?QZ8iVwAWcXATGNDNFX5qqk0boJgMuxeRqNO5ByOslsu1/+XqJeJEd3Jan0JU?= =?us-ascii?Q?tHiIZGMo3bdEFQQAlozCGN51YvhAWFHk8EJjljIjTvndVTp4wPipbn0ugP3/?= =?us-ascii?Q?UKkPq1X2BqWPCJCV4N6xB9WXImadU7LWwboTWUwnxy62uCJx9woScRJlIP2A?= =?us-ascii?Q?S1DPppxHwIPHJs7cDA/KQAGI6b5Nb/zZXoWyq2mANyyKk7dZgEdXEuNvQuKi?= =?us-ascii?Q?721yldgtgvqrDS3WNy50KxgtkjDujwoVcjWDLKtm5o02UJc6+XMvPVNRVESW?= =?us-ascii?Q?PguCoLK553tkJ1PfixGeTSYkMds1NcbxsAXduztq6sjserE34OSb19qoFkgS?= =?us-ascii?Q?j9xhkhhu22+Hv0ntWcFGRzHcwMNGUizo6/5WNPRopdpGbCO5B9bhcSX6pGeX?= =?us-ascii?Q?cRAdiZt0t1mRkK48Jh9/HAt30zP5UqKSqg8+PSk+xmTDZMmIXmqojP+/eF6k?= =?us-ascii?Q?Gqzjj5BNh3/YvCK+G3ZSOu4YoKh5dEOk1BR2qCYk?= 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: 12370b08-4294-471a-47e7-08daac2fdab0 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2022 08:57:55.8616 (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: Z73QdPj0TPR3sKDndrU71zeJTwcezQKHV70fy2skTJzrJR9Yyp32I40VE7kBVPFDFqZiJPDKcnaJu7Wm41W37w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR18MB5038 X-Proofpoint-GUID: b71WiMBMaXEwYFKh3wSurigO3TIJvx6m X-Proofpoint-ORIG-GUID: b71WiMBMaXEwYFKh3wSurigO3TIJvx6m 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-12_04,2022-10-11_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 >From: Pavan Nikhilesh > >Use em vector path to process event vector. > >Signed-off-by: Pavan Nikhilesh >--- > examples/l3fwd/l3fwd_em.c | 13 +++-- > examples/l3fwd/l3fwd_em.h | 29 +++++------ > examples/l3fwd/l3fwd_em_hlm.h | 72 +++++----------------------- > examples/l3fwd/l3fwd_em_sequential.h | 25 ++++++---- > examples/l3fwd/l3fwd_event.h | 21 -------- > 5 files changed, 48 insertions(+), 112 deletions(-) > >diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c >index a203dc9e46..35de31157e 100644 >--- a/examples/l3fwd/l3fwd_em.c >+++ b/examples/l3fwd/l3fwd_em.c >@@ -860,10 +860,15 @@ em_event_loop_vector(struct l3fwd_event_resources >*evt_rsrc, > int i, nb_enq =3D 0, nb_deq =3D 0; > struct lcore_conf *lconf; > unsigned int lcore_id; >+ uint16_t *dst_ports; > > if (event_p_id < 0) > return; > >+ dst_ports =3D rte_zmalloc("", sizeof(uint16_t) * evt_rsrc->vector_size, >+ RTE_CACHE_LINE_SIZE); >+ if (dst_ports =3D=3D NULL) >+ return; > lcore_id =3D rte_lcore_id(); > lconf =3D &lcore_conf[lcore_id]; > >@@ -885,13 +890,12 @@ em_event_loop_vector(struct l3fwd_event_resources >*evt_rsrc, > } > > #if defined RTE_ARCH_X86 || defined __ARM_NEON >- l3fwd_em_process_event_vector(events[i].vec, lconf); >+ l3fwd_em_process_event_vector(events[i].vec, lconf, >+ dst_ports); > #else > l3fwd_em_no_opt_process_event_vector(events[i].vec, >- lconf); >+ lconf, dst_ports); > #endif >- if (flags & L3FWD_EVENT_TX_DIRECT) >- event_vector_txq_set(events[i].vec, 0); > } > > if (flags & L3FWD_EVENT_TX_ENQ) { >@@ -915,6 +919,7 @@ em_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_ports); > } > > int __rte_noinline >diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h >index fe2ee59f6a..7d051fc076 100644 >--- a/examples/l3fwd/l3fwd_em.h >+++ b/examples/l3fwd/l3fwd_em.h >@@ -100,7 +100,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t >portid, > } > } > >-static __rte_always_inline void >+static __rte_always_inline uint16_t > l3fwd_em_simple_process(struct rte_mbuf *m, struct lcore_conf *qconf) > { > struct rte_ether_hdr *eth_hdr; >@@ -117,6 +117,8 @@ l3fwd_em_simple_process(struct rte_mbuf *m, struct >lcore_conf *qconf) > m->port =3D l3fwd_em_handle_ipv6(m, m->port, eth_hdr, qconf); > else > m->port =3D BAD_PORT; >+ >+ return m->port; > } > > /* >@@ -179,7 +181,8 @@ l3fwd_em_no_opt_process_events(int nb_rx, struct >rte_event **events, > > static inline void > l3fwd_em_no_opt_process_event_vector(struct rte_event_vector *vec, >- struct lcore_conf *qconf) >+ struct lcore_conf *qconf, >+ uint16_t *dst_ports) > { > struct rte_mbuf **mbufs =3D vec->mbufs; > int32_t i; >@@ -188,30 +191,20 @@ l3fwd_em_no_opt_process_event_vector(struct >rte_event_vector *vec, > for (i =3D 0; i < PREFETCH_OFFSET && i < vec->nb_elem; i++) > rte_prefetch0(rte_pktmbuf_mtod(mbufs[i], void *)); > >- /* Process first packet to init vector attributes */ >- l3fwd_em_simple_process(mbufs[0], qconf); >- if (vec->attr_valid) { >- if (mbufs[0]->port !=3D BAD_PORT) >- vec->port =3D mbufs[0]->port; >- else >- vec->attr_valid =3D 0; >- } >- > /* > * Prefetch and forward already prefetched packets. > */ >- for (i =3D 1; i < (vec->nb_elem - PREFETCH_OFFSET); i++) { >+ for (i =3D 0; i < (vec->nb_elem - PREFETCH_OFFSET); i++) { > rte_prefetch0( > rte_pktmbuf_mtod(mbufs[i + PREFETCH_OFFSET], void >*)); >- l3fwd_em_simple_process(mbufs[i], qconf); >- event_vector_attr_validate(vec, mbufs[i]); >+ dst_ports[i] =3D l3fwd_em_simple_process(mbufs[i], qconf); > } > > /* Forward remaining prefetched packets */ >- for (; i < vec->nb_elem; i++) { >- l3fwd_em_simple_process(mbufs[i], qconf); >- event_vector_attr_validate(vec, mbufs[i]); >- } >+ for (; i < vec->nb_elem; i++) >+ dst_ports[i] =3D l3fwd_em_simple_process(mbufs[i], qconf); >+ >+ process_event_vector(vec, dst_ports); > } > > #endif /* __L3FWD_EM_H__ */ >diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h >index 12b997e477..2e11eefad7 100644 >--- a/examples/l3fwd/l3fwd_em_hlm.h >+++ b/examples/l3fwd/l3fwd_em_hlm.h >@@ -332,70 +332,20 @@ l3fwd_em_process_events(int nb_rx, struct rte_event >**ev, > > static inline void > l3fwd_em_process_event_vector(struct rte_event_vector *vec, >- struct lcore_conf *qconf) >+ struct lcore_conf *qconf, uint16_t *dst_port) > { >- struct rte_mbuf **mbufs =3D vec->mbufs; >- uint16_t dst_port[MAX_PKT_BURST]; >- int32_t i, j, n, pos; >- >- for (j =3D 0; j < EM_HASH_LOOKUP_COUNT && j < vec->nb_elem; j++) >- rte_prefetch0( >- rte_pktmbuf_mtod(mbufs[j], struct rte_ether_hdr *) + 1); >+ uint16_t i; > > if (vec->attr_valid) >- vec->port =3D em_get_dst_port(qconf, mbufs[0], mbufs[0]->port); >- >- n =3D RTE_ALIGN_FLOOR(vec->nb_elem, EM_HASH_LOOKUP_COUNT); >- for (j =3D 0; j < n; j +=3D EM_HASH_LOOKUP_COUNT) { >- uint32_t pkt_type =3D >- RTE_PTYPE_L3_MASK | RTE_PTYPE_L4_TCP | >RTE_PTYPE_L4_UDP; >- uint32_t l3_type, tcp_or_udp; >- >- for (i =3D 0; i < EM_HASH_LOOKUP_COUNT; i++) >- pkt_type &=3D mbufs[j + i]->packet_type; >- >- l3_type =3D pkt_type & RTE_PTYPE_L3_MASK; >- tcp_or_udp =3D pkt_type & (RTE_PTYPE_L4_TCP | >RTE_PTYPE_L4_UDP); >- >- for (i =3D 0, pos =3D j + EM_HASH_LOOKUP_COUNT; >- i < EM_HASH_LOOKUP_COUNT && pos < vec->nb_elem; >- i++, pos++) { >- rte_prefetch0(rte_pktmbuf_mtod(mbufs[pos], >- struct rte_ether_hdr *) + >- 1); >- } >- >- if (tcp_or_udp && (l3_type =3D=3D RTE_PTYPE_L3_IPV4)) { >- em_get_dst_port_ipv4xN_events(qconf, &mbufs[j], >- &dst_port[j]); >- } else if (tcp_or_udp && (l3_type =3D=3D RTE_PTYPE_L3_IPV6)) { >- em_get_dst_port_ipv6xN_events(qconf, &mbufs[j], >- &dst_port[j]); >- } else { >- for (i =3D 0; i < EM_HASH_LOOKUP_COUNT; i++) { >- mbufs[j + i]->port =3D >- em_get_dst_port(qconf, mbufs[j + i], >- mbufs[j + i]->port); >- process_packet(mbufs[j + i], >- &mbufs[j + i]->port); >- event_vector_attr_validate(vec, mbufs[j + i]); >- } >- continue; >- } >- processx4_step3(&mbufs[j], &dst_port[j]); >- >- for (i =3D 0; i < EM_HASH_LOOKUP_COUNT; i++) { >- mbufs[j + i]->port =3D dst_port[j + i]; >- event_vector_attr_validate(vec, mbufs[j + i]); >- } >- } >- >- for (; j < vec->nb_elem; j++) { >- mbufs[j]->port =3D >- em_get_dst_port(qconf, mbufs[j], mbufs[j]->port); >- process_packet(mbufs[j], &mbufs[j]->port); >- event_vector_attr_validate(vec, mbufs[j]); >- } >+ l3fwd_em_process_packets(vec->nb_elem, vec->mbufs, >dst_port, >+ vec->port, qconf, 1); >+ else >+ for (i =3D 0; i < vec->nb_elem; i++) >+ l3fwd_em_process_packets(1, &vec->mbufs[i], >+ &dst_port[i], >+ vec->mbufs[i]->port, qconf, 1); >+ >+ process_event_vector(vec, dst_port); > } > > #endif /* __L3FWD_EM_HLM_H__ */ >diff --git a/examples/l3fwd/l3fwd_em_sequential.h >b/examples/l3fwd/l3fwd_em_sequential.h >index d2f75edb8a..067f23889a 100644 >--- a/examples/l3fwd/l3fwd_em_sequential.h >+++ b/examples/l3fwd/l3fwd_em_sequential.h >@@ -113,39 +113,48 @@ l3fwd_em_process_events(int nb_rx, struct rte_event >**events, > > for (i =3D 1, j =3D 0; j < nb_rx; i++, j++) { > struct rte_mbuf *mbuf =3D events[j]->mbuf; >+ uint16_t port; > > if (i < nb_rx) { > rte_prefetch0(rte_pktmbuf_mtod( > events[i]->mbuf, > struct rte_ether_hdr *) + 1); > } >+ port =3D mbuf->port; > mbuf->port =3D em_get_dst_port(qconf, mbuf, mbuf->port); > process_packet(mbuf, &mbuf->port); >+ if (mbuf->port =3D=3D BAD_PORT) >+ mbuf->port =3D port; > } > } > > static inline void > l3fwd_em_process_event_vector(struct rte_event_vector *vec, >- struct lcore_conf *qconf) >+ struct lcore_conf *qconf, uint16_t *dst_ports) > { >+ const uint8_t attr_valid =3D vec->attr_valid; > struct rte_mbuf **mbufs =3D vec->mbufs; > int32_t i, j; > > rte_prefetch0(rte_pktmbuf_mtod(mbufs[0], struct rte_ether_hdr *) + 1); > >- if (vec->attr_valid) >- vec->port =3D em_get_dst_port(qconf, mbufs[0], mbufs[0]->port); >- > for (i =3D 0, j =3D 1; i < vec->nb_elem; i++, j++) { > if (j < vec->nb_elem) > rte_prefetch0(rte_pktmbuf_mtod(mbufs[j], > struct rte_ether_hdr *) + > 1); >- mbufs[i]->port =3D >- em_get_dst_port(qconf, mbufs[i], mbufs[i]->port); >- process_packet(mbufs[i], &mbufs[i]->port); >- event_vector_attr_validate(vec, mbufs[i]); >+ dst_ports[i] =3D em_get_dst_port(qconf, mbufs[i], >+ attr_valid ? vec->port : >+ mbufs[i]->port); > } >+ j =3D RTE_ALIGN_FLOOR(vec->nb_elem, FWDSTEP); >+ >+ for (i =3D 0; i !=3D j; i +=3D FWDSTEP) >+ processx4_step3(&vec->mbufs[i], &dst_ports[i]); >+ for (; i < vec->nb_elem; i++) >+ process_packet(vec->mbufs[i], &dst_ports[i]); >+ >+ process_event_vector(vec, dst_ports); > } > > #endif /* __L3FWD_EM_SEQUENTIAL_H__ */ >diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h >index 3fe38aada0..e21817c36b 100644 >--- a/examples/l3fwd/l3fwd_event.h >+++ b/examples/l3fwd/l3fwd_event.h >@@ -103,27 +103,6 @@ process_dst_port(uint16_t *dst_ports, uint16_t >nb_elem) > } > #endif > >-static inline void >-event_vector_attr_validate(struct rte_event_vector *vec, struct rte_mbuf >*mbuf) >-{ >- /* l3fwd application only changes mbuf port while processing */ >- if (vec->attr_valid && (vec->port !=3D mbuf->port)) >- vec->attr_valid =3D 0; >-} >- >-static inline void >-event_vector_txq_set(struct rte_event_vector *vec, uint16_t txq) >-{ >- if (vec->attr_valid) { >- vec->queue =3D txq; >- } else { >- int i; >- >- for (i =3D 0; i < vec->nb_elem; i++) >- rte_event_eth_tx_adapter_txq_set(vec->mbufs[i], txq); >- } >-} >- > static inline uint16_t > filter_bad_packets(struct rte_mbuf **mbufs, uint16_t *dst_port, > uint16_t nb_pkts) >-- >2.25.1 =20 For the series: Acked-by: Shijith Thotton