From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5360AA04B2; Sat, 2 May 2020 00:57:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E6A081D905; Sat, 2 May 2020 00:56:59 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 159E51D904 for ; Sat, 2 May 2020 00:56:58 +0200 (CEST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 041MVlV6002447; Fri, 1 May 2020 18:56:56 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 30r8296gm2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 May 2020 18:56:56 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 041MVrgj002677; Fri, 1 May 2020 18:56:56 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 30r8296gku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 May 2020 18:56:56 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 041MshND006594; Fri, 1 May 2020 22:56:55 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma05wdc.us.ibm.com with ESMTP id 30mcu78ews-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 May 2020 22:56:55 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 041MusKV46924116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 1 May 2020 22:56:54 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8A1CCAE060; Fri, 1 May 2020 22:56:54 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F126AE05C; Fri, 1 May 2020 22:56:53 +0000 (GMT) Received: from Davids-MBP.randomparity.org (unknown [9.163.83.155]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 1 May 2020 22:56:52 +0000 (GMT) To: Ferruh Yigit , Michal Krawczyk , dev@dpdk.org Cc: mw@semihalf.com, mba@semihalf.com, gtzalik@amazon.com, evgenys@amazon.com, igorch@amazon.com, arybchenko@solarflare.com, Thomas Monjalon , David Marchand References: <20200408082921.31000-1-mk@semihalf.com> <20200408082921.31000-5-mk@semihalf.com> <1b5af199-684b-c49f-024f-1ba27c4279b6@intel.com> From: David Christensen Message-ID: <54396518-ee01-3d37-4002-a9d72a298764@linux.vnet.ibm.com> Date: Fri, 1 May 2020 15:56:52 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1b5af199-684b-c49f-024f-1ba27c4279b6@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-01_16:2020-05-01, 2020-05-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 clxscore=1011 phishscore=0 priorityscore=1501 spamscore=0 suspectscore=0 adultscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005010154 Subject: Re: [dpdk-dev] [PATCH v3 04/30] net/ena/base: generate default, random RSS hash key 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >> Although the RSS key still cannot be set, it is now being generated >> every time the driver is being initialized. >> >> Multiple devices can still have the same key if they're used by the same >> driver. >> >> Signed-off-by: Michal Krawczyk >> Reviewed-by: Igor Chauskin >> Reviewed-by: Guy Tzalik > > <...> > >> @@ -256,6 +256,23 @@ static const struct eth_dev_ops ena_dev_ops = { >> .reta_query = ena_rss_reta_query, >> }; >> >> +void ena_rss_key_fill(void *key, size_t size) >> +{ >> + static bool key_generated; >> + static uint8_t default_key[ENA_HASH_KEY_SIZE]; >> + size_t i; >> + >> + RTE_ASSERT(size <= ENA_HASH_KEY_SIZE); >> + >> + if (!key_generated) { >> + for (i = 0; i < ENA_HASH_KEY_SIZE; ++i) >> + default_key[i] = rte_rand() & 0xff; >> + key_generated = true; >> + } >> + >> + rte_memcpy(key, default_key, size); >> +} >> + > > I have updated PPC cross compiler [1] and now getting following build error [2]. > cc'ed David from IBM too. Can you please check this? > > [1] > powerpc64le-linux-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 9.3.0 > > > [2] https://pastebin.com/h70uFJmm > > In file included from /.../dpdk/_ppc_64-power8-linuxapp-gcc/include/rte_ether.h:21, > from /.../dpdk/drivers/net/ena/ena_ethdev.c:7: > /.../dpdk/drivers/net/ena/ena_ethdev.c: In function ‘ena_rss_key_fill’: > /.../dpdk/_ppc_64-power8-linuxapp-gcc/include/rte_memcpy.h:47:2: error: array > subscript 3 is outside array bounds of ‘uint8_t[40]’ {aka ‘unsigned char[40]’} > [-Werror=array-bounds] > 47 | vec_vsx_st(vec_vsx_ld(48, src), 48, dst); > | ^~~~~~~~~~ > /.../dpdk/drivers/net/ena/ena_ethdev.c:277:17: note: while referencing ‘default_key’ > 277 | static uint8_t default_key[ENA_HASH_KEY_SIZE]; > | ^~~~~~~~~~~ > In file included from /.../dpdk/_ppc_64-power8-linuxapp-gcc/include/rte_ether.h:21, > from /.../dpdk/drivers/net/ena/ena_ethdev.c:7: > /.../dpdk/_ppc_64-power8-linuxapp-gcc/include/rte_memcpy.h:47:2: error: array > subscript [3, 7] is outside array bounds of ‘uint8_t[40]’ {aka ‘unsigned > char[40]’} [-Werror=array-bounds] > 47 | vec_vsx_st(vec_vsx_ld(48, src), 48, dst); > | ^~~~~~~~~~ > /.../dpdk/drivers/net/ena/ena_ethdev.c:277:17: note: while referencing ‘default_key’ > 277 | static uint8_t default_key[ENA_HASH_KEY_SIZE]; > | ^~~~~~~~~~~ > Appears to be an open gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90387). PPC optimized version of rte_memcpy() uses __builtin_constant_p() which triggers the error when -Werror=array-bounds is used, x86 DPDK does not use __builtin_constant_p() and does not encounter an error. Can you try the following? Worked for me with Ubuntu 20.04. Dave diff --git a/lib/librte_eal/ppc/include/rte_memcpy.h b/lib/librte_eal/ppc/include/rte_memcpy.h index 25311ba1d..973e2bebe 100644 --- a/lib/librte_eal/ppc/include/rte_memcpy.h +++ b/lib/librte_eal/ppc/include/rte_memcpy.h @@ -17,6 +17,11 @@ extern "C" { #include "generic/rte_memcpy.h" +#if (__GNUC__ == 9 && __GNUC_MINOR__ < 4) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif + static inline void rte_mov16(uint8_t *dst, const uint8_t *src) { @@ -108,6 +113,13 @@ rte_memcpy_func(void *dst, const void *src, size_t n) return ret; } + if (n <= 48) { + rte_mov32((uint8_t *)dst, (const uint8_t *)src); + rte_mov16((uint8_t *)dst - 16 + n, + (const uint8_t *)src - 16 + n); + return ret; + } + if (n <= 64) { rte_mov32((uint8_t *)dst, (const uint8_t *)src); rte_mov32((uint8_t *)dst - 32 + n, @@ -192,6 +204,11 @@ rte_memcpy_func(void *dst, const void *src, size_t n) return ret; } +#if (__GNUC__ == 9 && __GNUC_MINOR__ < 4) +#pragma GCC diagnostic pop +#endif + + #ifdef __cplusplus } #endif