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 B9D0845BB6 for ; Wed, 23 Oct 2024 23:21:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF57643326; Wed, 23 Oct 2024 23:21:04 +0200 (CEST) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id 363BC43326 for ; Wed, 23 Oct 2024 23:21:04 +0200 (CEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43161c0068bso2151155e9.1 for ; Wed, 23 Oct 2024 14:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729718464; x=1730323264; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z3WnH6gWHuFWM+3xoLo+G0g3ckUYKS4FX3CTXFXjBKY=; b=bOnmiye9obFMcJqszLPP2VXyZwL8IaYb5eOMa4Ee4zQB9IgvXr8FkRH2jW2LPTalev aDUZViTpS8FID7U4vGb3rR8EMiVKY1XirNXqlEXBp4wB8OfN0rYMN4SrpQIdqBUVIyHh t/8yB+DtOVpAaoHpCximR0m52cbHeaqY2o8rnF03cDeYZcgbnoWWA1uuv8hZFbjGiBDM X8J+4rOJVtNeMtkwWSApg54tw4uKu+A1D5Tyzv5djOLR7S0hYWMDY96p9Hfo7X6d22An zST+RTXOPsjdhgg4YdB2zBnYjA/CF9JbF9qGpS9YXK/3/H07hMImnbwRfRMbq2deRc2l hvIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729718464; x=1730323264; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z3WnH6gWHuFWM+3xoLo+G0g3ckUYKS4FX3CTXFXjBKY=; b=Fnv1GfJt0CDOZG+9RYKwQshBi+K2EkXoCKS2bO1dgAwEaGRB/r72Y7iil6cpCKAgFk mjOeIymQrJ5ovlwzC3WWsEj+iJb2nUkQ5VHA5ukZueqW3jPkS4e/Xd10LiUMd1HwxzTi GDpYfi5VdyMotgTP1UA06w7uT3wFIpSvw/rvA73jWj41iT0XmHUckemOKPfgNzlUjrJ+ SaPGigeryDvqbOKXOjrXfpWhTSQoiLG295ejP72xDeJIPlcRcL32yiBYB4CtESC4bvZI aisSOZZPJIR5Q/XClofYIc2XoLgdQVBCTfge/Ch9D2FWTWHziIDM9G8AIOGKuiZvdNzm RrcQ== X-Forwarded-Encrypted: i=1; AJvYcCU24NbO0KOk/+dglNTaySL7PmlGDSNqBtVv5AIYl8Yug2WNiI76OVEUL0dt5U/S2nq87KWFpgQ=@dpdk.org X-Gm-Message-State: AOJu0Yyi7NrF8nm/vMZ1DWe+1SudZNGUNrJej30YY50xpuTci2t8QgK5 NNwfjGorZWNo/RP0B24k9yPLOJAK4W/Mtk/tEPM/20rmlSPFeT7knJB+WqBa X-Google-Smtp-Source: AGHT+IEU7TiCNMA6zwCDQkW7ZYQYU7B3ymoTHe/Gtbc6ye68QZ3PPCaVLHs6VrlZge6VjjvI5qUQYg== X-Received: by 2002:a05:600c:5491:b0:431:5503:43ca with SMTP id 5b1f17b1804b1-43184245fb8mr33934535e9.28.1729718463757; Wed, 23 Oct 2024 14:21:03 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0a584f7sm9747390f8f.53.2024.10.23.14.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 14:21:03 -0700 (PDT) From: luca.boccassi@gmail.com To: Chaoyong He Cc: Long Wu , Peng Zhang , Stephen Hemminger , dpdk stable Subject: patch 'net/nfp: fix link change return value' has been queued to stable release 22.11.7 Date: Wed, 23 Oct 2024 22:16:45 +0100 Message-ID: <20241023211704.1216956-65-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241023211704.1216956-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/25/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/4e6b6c42ce56ff93451a218e746d82fcdace6c20 Thanks. Luca Boccassi --- >From 4e6b6c42ce56ff93451a218e746d82fcdace6c20 Mon Sep 17 00:00:00 2001 From: Chaoyong He Date: Sat, 12 Oct 2024 10:41:02 +0800 Subject: [PATCH] net/nfp: fix link change return value [ upstream commit 0ca4f216b89162ce8142d665a98924bdf4a23a6e ] The return value of 'nfp_eth_set_configured()' is three ways, the original logic considered it as two ways wrongly. Fixes: 61d4008fe6bb ("net/nfp: support setting link up/down") Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/nfp_ethdev.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 68fd67a024..d795025004 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -205,6 +205,7 @@ error: static int nfp_net_stop(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; PMD_INIT_LOG(DEBUG, "Stop"); @@ -220,10 +221,12 @@ nfp_net_stop(struct rte_eth_dev *dev) if (rte_eal_process_type() == RTE_PROC_PRIMARY) /* Configure the physical port down */ - nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); + ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); else - nfp_eth_set_configured(dev->process_private, + ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0); + if (ret < 0) + return ret; return 0; } @@ -232,6 +235,7 @@ nfp_net_stop(struct rte_eth_dev *dev) static int nfp_net_set_link_up(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; PMD_DRV_LOG(DEBUG, "Set link up"); @@ -240,16 +244,21 @@ nfp_net_set_link_up(struct rte_eth_dev *dev) if (rte_eal_process_type() == RTE_PROC_PRIMARY) /* Configure the physical port down */ - return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1); + ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1); else - return nfp_eth_set_configured(dev->process_private, + ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 1); + if (ret < 0) + return ret; + + return 0; } /* Set the link down. */ static int nfp_net_set_link_down(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; PMD_DRV_LOG(DEBUG, "Set link down"); @@ -258,10 +267,14 @@ nfp_net_set_link_down(struct rte_eth_dev *dev) if (rte_eal_process_type() == RTE_PROC_PRIMARY) /* Configure the physical port down */ - return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); + ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); else - return nfp_eth_set_configured(dev->process_private, + ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0); + if (ret < 0) + return ret; + + return 0; } static void -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-10-23 22:16:42.982841281 +0100 +++ 0065-net-nfp-fix-link-change-return-value.patch 2024-10-23 22:16:40.527943830 +0100 @@ -1 +1 @@ -From 0ca4f216b89162ce8142d665a98924bdf4a23a6e Mon Sep 17 00:00:00 2001 +From 4e6b6c42ce56ff93451a218e746d82fcdace6c20 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0ca4f216b89162ce8142d665a98924bdf4a23a6e ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -17,2 +18,2 @@ - drivers/net/nfp/nfp_ethdev.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) + drivers/net/nfp/nfp_ethdev.c | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) @@ -21 +22 @@ -index 4b31785b9f..ef1c2a94b7 100644 +index 68fd67a024..d795025004 100644 @@ -24 +25,24 @@ -@@ -527,26 +527,36 @@ error: +@@ -205,6 +205,7 @@ error: + static int + nfp_net_stop(struct rte_eth_dev *dev) + { ++ int ret; + struct nfp_net_hw *hw; + + PMD_INIT_LOG(DEBUG, "Stop"); +@@ -220,10 +221,12 @@ nfp_net_stop(struct rte_eth_dev *dev) + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + /* Configure the physical port down */ +- nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); ++ ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); + else +- nfp_eth_set_configured(dev->process_private, ++ ret = nfp_eth_set_configured(dev->process_private, + hw->nfp_idx, 0); ++ if (ret < 0) ++ return ret; + + return 0; + } +@@ -232,6 +235,7 @@ nfp_net_stop(struct rte_eth_dev *dev) @@ -30 +53,0 @@ - struct nfp_net_hw_priv *hw_priv; @@ -32,2 +55,2 @@ - hw = dev->data->dev_private; - hw_priv = dev->process_private; + PMD_DRV_LOG(DEBUG, "Set link up"); +@@ -240,16 +244,21 @@ nfp_net_set_link_up(struct rte_eth_dev *dev) @@ -35,2 +58,8 @@ -- return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1); -+ ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + /* Configure the physical port down */ +- return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1); ++ ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1); + else +- return nfp_eth_set_configured(dev->process_private, ++ ret = nfp_eth_set_configured(dev->process_private, + hw->nfp_idx, 1); @@ -49 +77,0 @@ - struct nfp_net_hw_priv *hw_priv; @@ -51,2 +79,2 @@ - hw = dev->data->dev_private; - hw_priv = dev->process_private; + PMD_DRV_LOG(DEBUG, "Set link down"); +@@ -258,10 +267,14 @@ nfp_net_set_link_down(struct rte_eth_dev *dev) @@ -54,2 +82,8 @@ -- return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); -+ ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + /* Configure the physical port down */ +- return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); ++ ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); + else +- return nfp_eth_set_configured(dev->process_private, ++ ret = nfp_eth_set_configured(dev->process_private, + hw->nfp_idx, 0);