From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0066.outbound.protection.outlook.com [104.47.37.66]) by dpdk.org (Postfix) with ESMTP id 9FD9F7CAC for ; Mon, 5 Jun 2017 18:38:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AuhBoZivcrTGzJrOeqmFDsJFR2w5EE8qVHot3xHbWBU=; b=CyyQDKThlrfY1CBy/YDOtzFOWN3mIpTxSfnN5iCzeqdbVQuzjih29tx6o6W+8EX6HlXqmVOg21fR3Kl1/HArYnLDhdnQQHkw8+fivFuvm/gXG7XQeDydCr3oatGih8mPWtLVEtsy9I5+ZaO9HHXYeRNjDuaSek+3FYjh87WwM24= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (14.140.2.178) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Mon, 5 Jun 2017 16:38:30 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: olivier.matz@6wind.com, Jerin Jacob Date: Mon, 5 Jun 2017 22:08:07 +0530 Message-Id: <20170605163807.31941-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0088.INDPRD01.PROD.OUTLOOK.COM (10.174.144.156) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1714: X-MS-Office365-Filtering-Correlation-Id: ef896b44-d78d-489b-bf01-08d4ac314d40 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:fc0RK2NvaKoj4zcKNqb7DHvzCmxvqWS64GuWGEUI9JcCMCNjljrDNcjvdvozc7PQAK5beoNZFDpUnviT9XzD+dnC47swhpJ8uv4yV6a4s9FgocVENS7mpjFG5LetZUp3hXhazxqNANy/xWl41N+uLqyKI/r+JdiaS5nzswQqAfKHG12Fi2zdspANhQQpXksaUfZ4rIoBGyQ3nZPPllyS4mf9paZiPtF6Fo/axb9MqSSBARyxCNgAOlvediCKPpBBFQF0X+6oxrwrHXOdyuhzKgVE2b9wsblL4jjYhamdoSOYo1szFhaxjnaCbDb4zIzaylQsYyoaZhG4wcK64T6EHQ==; 25:U23K4rgtt1/IyWVsSnn2EKn79Os7wG1FnXdMJEedhRWUO1yF0h5LyjXvbtYfkFD0sKd87Ya7zQFDUg1KKS/cDDgDb9Sxk+Xi3Tpq7mN8TuVVkpfQOsf6cZvf+5j5ZQT2UMxxqyBW7Z/P8a75TzSSOwPDQjLrmxz9OQxPccYusr9i39vbJwj4cmubLY76RaMSHO0HZKtlXmjT8rPUWt/39Nn+7wd2um4CCP0IP5b+c+L4MCajx6QI2Tj/Ad+8Kh+HN2J42rnqOh+usL/yI6KUSlXiAmF6KX6fsOcWO7k0s21TJQJ2Z9W8nwKQ2GoTPchF2gUcKIFFcJiw3lwYezoq6A9Jb5dwVVhQkt2AgWycaM6pSkjGB5J9+YZ2HDq8yB64klK9ax+dcqOPrGv+R/r4YKUYfzyz1lpweCxTZU9QTXqc5touS9teq/eJ8mnUJJz9SflCKnIUz1WnNpq5HFgBWPTF7iaBn3c1gMU9KtF3LXI= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:xAL1gaeXTvD2QOBCykcToUYW5meH27/zxOfRAF0890+/L1YyLbA2Z0aNDmYdotyM5IG6kviFYv+2x5qdIxL1kj/uDw8HSAmVvsoBYZGeKjS2SsqdHTIv1diNf0zy7XSNesx9aeh88ystxu0NfuSG2dORmldMNg2FcSs4FFHeWRBbG8Lva+ABu2xZbGhxuvfn2qHeJluxr9Q1wKmZTg1zJOZYV9C9qYfKAtyK2wgFCM8=; 20:6N9VxHSCE2YPn0bBhBi/HBtBw5zz4QTQAvaL+N8RTEC4i8YWOuNmLKhA0c+ibgTYoiu3JJ9xY8Zv+irP3bLXseTIUOm52Ns3FEacHw7l7Py69rUMQlYd64GTm78wPoU5r8NQ07wLy880pBORIxeeqvhXuYsBFNEQmDAfJY6wmg1X4wMbPNaVe7YIc0mA9Iep464j7Stolw+ZdPvGMS7p81Iwu1tj0VJZpi53Ql9YLPokpc5jZdKat0foHQ7Ub3U4nMABRjeDhEBkcnjcFruI6Cos6ADDKrouG7czQLEEu9zzFaR27zopmnmTyi7vE/eOReMfk/4lVw6hFoajFZa5qBLdc+c16vktUfNVqpoW/fWHKPbZPhFRZ6m4pvkfTPoG6cDlURO1w9k3OzxLBUrOgjofJdHevod+chN8nmWCHsieXjtZnO4Y7sBmigIUzKmAtzwScEdD8zxcqvZa9sacVz+kZJRU82u7+MyJJsTTqi1PiOyijxQ3eI1bK/TGX+IFJZqb2nmtAW75VOdvRYjHuRfjcrDcDXyEfY72AZuY7z15F/M0L4AA0cf/cvzwyEjg21FdzDVB2WrV18knQcjH1N5ostnEXDQmsCfxw9PybHQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 4:hG3K9ejiBEsNA/z8VhKiQVSOSHD/UcEAZ/ESWuA6?= =?us-ascii?Q?rohiOy2a6z9p+0Cp4L5B4tAOQy+zoBiz6vcbOuaetyU+QiX+suvHBH636Hi0?= =?us-ascii?Q?bqEkPBslJT3gLRf2veFhAATLM/T6N3SVHKiPcpT7D9t7+waI/o6gcg+rWp47?= =?us-ascii?Q?JxsbA4nmM3lUv+raN7ofBa8a/3G7ZzQSx1Xa0gxv9+JYIhpiu0i7BAXPWeJT?= =?us-ascii?Q?AK2cOGchOoWQrBQ4ZBiJTHYYQvqP99k3EhKnalZiB/n7aI9JnhrTo6cMsMrO?= =?us-ascii?Q?8UXbiPCjU6jrdlLGTXfFz6h9PdwRBwm+84xMUx0atuyoy+TQleO8yhNA3zcQ?= =?us-ascii?Q?P7m4VfuguywNDY9c0QgvfgqhNxbcI2L0Zx/DQ2CI8nkIYI0Vfi2gev2nhzHS?= =?us-ascii?Q?4aYwRBiX//eRuHzwfrhrSY8iamIIa0Wnp2D8u/b2jMnE79BLs7EWjTWUfAdY?= =?us-ascii?Q?z9PES4bhb75H11yqUY8N37mCEZ3Ny4752iZhzNziqA+yvJHC5tBvCsMvNw6u?= =?us-ascii?Q?JU07K+BS65aWrrR3rA6eB3j8NxD7mqDTJbQmVWXYVZ1UWGJ8lnwpaFnUdy14?= =?us-ascii?Q?Eia5A5MVYDhwhc03AVMsbitNJ52ZLdVABRUZs4zRxdNFiJ5BiAcZnmSicb6i?= =?us-ascii?Q?rjhjZttRDX30gRympT5/x5JIjRM668uGvZV4IaGt3by/6jnE2+9eBD6dYHsx?= =?us-ascii?Q?ZidWdI0n9b/ereIPk+b2T8lJukEMpjGKx8ZoY2z01NgmZ43RfZtSg8+grF3W?= =?us-ascii?Q?p1mscRyUMgKjMhU7gqMdHzhDMbu8z+Q35T1qfjEyIcdMGcLCT9QUo/4JPsdt?= =?us-ascii?Q?yEO5pdwPSi3R31tZ51DV4yCSw4bd2w6OHRFfPhDP73Cxn4G6VtSlF/qHxsFQ?= =?us-ascii?Q?DeOpVFf9pjPq9DEQXLH2gghFZvwULMmrkHD7addBIUAx71qpwdhR9P8aK7vo?= =?us-ascii?Q?whj0k0IWT66j8PQ6I99xj52Te+ALP2V3ENxsySL0EabD+FQjIwswLD5IbzDk?= =?us-ascii?Q?HldEZuvaTPPtyjaEVOP8APHzd1N9/hFAquAdCHGIlkk59be1f4Lo/QNOVQg0?= =?us-ascii?Q?V0DVl2KOtKjS3rU5eJrhrXjXRK/7qlTdl7gFnnYRNacBz/hvzLzDkZm4p1dA?= =?us-ascii?Q?Z4KkcnPhEY4=3D?= X-Forefront-PRVS: 0329B15C8A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39400400002)(39850400002)(39410400002)(39840400002)(25786009)(4326008)(6512007)(6506006)(189998001)(107886003)(6486002)(38730400002)(478600001)(33646002)(6666003)(5003940100001)(7736002)(2361001)(53416004)(305945005)(50986999)(2351001)(5660300001)(53936002)(110136004)(5009440100003)(66066001)(42882006)(81166006)(8676002)(50226002)(6116002)(42186005)(1076002)(48376002)(3846002)(72206003)(50466002)(47776003)(6916009)(2906002)(36756003)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:jerin.domain.name; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:Rn3C+vKJ9lkpzx5/1vZJRCWFcMKFGSmcuL7YJdf?= =?us-ascii?Q?W9cERqkvlczJbiZAc0R0mz+iiycErnguEMua6gB0IV7l+kOZ/qu+ykSE9l/B?= =?us-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MhcqEuAvDzjsmmMF?= =?us-ascii?Q?h0SKhYsBImW/fIQoJ6OxRVkGhJKzwAqQCdZrmxvmbNe/situOsY8pTzHYN6P?= =?us-ascii?Q?AQ7GnxRA0V6LwAigyJDsg+KnWyk3mrEQxnknqHVPT7soYbL0Mm5xcUIsNWcx?= =?us-ascii?Q?HAHaZJ/zN9jl86qnfmNzAq45pgJn29+eEAkwxt61eYkZuxg3Y1fiACA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 6:YdEoBqOE656CQSI53wMUIxnyMggEtSYNyOEVE4Z8D5PNa2B5enDUZHikPh1ajGNh1RBmCAzHsjl7TT+FDp8tzSAxOouwxGhayO1ln8rly8kwNiaiUJK09nhnwlLltFLjxmoMW8DC7tY10+A1A7wJd+sri1CKGyllC3q901amhOVLN3hxC8CLYFfJNf9U3QGGPU6jRM6QDGzEn1ZRJzyOOw+PWAAD65fYr+ZuZy24jyeEQFrVtd0QdK742K22uuGgxV85POLSzhaiL1voSselPVqu9CB6CQOIINOmr2gPepmxWSrSvyDKlkKuuJOzng09qgWvddGFwswSMQ5kHOD31FLM7VvWcuzvaB75x2VjJLAZFv8mWRvXrYsGF3ReI4iZAAfgQG8qKoHsmbeT023bhxGCpp2LkXQtk+kUYfoe659CRex7yzsNS36qESSp4H75f8UiUce7CGYo4ri3Codjqr1oCXGf39/D+SiFSIxaY7KO+1DBcN3ecAwvzMzzpyFCp6yQa5sgY0nB/Ay/A82lIw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 5:Cnshshm8r9/9GOizNHwB85OD/tOxf+MDVMcrwrUzYjfivMWnvWVczWPz8jn57AMaakryMDl7u/a9q5yO+Q94s4R/uVNeqZNHmsJ63TooHgBjqmOJMWhYDrg7p8PlAI4wRFM0pBdE1waMHYajLl7PQXEnJYr2HhWF15NAN60wCcxIkDcLNiggzH7cly5LiJ5Iu0aCi8JjZousXtYJB4mhpJo1YfcnSKr6t83hWntZiAObykpEZWzqU7atl1+Ggxwgeg+vr88VuFQmCb80H4zsmTbql7i9w29fPaE37BMazMHXTLnelpk61pDIo0bghWK/DfOTzk7tLSAFZBh9NzPQybiONmaNjJi31c0kTmST+wrHgCPIP/TZ/dirEEopJCYCuZRhBoVR2f9eb4SjSKs4nlQ6EVWdh2xqyMwNarYdENfA/TqWS3xqb9qf5K4BQBY6jXh3M6K42t+fBEjmrvLImjqejUuzjmWGOuMMjbtoUvo1piJpR77HyH95eM8G+R6U; 24:PpzVgfzcwowga/iJnAnD88PLh2Rq5R4cbxbCEhBa6aYVRyQK2PxFEFHXBCZmVZSTNO9LViZok5A9y7IYCanpunzAXdLBZzh0PHvvWva65ks= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:ujC+uzVEtGcWvNT5P0jOVjMi+lHsmgjc2ZeVdlf2Tn4AbdpyQw1ylrSks2NhLS2xJ3+b7O5SdPqLCyhpl2/ekRuo2m7WMebbJPo00ujsWI//xZr7bAfJhfdzCXZv6ErCx7aW9dRmkqIzrspvYm/GQAB5t7tgPcPg24FNFeLBIMbfDRj2s7TsSdWkFmv4SG0gl4x1rN8vQa1sUkdw/11NQvH8TdrPC/hcFltsc+MEepzot+5yvn5hE38JCRlMCTmrbNQGy4jj4+R0gjZKr32RHWcNtqxCypVwl0cZMy2Lnrwz+HvrUFcp+RPhtx3VK1YX9TpZKZzTvROlmOniWb0z/g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2017 16:38:30.0076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH] mbuf: reduce pktmbuf init cycles 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: Mon, 05 Jun 2017 16:38:34 -0000 There is no need for initializing the complete packet buffer with zero as the packet data area will be overwritten by the NIC Rx HW anyway. The testpmd configures the packet mempool with around 180k buffers with 2176B size. In existing scheme, the init routine needs to memset around ~370MB vs the proposed scheme requires only around ~44MB on 128B cache aligned system. Useful in running DPDK in HW simulators/emulators, where millions of cycles have an impact on boot time. Signed-off-by: Jerin Jacob --- lib/librte_mbuf/rte_mbuf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 0e3e36a58..1d5ce7816 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -131,8 +131,7 @@ rte_pktmbuf_init(struct rte_mempool *mp, RTE_ASSERT(mp->elt_size >= mbuf_size); RTE_ASSERT(buf_len <= UINT16_MAX); - memset(m, 0, mp->elt_size); - + memset(m, 0, mbuf_size + RTE_PKTMBUF_HEADROOM); /* start of buffer is after mbuf structure and priv data */ m->priv_size = priv_size; m->buf_addr = (char *)m + mbuf_size; -- 2.13.0