From c3d31352bf8713c8860bf90078c956b0a3792658 Mon Sep 17 00:00:00 2001 From: Dawid Gorecki Date: Tue, 7 Jun 2022 18:43:39 +0200 Subject: [PATCH] net/ena: remove redundant MTU verification Remove MTU verification from ena_mtu_set() and ena_start(). It is done by rte_ethdev already, so there is no reason to repeat it inside the ENA driver. Signed-off-by: Dawid Gorecki Reviewed-by: Michal Krawczyk Reviewed-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/ena_ethdev.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 68a4478410..efd6dea4c2 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -987,20 +987,6 @@ static int ena_queue_start_all(struct rte_eth_dev *dev, return rc; } -static int ena_check_valid_conf(struct ena_adapter *adapter) -{ - uint32_t mtu = adapter->edev_data->mtu; - - if (mtu > adapter->max_mtu || mtu < ENA_MIN_MTU) { - PMD_INIT_LOG(ERR, - "Unsupported MTU of %d. Max MTU: %d, min MTU: %d\n", - mtu, adapter->max_mtu, ENA_MIN_MTU); - return ENA_COM_UNSUPPORTED; - } - - return 0; -} - static int ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx, bool use_large_llq_hdr) @@ -1165,13 +1151,6 @@ static int ena_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) ena_dev = &adapter->ena_dev; ena_assert_msg(ena_dev != NULL, "Uninitialized device\n"); - if (mtu > adapter->max_mtu || mtu < ENA_MIN_MTU) { - PMD_DRV_LOG(ERR, - "Invalid MTU setting. New MTU: %d, max MTU: %d, min MTU: %d\n", - mtu, adapter->max_mtu, ENA_MIN_MTU); - return -EINVAL; - } - rc = ENA_PROXY(adapter, ena_com_set_dev_mtu, ena_dev, mtu); if (rc) PMD_DRV_LOG(ERR, "Could not set MTU: %d\n", mtu); @@ -1193,10 +1172,6 @@ static int ena_start(struct rte_eth_dev *dev) return -EPERM; } - rc = ena_check_valid_conf(adapter); - if (rc) - return rc; - rc = ena_setup_rx_intr(dev); if (rc) return rc;