Go to file
Ferruh Yigit 97de3819ed net/ice/base: fix build with GCC 11
Reproduced with '--buildtype=debugoptimized' config,
compiler version: gcc (GCC) 12.0.0 20210509 (experimental)

There are multiple build errors, like:
../drivers/net/ice/base/ice_switch.c: In function ‘ice_add_marker_act’:
../drivers/net/ice/base/ice_switch.c:3727:15:
	warning: array subscript ‘struct ice_aqc_sw_rules_elem[0]’
	is partly outside array bounds of ‘unsigned char[52]’
	[-Warray-bounds]
 3727 |         lg_act->type = CPU_TO_LE16(ICE_AQC_SW_RULES_T_LG_ACT);
      |               ^~
In file included from ../drivers/net/ice/base/ice_type.h:52,
                 from ../drivers/net/ice/base/ice_common.h:8,
                 from ../drivers/net/ice/base/ice_switch.h:8,
                 from ../drivers/net/ice/base/ice_switch.c:5:
../drivers/net/ice/base/ice_osdep.h:209:29:
	note: referencing an object of size 52 allocated by ‘rte_zmalloc’
  209 | #define ice_malloc(h, s)    rte_zmalloc(NULL, s, 0)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ice/base/ice_switch.c:3720:50:
	note: in expansion of macro ‘ice_malloc’
  lg_act = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, rules_size);

These errors are mainly because allocated memory is cast to
"struct ice_aqc_sw_rules_elem *" but allocated size is less than the size
of "struct ice_aqc_sw_rules_elem".

"struct ice_aqc_sw_rules_elem" has multiple other structs has unions,
based on which one is used allocated memory being less than the size of
"struct ice_aqc_sw_rules_elem" is logically correct but compiler is
complaining about it.

Since the allocation is done explicitly and both producer and consumer
are internal, safe to ignore the warnings. Also to prevent any side
affect disabling the compiler warning for now, until proper fix done.

Reducing the warning disable to gcc >= 11 version.

Bugzilla ID: 678
Fixes: c7dd159311 ("net/ice/base: add virtual switch code")
Fixes: 02acdce2f5 ("net/ice/base: add MAC filter with marker and counter")
Fixes: f89aa3affa ("net/ice/base: support removing advanced rule")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2021-05-12 14:54:16 +02:00
.ci build: update minimum required Meson version 2021-04-16 18:51:51 +02:00
.github/workflows ci: bump ABI reference version 2021-04-16 14:09:03 +02:00
app app/testpmd: support action meter color 2021-05-12 14:06:27 +02:00
buildtools build: fix default drivers list without Python 2021-05-07 15:41:45 +02:00
config doc: fix Arm SoCs list 2021-05-06 09:41:25 +02:00
devtools doc: remove PDF requirements 2021-05-12 16:52:20 +02:00
doc net/ena: indicate Rx RSS hash presence 2021-05-12 14:19:02 +02:00
drivers net/ice/base: fix build with GCC 11 2021-05-12 14:54:16 +02:00
examples examples/timer: fix time interval 2021-05-12 16:52:20 +02:00
kernel lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
lib vhost: fix sign extension in async packed ring 2021-05-12 10:28:18 +02:00
license lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
usertools build: change indentation in infrastructure files 2021-04-21 14:04:09 +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 regex/mlx5: introduce driver for BlueField 2 2020-07-21 19:04:05 +02:00
.travis.yml ci: bump ABI reference version 2021-04-16 14:09:03 +02:00
ABI_VERSION version: 21.05-rc0 2021-02-15 11:08:19 +01:00
MAINTAINERS maintainers: update for e1000/igc/ixgbe/i40e 2021-04-29 15:56:57 +02:00
Makefile build: create dummy Makefile 2020-09-07 23:51:57 +02:00
meson_options.txt lib: allow disabling optional libraries 2021-04-21 14:17:29 +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.05-rc2 2021-05-06 00:31:24 +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