From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 333419AE2
 for <dev@dpdk.org>; Fri,  8 Jul 2016 18:04:54 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga103.jf.intel.com with ESMTP; 08 Jul 2016 09:04:24 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.28,330,1464678000"; d="scan'208";a="1003285575"
Received: from ahaldar-mobl.ger.corp.intel.com ([10.252.24.62])
 by fmsmga001.fm.intel.com with SMTP; 08 Jul 2016 09:04:22 -0700
Received: by  (sSMTP sendmail emulation); Fri, 08 Jul 2016 17:04:21 +0025
Date: Fri, 8 Jul 2016 17:04:21 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: Nelson Escobar <neescoba@cisco.com>
Cc: dev@dpdk.org
Message-ID: <20160708160420.GD29116@bricha3-MOBL3>
References: <1467847319-6151-1-git-send-email-neescoba@cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1467847319-6151-1-git-send-email-neescoba@cisco.com>
Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?=
 =?iso-8859-1?Q?opment?= Ireland Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
Subject: Re: [dpdk-dev] [PATCH] net/enic: fix checking for sufficient
	resources
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: Fri, 08 Jul 2016 16:04:54 -0000

On Wed, Jul 06, 2016 at 04:21:59PM -0700, Nelson Escobar wrote:
> The enic PMD was using the same variables in the enic structure to
> track two different things.  Initially rq_count, wq_count, cq_count,
> and intr_count were set to the values obtained from the VIC adapters
> as the maximum resources allocated on the VIC, then in
> enic_set_vnic_res(), they were set to the counts of resources actually
> used, discarding the initial values. The checks in enic_set_vnic_res()
> were technically incorrect if it is called more than once on a port,
> which happens when using bonding, but were harmless in practice as the
> checks couldn't fail on the second call.
> 
> The enic rx-scatter patch misunderstood the subtleties of
> enic_set_vnic_res(), and naively added a multiply by two to the
> rq_count check. This resulted in the rq_count check failing when
> enic_set_vnic_res() was called a second time, ie when using bonding.
> 
> This patch adds new variables to the enic structure to track the
> maximum resources the VIC is configured to provide so that the
> information isn't later lost and calls to enic_set_vnic_res() do
> the expected thing.
> 
> Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>

Applied to dpdk-next-net/rel_16_07

/Bruce