From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 375CB594D for ; Fri, 15 Nov 2013 16:14:55 +0100 (CET) Received: by mail-wg0-f50.google.com with SMTP id k14so3643763wgh.17 for ; Fri, 15 Nov 2013 07:15:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:organization:to:subject:date:user-agent:cc :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=STQKRkbrcLfLsCaNvhRCTIC6Jaa0ROkvIt2caDtElL0=; b=M3YsSpX9voYkeBgGeXD6cdCRZyztAMDTEOmiKOndKTOZfL3XO17TIKeIsSS5d/J+Ew TwCBzPw6runa3jjHyC8VCPwHSDnGgBy7Dt8Ntu8m2LKar61AqIHYD/UUHcSVf9nchSq8 7Zu4mpiKxzPqa1MWwkeHUAxr18K5Ll7vhbjiQomb3CERB+R3A6MRavpZFEP/62TAM1Um Jp/EjTTU9uFlHJ0Ig2KXW+440YEM6vGiFj958akA35N9pkzgNDGhWv/TXFQnjmvyAYkj sGY3j6ThAJ/YkygULgeUaSa7b8wNqK5VgJXh0aOUiqntICITUMMhY7+UFLdDszzDQNYr Az8w== X-Gm-Message-State: ALoCoQmV1FaVTxb9fZGACVSYuNZbRFRJaHedflQ/FoSCKn0Acq4Sr4aXLR7YZAnXWJjbMk0tDY+B X-Received: by 10.194.77.167 with SMTP id t7mr7213598wjw.27.1384528551513; Fri, 15 Nov 2013 07:15:51 -0800 (PST) Received: from angus.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id je17sm5979827wic.4.2013.11.15.07.15.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2013 07:15:50 -0800 (PST) From: Thomas Monjalon Organization: 6WIND To: Ivan Boule Date: Fri, 15 Nov 2013 16:15:48 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) References: <1384521548-7729-1-git-send-email-thomas.monjalon@6wind.com> <52862120.8070604@6wind.com> In-Reply-To: <52862120.8070604@6wind.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201311151615.48422.thomas.monjalon@6wind.com> Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] igb/ixgbe: fix index overflow when resetting 4096 queue rings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Nov 2013 15:14:55 -0000 15/11/2013 14:26, Ivan Boule : > 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 pushed -- Thomas