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 240F945B67; Fri, 18 Oct 2024 04:43:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B32F74027C; Fri, 18 Oct 2024 04:43:18 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2094.outbound.protection.outlook.com [40.107.94.94]) by mails.dpdk.org (Postfix) with ESMTP id 46FEE40265 for ; Fri, 18 Oct 2024 04:43:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H+SfBCLm54boBDBzcIXPkmOAZbFCagLKC6TB1Ro8URg2sFGi23/XkzejD0TPj0X8BpachDDo/qRRhMHYeMNghHBw0LmaBi5239GDh5gOE3u3eEUTxQuZwMkxnHyo/qfI5Sfw+nS57Lx8E50AskHCSdfT7fJMO1KRur652qdHsf/YU0yHqDDD0Y2QzyyWhGNBxKnhRnPaTUmLLyUxRRa1uT49YIkh7eLQA+ITiWTLwwg9ZFm7VWriYBp8JIt572noNujk/QBdMKUv/XJxADSmCuEXnZzwxRJSB0zZlhHdNG24H75o6rdz3XLNJYUK4hAafFcVP5tG4SSL0F9Da8jgHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=t9mRUMZ9+KAYqF3kgNMO5D6Z370alNiMj7M02QoFvrs=; b=B8ogggpxKSfUVBVaIbJCZ1hgIH5pVAtE8w6MugEqohVyXqxFDYtVV6ql4uT5IqqSnfFkraJW6hQRiZEwfxd55c17+8KapAlruoAAf1WaoZhW1LIoK7/IdbKq5VC3JsLQW/wytURJ5qQjE3++c+9FaAuixShWKbr0KtOPOZ38o6OsHTH2xW1e3tiGLRdy+V74VJQxJCJtoxlDIUJc9D13uThvQjm0ZbmPiXMCnct7wiAP5d3p1DW1B9bRM3wYOSMYqea6WhxNsrGQK4ejtel3u7rmV3NW4KWBR8OZc0OZI2xGm6oQgxM/AwfB2Ost1FGWbPDtolihsZy4QhAftgbo1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t9mRUMZ9+KAYqF3kgNMO5D6Z370alNiMj7M02QoFvrs=; b=g0iZW8Xy+V88Db/Zn8f/+zEbycgLBuaxWNrggT95PGhCH77Ae30BP3pJDoHHl30Upkl95HHi69Qpvv0n/MvNz3f/7aTF8qvE7tlJweKNxsEMOYfEHYa4sqSXfXu8AwoihdIRSh93C0mmHRU5fHZqZgjzumloSRZtmcSePR1qSAQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by MN0PR13MB6801.namprd13.prod.outlook.com (2603:10b6:208:4be::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 02:43:13 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8069.019; Fri, 18 Oct 2024 02:43:12 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v2] examples/l3fwd: support setting the data size of mbuf Date: Fri, 18 Oct 2024 10:42:53 +0800 Message-Id: <20241018024253.4075609-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241016082232.4005800-1-chaoyong.he@corigine.com> References: <20241016082232.4005800-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0112.apcprd01.prod.exchangelabs.com (2603:1096:4:40::16) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MN0PR13MB6801:EE_ X-MS-Office365-Filtering-Correlation-Id: dff58e76-8056-4185-3a7d-08dcef1e9be8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?N3BGTmE4azdNdUo3TXhoZU9zbVBaSjFXWWszWVJkQlFzTDVEVHFhK0E2YVpv?= =?utf-8?B?SFdLV01YYk9LdElPNmZXdzJ3OC92TjhoUnhGWHh1bDhIRkxLR2ZNL3J4dC9N?= =?utf-8?B?NTQ4NmpDN2h0ZVNYSW9kbHpMWDZZbW9MdVZhanBxQytiaTAyRVZLdzk0M2pT?= =?utf-8?B?WnpvS1l4SW5pcEIyb1M2RHNqUzhNZ2lFNjFnL2NuZ0NFdEVQalZ3MENtNWs5?= =?utf-8?B?d05GeWE3Qm4vYXp1TlREYmN1YkxZK0dlSWhXamxUT2kwcTZHVlY3YTk5U3Ba?= =?utf-8?B?RUUreWwwUnN3UU9oNW0zVko5d29rRU8vVVBZbHZhNzhFS2I5bUNzdlY2Mks5?= =?utf-8?B?Mm9HeFF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3d6?= =?utf-8?B?Rk1PNUI0d2dMZFVuUUR0TndJR2w3QlJoeHMwVDZGbXNTKzN5d1JWa1lGYjMx?= =?utf-8?B?SXVBbm1RYjVXNGVEYmNNRHlGUk02K2pReGJIQm9uUFJRYVZqMHVJWGZRbnJJ?= =?utf-8?B?aXNha2pDYmpDVTNxSExJRWphUzl4eHpKRzN5TWt6ZkQ0SGZEK2U0M0JRZFpy?= =?utf-8?B?bFozak1CNm56T0JFK2RUUGNUSkl6SGs4RXhYKzlpbXhKK2lZYXV1dGFtNEI2?= =?utf-8?B?Ti9OZVFrb3JHOGFhUGlrMDVPTGxBOVRkN1hoK2dXUkVZNGVwVzhQa1lELy9I?= =?utf-8?B?eXRSNExMclVEMFV3NEJjQmlJQk1XMTd1Y0FMMENsZHJMOHVsRVZTVVNXVmpu?= =?utf-8?B?UkFHUi90aFhGMkNtNGtKWlNRWCtleHRhZnpzRGUybXlodHhzTFZJZG9RZGRi?= =?utf-8?B?MnB4enRHZFJ5djZWd0hNd0ZUZFQ5b25vbXNSazB1YmlqTU5wWER1MzQ4WTZ0?= =?utf-8?B?MlhHWGNxN2ptejVlbkxLUzdJR3JjUkVkSzJ0a2p6STVSU1h5RFI1RFVEWDAx?= =?utf-8?Q?p61Md61wCgyT8p083Flt5ET8gIeWijZGmHjH4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q3JBNjh2aVFwQlFlVU1vYzFyYVRPblVGQitYaVUyS21kQW80emVLM1praDgx?= =?utf-8?B?NFlSRkRaYnZ6Tm1Ga2wwakZ3Y3VqU3R4VG5aNCtPTUVScTlTQjBVeWEr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TFU2Z2JSMm1MTmZYZ3c0Z1BjamI1M1JG?= =?utf-8?B?aGNHMTVNZFA1MjZ3WWNuYXR4MmVtUy9LcWhNcWszU0ZkMkY0Y2taYzdKR3Vx?= =?utf-8?B?WnltVzNqMHVBWE9ZNmFRNVFoVGxHbXpmb3N3WXZvdnB5Nng4OTdHbk42anhx?= =?utf-8?B?TzNXSkUzZStudEx5b2ppNERkeXpOWmY1bXdsNUNzb3pNekx6NVZzbHFQNTJF?= =?utf-8?B?WThMUG5MREdOV29vdzcwblpheU5sMmtoRzNGVnZLcllrMERxWG9aQ1lrdXg1?= =?utf-8?B?Snc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: dff58e76-8056-4185-3a7d-08dcef1e9be8 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 02:43:12.5518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kZbrWwoZJ4syltA9S/q44ocLs4mz9iWTghguaZ6xYb86k1uAFNPHXI6e+yH2hSwI5MBSxDwY4ndXXEcnDQtBnB6WbSo7RqXJuArzDSAYOYA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR13MB6801 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: Long Wu The previous code used a macro as the data size for mbuf to create the mempool and users cannot modify the size. Now modify the code to support setting the data size of mbuf by '--mbuf-size' parameter. If user does not add the parameter in start command line, the default size is still 'RTE_MBUF_DEFAULT_BUF_SIZE'. Examples: dpdk-l3fwd -l 0-3 -- -p 0x03 --mbuf-size=4096 Signed-off-by: Long Wu Reviewed-by: Chaoyong He Acked-by: Morten Brørup --- v2: * Modify some logic following the advices of reviewer. * Add the 'Acked-by' tag. --- doc/guides/sample_app_ug/l3_forward.rst | 2 ++ examples/l3fwd/main.c | 31 ++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst index 1cc2c1dd1d..5afbbb242b 100644 --- a/doc/guides/sample_app_ug/l3_forward.rst +++ b/doc/guides/sample_app_ug/l3_forward.rst @@ -143,6 +143,8 @@ Where, * ``--alg=:`` optional, ACL classify method to use, one of: ``scalar|sse|avx2|neon|altivec|avx512x16|avx512x32`` +* ``--mbuf-size=N:`` Optional, Set the data size of mbuf to N bytes. + * ``-E:`` Optional, enable exact match, legacy flag, please use ``--lookup=em`` instead. diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 01b763e5ba..ed5d0c2608 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -140,6 +140,7 @@ uint32_t max_pkt_len; #ifdef RTE_LIB_EVENTDEV static struct rte_mempool *vector_pool[RTE_MAX_ETHPORTS]; #endif +static uint16_t mbuf_data_size = RTE_MBUF_DEFAULT_DATAROOM; static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS]; static uint8_t lkp_per_socket[NB_SOCKETS]; @@ -448,7 +449,8 @@ print_usage(const char *prgname) " One is ACL entry at while line leads with character '%c',\n" " another is route entry at while line leads with character '%c'.\n" " --rule_ipv6=FILE: Specify the ipv6 rules entries file.\n" - " --alg: ACL classify method to use, one of: %s.\n\n", + " --alg: ACL classify method to use, one of: %s.\n" + " --mbuf-size=N: Set the data size of mbuf to N bytes.\n\n", prgname, RX_DESC_DEFAULT, TX_DESC_DEFAULT, ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg); } @@ -667,6 +669,22 @@ parse_lookup(const char *optarg) return 0; } +static void +parse_mbuf_data_size(const char *optarg) +{ + char *end = NULL; + + mbuf_data_size = strtoul(optarg, &end, 10); + if ((optarg[0] == '\0') || (end == NULL) || (*end != '\0')) + rte_exit(EXIT_FAILURE, "Invalid mbuf data size: %s\n", optarg); + + if (mbuf_data_size < RTE_ETHER_MIN_LEN || + mbuf_data_size > 0xFFFF - RTE_PKTMBUF_HEADROOM) + rte_exit(EXIT_FAILURE, + "mbuf-size should be >= %u and <= %u\n", + RTE_ETHER_MIN_LEN, 0xFFFF - RTE_PKTMBUF_HEADROOM); +} + #define MAX_JUMBO_PKT_LEN 9600 static const char short_options[] = @@ -698,6 +716,7 @@ static const char short_options[] = #define CMD_LINE_OPT_RULE_IPV4 "rule_ipv4" #define CMD_LINE_OPT_RULE_IPV6 "rule_ipv6" #define CMD_LINE_OPT_ALG "alg" +#define CMD_LINE_OPT_MBUF_SIZE "mbuf-size" enum { /* long options mapped to a short option */ @@ -726,7 +745,8 @@ enum { CMD_LINE_OPT_LOOKUP_NUM, CMD_LINE_OPT_ENABLE_VECTOR_NUM, CMD_LINE_OPT_VECTOR_SIZE_NUM, - CMD_LINE_OPT_VECTOR_TMO_NS_NUM + CMD_LINE_OPT_VECTOR_TMO_NS_NUM, + CMD_LINE_OPT_MBUF_SIZE_NUM, }; static const struct option lgopts[] = { @@ -753,6 +773,7 @@ static const struct option lgopts[] = { {CMD_LINE_OPT_RULE_IPV4, 1, 0, CMD_LINE_OPT_RULE_IPV4_NUM}, {CMD_LINE_OPT_RULE_IPV6, 1, 0, CMD_LINE_OPT_RULE_IPV6_NUM}, {CMD_LINE_OPT_ALG, 1, 0, CMD_LINE_OPT_ALG_NUM}, + {CMD_LINE_OPT_MBUF_SIZE, 1, 0, CMD_LINE_OPT_MBUF_SIZE_NUM}, {NULL, 0, 0, 0} }; @@ -934,6 +955,9 @@ parse_args(int argc, char **argv) case CMD_LINE_OPT_ALG_NUM: l3fwd_set_alg(optarg); break; + case CMD_LINE_OPT_MBUF_SIZE_NUM: + parse_mbuf_data_size(optarg); + break; default: print_usage(prgname); return -1; @@ -1034,7 +1058,8 @@ init_mem(uint16_t portid, unsigned int nb_mbuf) pktmbuf_pool[portid][socketid] = rte_pktmbuf_pool_create(s, nb_mbuf, MEMPOOL_CACHE_SIZE, 0, - RTE_MBUF_DEFAULT_BUF_SIZE, socketid); + mbuf_data_size + RTE_PKTMBUF_HEADROOM, + socketid); if (pktmbuf_pool[portid][socketid] == NULL) rte_exit(EXIT_FAILURE, "Cannot init mbuf pool on socket %d\n", -- 2.39.1