net/iavf: fix Rx queue buffer size alignment
authorQiming Chen <chenqiming_huawei@163.com>
Sat, 11 Sep 2021 02:07:56 +0000 (10:07 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 15 Sep 2021 02:44:22 +0000 (04:44 +0200)
commitc9c45beb1b97eed3fbf05095e376823fc58c9aa7
treeb7a64588602c7e31167263d104c92a2081fac46f
parent071eb26fb53914aafda4aa33356f65d2c7a2e4e0
net/iavf: fix Rx queue buffer size alignment

The RTE_ALIGN macro is aligned upwards. If the buf_size variable is not
aligned with 1 << I40E_RXQ_CTX_DBUFF_SHIFT, the rx_buf_len is larger than
the actual mbuf memory after the operation. When receiving the packet, if
the packet is larger than the configured buf_size, it will cause a memory
stepping event.

The patch uses the RTE_ALIGN_FLOOR down alignment macro to correct the
problem.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_rxtx.c