From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 30F121B5D9; Wed, 4 Oct 2017 00:04:13 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 03 Oct 2017 15:04:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,475,1500966000"; d="scan'208";a="906388711" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.241.224.245]) ([10.241.224.245]) by FMSMGA003.fm.intel.com with ESMTP; 03 Oct 2017 15:04:11 -0700 To: Andrew Rybchenko , dev@dpdk.org Cc: Ivan Malov , stable@dpdk.org References: <1507016634-6298-1-git-send-email-arybchenko@solarflare.com> From: Ferruh Yigit Message-ID: <6db7ff3a-25cc-fdfc-14a6-a3f8e3b9f1b2@intel.com> Date: Tue, 3 Oct 2017 23:04:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1507016634-6298-1-git-send-email-arybchenko@solarflare.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] net/sfc: add device state check to reta update operation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 22:04:14 -0000 On 10/3/2017 8:43 AM, Andrew Rybchenko wrote: > From: Ivan Malov > > The callback must not attempt to program RSS table to the HW > in non-started state; the new table must be remembered and > applied on the next start > > Fixes: 32bcfb0a50b1 ("net/sfc: update RSS redirection table") > Cc: stable@dpdk.org > > Signed-off-by: Ivan Malov > Signed-off-by: Andrew Rybchenko > Reviewed-by: Andy Moreton > --- > drivers/net/sfc/sfc_ethdev.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c > index 9e65b6a..8650f87 100644 > --- a/drivers/net/sfc/sfc_ethdev.c > +++ b/drivers/net/sfc/sfc_ethdev.c > @@ -1399,11 +1399,16 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev, > } > } > > - rc = efx_rx_scale_tbl_set(sa->nic, EFX_RSS_CONTEXT_DEFAULT, > - rss_tbl_new, EFX_RSS_TBL_SIZE); > - if (rc == 0) > - rte_memcpy(sa->rss_tbl, rss_tbl_new, sizeof(sa->rss_tbl)); > + if (sa->state == SFC_ADAPTER_STARTED) { This is causing a build error with clang: .../dpdk/drivers/net/sfc/sfc_ethdev.c:1402:6: error: variable 'rc' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (sa->state == SFC_ADAPTER_STARTED) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../dpdk/drivers/net/sfc/sfc_ethdev.c:1418:10: note: uninitialized use occurs here return -rc; ^~ .../dpdk/drivers/net/sfc/sfc_ethdev.c:1402:2: note: remove the 'if' if its condition is always true if (sa->state == SFC_ADAPTER_STARTED) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../dpdk/drivers/net/sfc/sfc_ethdev.c:1357:8: note: initialize the variable 'rc' to silence this warning int rc; ^ = 0 > + rc = efx_rx_scale_tbl_set(sa->nic, EFX_RSS_CONTEXT_DEFAULT, > + rss_tbl_new, EFX_RSS_TBL_SIZE); > + if (rc != 0) > + goto fail_scale_tbl_set; > + } > + > + rte_memcpy(sa->rss_tbl, rss_tbl_new, sizeof(sa->rss_tbl)); > > +fail_scale_tbl_set: > bad_reta_entry: > sfc_adapter_unlock(sa); > >