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 93814A057F for ; Tue, 28 Jun 2022 17:20:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D9E242B6C; Tue, 28 Jun 2022 17:20:24 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 901AB42B6C for ; Tue, 28 Jun 2022 17:20:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656429622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AMAsUwH/YV8uTzYMVZaHljdXrdC3BdVeUEYyuU2w4P4=; b=QNQHT9BDspZsnkSy7vBWM62BzfDrLWYBstT4f19nrSsvO2fgROu5H7i2tMFJAWLuO/BHP5 Cq5HaVYo48TmsMEy6TiaMVrbcyi8o/Kp7RblpJbBgjMR9yCV8fuEoFjY+8L9DF/5XF5zmQ nH23iLMejLNBmESAhLTGEFkok3+Mj18= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-0G4mKRlLP4SolWCNa1_-gw-1; Tue, 28 Jun 2022 11:20:17 -0400 X-MC-Unique: 0G4mKRlLP4SolWCNa1_-gw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA99180D401; Tue, 28 Jun 2022 15:20:16 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C53A1415108; Tue, 28 Jun 2022 15:20:15 +0000 (UTC) From: Kevin Traynor To: Damodharam Ammepalli Cc: Andy Gospodarek , Ajit Khaparde , dpdk stable Subject: patch 'net/bnxt: disallow MTU change when device is started' has been queued to stable release 21.11.2 Date: Tue, 28 Jun 2022 16:19:36 +0100 Message-Id: <20220628151938.2278711-24-ktraynor@redhat.com> In-Reply-To: <20220628151938.2278711-1-ktraynor@redhat.com> References: <20220628151938.2278711-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/30/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/9fe3dcd614db1a005ed76ffe0b19296e65fc0bcc Thanks. Kevin --- >From 9fe3dcd614db1a005ed76ffe0b19296e65fc0bcc Mon Sep 17 00:00:00 2001 From: Damodharam Ammepalli Date: Wed, 15 Jun 2022 20:27:01 +0530 Subject: [PATCH] net/bnxt: disallow MTU change when device is started [ upstream commit a42ab1eb33ff4d9358e746782365d7de0b1ed98b ] With this patch, bnxt_mtu_set_op() will return an error code if the device has already started. The user application will have to take care to bring down device before invoking the mtu_set() Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Signed-off-by: Damodharam Ammepalli Reviewed-by: Andy Gospodarek Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 00129c76e6..93d17b7670 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3021,7 +3021,5 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) { - uint32_t overhead = BNXT_MAX_PKT_LEN - BNXT_MAX_MTU; struct bnxt *bp = eth_dev->data->dev_private; - uint32_t new_pkt_size; uint32_t rc; uint32_t i; @@ -3031,23 +3029,13 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) return rc; + /* Return if port is active */ + if (eth_dev->data->dev_started) { + PMD_DRV_LOG(ERR, "Stop port before changing MTU\n"); + return -EPERM; + } + /* Exit if receive queues are not configured yet */ if (!eth_dev->data->nb_rx_queues) - return rc; - - new_pkt_size = new_mtu + overhead; - - /* - * Disallow any MTU change that would require scattered receive support - * if it is not already enabled. - */ - if (eth_dev->data->dev_started && - !eth_dev->data->scattered_rx && - (new_pkt_size > - eth_dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) { - PMD_DRV_LOG(ERR, - "MTU change would require scattered rx support. "); - PMD_DRV_LOG(ERR, "Stop port before changing MTU.\n"); - return -EINVAL; - } + return -ENOTSUP; if (new_mtu > RTE_ETHER_MTU) @@ -3058,5 +3046,5 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) /* Is there a change in mtu setting? */ if (eth_dev->data->mtu == new_mtu) - return rc; + return 0; for (i = 0; i < bp->nr_vnics; i++) { -- 2.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-28 16:18:04.616837478 +0100 +++ 0024-net-bnxt-disallow-MTU-change-when-device-is-started.patch 2022-06-28 16:18:04.066387174 +0100 @@ -1 +1 @@ -From a42ab1eb33ff4d9358e746782365d7de0b1ed98b Mon Sep 17 00:00:00 2001 +From 9fe3dcd614db1a005ed76ffe0b19296e65fc0bcc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a42ab1eb33ff4d9358e746782365d7de0b1ed98b ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 4e4791c2db..f040cdcf94 100644 +index 00129c76e6..93d17b7670 100644 @@ -24 +25 @@ -@@ -3020,7 +3020,5 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, +@@ -3021,7 +3021,5 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, @@ -32 +33 @@ -@@ -3030,23 +3028,13 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) +@@ -3031,23 +3029,13 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) @@ -63 +64 @@ -@@ -3057,5 +3045,5 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) +@@ -3058,5 +3046,5 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)