From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-we0-f175.google.com (mail-we0-f175.google.com
 [74.125.82.175]) by dpdk.org (Postfix) with ESMTP id B83576A99
 for <dev@dpdk.org>; Mon, 29 Sep 2014 12:54:33 +0200 (CEST)
Received: by mail-we0-f175.google.com with SMTP id q59so1567829wes.34
 for <dev@dpdk.org>; Mon, 29 Sep 2014 04:01:08 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=g6KodWEr70fB0/PfC1BzxYvClYJDA06OWAf3DffpgBY=;
 b=nDkjzejTHj5VfAJH+F7sa/0ayF+QA/bxWyuUjjfMXCVDSGzej5naUnLEOLCJgME4ym
 c7txXPj/sdwL7MgUDvs2glhkWMJAg5Q+yMg1Mos8XxWTmRK4AIkEfarvMXSxhAtvXyCh
 8Gjoe9hzqtI/sLXBbck2flHDcD4zdzAe/jLog3AMY8QWtTNF+A325AwtN0FRRg7Iq8tG
 +oFY3gn+9P5etO45uAmftoxxHmkoooUL2DwubfSCI5F16rLwb2YOEjyXbjdrvnvz8FSw
 SfxJjrLfiCKUwSGXpNQNyHTOlm1iCPeMVti6QlyX1lOSV1xV1DE5TZKCHDKqbX+zwPMs
 KQdw==
X-Gm-Message-State: ALoCoQkOsBaTb/H8MuRvCczcijAeEPwnnrTYyeURRFGk2Fi87c6pDNCKgw4bhK7KsYDL+YeESFA3
X-Received: by 10.180.212.48 with SMTP id nh16mr3855049wic.44.1411988468673;
 Mon, 29 Sep 2014 04:01:08 -0700 (PDT)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by mx.google.com with ESMTPSA id ga9sm15296080wjb.45.2014.09.29.04.01.07
 for <multiple recipients>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 29 Sep 2014 04:01:07 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: "Nemeth, Balazs" <balazs.nemeth@intel.com>
Date: Mon, 29 Sep 2014 13:00:57 +0200
Message-ID: <3180739.dqlX9CSYNs@xps13>
Organization: 6WIND
User-Agent: KMail/4.13.3 (Linux/3.15.8-1-ARCH; KDE/4.13.3; x86_64; ; )
In-Reply-To: <2601191342CEEE43887BDE71AB9772582137C148@IRSMSX104.ger.corp.intel.com>
References: <1411725440-4520-1-git-send-email-balazs.nemeth@intel.com>
 <2601191342CEEE43887BDE71AB9772582137C148@IRSMSX104.ger.corp.intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix crash caused by bulk allocation
	failure in vector pmd
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://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: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 29 Sep 2014 10:54:33 -0000

> > Since the introduction of vector PMD, a bug in ixgbe_rxq_rearm could
> > cause a crash. As long as the memory pool allocated to the RX queue
> > has mbufs available, there is no problem. After allocation of _all_
> > mbufs from the memory pool, previously returned mbufs by
> > rte_eth_rx_burst could be accessed by subsequent calls to the PMD and
> > could be returned by subsequent calls to rte_eth_rx_burst. From the
> > perspective of the application, the means that fields within the mbuf
> > could change and that previously allocated mbufs could appear multiple
> > times.
> > 
> > After failure of mbuf allocation, the dd bits should indicate that the
> > packets are not ready. For this, this patch adds code to reset the dd
> > bits in the first RTE_IXGBE_DESCS_PER_LOOP packets of the next
> > RTE_IXGBE_RXQ_REARM_THRESH packets only if the next
> > RTE_IXGBE_RXQ_REARM_THRESH packets that will be accessed contain
> > previously allocated packets.
> > 
> > Setting the bits is not enough. The bits are checked _after_ setting
> > the mbuf fields, thus a mechanism is needed to prevent the previously
> > used mbuf pointers from being accessed during the speculative load of
> > the mbuf fields. For this reason, not only the dd bits are reset, but
> > also the mbufs associated to those descriptors are set to point to a
> > "fake" mbuf.
> > 
> > Signed-off-by: Balazs Nemeth <balazs.nemeth@intel.com>
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied

Thanks
-- 
Thomas