From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com
 [209.85.192.194]) by dpdk.org (Postfix) with ESMTP id 0100A23D
 for <dev@dpdk.org>; Thu, 28 Dec 2017 21:36:50 +0100 (CET)
Received: by mail-pf0-f194.google.com with SMTP id j124so21360296pfc.2
 for <dev@dpdk.org>; Thu, 28 Dec 2017 12:36:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=x+WleB5yC915sX4/zK0MTjFT1Z+2S+WjwGeTF1BExE4=;
 b=sBnNgrIrxOUqH3WAHCH4954cIlJUfo9SyplwjZZ7DD5ZhD/F6HFqsZaPDLhSag47PF
 ZwjtUqraE+WMzXFYe9RO3dkiyxqK2KclQcFjyVp0xmXzlQXq56FpyW256eJEyHUjjHF5
 GquEzXEbtrwSVej3DQCVXDOJz4fbx/DevTt0Zo3+v5kg6Dwzra9vTfZdi7nXE9R/nTsm
 7G8RfY1twP8x1ab2k2GQ2MP5eeDSreaKKWSkb7mDDzIA+oXrUFwZpcki8HcV7gSsoU56
 YY+QklXMbb6Wr1Wqve0uRMncjOmURhnPmj3PPldEf0fJUfFdttJ6SHu5AkdvZdyxBvWC
 Sbcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=x+WleB5yC915sX4/zK0MTjFT1Z+2S+WjwGeTF1BExE4=;
 b=iJnoEmTqohX+Rwa3w7M9suG2XKC00g5mGU37sF+eDGa9+2W/ugQmn4qvjKUdiw2zEj
 bhM9WT9IAC0ULl/UQUMnxDXtcUCOiMDfLjHFe01di+FI7mySJIjTQk+QFW9QuHdiMK9y
 dSLHRYEqan/bb16Hb/nGxka7SSV6q4QwO0H+oimPE+DB4bymfHZvDDIAKdS69pTJCpKx
 PnyR+ULeI4DGi/FIb6ZJ/SwYp5eJyBBB2cdZ3zcM/A7xMvcNKnsNMbJxcUViW6IeQvDe
 d1oKbzyMyVuQmguYSVg43iQjGxNcVyVfwymkUPXpAvc7uMriyog0Vx4Jv3TIecVL0rCp
 DvSw==
X-Gm-Message-State: AKGB3mJYFlXmbRdebZTsD79toCW3Hu9EfslE0+qh9IEhp4q+1jUNXYwB
 1yI7TLzp9qyi/OuKuqgREFEjBQ==
X-Google-Smtp-Source: ACJfBouYEf7SM3BX6A9kz055HwMknG42RNXo2Jk/o2/aaO936dSWnk34tDs4MWcGchOFpJb44lb+4Q==
X-Received: by 10.101.77.195 with SMTP id q3mr7486404pgt.420.1514493410078;
 Thu, 28 Dec 2017 12:36:50 -0800 (PST)
Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133])
 by smtp.gmail.com with ESMTPSA id m22sm71926710pfg.120.2017.12.28.12.36.49
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 28 Dec 2017 12:36:49 -0800 (PST)
Date: Thu, 28 Dec 2017 12:36:42 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Cc: bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, dev@dpdk.org
Message-ID: <20171228123642.39c7aca4@xeon-e3>
In-Reply-To: <20171228201906.22770-1-pbhagavatula@caviumnetworks.com>
References: <20171228201906.22770-1-pbhagavatula@caviumnetworks.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH] examples/l2fwd: increase pktmbuf pool size
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Dec 2017 20:36:51 -0000

On Fri, 29 Dec 2017 01:49:06 +0530
Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> wrote:

> +/*
> + * This expression is used to calculate the number of mbufs needed
> + * depending on user input, taking  into account memory for rx and
> + * tx hardware rings, cache per lcore and mbuf pkt burst per port
> + * per lcore. RTE_MAX is used to ensure that NB_MBUF never goes below
> + * a minimum value of 8192
> + */
> +#define NB_MBUF RTE_MAX(\
> +		nb_ports * (nb_rxd + nb_txd + MAX_PKT_BURST +\
> +		nb_lcores * MEMPOOL_CACHE_SIZE), (unsigned int)8192)

Why not put this inplace where it is used, rather than keeping
the define? Also good practice with macros is to not have the
macro depend on variables that are in context at that point.

You also don't need a cast of (unsigned int)8192, use 8192u instead