From patchwork Thu Sep 15 11:29:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Le Berre X-Patchwork-Id: 116348 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 07238A00C5; Thu, 15 Sep 2022 13:29:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D25E04021D; Thu, 15 Sep 2022 13:29:27 +0200 (CEST) Received: from smtpservice.6wind.com (unknown [185.13.181.2]) by mails.dpdk.org (Postfix) with ESMTP id 2CBCB40156 for ; Thu, 15 Sep 2022 13:29:27 +0200 (CEST) Received: from localhost (metallica.dev.6wind.com [10.17.1.191]) by smtpservice.6wind.com (Postfix) with ESMTP id 05B3D600D7; Thu, 15 Sep 2022 13:29:27 +0200 (CEST) From: Benjamin Le Berre To: ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com Cc: dev@dpdk.org, Benjamin Le Berre Subject: [PATCH] net/bnxt: return -EBUSY if port is active during MTU change Date: Thu, 15 Sep 2022 13:29:06 +0200 Message-Id: <20220915112906.4487-1-benjamin.le_berre@6wind.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 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 When the BNXT PMD was made to disallow MTU changes on active ports, the error code chosen for the case in bnxt_set_mtu_op() was -EPERM. The doc comment for rte_eth_dev_set_mtu() in lib/ethdev/rte_ethdev.h lists -EBUSY as the value to be used if the port must be stopped before applying an MTU change and does not list -EPERM as a possible return value. This patch makes bnxt_set_mtu_op() return -EBUSY instead of -EPERM so that rte_eth_dev_set_mtu() behaves as expected. Fixes: a42ab1eb33ff ("net/bnxt: disallow MTU change when device is started") Signed-off-by: Benjamin Le Berre Acked-by: Ajit Khaparde --- Hi, Should I Cc stable@dpdk.org? Thanks, Benjamin. drivers/net/bnxt/bnxt_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index e275d3a53fda..c07a41c693da 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3030,7 +3030,7 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) /* Return if port is active */ if (eth_dev->data->dev_started) { PMD_DRV_LOG(ERR, "Stop port before changing MTU\n"); - return -EPERM; + return -EBUSY; } /* Exit if receive queues are not configured yet */