Skip to content

Commit

Permalink
net/mvpp2: remove CRC length from MRU validation
Browse files Browse the repository at this point in the history
[ upstream commit 31536a6 ]

CRC is being removed by HW before packet get
write to the buffer, so CRC len should not be
included in MRU validation

Fixes: 79ec620 ("net/mvpp2: update MTU and MRU related calculations")

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
  • Loading branch information
liron-himi-mvl authored and cpaelzer committed Feb 3, 2021
1 parent 39733ff commit 0595f2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/mvpp2/mrvl_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ mrvl_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
* when this feature has not been enabled/supported so far
* (TODO check scattered_rx flag here once scattered RX is supported).
*/
if (mru + MRVL_PKT_OFFS > mbuf_data_size) {
mru = mbuf_data_size - MRVL_PKT_OFFS;
if (mru - RTE_ETHER_CRC_LEN + MRVL_PKT_OFFS > mbuf_data_size) {
mru = mbuf_data_size + RTE_ETHER_CRC_LEN - MRVL_PKT_OFFS;
mtu = MRVL_PP2_MRU_TO_MTU(mru);
MRVL_LOG(WARNING, "MTU too big, max MTU possible limitted "
"by current mbuf size: %u. Set MTU to %u, MRU to %u",
Expand Down

0 comments on commit 0595f2a

Please sign in to comment.