From patchwork Fri Nov 10 15:16:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 836780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="unknown key hash" (0-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="LP0cJGqh"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yYNw90w1bz9sRm for ; Sat, 11 Nov 2017 02:18:33 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CBD6EBB3; Fri, 10 Nov 2017 15:16:32 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 780F0BA2 for ; Fri, 10 Nov 2017 15:16:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1C4AC8A for ; Fri, 10 Nov 2017 15:16:31 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20171110151628euoutp02e05eaf325e12e0a1d0142d224eb08a97~1wmT0hJqR1840618406euoutp02Y; Fri, 10 Nov 2017 15:16:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171110151628euoutp02e05eaf325e12e0a1d0142d224eb08a97~1wmT0hJqR1840618406euoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1510326988; bh=MvgDtzz6YJ/+DKhs+h9M4mPpNX81da9iknzynRiVo7I=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=LP0cJGqhjXKuYW0knBHDXkQKarTw6dXbH/jzRIJsLlbXccw6zABXgoCH+r2E2cK00 X0+N43dVEIlTErAg71bfAunmqKSSP0c1n5kWz13rw2hjER0EUI6kXn+7LHwGuYPm/d Mise86S7OjnnIzogmIaH2O9XnUo0ZR2ao6JK2X8g= Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171110151628eucas1p23bb765cf91b196e87f064a4590d51da5~1wmTNH4RH0625506255eucas1p2g; Fri, 10 Nov 2017 15:16:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 37.13.12944.BC2C50A5; Fri, 10 Nov 2017 15:16:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171110151627eucas1p282f5cea59e60b0b5043587be8a5c798e~1wmSk1Slp0624606246eucas1p2W; Fri, 10 Nov 2017 15:16:27 +0000 (GMT) X-AuditID: cbfec7f4-f79ab6d000003290-0f-5a05c2cb9266 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 95.26.18832.BC2C50A5; Fri, 10 Nov 2017 15:16:27 +0000 (GMT) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OZ7008MUJR2YR00@eusync1.samsung.com>; Fri, 10 Nov 2017 15:16:27 +0000 (GMT) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 10 Nov 2017 18:16:12 +0300 Message-id: <1510326972-26479-4-git-send-email-i.maximets@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1510326972-26479-1-git-send-email-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRmVeSWpSXmKPExsWy7djP87qnD7FGGSxeZmOx+henRUv/TGaL aZ9vs1tcaf/JbrHx4VlWixU3TjFazP30nNHi9dF/zA4cHov3vGTyeHbzP6NH35ZVjAHMUVw2 Kak5mWWpRfp2CVwZxx6/Zi54zF/xs2MJewPjY54uRk4OCQETiVvHljJB2GISF+6tZ+ti5OIQ EljKKNFz9yAjhPOZUaKj4xczTMf0rX/ZIRLLGCU2rZnKAuE0M0n07+xlBaliE9CROLX6CCOI LSIgLfG69w0rSBGzwHYmic13TrGBJIQF7CXOLHwKVsQioCrReXI+UJyDg1fATaKhTRZim5zE zXOdYJs5Bdwlbh2cADZHQqCHTWLK3y/sEEUuEr2fdkA9ISzx6vgWqLiMRGfHQSaIhmZGiYZV lxghnAmMEl+al0N12EucunkVzGYW4JOYtG06M8gVEgK8Eh1tQhCmh8SGDYwQpqPEpUtOEA/P YpSYcmk2ywRG6QWMDKsYRVJLi3PTU4tN9IoTc4tL89L1kvNzNzECI/T0v+NfdjAuPmZ1iFGA g1GJh/fDXZYoIdbEsuLK3EOMEhzMSiK8gfNYo4R4UxIrq1KL8uOLSnNSiw8xSnOwKInz2ka1 RQoJpCeWpGanphakFsFkmTg4pRoYzUWutb70dN5myPDW9vdLBf5jym4HMl63bHu4ZHr5wbw7 4heLLq67zL73TFeDIaeDxa3vId7M/hwCS4rnl+muDarST3jYsDny8tzqnwe3Ly+/LuUdc2aj 2sHcwjlfu4xm+8ew/P+Q51Lc8OrU2s7/hw79X/z6Mrfd/gKRmOSNzlPknVyOfjNarsRSnJFo qMVcVJwIAHyND9fMAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjluLIzCtJLcpLzFFi42I5/e/4Zd3Th1ijDA4dVrRY/YvToqV/JrPF tM+32S2utP9kt9j48CyrxYobpxgt5n56zmjx+ug/ZgcOj8V7XjJ5PLv5n9Gjb8sqxgDmKC6b lNSczLLUIn27BK6MY49fMxc85q/42bGEvYHxMU8XIyeHhICJxPStf9khbDGJC/fWs3UxcnEI CSxhlJh1fS0rhNPKJHH70B+wKjYBHYlTq48wgtgiAtISr3vfgBUxC+xkknjY8wgsISxgL3Fm 4VMwm0VAVaLz5HygsRwcvAJuEg1tshDb5CRunutkBrE5Bdwlbh2cwApiCwGVTJi/nm0CI+8C RoZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgaG07djPzTsYL20MPsQowMGoxMPr8YAlSog1 say4MvcQowQHs5IIb+A81igh3pTEyqrUovz4otKc1OJDjNIcLErivL17VkcKCaQnlqRmp6YW pBbBZJk4OKUaGMWeWHoWyPMKJnC8t/D5cK2/ZN7ELJ73+3jVzv/tPB8aXbh/7/LpPB1/n7e5 HnD+XSBVMnWZxokJdzeI+75S7QiRe5/H8eEk4zKl34pH1gR7maedLzx+KDx8R/ySuQ9uT/wt c6i039a3RkdsW9EFo7h3Nf1Jhw4vevov93Nj4n4Hr5W771jdy1FiKc5INNRiLipOBAAsFrEV IQIAAA== X-CMS-MailID: 20171110151627eucas1p282f5cea59e60b0b5043587be8a5c798e X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171110151627eucas1p282f5cea59e60b0b5043587be8a5c798e X-RootMTR: 20171110151627eucas1p282f5cea59e60b0b5043587be8a5c798e References: <1510326972-26479-1-git-send-email-i.maximets@samsung.com> X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD,T_DKIM_INVALID autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Robert Wojciechowicz , Heetae Ahn , Ilya Maximets Subject: [ovs-dev] [PATCH v3 3/3] netdev-dpdk: Remove unused MAX_NB_MBUF. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org MAX_NB_MBUF was used as a default mempool size for almost all ports. Not used since new per-port mempool allocation introduced. MIN_NB_MBUF still used as a lower limit. CC: Robert Wojciechowicz Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.") Signed-off-by: Ilya Maximets Acked-by: Antonio Fischetti --- lib/netdev-dpdk.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 82f41db..9ceb109 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -89,23 +89,13 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); #define NETDEV_DPDK_MBUF_ALIGN 1024 #define NETDEV_DPDK_MAX_PKT_LEN 9728 -/* Max and min number of packets in the mempool. OVS tries to allocate a - * mempool with MAX_NB_MBUF: if this fails (because the system doesn't have - * enough hugepages) we keep halving the number until the allocation succeeds - * or we reach MIN_NB_MBUF */ - -#define MAX_NB_MBUF (4096 * 64) +/* Min number of packets in the mempool. OVS tries to allocate a mempool with + * roughly estimated number of mbufs: if this fails (because the system doesn't + * have enough hugepages) we keep halving the number until the allocation + * succeeds or we reach MIN_NB_MBUF */ #define MIN_NB_MBUF (4096 * 4) #define MP_CACHE_SZ RTE_MEMPOOL_CACHE_MAX_SIZE -/* MAX_NB_MBUF can be divided by 2 many times, until MIN_NB_MBUF */ -BUILD_ASSERT_DECL(MAX_NB_MBUF % ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF) == 0); - -/* The smallest possible NB_MBUF that we're going to try should be a multiple - * of MP_CACHE_SZ. This is advised by DPDK documentation. */ -BUILD_ASSERT_DECL((MAX_NB_MBUF / ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF)) - % MP_CACHE_SZ == 0); - /* * DPDK XSTATS Counter names definition */