]> git.droids-corp.org - dpdk.git/commit
net/ena: fix build with GCC 12
authorDavid Marchand <david.marchand@redhat.com>
Wed, 18 May 2022 10:16:49 +0000 (12:16 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 15 Jun 2022 08:19:18 +0000 (10:19 +0200)
commit2449949584667fbb275df1ea5a5ceeead1a65786
tree7c8988e6d7c51ef5376f7c4a2c6711a6a1d23009
parent468f31eb71c4c2aa454841b316766514cabd0f02
net/ena: fix build with GCC 12

GCC 12 raises the following warning:

In file included from ../lib/mempool/rte_mempool.h:46,
                 from ../lib/mbuf/rte_mbuf.h:38,
                 from ../lib/net/rte_ether.h:22,
                 from ../drivers/net/ena/ena_ethdev.h:10,
                 from ../drivers/net/ena/ena_rss.c:6:
../drivers/net/ena/ena_rss.c: In function ‘ena_rss_key_fill’:
../lib/eal/x86/include/rte_memcpy.h:370:9: warning: array subscript 64 is
        outside array bounds of ‘uint8_t[40]’
        {aka ‘unsigned char[40]’} [-Warray-bounds]
  370 | rte_mov32((uint8_t *)dst + 2 * 32, (const uint8_t *)src + 2 * 32);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ena/ena_rss.c:51:24: note: while referencing ‘default_key’
   51 | static uint8_t default_key[ENA_HASH_KEY_SIZE];
      |                ^~~~~~~~~~~

This is a false positive because the copied size is checked against
ENA_HASH_KEY_SIZE in a (build) assert.
Silence this warning by calling memcpy with the minimal size.

Bugzilla ID: 849
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/ena/ena_rss.c