app/testpmd: revert max Rx packet length adjustment
authorThomas Monjalon <thomas@monjalon.net>
Thu, 5 Nov 2020 17:05:41 +0000 (18:05 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 5 Nov 2020 18:16:59 +0000 (19:16 +0100)
The fix of max_rx_pkt_len for allowing VLAN packets in all cases
was breaking configuration of some drivers. Example with virtio:

Ethdev port_id=0 max_rx_pkt_len 11229 > max valid value 9728
Fail to configure port 0

Trying to fix the logic was revealing other issues in some drivers.
That's why it is decided to revert.

The workaround for the original issue would be
to set the MTU explicitly from the application
with rte_eth_dev_set_mtu().
See RFC: https://patches.dpdk.org/patch/83756/

Fixes: f6870a7ed6b3 ("app/testpmd: fix max Rx packet length for VLAN packet")
Cc: stable@dpdk.org
Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/testpmd.c

index c263121..33fc0fd 100644 (file)
@@ -1421,7 +1421,6 @@ init_config(void)
        struct rte_gro_param gro_param;
        uint32_t gso_types;
        uint16_t data_size;
-       uint16_t overhead_len;
        bool warning = 0;
        int k;
        int ret;
@@ -1458,28 +1457,6 @@ init_config(void)
                        rte_exit(EXIT_FAILURE,
                                 "rte_eth_dev_info_get() failed\n");
 
-               /* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */
-               if (port->dev_info.max_rx_pktlen && port->dev_info.max_mtu)
-                       overhead_len = port->dev_info.max_rx_pktlen -
-                               port->dev_info.max_mtu;
-               else
-                       overhead_len = RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
-
-               port->dev_conf.rxmode.max_rx_pkt_len =
-                                               RTE_ETHER_MTU + overhead_len;
-
-               /*
-                * This is workaround to avoid resize max rx packet len.
-                * Ethdev assumes jumbo frame size must be greater than
-                * RTE_ETHER_MAX_LEN, and will resize 'max_rx_pkt_len' to
-                * default value when it is greater than RTE_ETHER_MAX_LEN
-                * for normal frame.
-                */
-               if (port->dev_conf.rxmode.max_rx_pkt_len > RTE_ETHER_MAX_LEN) {
-                       port->dev_conf.rxmode.offloads |=
-                                               DEV_RX_OFFLOAD_JUMBO_FRAME;
-               }
-
                if (!(port->dev_info.tx_offload_capa &
                      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
                        port->dev_conf.txmode.offloads &=