net/iavf: fix overflow in maximum packet length config
authorTudor Cornea <tudor.cornea@gmail.com>
Thu, 5 Aug 2021 11:35:23 +0000 (14:35 +0300)
committerQi Zhang <qi.z.zhang@intel.com>
Mon, 30 Aug 2021 01:05:32 +0000 (03:05 +0200)
commit7fe741821337f3cbeecac768b8ef3a16bf21c938
treee75ee3571205404126bb53c67eae843da3767019
parent415363e2fc58ad89caf65d3d170b004751376f1a
net/iavf: 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:

rxq->rx_buf_len * IAVF_MAX_CHAINED_RX_BUFFERS

Since, we could define the mbuf size to have a large value (i.e 13312),
and IAVF_MAX_CHAINED_RX_BUFFERS 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: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Tudor Cornea <tudor.cornea@gmail.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_ethdev.c