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 384EAA0560; Mon, 17 Oct 2022 14:06:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B0254021E; Mon, 17 Oct 2022 14:06:23 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2203B4021E for ; Mon, 17 Oct 2022 14:06:22 +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 29GNW4Pn018318; Mon, 17 Oct 2022 05:06:19 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3k7vcp5yk6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Oct 2022 05:06:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kGWCEW9phAhXlYNnBXe8/2zxuRv9nuab7kHMNTB/sQEJ2Ky/AqZiglGdfCY4BjV76BStOHlb9N3HpnGIqHevj8zuQxFXQGGgG0HXJbvoom7QRu1M2XO4CYncTZVd1in9Nj2xPUu60qR1VY+MtPyh6TYp6cSzsAjG16yvVgQlJ7G+LU35GXXno5dEXY9Al8YTC1S/1HMpu/ZPyA1dab2ThaCfQNLcEfqIclDwiISB98xiG+XpqDG7KtUZ78qtMSsLCxGWTjxu7RtkWwsezbeIwQ9TlX10kz9f2qLyjM7pvAEYOQHekDP0Fozq/OdN27PQcfpeZVzJl5VHz/RRJ/lQQQ== 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=0ADz4QAhxiSub/dIUIfHlYXx76VmKQGmUYKNwPdVd5I=; b=WzBjbdEgLNnCGZx1GqtWSbV2p+QDr50GK4Oz6WlhxEposuPaLMLxAFyUgwGmwsi5vioQH/2QgOxdPqazRr9R02eFv5GDNNsVGopwY+gLJJQPhO2Yr149CU6dp/vKGVWn4+ADTGgq2wRau/7Zq+1PaZF9xr+hDoXDheEu/FdShG+3BKOL1gLIUo+WUGZyKUf4/rTAwDyeQ6Axv+BGTnrhyKZYnBfe5+I3IMGpUnBlP/UCv8Y9BjsVQiO1w+HqnacoUD3PDXlQP79ElXlNqOKJCzOWUhCT1GwmTBjcaucDYvz+dL8HXBBtCMZs2fC8CBFJWGz3A4jyZylmfZH9d0os/A== 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=0ADz4QAhxiSub/dIUIfHlYXx76VmKQGmUYKNwPdVd5I=; b=itG6xCcVkfqj/yQyhTaz6W64MyFVy9D8lMHYQH9rEtuVx7udj4M+B4BNn0UjRfXE+2lxYUU9tsIRqnYzt3gpIRMcoc9QcWO7DRuCYh8nmcaRKzNu34PIa7WtFFnFved5SdxnFiCMi8MJ9VCzu8H3k1dfKQlInuEuPRWEvZa7MZI= 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:17 +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:17 +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 2/5] examples/l3fwd: split processing and send stages Thread-Topic: [EXT] [PATCH v5 2/5] examples/l3fwd: split processing and send stages Thread-Index: AQHY3Vn7hoPdW1lysUG1/VhLAkar264Shudg Date: Mon, 17 Oct 2022 12:06:16 +0000 Message-ID: References: <20221011090805.3602-1-pbhagavatula@marvell.com> <20221011101207.4489-1-pbhagavatula@marvell.com> <20221011101207.4489-2-pbhagavatula@marvell.com> In-Reply-To: <20221011101207.4489-2-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: 9ff3995f-e413-4fe7-c7fa-08dab037fec7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PI2ZdWgaY5Fb82BTM8j9zD/pMENrXDBBg0Kw/pBM/FHas8AYHwuVQLo8R/jFVyphuk0ihmWr5tfNN03VzNJFXoXVgFa8mHuj914YRTIwPFqsRI95ZTv3uskCLsdHHHQC9VN8R7RktzCioNj8AdJAOlN/7Yd5UTfzvRQTlmB3x9/rzhTR+I8KAr8Fkth6UwdY7fgR6sZ6acQwXwFG+FMiV2cfBdqUQjCLuytre3UQmDi2nRYLbHobmWjB1EEonU8svs+h/7QHeFdCNe8Wf/vGd71TJhV4TZAzUQd20qa8dJpfD8OyNCXQefvFHZW3fSC/gU5JqR8Crbv4R1s4d7estC3mxiDMLfKPLfBnKUC8BlnCsFEra3BYMcfZDaFrbi3gyv4kQq0wcn07i+llfNn9ug/glg7ALeJPdafnNysoVjcEKCn7tIQPo+8r0lqxRite8aLqOHwVkZal+I3rmKd7xxyAQfoQ1BL/Kstc4IOgNsPjuD3r1xeH9FDq1CwClF/DuOe1lx9A0o+RSRV0g4DVADZ1+MqClel+An/FKEcnFcglwJzUI44Jp88vH9N7dpb/feJGsDqWxUI0XDy/6FGWdURIOEH96VTsBbTWu8Vxg+87j8Em0QL9qL6Pdpa4Y9GfzNNs1aYLbl9K1FlXYlWn0TDlRkkEqwxp5i1O5PlWSX1aU01BpZjgDcvKdpdeqaLC8wNi0bkQ9uGfb9haU5vHUifEB3zkDS04ko1zTXcRVgsXY6RhgIFSedrT0yDTd6XTlp+IUXmKQ3k2Mz//2/5vXQ== 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?TgMnUXxPanKBzZKlg9XJtMGCjf+AchXtS+oBmW7kpfNPJlZXa19Aq0TBSi0D?= =?us-ascii?Q?2Ph+FUzABUGVVFd0kxbInAik3vDcXNsbBFMZVUo7eC4lARYrcmTHDovzyv88?= =?us-ascii?Q?yiyoohR5apRZSr4bU+auiWVLUfTUXkW7Sec9gNF5hpxMLoEsDWQ/lgodPRS/?= =?us-ascii?Q?Gm7AyEUq+COx2WN2/waS/GlrrJ2e8x7Ce9t48xa0sPTkJlNJO7oHpK5/+YA+?= =?us-ascii?Q?nhRuSVmNZYZebTaXCvYFQfqbD09O9I0FFLpkJSIPvW4d+NCXMoidFgEayEeO?= =?us-ascii?Q?I68JPlzOZXp93gg7ImR63tzNmgpk8xzCXjb1XqOJUURKgtnAoxt/tXJwFXm8?= =?us-ascii?Q?/Wd7D/iV+nEOQQeWgVQAGQ0ec1Sola1OnhMIaGAdrQPPhiQBLF+bNRpur5E+?= =?us-ascii?Q?XfuhPwZ0opysIDsC4wfz//NZAQPAIf6yxhucmKGpHSrabTi0rpmTeX+QoGd2?= =?us-ascii?Q?BQuX2UgsESyxvoheBNDVez+kimd+qXYZ8WyMiDee27ybSAcyMoMy6tvcriHK?= =?us-ascii?Q?xHa5B7AMhFt9WC7ioSzc03ihCSbiITxFTte+bTu1FhzjlinYpOYkhTEsDXjH?= =?us-ascii?Q?BdtyP26qrA0GZcmRL2KYkzGb/9KuSZER09nMCDVXJ2tUXpM+8HTTjEsRLVDO?= =?us-ascii?Q?jfs8PpC8EWzfVSzNszqqQ2uD4QA8fsy6LUG47034ZZ0/j0KPCaAeC+ADTy7c?= =?us-ascii?Q?6ZqAUM5PYSbYzkHMXmxW4fFn4a3SnFauAaju1gECOSLOtHtB+AWsGy6c7wqg?= =?us-ascii?Q?bOCRZi1xzhBJEoI8IpCRWH6iqYIj9DHjs69LMIlfVgdnccKnTKAKdciU8/9w?= =?us-ascii?Q?w4sXb+gGrDT0Dwemh0X30f4qYewSWVW0Sj2JhgJ3S8rpN3MKjubo2nYsdoV8?= =?us-ascii?Q?5f0qHAOttNpjrdM/1Mm+QMfYoS8BApI2ue0yE9uigQD2rqI02hOOtA2UpFQ+?= =?us-ascii?Q?axWNePPmU5XbJ9J87xjm7O1mtPHLtxKlbyYz+Znjy9XV0563lX10NudhpIVz?= =?us-ascii?Q?Mo3mPsGbJW7GWlPTCnGQ3EpvSXqeVx0NkwNGH7AOCg3YAV4NFtn3lKIpjBq/?= =?us-ascii?Q?nDyX3no/BBXtxk+NiIpUkWGZOXA/SFZ+ecU/WgroGZ6ypkyfebSv1D8VvwJJ?= =?us-ascii?Q?KlpJh+NX4E9rRCuNs0/Nui/M5KCtgpJVN46yVGtoEmUS6Zl70hMtjKFC4n9Y?= =?us-ascii?Q?+whT+ntS4OXZp+RcHkBAmboWzwh4p5xWnO/dNWzVl/6rB+G8b0fj5JttW6xx?= =?us-ascii?Q?m85LbNuSFAXcH8mlDQhm/SmkssC540LkyFLQhTdisXSQqX7l1cDAHmr/Hbxg?= =?us-ascii?Q?Yw9qdbDeqsH/+p9z7q45PW8lN+EaFoWHnCdelgTOaMVZLcAf4dcyixlj5i+3?= =?us-ascii?Q?Pc0yFOKm3khUuc5sqUgI10bECXYbpqChEbl7j67Xq5iS9JhyA8LEeVphYSRq?= =?us-ascii?Q?pee+sOrzGlnAxL2upTg/g8zVU/wo4miN0gHvBJ+EeXK1a2pBHu1Mbg45PofE?= =?us-ascii?Q?mqASOO5Rec8lL0U+5bgJpQ14tD7nXWRLniTD4+WjWenB6TbpzXpmMT0ScUaP?= =?us-ascii?Q?dtegIshMemF7Or1DwvkosOLirQIkXzlyW/LeFMXp?= 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: 9ff3995f-e413-4fe7-c7fa-08dab037fec7 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2022 12:06:16.9903 (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: h5CTVONWzQjnrrfxUeaqYOpGYWYqm5Z7HhrYyO4biHcwXnKN7fPwzEr38w2O4YRetfACfoGtcbCM1FgzA5MvTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR18MB4565 X-Proofpoint-ORIG-GUID: Y1DQw5eCyfsFZL4Ev-1oH-7wAAk63dEA X-Proofpoint-GUID: Y1DQw5eCyfsFZL4Ev-1oH-7wAAk63dEA 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 > >Split packet processing from packet send stage, as send stage >is not common for poll and event mode. > >Signed-off-by: Pavan Nikhilesh Acked-by: Shijith Thotton >--- > examples/l3fwd/l3fwd_em_hlm.h | 39 +++++++++++++++++++----------- > examples/l3fwd/l3fwd_lpm_altivec.h | 25 ++++++++++++++++--- > examples/l3fwd/l3fwd_lpm_neon.h | 35 ++++++++++++++++++++------- > examples/l3fwd/l3fwd_lpm_sse.h | 25 ++++++++++++++++--- > 4 files changed, 95 insertions(+), 29 deletions(-) > >diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h >index e76f2760b0..12b997e477 100644 >--- a/examples/l3fwd/l3fwd_em_hlm.h >+++ b/examples/l3fwd/l3fwd_em_hlm.h >@@ -177,16 +177,12 @@ em_get_dst_port(const struct lcore_conf *qconf, stru= ct >rte_mbuf *pkt, > return portid; > } > >-/* >- * Buffer optimized handling of packets, invoked >- * from main_loop. >- */ > static inline void >-l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, >- uint16_t portid, struct lcore_conf *qconf) >+l3fwd_em_process_packets(int nb_rx, struct rte_mbuf **pkts_burst, >+ uint16_t *dst_port, uint16_t portid, >+ struct lcore_conf *qconf, const uint8_t do_step3) > { > int32_t i, j, pos; >- uint16_t dst_port[MAX_PKT_BURST]; > > /* > * Send nb_rx - nb_rx % EM_HASH_LOOKUP_COUNT packets >@@ -233,13 +229,30 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf >**pkts_burst, > dst_port[j + i] =3D em_get_dst_port(qconf, > pkts_burst[j + i], portid); > } >+ >+ for (i =3D 0; i < EM_HASH_LOOKUP_COUNT && do_step3; i +=3D >FWDSTEP) >+ processx4_step3(&pkts_burst[j + i], &dst_port[j + i]); > } > >- for (; j < nb_rx; j++) >+ for (; j < nb_rx; j++) { > dst_port[j] =3D em_get_dst_port(qconf, pkts_burst[j], portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &pkts_burst[j]->port); >+ } >+} > >- send_packets_multi(qconf, pkts_burst, dst_port, nb_rx); >+/* >+ * Buffer optimized handling of packets, invoked >+ * from main_loop. >+ */ >+static inline void >+l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint16_t >portid, >+ struct lcore_conf *qconf) >+{ >+ uint16_t dst_port[MAX_PKT_BURST]; > >+ l3fwd_em_process_packets(nb_rx, pkts_burst, dst_port, portid, qconf, >0); >+ send_packets_multi(qconf, pkts_burst, dst_port, nb_rx); > } > > /* >@@ -260,11 +273,8 @@ l3fwd_em_process_events(int nb_rx, struct rte_event >**ev, > */ > int32_t n =3D RTE_ALIGN_FLOOR(nb_rx, EM_HASH_LOOKUP_COUNT); > >- for (j =3D 0; j < EM_HASH_LOOKUP_COUNT && j < nb_rx; j++) { >+ for (j =3D 0; j < nb_rx; j++) > pkts_burst[j] =3D ev[j]->mbuf; >- rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], >- struct rte_ether_hdr *) + 1); >- } > > for (j =3D 0; j < n; j +=3D EM_HASH_LOOKUP_COUNT) { > >@@ -305,7 +315,8 @@ l3fwd_em_process_events(int nb_rx, struct rte_event >**ev, > } > continue; > } >- processx4_step3(&pkts_burst[j], &dst_port[j]); >+ for (i =3D 0; i < EM_HASH_LOOKUP_COUNT; i +=3D FWDSTEP) >+ processx4_step3(&pkts_burst[j + i], &dst_port[j + i]); > > for (i =3D 0; i < EM_HASH_LOOKUP_COUNT; i++) > pkts_burst[j + i]->port =3D dst_port[j + i]; >diff --git a/examples/l3fwd/l3fwd_lpm_altivec.h >b/examples/l3fwd/l3fwd_lpm_altivec.h >index 0c6852a7bb..adb82f1478 100644 >--- a/examples/l3fwd/l3fwd_lpm_altivec.h >+++ b/examples/l3fwd/l3fwd_lpm_altivec.h >@@ -96,11 +96,11 @@ processx4_step2(const struct lcore_conf *qconf, > * from main_loop. > */ > static inline void >-l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, >- uint8_t portid, struct lcore_conf *qconf) >+l3fwd_lpm_process_packets(int nb_rx, struct rte_mbuf **pkts_burst, >+ uint8_t portid, uint16_t *dst_port, >+ struct lcore_conf *qconf, const uint8_t do_step3) > { > int32_t j; >- uint16_t dst_port[MAX_PKT_BURST]; > __vector unsigned int dip[MAX_PKT_BURST / FWDSTEP]; > uint32_t ipv4_flag[MAX_PKT_BURST / FWDSTEP]; > const int32_t k =3D RTE_ALIGN_FLOOR(nb_rx, FWDSTEP); >@@ -114,22 +114,41 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf >**pkts_burst, > ipv4_flag[j / FWDSTEP], > portid, &pkts_burst[j], &dst_port[j]); > >+ if (do_step3) >+ for (j =3D 0; j !=3D k; j +=3D FWDSTEP) >+ processx4_step3(&pkts_burst[j], &dst_port[j]); >+ > /* Classify last up to 3 packets one by one */ > switch (nb_rx % FWDSTEP) { > case 3: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > /* fall-through */ > case 2: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > /* fall-through */ > case 1: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > /* fall-through */ > } >+} >+ >+static inline void >+l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint8_t >portid, >+ struct lcore_conf *qconf) >+{ >+ uint16_t dst_port[MAX_PKT_BURST]; > >+ l3fwd_lpm_process_packets(nb_rx, pkts_burst, portid, dst_port, qconf, >+ 0); > send_packets_multi(qconf, pkts_burst, dst_port, nb_rx); > } > >diff --git a/examples/l3fwd/l3fwd_lpm_neon.h >b/examples/l3fwd/l3fwd_lpm_neon.h >index 78ee83b76c..2a68c4c15e 100644 >--- a/examples/l3fwd/l3fwd_lpm_neon.h >+++ b/examples/l3fwd/l3fwd_lpm_neon.h >@@ -80,16 +80,12 @@ processx4_step2(const struct lcore_conf *qconf, > } > } > >-/* >- * Buffer optimized handling of packets, invoked >- * from main_loop. >- */ > static inline void >-l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, >- uint16_t portid, struct lcore_conf *qconf) >+l3fwd_lpm_process_packets(int nb_rx, struct rte_mbuf **pkts_burst, >+ uint16_t portid, uint16_t *dst_port, >+ struct lcore_conf *qconf, const uint8_t do_step3) > { > int32_t i =3D 0, j =3D 0; >- uint16_t dst_port[MAX_PKT_BURST]; > int32x4_t dip; > uint32_t ipv4_flag; > const int32_t k =3D RTE_ALIGN_FLOOR(nb_rx, FWDSTEP); >@@ -100,7 +96,6 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf >**pkts_burst, > rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i], > void *)); > } >- > for (j =3D 0; j !=3D k - FWDSTEP; j +=3D FWDSTEP) { > for (i =3D 0; i < FWDSTEP; i++) { > rte_prefetch0(rte_pktmbuf_mtod( >@@ -111,11 +106,15 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf >**pkts_burst, > processx4_step1(&pkts_burst[j], &dip, &ipv4_flag); > processx4_step2(qconf, dip, ipv4_flag, portid, > &pkts_burst[j], &dst_port[j]); >+ if (do_step3) >+ processx4_step3(&pkts_burst[j], &dst_port[j]); > } > > processx4_step1(&pkts_burst[j], &dip, &ipv4_flag); > processx4_step2(qconf, dip, ipv4_flag, portid, &pkts_burst[j], > &dst_port[j]); >+ if (do_step3) >+ processx4_step3(&pkts_burst[j], &dst_port[j]); > > j +=3D FWDSTEP; > } >@@ -138,26 +137,44 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf >**pkts_burst, > void *)); > j++; > } >- > j -=3D m; > /* Classify last up to 3 packets one by one */ > switch (m) { > case 3: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], > portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > /* fallthrough */ > case 2: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], > portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > /* fallthrough */ > case 1: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], > portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > } > } >+} >+ >+/* >+ * Buffer optimized handling of packets, invoked >+ * from main_loop. >+ */ >+static inline void >+l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint16_t >portid, >+ struct lcore_conf *qconf) >+{ >+ uint16_t dst_port[MAX_PKT_BURST]; > >+ l3fwd_lpm_process_packets(nb_rx, pkts_burst, portid, dst_port, qconf, >+ 0); > send_packets_multi(qconf, pkts_burst, dst_port, nb_rx); > } > >diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse= .h >index 3f637a23d1..db15030320 100644 >--- a/examples/l3fwd/l3fwd_lpm_sse.h >+++ b/examples/l3fwd/l3fwd_lpm_sse.h >@@ -82,11 +82,11 @@ processx4_step2(const struct lcore_conf *qconf, > * from main_loop. > */ > static inline void >-l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, >- uint16_t portid, struct lcore_conf *qconf) >+l3fwd_lpm_process_packets(int nb_rx, struct rte_mbuf **pkts_burst, >+ uint16_t portid, uint16_t *dst_port, >+ struct lcore_conf *qconf, const uint8_t do_step3) > { > int32_t j; >- uint16_t dst_port[MAX_PKT_BURST]; > __m128i dip[MAX_PKT_BURST / FWDSTEP]; > uint32_t ipv4_flag[MAX_PKT_BURST / FWDSTEP]; > const int32_t k =3D RTE_ALIGN_FLOOR(nb_rx, FWDSTEP); >@@ -99,21 +99,40 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf >**pkts_burst, > processx4_step2(qconf, dip[j / FWDSTEP], > ipv4_flag[j / FWDSTEP], portid, &pkts_burst[j], >&dst_port[j]); > >+ if (do_step3) >+ for (j =3D 0; j !=3D k; j +=3D FWDSTEP) >+ processx4_step3(&pkts_burst[j], &dst_port[j]); >+ > /* Classify last up to 3 packets one by one */ > switch (nb_rx % FWDSTEP) { > case 3: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > /* fall-through */ > case 2: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > /* fall-through */ > case 1: > dst_port[j] =3D lpm_get_dst_port(qconf, pkts_burst[j], portid); >+ if (do_step3) >+ process_packet(pkts_burst[j], &dst_port[j]); > j++; > } >+} >+ >+static inline void >+l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint16_t >portid, >+ struct lcore_conf *qconf) >+{ >+ uint16_t dst_port[MAX_PKT_BURST]; > >+ l3fwd_lpm_process_packets(nb_rx, pkts_burst, portid, dst_port, qconf, >+ 0); > send_packets_multi(qconf, pkts_burst, dst_port, nb_rx); > } > >-- >2.25.1