From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 37667330D; Wed, 6 Sep 2017 17:07:42 +0200 (CEST) Received: from lfbn-1-18623-73.w90-103.abo.wanadoo.fr ([90.103.154.73] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dpc0y-0003DP-QK; Wed, 06 Sep 2017 17:13:18 +0200 Received: by droids-corp.org (sSMTP sendmail emulation); Wed, 06 Sep 2017 17:07:35 +0200 Date: Wed, 6 Sep 2017 17:07:35 +0200 From: Olivier MATZ To: Venkatesh Nuthula Cc: users@dpdk.org, dev@dpdk.org Message-ID: <20170906150734.hon6fm2b4n556e6r@neon> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] Regarding changing RTE_RING_SZ_MASK to 0x7FFFFFFF 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: Wed, 06 Sep 2017 15:07:42 -0000 Hi Venky, Sorry for the late reply. On Mon, Aug 14, 2017 at 11:01:38AM -0700, Venkatesh Nuthula wrote: > Hi all, > > I am a newbie to DPDK and in one of the applications I am building , I am > trying to capture more than 150M packets and save them to file. I noticed > that with packet count > 134M, the check 'count > RTE_RING_SZ_MASK' fails > as RTE_RING_SZ_MASK is set to 0x0FFFFFFF. So I tried changing > RTE_RING_SZ_MASK to 0x7FFFFFFF and it took me past the check > 'count > RTE_RING_SZ_MASK' and the DPDK booted successfully. No error > messages. But when I try to save the packets captured in memory pool into > the file, I notice that it fails(my application exits without any error > message) to write beyond a number of packets. > > I noticed that this failure to write packets happens only when I change the > RTE_RING_SZ_MASK to 0x7FFFFFFF from original value 0x0FFFFFFF. I have below > questions to understand this further. > > > > *1) Why is RTE_RING_SZ_MASK set to 0x0FFFFFFF. Why are the 4 bits left > unused? Is it because ring size shouldn't exceed 2 power 32?2) If yes to > above question, can anybody please explain why ring size can't exceed 2 > power 32 as ssize_t can hold more than 2 power 32? * I don't see any good reason today to limit the size of the ring to 0x0FFFFFFF. Looking in the history, this was probably done to keep some room for flags. See 50d769054872 ("ring: add burst API"). The only flag used (RTE_RING_QUOT_EXCEED) has been removed recently in commit 77dd3064270c ("ring: remove watermark support"). So I think there is no issue to change the max size to 0x7FFFFFFF. I don't think it would be straightforward to increase it more, since ring->size is an uint32_t. I will submit a patch for this. Thanks, Olivier