From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Boule Subject: Re: [PATCH] igb/ixgbe: fix index overflow when resetting 4096 queue rings Date: Fri, 15 Nov 2013 14:26:56 +0100 Message-ID: <52862120.8070604@6wind.com> References: <1384521548-7729-1-git-send-email-thomas.monjalon@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Thomas Monjalon Return-path: In-Reply-To: <1384521548-7729-1-git-send-email-thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On 11/15/2013 02:19 PM, Thomas Monjalon wrote: > Rings are resetted with a loop because memset cannot be used without > issuing a warning about volatile casting. > The index of the loop was a 16-bit variable which is is sufficient for > ring entries number but not for the byte size of the whole ring. > The overflow happens when rings are configured for 4096 entries > (descriptor size is 16 bytes). The result is an endless loop. > > It is fixed by indexing ring entries and resetting all bytes of the entry > with a simple assignment. > The descriptor initializer is zeroed thanks to its static declaration. > > Signed-off-by: Thomas Monjalon > --- > lib/librte_pmd_e1000/igb_rxtx.c | 14 ++++++-------- > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 10 ++++++---- > 2 files changed, 12 insertions(+), 12 deletions(-) > > Acked-by: Ivan Boule -- Ivan Boule 6WIND Development Engineer