From: Ferruh Yigit Date: Wed, 27 Oct 2021 09:14:29 +0000 (+0100) Subject: net/memif: fix driver init with default MTU X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=411878ba25f691557df08d4abc0a8ae3b918d253;p=dpdk.git net/memif: fix driver init with default MTU Driver is using 'ETH_FRAME_LEN' Linux defined value as max frame length, which doesn't include FCS (4 bytes CRC). But ethdev by default uses frame size with FCS when application doesn't define any explicit value. As a result device configuration fails because device is tried to be configured with a frame size length that is bigger than what device reported as supported. Device reports as max supported frame size is 1514 but configured value is 1518. Instead use DPDK macro, 'RTE_ETHER_MAX_LEN', that includes FCS in the driver to report the max supported frame size, this matches to the initial intention. Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length") Reported-by: Andrew Rybchenko Signed-off-by: Ferruh Yigit Tested-by: David Christensen Reviewed-by: Andrew Rybchenko --- diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index 8cec493ffd..e4ebabec6a 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -195,7 +195,7 @@ static int memif_dev_info(struct rte_eth_dev *dev __rte_unused, struct rte_eth_dev_info *dev_info) { dev_info->max_mac_addrs = 1; - dev_info->max_rx_pktlen = (uint32_t)ETH_FRAME_LEN; + dev_info->max_rx_pktlen = RTE_ETHER_MAX_LEN; dev_info->max_rx_queues = ETH_MEMIF_MAX_NUM_Q_PAIRS; dev_info->max_tx_queues = ETH_MEMIF_MAX_NUM_Q_PAIRS; dev_info->min_rx_bufsize = 0;