]> git.droids-corp.org - dpdk.git/commit
common/cnxk: fix build with custom maximum port config
authorVamsi Attunuru <vattunuru@marvell.com>
Wed, 2 Mar 2022 13:46:54 +0000 (19:16 +0530)
committerJerin Jacob <jerinj@marvell.com>
Thu, 3 Mar 2022 05:59:25 +0000 (06:59 +0100)
commit694e29ea9b8dd9c0f532db37ac64dc2daa482bb1
tree2a2ab3c8d1f849174d48609ded500d03ba6ce50f
parentd852fec1be63126bb2c16be187340eb89a3d8a32
common/cnxk: fix build with custom maximum port config

Build fails with custom max eth ports configuration, like
-Dmax_ethports=1024.

Build error is:
../drivers/common/cnxk/roc_nix_inl_dev.c:794:2:
  note: in expansion of macro ‘PLT_STATIC_ASSERT’
 |  PLT_STATIC_ASSERT(sizeof(struct nix_inl_dev) <= ROC_NIX_INL_MEM_SZ);
 |  ^~~~~~~~~~~~~~~~~

Earlier soft expiry ring struct member was an array of pointers and it's
size is linked to number of RTE_MAX_ETHPORTS, and the whole struct size
is confined and protected by size assertion.
It resulted in build failure with -Dmax_ethports=1024 option and
assertion caught that failure.

Use dynamically allocated memory for storing soft expiry ring base
addresses which fixes the struct size against custom RTE_MAX_ETHPORTS
values and solves the static assertion failure.

Bugzilla ID: 940
Fixes: bea5d990a93b ("net/cnxk: support outbound soft expiry notification")
Cc: stable@dpdk.org
Reported-by: Wei Ling <weix.ling@intel.com>
Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_nix_inl.c
drivers/common/cnxk/roc_nix_inl.h
drivers/common/cnxk/roc_nix_inl_dev.c
drivers/common/cnxk/roc_nix_inl_priv.h
drivers/common/cnxk/roc_platform.h