Skip to content

Commit

Permalink
net/mvpp2: fix frame size checking
Browse files Browse the repository at this point in the history
[ upstream commit 1c9a958 ]

Need to add CRC len to the frame-size to compare against
max_rx_pkt_len which includes it.

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 0595f2a commit 6b5aae6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/mvpp2/mrvl_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,8 @@ mrvl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
return -EFAULT;
}

frame_size = buf_size - RTE_PKTMBUF_HEADROOM - MRVL_PKT_EFFEC_OFFS;
frame_size = buf_size - RTE_PKTMBUF_HEADROOM -
MRVL_PKT_EFFEC_OFFS + RTE_ETHER_CRC_LEN;
if (frame_size < max_rx_pkt_len) {
MRVL_LOG(WARNING,
"Mbuf size must be increased to %u bytes to hold up "
Expand Down

0 comments on commit 6b5aae6

Please sign in to comment.