aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-dpdk/include/odp/api
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2023-12-21 13:09:12 +0200
committerTuomas Taipale <95341842+TuomasTaipale@users.noreply.github.com>2024-01-12 10:58:26 +0200
commit3e269c622ae1c12b466f30f70896197a7311000f (patch)
tree9fa66520b8303b8b72171cc13cf66ab51568264b /platform/linux-dpdk/include/odp/api
parentcce2f04368c395e719112260993f3712aeb686fd (diff)
linux-dpdk: buffer: ignore array bounds warnings from emmintrin.h
When compiling with GCC 13, there are many warnings from emmintrin.h: /usr/lib/gcc/x86_64-redhat-linux/13/include/emmintrin.h:706:10: warning: array subscript 5 is outside array bounds of ‘struct rte_mbuf *[10]’ [-Warray-bounds=] These are warnings from call chains involving rte_memcpy(). They're false positives, where GCC 13 is apparently unable to figure out that subscripts are in fact within bounds. Ignore the warnings by using pragmas. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include/odp/api')
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h b/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h
index 396d78559..1740c36b3 100644
--- a/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h
+++ b/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h
@@ -115,6 +115,12 @@ _ODP_INLINE void odp_buffer_free_multi(const odp_buffer_t buf[], int num)
mp_pending = mbuf_tbl[0]->pool;
num_pending = 1;
+/*
+ * num_pending is less than or equal to num, but GCC 13 is not able figure that out, so we have to
+ * ignore array-bounds warnings in the rte_mempool_put_bulk() calls.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
for (int i = 1; i < num; i++) {
struct rte_mbuf *mbuf = (struct rte_mbuf *)buf[i];
@@ -128,6 +134,7 @@ _ODP_INLINE void odp_buffer_free_multi(const odp_buffer_t buf[], int num)
}
}
rte_mempool_put_bulk(mp_pending, (void **)mbuf_tbl, num_pending);
+#pragma GCC diagnostic pop
}
_ODP_INLINE int odp_buffer_is_valid(odp_buffer_t buf)