Go to file
Eli Britstein da0333c879 mbuf: avoid cast-align warning in data offset macro
In rte_pktmbuf_mtod_offset macro, there is a casting from char * to type
't', which may cause cast-align warning when using strict cast align
flag with supporting gcc:
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
CFLAGS="-Wcast-align=strict" make V=1 -C examples/l2fwd clean static

main.c: In function 'l2fwd_mac_updating':
/dpdk/build/include/rte_mbuf_core.h:719:3: warning: cast increases
required alignment of target type [-Wcast-align]
  719 |  ((t)((char *)(m)->buf_addr + (m)->data_off + (o)))
      |   ^
/dpdk/build/include/rte_mbuf_core.h:733:32: note: in expansion of macro
'rte_pktmbuf_mtod_offset'
  733 | #define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0)
      |                                ^~~~~~~~~~~~~~~~~~~~~~~

As the code assumes correct alignment, add first a (void *) casting, to
avoid the warning.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-10-25 17:27:48 +02:00
.ci build: update minimum required Meson version 2021-04-16 18:51:51 +02:00
.github/workflows version: 21.11-rc0 2021-08-17 08:37:52 +02:00
app mempool: fix non-IO flag inference 2021-10-25 16:52:56 +02:00
buildtools buildtools: enable header includes check on Windows 2021-10-11 21:17:21 +02:00
config eventdev: allocate max space for internal arrays 2021-10-21 10:14:50 +02:00
devtools devtools: add cocci script to rename mbuf offload flags 2021-10-24 13:37:02 +02:00
doc doc: fix default mempool option in guides 2021-10-25 17:12:52 +02:00
drivers mbuf: add namespace to offload flags 2021-10-24 13:37:43 +02:00
examples port: configure loop count for source port 2021-10-25 14:30:32 +02:00
kernel kni: fix build for SLES15-SP3 2021-10-25 15:30:23 +02:00
lib mbuf: avoid cast-align warning in data offset macro 2021-10-25 17:27:48 +02:00
license lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
usertools usertools/pmdinfo: fix plugin auto scan 2021-10-25 17:09:01 +02:00
.editorconfig doc: add Meson coding style to contributors guide 2021-04-21 14:04:09 +02:00
.gitattributes improve git diff 2016-11-13 15:25:12 +01:00
.gitignore doc: add flow API features tables 2021-05-18 19:06:56 +02:00
.travis.yml version: 21.11-rc0 2021-08-17 08:37:52 +02:00
ABI_VERSION version: 21.11-rc0 2021-08-17 08:37:52 +02:00
MAINTAINERS crypto/ipsec_mb: add chacha_poly PMD 2021-10-20 15:33:16 +02:00
Makefile build: create dummy Makefile 2020-09-07 23:51:57 +02:00
meson_options.txt build: add optional NUMA and CPU counts detection 2021-09-16 09:43:28 +02:00
meson.build lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
README license: introduce SPDX identifiers 2018-01-04 22:41:38 +01:00
VERSION version: 21.11-rc0 2021-08-17 08:37:52 +02:00

DPDK is a set of libraries and drivers for fast packet processing.
It supports many processor architectures and both FreeBSD and Linux.

The DPDK uses the Open Source BSD-3-Clause license for the core libraries
and drivers. The kernel components are GPL-2.0 licensed.

Please check the doc directory for release notes,
API documentation, and sample application information.

For questions and usage discussions, subscribe to: users@dpdk.org
Report bugs and issues to the development mailing list: dev@dpdk.org