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 93AB245B14; Sat, 12 Oct 2024 14:22:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63DFC40268; Sat, 12 Oct 2024 14:22:55 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id ADCA840265 for ; Sat, 12 Oct 2024 14:22:54 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id A2F3D20CA2; Sat, 12 Oct 2024 14:22:53 +0200 (CEST) Content-class: urn:content-classes:message Subject: RE: [PATCH] examples/l3fwd: add option to set RX burst size MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Sat, 12 Oct 2024 14:22:50 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F7C9@smartserver.smartshare.dk> In-Reply-To: <20241012084052.3485-1-haijie1@huawei.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] examples/l3fwd: add option to set RX burst size X-MimeOLE: Produced By Microsoft Exchange V6.5 Thread-Index: Adscg/P1MjjXiLwnRlOd0hnKptV1tgAE3XDw References: <20241012084052.3485-1-haijie1@huawei.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Jie Hai" , , , Cc: , 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: Jie Hai [mailto:haijie1@huawei.com] > Sent: Saturday, 12 October 2024 10.41 >=20 > Now the Rx burst size is fixed to MAX_PKT_BURST (32). This > parameter needs to be modified in some performance optimization > scenarios. So an option '--burst' is added to set the burst size > explicitly. The default value is DEFAULT_PKT_BURST (32) and maximum > value is MAX_PKT_BURST (512). Good idea. >=20 > Signed-off-by: Jie Hai > --- >=20 > -#define MAX_PKT_BURST 32 > +#define DEFAULT_PKT_BURST 32 > +#define MAX_PKT_BURST 512 > #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >=20 > #define MEMPOOL_CACHE_SIZE 256 It seems strange to use a burst size larger than the mempool cache size. You might want to make the cache size configurable too, or simply define = MEMPOOL_CACHE_SIZE as RTE_MEMPOOL_CACHE_MAX_SIZE (currently 512) instead = of 256. And, as a safety measure, consider adding: #include static_assert(MEMPOOL_CACHE_SIZE >=3D MAX_PKT_BURST);