From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id C105B156 for ; Fri, 15 Nov 2013 14:26:07 +0100 (CET) Received: by mail-wg0-f51.google.com with SMTP id m15so3454551wgh.6 for ; Fri, 15 Nov 2013 05:27:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=5TXoswHq1YRctmr3H0X4VuCqEEsp+vUCQWxcWXYDXTw=; b=D31ITCyRr5WU5ksg0kMK6dYRMflA0ctC3ID7v8rnSUeyTPRqKn4n/UTEby4OXdu7OO qzw+8pbfKxEVQ6kRoGsxRWg7h23rpWc5CH3mZ2MF2wK0Jp35C61QTUK/NP+bay6/RNLf R73XSF5IEaErH5fn22ffIhIc/3Ai//0psVD9Dc65jsN0dUE5iO4iC4LZaDD9/LAwB8T7 JF0G4eSEtQ3RjHRwXzxpzEuSw/gQlzztGWt5gz+xMlBme8CCTtnnUopBjuKRv5uEOWVk EAl4sW+aoZA297Vxwe7qORZdKOYbRSnKf7ysJFUkVcwi2ngAweRHP27fMJU5ViBqMBZh YEXg== X-Gm-Message-State: ALoCoQkGShSgE4HcUcTrWguKHcYwePOv1PbsMTa49g8NhaCavJtPtYk0nH//bKgl3xc4E10rg4Sb X-Received: by 10.180.188.49 with SMTP id fx17mr7335577wic.33.1384522021031; Fri, 15 Nov 2013 05:27:01 -0800 (PST) Received: from [10.16.0.189] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id uc12sm5134257wib.3.2013.11.15.05.26.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Nov 2013 05:26:59 -0800 (PST) Message-ID: <52862120.8070604@6wind.com> Date: Fri, 15 Nov 2013 14:26:56 +0100 From: Ivan Boule User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9 MIME-Version: 1.0 To: Thomas Monjalon References: <1384521548-7729-1-git-send-email-thomas.monjalon@6wind.com> In-Reply-To: <1384521548-7729-1-git-send-email-thomas.monjalon@6wind.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 13:26:08 -0000 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