From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E01ADA0548; Wed, 15 Jun 2022 16:58:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D665242BA5; Wed, 15 Jun 2022 16:57:53 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id C31B842B8A for ; Wed, 15 Jun 2022 16:57:52 +0200 (CEST) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 19D37C0000E6; Wed, 15 Jun 2022 07:57:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 19D37C0000E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1655305072; bh=369kr2sUpBzp5GMifAyjK4/8zsDCn0O7RfDPAPOxgP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VxrCIjPBf8xlpNIOIC4ZuWa+q3U2GWxu+qeeOccuW0PPUNepMTKfVV1O/Zx7YgD/o sXItJi+BoF+KjhA8ByHo3Kfr4wbsnHXhdtNTNDqC51APehEwtoeFDzWyOaDq8Y9Vwo NyCCehJcPZaasLwp/0/bCy8DjjKPipEmmJPi6bIc= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@xilinx.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 7/8] net/bnxt: cleanups in MTU set callback Date: Wed, 15 Jun 2022 20:27:02 +0530 Message-Id: <20220615145703.6613-8-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220615145703.6613-1-kalesh-anakkur.purayil@broadcom.com> References: <20220615145703.6613-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Damodharam Ammepalli Minor cleanup in bnxt_mtu_set_op() to move pre-mature setting of jumbo flag post mtu check and remove a redundant mtu set operation from rxq vnic configs. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Damodharam Ammepalli Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 8 ++++---- drivers/net/bnxt/bnxt_rxq.c | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f040cdc..e275d3a 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3037,15 +3037,15 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) if (!eth_dev->data->nb_rx_queues) return -ENOTSUP; + /* Is there a change in mtu setting? */ + if (eth_dev->data->mtu == new_mtu) + return 0; + if (new_mtu > RTE_ETHER_MTU) bp->flags |= BNXT_FLAG_JUMBO; else bp->flags &= ~BNXT_FLAG_JUMBO; - /* Is there a change in mtu setting? */ - if (eth_dev->data->mtu == new_mtu) - return 0; - for (i = 0; i < bp->nr_vnics; i++) { struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; uint16_t size = 0; diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index f4b6417..fabbbd4 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -402,10 +402,6 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, rxq->rx_started = rxq->rx_deferred_start ? false : true; rxq->vnic = BNXT_GET_DEFAULT_VNIC(bp); - /* Configure mtu if it is different from what was configured before */ - if (!queue_idx) - bnxt_mtu_set_op(eth_dev, eth_dev->data->mtu); - return 0; err: bnxt_rx_queue_release_op(eth_dev, queue_idx); -- 2.10.1