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 70E8B432DA for ; Wed, 8 Nov 2023 20:26:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A7F4406A2; Wed, 8 Nov 2023 20:26:44 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id 7C2A540395 for ; Wed, 8 Nov 2023 20:26:42 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-32db188e254so26187f8f.0 for ; Wed, 08 Nov 2023 11:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699471602; x=1700076402; 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=EkliTAeXplrkpVdVRr9lntTwr3w7wqb5bB71lv5srHc=; b=acEHjEPZyoGZl6heBjq36tPBSlEGqyutUXZluY/LsKVfPNun/UyA3tKW6Y2TogzRwA xW/zCSrTM7CGG7YKTUlKehA1fVT/+Zb0oeGfmwyl8vi3q/gKT2CXUAdSuKbKJC6YL2uU 9bT7ootgqis78V5uAOtHG4ujGWLrn9Evb1vKw2eeLm5oOOBaqOaUSYEU4JvyW7F/N0n8 nkZkzD9nzWEAOfn2etmdvZppCcrvvNmbuEmw6BYYYsGgBYdh+52Qv+ICNQyGsHW98lWA bIn3pHXgM0Wvfe/nEGfUtAZrBP56wpkEZF8EzWQOjJxd+2Krk8P9aoP4TAMJfyvftzPJ eP+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699471602; x=1700076402; 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=EkliTAeXplrkpVdVRr9lntTwr3w7wqb5bB71lv5srHc=; b=NZqgWvt61yvrTqnTvN6ZAkswtiKl8l0aClag6M1Q8uFZJ9qoR3cja3zUuIqRMWiX5x uv5S459HPdq+gK7cEqXVGzQpo/ahU9DTeSZ6alzI/WB9jUw8s/O+EtZPHniJ+4RPZaeL EDWlgmZK8aQr1E10GknMMZ9eFo4zpsGgmbDNWByIwVuaFEWq8+Mv7u5GjpsHTfXra/WR E1DUSWMuJAYFcevBFRkg4JKlCZpjkAP+GXm0g9ix7/UYnFKLp8zQz2F+4tNyRDNK0hp6 nXLjGszvcRipl8AeIJI0mYVssJusuwqJE2djRLFv3rUuAs8lkqwlhFWXghhM+Yeo/qar 6RzQ== X-Gm-Message-State: AOJu0YyLuTQ9P69aVkkelGw1Y0xOyUDIN44JnObIrjTkucbs9ieUoQ+6 QyMzj7DfqrVbXvORmJR5pt7eHhZPDx6ttA== X-Google-Smtp-Source: AGHT+IHSxJQAAYeQFY+RcruvfJuHXTzTtJpdRWD5NZUqSGv+sBppbbCLGwyKUo8JGMfhgsLo6W+TiQ== X-Received: by 2002:a5d:5846:0:b0:32f:9a76:ea0f with SMTP id i6-20020a5d5846000000b0032f9a76ea0fmr2814603wrf.46.1699471602057; Wed, 08 Nov 2023 11:26:42 -0800 (PST) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id y11-20020adff6cb000000b0032fc609c118sm5596724wrp.66.2023.11.08.11.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 11:26:41 -0800 (PST) From: luca.boccassi@gmail.com To: Jie Hai Cc: dpdk stable Subject: patch 'net/hns3: fix some return values' has been queued to stable release 20.11.10 Date: Wed, 8 Nov 2023 19:25:19 +0000 Message-Id: <20231108192535.922238-21-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231108192535.922238-1-luca.boccassi@gmail.com> References: <20231018235930.3144-41-luca.boccassi@gmail.com> <20231108192535.922238-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 20.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/10/23. 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/a6dd3475c50042cc1aecaef153dbbaa71e556b4d Thanks. Luca Boccassi --- >From a6dd3475c50042cc1aecaef153dbbaa71e556b4d Mon Sep 17 00:00:00 2001 From: Jie Hai Date: Tue, 31 Oct 2023 20:23:56 +0800 Subject: [PATCH] net/hns3: fix some return values [ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ] 1. Fix the return value of hns3_get_imissed_stats_num as 'uint16_t'. 2. Add some error check for return value. Fixes: fcba820d9b9e ("net/hns3: support flow director") Signed-off-by: Jie Hai --- drivers/net/hns3/hns3_ethdev_vf.c | 5 ++++- drivers/net/hns3/hns3_fdir.c | 2 +- drivers/net/hns3/hns3_stats.c | 10 ++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index cc04659369..0b15b3bd2f 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -2659,8 +2659,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns) */ if (pci_dev->kdrv == RTE_PCI_KDRV_IGB_UIO || pci_dev->kdrv == RTE_PCI_KDRV_UIO_GENERIC) { - if (hns3vf_enable_msix(pci_dev, true)) + ret = hns3vf_enable_msix(pci_dev, true); + if (ret != 0) { hns3_err(hw, "Failed to enable msix"); + return ret; + } } rte_intr_enable(&pci_dev->intr_handle); diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index f210c8b1e4..cbb78bfcd6 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -962,7 +962,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns, rule->key_conf.spec.src_port, rule->key_conf.spec.dst_port, ret); else - hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf); + ret = hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf); return ret; } diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 7e645361cf..5cbdbecb6f 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -1144,9 +1144,15 @@ int hns3_stats_init(struct hns3_hw *hw) { struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); + int ret; - if (!hns->is_vf) - hns3_mac_stats_reset(hw); + if (!hns->is_vf) { + ret = hns3_mac_stats_reset(hw); + if (ret) { + hns3_err(hw, "reset mac stats failed, ret = %d", ret); + return ret; + } + } return hns3_tqp_stats_init(hw); } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-08 19:23:53.037677581 +0000 +++ 0021-net-hns3-fix-some-return-values.patch 2023-11-08 19:23:51.797396789 +0000 @@ -1 +1 @@ -From 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 Mon Sep 17 00:00:00 2001 +From a6dd3475c50042cc1aecaef153dbbaa71e556b4d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -16,2 +17,2 @@ - drivers/net/hns3/hns3_stats.c | 15 ++++++++++----- - 3 files changed, 15 insertions(+), 7 deletions(-) + drivers/net/hns3/hns3_stats.c | 10 ++++++++-- + 3 files changed, 13 insertions(+), 4 deletions(-) @@ -20 +21 @@ -index 0a227e6e45..156fb905f9 100644 +index cc04659369..0b15b3bd2f 100644 @@ -23 +24 @@ -@@ -2081,8 +2081,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns) +@@ -2659,8 +2659,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns) @@ -35 +36 @@ - rte_intr_enable(pci_dev->intr_handle); + rte_intr_enable(&pci_dev->intr_handle); @@ -37 +38 @@ -index c80fa59e63..d100e58d10 100644 +index f210c8b1e4..cbb78bfcd6 100644 @@ -40 +41 @@ -@@ -978,7 +978,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns, +@@ -962,7 +962,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns, @@ -50 +51 @@ -index c2e692a2c5..9a1e8935e5 100644 +index 7e645361cf..5cbdbecb6f 100644 @@ -53,19 +54,2 @@ -@@ -771,7 +771,7 @@ hns3_mac_stats_reset(struct hns3_hw *hw) - return 0; - } - --static int -+static uint16_t - hns3_get_imissed_stats_num(struct hns3_adapter *hns) - { - #define NO_IMISSED_STATS_NUM 0 -@@ -993,7 +993,7 @@ hns3_imissed_stats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, - struct hns3_adapter *hns = dev->data->dev_private; - struct hns3_hw *hw = &hns->hw; - struct hns3_rx_missed_stats *imissed_stats = &hw->imissed_stats; -- int imissed_stats_num; -+ uint16_t imissed_stats_num; - int cnt = *count; - char *addr; - uint16_t i; -@@ -1170,7 +1170,7 @@ hns3_imissed_stats_name_get(struct rte_eth_dev *dev, +@@ -1144,9 +1144,15 @@ int + hns3_stats_init(struct hns3_hw *hw) @@ -73,10 +57,2 @@ - struct hns3_adapter *hns = dev->data->dev_private; - uint32_t cnt = *count; -- int imissed_stats_num; -+ uint16_t imissed_stats_num; - uint16_t i; - - imissed_stats_num = hns3_get_imissed_stats_num(hns); -@@ -1539,8 +1539,13 @@ hns3_stats_init(struct hns3_hw *hw) - return ret; - } + struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); ++ int ret;