From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC598A0093 for ; Tue, 19 May 2020 15:09:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B40A91D6A4; Tue, 19 May 2020 15:09:56 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 9B5421D6A4 for ; Tue, 19 May 2020 15:09:55 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id f134so3015396wmf.1 for ; Tue, 19 May 2020 06:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HryCKVgcNDnqSX9BiNMr0h3oAm6IYJRihfxrJ6zeJZA=; b=Q+zHERvvhO2o58D+hyIhXSzZU0P+S6+F/YWJFzbv6b9yCNcqd5eF73cPHqmCsRpsBb 2EWkp742bhnoLicIw0Pokc99KL8Zvt/eWRza2HFagnZuTQNPEMGGxLTuOZL/aqUV8YMR 004asjpySlXFjjUSnNF78PYlQZgHYCHlIWEakY6srim8VtX2U+zhLXOiTFYQEaW6dDv4 giOi9dCrc3flQpQ0BKmXKkNL3+IZOU3rGBuIMoHyolptb9QU6CMoXFJScfzHjV0n9rUC w0cavR0ES89w8SiKyc498H/5f0+ihEdHJyqBzUPxvf3pGxfF8qMFb6bKpmg7jnWFMy5A tEHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HryCKVgcNDnqSX9BiNMr0h3oAm6IYJRihfxrJ6zeJZA=; b=EshQeuNMhra71fS3/Aeg/Vp+Kgc6c3C8VmPknYSvvrIr9iExU0m6Sljvltyj7GjIQq Mam5/M6Uj3Mo+wgQzHUaE8/mXFz3JFBFzhfwKMRKCgRMuMNL05uWUfK1vi1rBhMP1o40 T/OuTWydRWcW8Lndzdtn2FSTPC+ZAREfw4oRx0kCy28ijzzHAQ/km2DV0a/OMj8Re0w/ 1Yn/C9UGY3yAkXRKmlFitGWOTR3Tnu8cMK4yUNnufEAN7DM9NfdTgrh1311aesW/+bA7 TyvqgnoYFSCv23j+fFpQSedYtoSB4zDGy0ZOvfy+PzSHNKu+KEhXwFoV79w6KQwenXrn WD1Q== X-Gm-Message-State: AOAM533hAQ9Mlq4nt966P3qVMlrolcvLD2zhWQO7KOLm72LoRB/1CMii vsnwuLH5/Cipi5Nwgzl0N3s= X-Google-Smtp-Source: ABdhPJyNFxGyGbw3CIegz4JXRlGvnc2OLoW+LTDraP5LaSntygqGkIFmjpjscKaf6siGNaofgrmrJQ== X-Received: by 2002:a1c:a952:: with SMTP id s79mr5210708wme.153.1589893795348; Tue, 19 May 2020 06:09:55 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:7a8e:ed70:5c52:ea3]) by smtp.gmail.com with ESMTPSA id r2sm21221423wrg.84.2020.05.19.06.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:09:54 -0700 (PDT) From: luca.boccassi@gmail.com To: Lijun Ou Cc: Wei Hu , Chengwen Feng , Chengchang Tang , dpdk stable Date: Tue, 19 May 2020 14:03:31 +0100 Message-Id: <20200519130549.112823-76-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix RSS key length' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/20. 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. Thanks. Luca Boccassi --- >From 0bd1d3b49ce2c0c2c14ce5fb5fefa0c7677c9d7d Mon Sep 17 00:00:00 2001 From: Lijun Ou Date: Fri, 10 Apr 2020 19:09:28 +0800 Subject: [PATCH] net/hns3: fix RSS key length [ upstream commit 708e60a4e63c872573e11befa9a073125395343d ] When upper application calls the rte_eth_dev_rss_hash_conf_get API function to get the RSS key parameters, the function should return the RSS key length supported by the device. Otherwise, an error will occur when the upper application needs to use the RSS key length supported by this specified hardware for judgment and configure the specified key into hardware. For example, in the following scenario: When users want to use their own RSS key, but the length of the key is bigger than the one of the supported by hardware. As a result, users need to get the RSS key length supported by hardware according to the above API firstly, and then compare the actual obtained RSS key length with the length of their own RSS key. If the driver does not return the actual value, error may occur when user calls the rte_eth_dev_rss_hash_update API function to configure their own key into hardware. Besides, this patch fixes the problem of stepping on memory when the RSS key array configured by users are less than the RSS key length supported by the driver at the same time. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) Signed-off-by: Chengwen Feng Signed-off-by: Chengchang Tang --- drivers/net/hns3/hns3_rss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index 9b6b72908f..ff2da5afd7 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -322,8 +322,10 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev, rss_conf->rss_hf = rss_cfg->conf.types; /* Get the RSS Key required by the user */ - if (rss_conf->rss_key) + if (rss_conf->rss_key && rss_conf->rss_key_len >= HNS3_RSS_KEY_SIZE) { memcpy(rss_conf->rss_key, rss_cfg->key, HNS3_RSS_KEY_SIZE); + rss_conf->rss_key_len = HNS3_RSS_KEY_SIZE; + } rte_spinlock_unlock(&hw->lock); return 0; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:47.562523801 +0100 +++ 0076-net-hns3-fix-RSS-key-length.patch 2020-05-19 14:04:44.240648808 +0100 @@ -1,8 +1,10 @@ -From 708e60a4e63c872573e11befa9a073125395343d Mon Sep 17 00:00:00 2001 +From 0bd1d3b49ce2c0c2c14ce5fb5fefa0c7677c9d7d Mon Sep 17 00:00:00 2001 From: Lijun Ou Date: Fri, 10 Apr 2020 19:09:28 +0800 Subject: [PATCH] net/hns3: fix RSS key length +[ upstream commit 708e60a4e63c872573e11befa9a073125395343d ] + When upper application calls the rte_eth_dev_rss_hash_conf_get API function to get the RSS key parameters, the function should return the RSS key length supported by the device. Otherwise, an error will occur @@ -27,7 +29,6 @@ by the driver at the same time. Fixes: c37ca66f2b27 ("net/hns3: support RSS") -Cc: stable@dpdk.org Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) @@ -38,10 +39,10 @@ 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c -index 95a637ddc2..a6cab29c93 100644 +index 9b6b72908f..ff2da5afd7 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c -@@ -328,8 +328,10 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev, +@@ -322,8 +322,10 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev, rss_conf->rss_hf = rss_cfg->conf.types; /* Get the RSS Key required by the user */