net/af_packet: fix driver init with default MTU
PATCH 1/2 net/af_packet: 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.
--- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_packet/rte_eth_af_packet.c +1 -1
@@ -342,7 +342,7 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->if_index = internals->if_index; dev_info->max_mac_addrs =1 ; - dev_info->max_rx_pktlen = (uint32_t )ETH_FRAME_LEN ; + dev_info->max_rx_pktlen = (uint32_t )RTE_ETHER_MAX_LEN ; dev_info->max_rx_queues = (uint16_t )internals->nb_queues; dev_info->max_tx_queues = (uint16_t )internals->nb_queues; dev_info->min_rx_bufsize =0 ;
Signature · 1 line
2.31.1
PATCH 2/2 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.
--- drivers/net/memif/rte_eth_memif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/memif/rte_eth_memif.c +1 -1
@@ -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 = (uint32_t )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 ;
Signature · 1 line
2.31.1
Re: [dpdk-dev] [PATCH 2/2] net/memif: fix driver init with default MTU
Quoted 27 lines · Ferruh Yigit
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")Signed-off-by Ferruh Yigit <[email protected]>Reported-by Andrew Rybchenko <[email protected]>--- drivers/net/memif/rte_eth_memif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/memif/rte_eth_memif.c +0
-0
drivers/net/memif/rte_eth_memif.c static int · line 201
Quoted 8 lines
drivers/net/memif/rte_eth_memif.c +1
-1@@ -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 = (uint32_t )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 ;
Re: [dpdk-dev] [PATCH 2/2] net/memif: fix driver init with default MTU
In reply to Ferruh Yigitdrivers/net/memif/rte_eth_memif.c static int · line 198
Quoted 10 lines · On Tue, 26 Oct 2021 16:38:01 +0100 Ferruh Yigit <[email protected]> wrote:
drivers/net/memif/rte_eth_memif.c +1
-1@@ -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 = (uint32_t )RTE_ETHER_MAX_LEN ;
The cast is not necessary here. Not sure why the original code had it?
Re: [dpdk-dev] [PATCH 2/2] net/memif: fix driver init with default MTU
Quoted 16 lines · Stephen Hemminger
drivers/net/memif/rte_eth_memif.c static int · line 198
Quoted 10 lines · On Tue, 26 Oct 2021 16:38:01 +0100 Ferruh Yigit <[email protected]> wrote:
drivers/net/memif/rte_eth_memif.c +1
-1@@ -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 = (uint32_t )RTE_ETHER_MAX_LEN ;The cast is not necessary here. Not sure why the original code had it?
ack.
I will send a new version to remove the cast, since touching those lines.
PATCH v2 1/2 net/af_packet: fix driver init with default MTU
In reply to Ferruh YigitDriver 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.
---
v2:
* Remove unnecessary cast
--- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_packet/rte_eth_af_packet.c +1 -1
@@ -342,7 +342,7 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->if_index = internals->if_index; 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 = (uint16_t )internals->nb_queues; dev_info->max_tx_queues = (uint16_t )internals->nb_queues; dev_info->min_rx_bufsize =0 ;
Signature · 1 line
2.31.1
PATCH v2 2/2 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.
---
v2:
* Remove unnecessary cast
--- drivers/net/memif/rte_eth_memif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/memif/rte_eth_memif.c +1 -1
@@ -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 ;
Signature · 1 line
2.31.1
Re: [dpdk-dev] [PATCH v2 2/2] net/memif: fix driver init with default MTU
Quoted 13 lines · Ferruh Yigit
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.
Quoted 5 lines
Fixes 1bb4a528c41f ("ethdev: fix max Rx packet length")Signed-off-by Ferruh Yigit <[email protected]>Reported-by Andrew Rybchenko <[email protected]>Tested-by David Christensen <[email protected]>
Quoted 9 lines · Ferruh Yigit
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.
Quoted 8 lines
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 <[email protected]>Signed-off-by Ferruh Yigit <[email protected]>
Quoted 14 lines · Andrew Rybchenko
Quoted 13 lines · Ferruh Yigit
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.
Quoted 7 lines
Quoted 4 lines
Fixes 1bb4a528c41f ("ethdev: fix max Rx packet length")Reported-by Andrew Rybchenko <[email protected]>Signed-off-by Ferruh Yigit <[email protected]>Reviewed-by Andrew Rybchenko <[email protected]>
Series applied to dpdk-next-net/main, thanks.