From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0064.outbound.protection.outlook.com [104.47.33.64]) by dpdk.org (Postfix) with ESMTP id 0F1711B28A for ; Thu, 12 Oct 2017 15:25:56 +0200 (CEST) Received: from DM5PR03CA0034.namprd03.prod.outlook.com (10.174.189.151) by CY4PR03MB2696.namprd03.prod.outlook.com (10.173.43.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 13:25:55 +0000 Received: from BN1AFFO11OLC004.protection.gbl (2a01:111:f400:7c10::182) by DM5PR03CA0034.outlook.office365.com (2603:10b6:4:3b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 12 Oct 2017 13:25:55 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11OLC004.mail.protection.outlook.com (10.58.53.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 12 Oct 2017 13:25:55 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v9CDPqrW015744; Thu, 12 Oct 2017 06:25:53 -0700 From: Hemant Agrawal To: , Date: Thu, 12 Oct 2017 18:55:17 +0530 Message-ID: <1507814717-13306-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504690460-30616-1-git-send-email-hemant.agrawal@nxp.com> References: <1504690460-30616-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131522883552361165; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7966004)(39380400002)(346002)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(53936002)(76176999)(50986999)(104016004)(33646002)(189998001)(2906002)(498600001)(105606002)(106466001)(50466002)(48376002)(68736007)(356003)(50226002)(85426001)(77096006)(36756003)(8676002)(110136005)(5660300001)(316002)(47776003)(16586007)(8936002)(81166006)(81156014)(2950100002)(305945005)(6666003)(86362001)(97736004)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2696; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC004; 1:3O7TbwwVkoatPIRgLbVkKPf/hPYfDZ1gllhQJ9SM+WDG8fVEtt6aRt76h2RAm/lfmPm7b10iM2sPKeDUdo7ldWgvvHD6j0Hz376RFZUElvKMQKGwot1Hx4ePPo1RM6ah MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7b8f8cf-db4c-46c8-d971-08d51174c46d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CY4PR03MB2696; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2696; 3:b42r0yj1V5Qm/OmuT5WdFzFvKR04+LMk8PNWuOM+IKxWBZkCU4x5+izzyevkVL8cYXHB3oTvQXXCDgEDE4C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ErG6mL86NdQ3zzK/5GEYHCoEaRG3RBHgIPl0XCyGQ70BUZ0wJyR0KPQ69iWv49TC8x2dLDstatFa1Y3zxZgcE3nsdvrzy4jJqanO8OhjkaFPMYGTQi94yGmH+b8NrWK0zrwk2971VAqiDyGeRTI= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123559100)(20161123563025)(20161123561025)(20161123565025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB2696; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB2696; X-Forefront-PRVS: 04583CED1A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2696; 23:55hZ8iVHkkx9WqCDw/7kyZqQK4owWz2Biypz07iFf?= =?us-ascii?Q?HEqpaVz0WB1PAOMMg7eetVjWHJB1kb0W6v74PK6KWEAd1Ke1fIn7MJ4aZZdu?= =?us-ascii?Q?oGmy+KGM5EAQBC9CRFaAqv558kbQjraKDE84my8qCym3PtCaBEdC1nU/WiM+?= =?us-ascii?Q?/PNBPlfV7g3u1DJV9XFxW3KZdDZO8nuQui0oFFpfvRd9NQi3T4wK4O2eZUh6?= =?us-ascii?Q?diuwoUFMdE1sB1LfyaXRCba3C1pit4CO7tsAXFyaaBjxuyDEjEb6iWNCnWMl?= =?us-ascii?Q?7ewSEIZC88rwoBcK7K0fksekOmAWWNJGKQ2Q1J6XhKFVrzB082G3FLtWK6iF?= =?us-ascii?Q?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ta1paGL1NsezkhkpFjVAPtXRaVEeXBFUyXnee8mIrXUya9XYbKBwuSerWolsj2a2tOzprlp9dhUv8YBwDPB+6AJYV/6HDrwxCnj6YFL3PUfBANO69lnrjAb+6JezXJ7bwu+ZZQAX3Hh+i8UXIJfTqlaVlKmoOfrm1xlchAS17zsRh4scYE8HczvAD5IwEGKW0plUQoLHAZod2vQXjQOxXV2zqGrXAEr39N1nFC9SHeVD/qCyfGDd1K72Cb1McUQQg==; 5:P9878wKe58kYa3egBTUJo31ECzZUXkXL5GlqR8MpZqHGmMtjzJhP/lQlRQ3DCyiOrSu/Hx1KeHWBCY69LW3Ombmgn4TEFJIfKeSgmuUcS7qTHEMKVYfhUBukSrJgqT4BDB6InVm4gvSg5zg3lF0j/Q==; 24:nXBeJSoPD5pIbdAiddPkYJyQ9XBrjnYl+8kXJYBbw2h3EdrN0Pd8Y0LVrVDjfnw0068KhRl1IDH7t2y6QQN6GkemxyEvZVPWE56JleS+vUw=; 7:efowu/MCqsD4ajmGv5FSJlUvVV5lr6tIekg2OeBqC6yXeLxKGL91oZc4OQRJjsQ+TNPeRJPsjX48tceZ2K1a1w3beu5VXJsKrO3/OUm9D0UUGDDw0jv8OHADlCdAcDsesBlJJupAr6IGG3Ya+nRvCBgr7ZJFhPEZnsGYaCNdgTyN/yTlgMXOljiVgW1DwgZCWVjBe0NWkAwiNW7AK6TNCm/ZD/7IccnzGu9C5UpdkCo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 13:25:55.0489 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2696 Subject: [dpdk-dev] [PATCH v2] examples/ip_reassembly: use pktmbuf to create pool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 13:25:57 -0000 From: Ashish Jain Use of rte_mempool_create() with the helper provided in librte_mbuf: rte_pktmbuf_pool_create(). This is the preferred way to create a mbuf pool else it may not work on implementation using the HW buffer pool Signed-off-by: Ashish Jain --- v2: add mempool caches - as suggested by Konstantin examples/ip_reassembly/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index cadf4c5..2f662ba 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -84,10 +84,10 @@ #define MAX_JUMBO_PKT_LEN 9600 #define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM -#define MBUF_SIZE \ - (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) +#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE #define NB_MBUF 8192 +#define MEMPOOL_CACHE_SIZE 256 /* allow max jumbo frame 9.5 KB */ #define JUMBO_FRAME_MAX_SIZE 0x2600 @@ -909,11 +909,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue) snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue); - if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0, - sizeof(struct rte_pktmbuf_pool_private), - rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL, - socket, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) == NULL) { - RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf); + rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, MEMPOOL_CACHE_SIZE, 0, + MBUF_DATA_SIZE, socket); + if (rxq->pool == NULL) { + RTE_LOG(ERR, IP_RSMBL, + "rte_pktmbuf_pool_create(%s) failed", buf); return -1; } -- 2.7.4