From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5E4337CAA; Tue, 29 Aug 2017 19:04:05 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 10:04:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,445,1498546800"; d="scan'208";a="123717873" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga004.jf.intel.com with ESMTP; 29 Aug 2017 10:04:00 -0700 To: Andrew Rybchenko , dev@dpdk.org Cc: Ivan Malov , stable@dpdk.org References: <1503924826-27311-1-git-send-email-arybchenko@solarflare.com> From: Ferruh Yigit Message-ID: Date: Tue, 29 Aug 2017 18:03:59 +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: <1503924826-27311-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: specify correct scale table size on Rx start 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, 29 Aug 2017 17:04:06 -0000 On 8/28/2017 1:53 PM, Andrew Rybchenko wrote: > From: Ivan Malov > > efx_rx_scale_tbl_set() takes the number of entries in the scale table > to be set, not the size of the table in bytes; currently this bug does > not make any damage since the size argument is used to wrap the loop > on the input table when filling in an MCDI request in case if the table > size in the MCDI request is larger then one provided by the user, > and MCDI scale table size is the same as the size of the table provided > by the driver; this patch brings a fix for the bug > > Fixes: 4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach") > Cc: stable@dpdk.org > > Signed-off-by: Ivan Malov > Signed-off-by: Andrew Rybchenko > --- > drivers/net/sfc/sfc_rx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c > index 1bf8644..364f718 100644 > --- a/drivers/net/sfc/sfc_rx.c > +++ b/drivers/net/sfc/sfc_rx.c > @@ -1068,7 +1068,7 @@ struct sfc_dp_rx sfc_efx_rx = { > goto finish; > It is not shown in this patch, but there is "sizeof(sa->rss_key)" usage here, since its type is uint8_t, it is not wrong, but it can be good to change that one too to RTE_DIM() both to show the intent and to be safe if in the future type updated... But this is your call to update or not. > rc = efx_rx_scale_tbl_set(sa->nic, sa->rss_tbl, > - sizeof(sa->rss_tbl)); > + RTE_DIM(sa->rss_tbl)); There are more sizeof(sa->rss_tbl) usage in sfc_ethdev.c [1], can you please check them too? malloc and memcpy ones look suspicious. [1] $ git grep "sizeof(sa->rss_tbl)" drivers/net/sfc/sfc_ethdev.c: rss_tbl_new = rte_zmalloc("rss_tbl_new", sizeof(sa->rss_tbl), 0); drivers/net/sfc/sfc_ethdev.c: rte_memcpy(rss_tbl_new, sa->rss_tbl, sizeof(sa->rss_tbl)); drivers/net/sfc/sfc_ethdev.c: rte_memcpy(sa->rss_tbl, rss_tbl_new, sizeof(sa->rss_tbl)); drivers/net/sfc/sfc_rx.c: sizeof(sa->rss_tbl)); > } > > finish: >