[PATCH v12 03/12] common/zsda: add some common functions
Stephen Hemminger
stephen at networkplumber.org
Tue Oct 22 04:16:15 CEST 2024
On Sat, 19 Oct 2024 19:04:05 +0800
Hanxiao Li <li.hanxiao at zte.com.cn> wrote:
> +struct zsda_op_cookie {
> + bool used;
> + bool decomp_no_tail;
> + void *op;
> + uint16_t sid;
> + struct zsda_sgl sgl_src;
> + struct zsda_sgl sgl_dst;
> + phys_addr_t sgl_src_phys_addr;
> + phys_addr_t sgl_dst_phys_addr;
> + phys_addr_t comp_head_phys_addr;
> +
> + uint8_t comp_head[COMP_REMOVE_SPACE_LEN];
> +} __rte_packed;
If the config/meson.build file is changed to re-enable some compiler warnings
that are being suppressed. It shows that this structure might be problematic.
This is not a show stopper. But it does indicate problems (especially on Arm where
unaligned access is more of a problem).
In file included from ../drivers/common/zsda/zsda_common.c:5:
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
That means the void * value is not aligned etc.
Full list of warnings
[1094/3082] Compiling C object drivers/libtmp_rte_common_zsda.a.p/crypto_zsda_zsda_sym.c.o
In file included from ../drivers/crypto/zsda/zsda_sym.h:8,
from ../drivers/crypto/zsda/zsda_sym.c:8:
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:252:25: warning: ‘sgl_src’ offset 12 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
252 | struct zsda_sgl sgl_src;
| ^~~~~~~
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:253:25: warning: ‘sgl_dst’ offset 8204 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
253 | struct zsda_sgl sgl_dst;
| ^~~~~~~
../drivers/crypto/zsda/zsda_sym.c: In function ‘zsda_build_cipher_request’:
../drivers/crypto/zsda/zsda_sym.c:142:36: warning: taking address of packed member of ‘struct zsda_op_cookie’ may result in an unaligned pointer value [-Waddress-of-packed-member]
142 | struct zsda_sgl *sgl_src = (struct zsda_sgl *)&cookie->sgl_src;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/crypto/zsda/zsda_sym.c:143:36: warning: taking address of packed member of ‘struct zsda_op_cookie’ may result in an unaligned pointer value [-Waddress-of-packed-member]
143 | struct zsda_sgl *sgl_dst = (struct zsda_sgl *)&cookie->sgl_dst;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/crypto/zsda/zsda_sym.c: In function ‘zsda_build_hash_request’:
../drivers/crypto/zsda/zsda_sym.c:220:36: warning: taking address of packed member of ‘struct zsda_op_cookie’ may result in an unaligned pointer value [-Waddress-of-packed-member]
220 | struct zsda_sgl *sgl_src = &cookie->sgl_src;
| ^~~~~~~~~~~~~~~~
[1095/3082] Compiling C object drivers/libtmp_rte_common_zsda.a.p/crypto_zsda_zsda_sym_pmd.c.o
In file included from ../drivers/crypto/zsda/zsda_sym.h:8,
from ../drivers/crypto/zsda/zsda_sym_pmd.c:9:
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:252:25: warning: ‘sgl_src’ offset 12 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
252 | struct zsda_sgl sgl_src;
| ^~~~~~~
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:253:25: warning: ‘sgl_dst’ offset 8204 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
253 | struct zsda_sgl sgl_dst;
| ^~~~~~~
[1096/3082] Compiling C object drivers/librte_dma_cnxk.a.p/meson-generated_.._rte_dma_cnxk.pmd.c.o
[1097/3082] Generating drivers/rte_mempool_cnxk.sym_chk with a custom command (wrapped by meson to capture output)
[1098/3082] Generating drivers/rte_mempool_dpaa.sym_chk with a custom command (wrapped by meson to capture output)
[1099/3082] Compiling C object drivers/libtmp_rte_common_zsda.a.p/compress_zsda_zsda_comp_pmd.c.o
In file included from ../drivers/compress/zsda/zsda_comp.h:10,
from ../drivers/compress/zsda/zsda_comp_pmd.c:7:
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:252:25: warning: ‘sgl_src’ offset 12 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
252 | struct zsda_sgl sgl_src;
| ^~~~~~~
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:253:25: warning: ‘sgl_dst’ offset 8204 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
253 | struct zsda_sgl sgl_dst;
| ^~~~~~~
[1100/3082] Linking static target drivers/libtmp_rte_dma_dpaa2.a
[1101/3082] Compiling C object drivers/libtmp_rte_common_zsda.a.p/crypto_zsda_zsda_sym_session.c.o
In file included from ../drivers/crypto/zsda/zsda_sym_session.c:7:
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:252:25: warning: ‘sgl_src’ offset 12 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
252 | struct zsda_sgl sgl_src;
| ^~~~~~~
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:253:25: warning: ‘sgl_dst’ offset 8204 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
253 | struct zsda_sgl sgl_dst;
| ^~~~~~~
[1102/3082] Generating drivers/rte_mempool_dpaa2.sym_chk with a custom command (wrapped by meson to capture output)
[1103/3082] Compiling C object drivers/libtmp_rte_common_zsda.a.p/common_zsda_zsda_qp.c.o
In file included from ../drivers/common/zsda/zsda_qp.c:9:
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:252:25: warning: ‘sgl_src’ offset 12 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
252 | struct zsda_sgl sgl_src;
| ^~~~~~~
../drivers/common/zsda/zsda_common.h:259:1: warning: alignment 1 of ‘struct zsda_op_cookie’ is less than 64 [-Wpacked-not-aligned]
259 | } __rte_packed;
| ^
../drivers/common/zsda/zsda_common.h:253:25: warning: ‘sgl_dst’ offset 8204 in ‘struct zsda_op_cookie’ isn’t aligned to 64 [-Wpacked-not-aligned]
253 | struct zsda_sgl sgl_dst;
| ^~~~~~~
More information about the dev
mailing list