net/ice: fix overflow in maximum packet length config
authorTudor Cornea <tudor.cornea@keysight.com>
Tue, 15 Jun 2021 10:38:34 +0000 (13:38 +0300)
committerQi Zhang <qi.z.zhang@intel.com>
Sun, 4 Jul 2021 14:57:12 +0000 (16:57 +0200)
commit58bb86cf13b8535fa8786f97cc9a4dfaa780a51e
tree11eebbdef2f4412a3c3f12ad2bcdbb7cf8a475bc
parentc30751afc36053a095db844b825fab859474a60a
net/ice: fix overflow in maximum packet length config

The len variable, used in the computation of max_pkt_len could overflow,
if used to store the result of the following computation:

ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len

Since, we could define the mbuf size to have a large value (i.e 13312),
and ICE_SUPPORT_CHAIN_NUM is defined as 5, the computation mentioned
above could potentially result in a value which might be bigger than
MAX_USHORT.

The result will be that Jumbo Frames will not work properly

Fixes: 1b009275e2c8 ("net/ice: add Rx queue init in DCF")
Cc: stable@dpdk.org
Signed-off-by: Tudor Cornea <tudor.cornea@keysight.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_dcf_ethdev.c
drivers/net/ice/ice_rxtx.c