numam-dpdk/lib/vhost
David Marchand 4414bb6701 vhost/crypto: 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/vhost/vhost_crypto.c:7:
../lib/vhost/vhost_crypto.c: In function ‘rte_vhost_crypto_fetch_requests’:
../lib/eal/x86/include/rte_memcpy.h:371:9: warning: array subscript 1 is
     outside array bounds of ‘struct virtio_crypto_op_data_req[1]’
     [-Warray-bounds]
  371 | rte_mov32((uint8_t *)dst + 3 * 32, (const uint8_t *)src + 3 * 32);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/vhost/vhost_crypto.c:1178:42: note: while referencing ‘req’
 1178 |         struct virtio_crypto_op_data_req req;
      |                                          ^~~

Split this function and separate the per descriptor copy.
This makes the code clearer, and the compiler happier.

Note: logs for errors have been moved to callers to avoid duplicates.

Fixes: 3c79609fda ("vhost/crypto: handle virtually non-contiguous buffers")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2022-06-21 11:20:58 +02:00
..
fd_man.c lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
fd_man.h lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
iotlb.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
iotlb.h vhost: improve IOTLB logs 2022-01-27 09:44:31 +01:00
meson.build vhost: integrate dmadev in asynchronous data-path 2022-02-10 15:59:17 +01:00
rte_vdpa.h vhost: add missing C++ guards 2022-02-22 14:47:49 +01:00
rte_vhost_async.h vhost: support clear in-flight packets for async dequeue 2022-06-17 15:19:57 +02:00
rte_vhost_crypto.h vhost: add missing C++ guards 2022-02-22 14:47:49 +01:00
rte_vhost.h replace zero-length arrays with flexible ones 2022-06-07 16:44:21 +02:00
socket.c vhost: get vDPA device type 2022-06-01 11:50:10 +02:00
vdpa_driver.h vhost: get vDPA device type 2022-06-01 11:50:10 +02:00
vdpa.c lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
version.map vhost: support clear in-flight packets for async dequeue 2022-06-17 15:19:57 +02:00
vhost_crypto.c vhost/crypto: fix build with GCC 12 2022-06-21 11:20:58 +02:00
vhost_user.c vhost: support vhost message for get/set config 2022-06-01 11:50:09 +02:00
vhost_user.h vhost: remove unneeded header includes 2022-06-21 16:46:57 +02:00
vhost.c vhost: add runtime locking check in unsafe API 2022-06-01 11:50:09 +02:00
vhost.h vhost: remove unneeded header includes 2022-06-21 16:46:57 +02:00
virtio_crypto.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
virtio_net.c vhost: fix log message for async dequeue 2022-06-17 16:01:21 +02:00