On 4/8/2020 9:28 AM, Michal Krawczyk wrote: > 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 <m...@semihalf.com> > Reviewed-by: Igor Chauskin <igo...@amazon.com> > Reviewed-by: Guy Tzalik <gtza...@amazon.com>
<...> > @@ -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]; | ^~~~~~~~~~~