net/failsafe: report minimum and maximum MTU
authorAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Tue, 22 Dec 2020 08:51:49 +0000 (11:51 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 22 Feb 2021 16:35:38 +0000 (17:35 +0100)
Take minimum and maximum MTU values for subdevices and
report maximum of minimums and minimum of maximums.

Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Gaetan Rivet <grive@u256.net>
drivers/net/failsafe/failsafe_ops.c

index 966cfd2..1343777 100644 (file)
@@ -1095,6 +1095,8 @@ static void
 fs_dev_merge_info(struct rte_eth_dev_info *info,
                  const struct rte_eth_dev_info *sinfo)
 {
+       info->min_mtu = RTE_MAX(info->min_mtu, sinfo->min_mtu);
+       info->max_mtu = RTE_MIN(info->max_mtu, sinfo->max_mtu);
        info->max_rx_pktlen = RTE_MIN(info->max_rx_pktlen, sinfo->max_rx_pktlen);
        info->max_rx_queues = RTE_MIN(info->max_rx_queues, sinfo->max_rx_queues);
        info->max_tx_queues = RTE_MIN(info->max_tx_queues, sinfo->max_tx_queues);
@@ -1163,6 +1165,8 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
        int ret;
 
        /* Use maximum upper bounds by default */
+       infos->min_mtu = RTE_ETHER_MIN_MTU;
+       infos->max_mtu = UINT16_MAX;
        infos->max_rx_pktlen = UINT32_MAX;
        infos->max_rx_queues = RTE_MAX_QUEUES_PER_PORT;
        infos->max_tx_queues = RTE_MAX_QUEUES_PER_PORT;