diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2022-12-22 01:06:21 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2023-01-03 16:06:30 +0100 |
commit | b17cadff1d3d060eb8b19aac8787b894d2e1c89a (patch) | |
tree | 5d8f314972e75df07bc0f49eff4e35bbc5599bcf | |
parent | 1dcc490d44879f33392337dfd9175645fcc4118e (diff) | |
download | openvswitch-b17cadff1d3d060eb8b19aac8787b894d2e1c89a.tar.gz |
netdev-afxdp: Hide too large memset from sparse.
Sparse complains about 64M umem initialization. Hide it from
the checker instead of disabling a warning globally.
SPARSE_FLAGS are kept in the CI script even though they are
empty at the moment.
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rwxr-xr-x | .ci/linux-build.sh | 4 | ||||
-rw-r--r-- | lib/netdev-afxdp.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index a944cf149..e6e4f6a60 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -222,10 +222,6 @@ elif [ "$M32" ]; then export CC="$CC -m32" else EXTRA_OPTS="$EXTRA_OPTS --enable-sparse" - if [ "$AFXDP" ]; then - # netdev-afxdp uses memset for 64M for umem initialization. - SPARSE_FLAGS="${SPARSE_FLAGS} -Wno-memcpy-max-count" - fi CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${SPARSE_FLAGS}" fi diff --git a/lib/netdev-afxdp.c b/lib/netdev-afxdp.c index f8995da1f..16f26bc30 100644 --- a/lib/netdev-afxdp.c +++ b/lib/netdev-afxdp.c @@ -434,7 +434,11 @@ xsk_configure(int ifindex, int xdp_queue_id, enum afxdp_mode mode, /* Umem memory region. */ bufs = xmalloc_pagealign(NUM_FRAMES * FRAME_SIZE); +#ifndef __CHECKER__ + /* Sparse complains about a very large memset, but it is OK in this case. + * So, hiding it from the checker. */ memset(bufs, 0, NUM_FRAMES * FRAME_SIZE); +#endif /* Create AF_XDP socket. */ umem = xsk_configure_umem(bufs, NUM_FRAMES * FRAME_SIZE); |