From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH] net/enic: fix checking for sufficient resources Date: Fri, 8 Jul 2016 17:04:21 +0100 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 Cc: dev@dpdk.org To: Nelson Escobar Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 333419AE2 for ; Fri, 8 Jul 2016 18:04:54 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1467847319-6151-1-git-send-email-neescoba@cisco.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Applied to dpdk-next-net/rel_16_07 /Bruce