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 C2AC3A0C4C for ; Mon, 12 Jul 2021 15:10:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA1044069D; Mon, 12 Jul 2021 15:10:44 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 8D1074069D for ; Mon, 12 Jul 2021 15:10:43 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id j34so11374420wms.5 for ; Mon, 12 Jul 2021 06:10:43 -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=G7vlo2TUgVUSFa3Mz43mP5UjAlG4PyUtAOtbc9pHAcw=; b=OF0+Iszwq0ygeWn3VdY143hvq1C58q/gxZHeZ9jbWOzsYiqOgilPI1+081745DfLxE q0HF5dT5cIrFXCoSmKdgGZKFaAWY9gTBVWqhiuJtgWdUNcxrqpptOYAKmNRxHLzRfV7H 1ZxAld4Z5og8ttFaotCb/gdsYkAzF6WOOtMknDnaQIU+m3/PEG9YtdeM4Mf2+tIzK1lc +lLviqXoGil69gkOdYT+AFP9dwRM24MuNjVZaXpzteBMcl0iDN6cbvVMbRopHakD1g7Y R7AziCQbBLDuHOE1x7v4O3WscgLVAzjVjWtgbIeTE6PSyKFSB7JP5qVRcJ0HIaXaRxqv 8sMA== 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=G7vlo2TUgVUSFa3Mz43mP5UjAlG4PyUtAOtbc9pHAcw=; b=aQCa2r85/Sou/lphqikzHEdw3bQ9M5ptoh8ytQKtqy6HppcrMllR9HDZSHCpTFWfMu SQpoKa3gES9U54TsaGOaQOpSFXhqXrArPBrmC3J4ejnODUYSuToIKS7Lx9JIdFadnm3o XXNjie8sGVBrOrURs01t3q8hXJ9EX2/rOcc9VNYy9D6BsBCx6OjtfaA1fQm+vSQXYtbc XM0Zbl/s6yLFbecsEyiAiH5yj+17NRkp1qWYQdEbE3oa1e0Yww9RsUylnTBvQsNErQYE PVi75BNTrYN7Ax3zJb4VxroVOpuZKqyP62+gRHG1c5eZ3DIGNoD85SpqDeTcUcL9bN00 9pdg== X-Gm-Message-State: AOAM533YHQEs2bGGb5A7dURo9e7nal2FAK7LYCk2RY35IuYgQR2qLcIw uIvLxcg2XJO57tY8JRmlUTg= X-Google-Smtp-Source: ABdhPJwMvehev3vCaKP1Fs+2jQtarphwaWHKdkeZB9WNGuz1Jek0dw2AAACHZ+5kSAYF9pdce2TDaA== X-Received: by 2002:a1c:7411:: with SMTP id p17mr14421783wmc.116.1626095443245; Mon, 12 Jul 2021 06:10:43 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id x8sm6847176wrt.93.2021.07.12.06.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:10:41 -0700 (PDT) From: luca.boccassi@gmail.com To: Dapeng Yu Cc: Qi Zhang , dpdk stable Date: Mon, 12 Jul 2021 14:04:13 +0100 Message-Id: <20210712130551.2462159-18-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice: fix default RSS key generation' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.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 07/14/21. 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/ea3ef0c977a74d33b54c86f811374e6df7dcb3c8 Thanks. Luca Boccassi --- >From ea3ef0c977a74d33b54c86f811374e6df7dcb3c8 Mon Sep 17 00:00:00 2001 From: Dapeng Yu Date: Thu, 27 May 2021 14:42:51 +0800 Subject: [PATCH] net/ice: fix default RSS key generation [ upstream commit 03a91d7efb7098ba739ba458bcc118c3e348fae1 ] In original implementation, device reconfiguration will generate a new default RSS key if there is no one from user, it is unexpected when updating a completely unrelated configuration. This patch makes default RSS key unchanged, during the lifetime of the DPDK application even if there are multiple reconfigurations. Fixes: 50370662b727 ("net/ice: support device and queue ops") Signed-off-by: Dapeng Yu Acked-by: Qi Zhang --- drivers/net/ice/ice_ethdev.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 40498f038a..3541cc2381 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3177,6 +3177,31 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf) pf->rss_hf = rss_hf & ICE_RSS_HF_ALL; } +static void +ice_get_default_rss_key(uint8_t *rss_key, uint32_t rss_key_size) +{ + static struct ice_aqc_get_set_rss_keys default_key; + static bool default_key_done; + uint8_t *key = (uint8_t *)&default_key; + size_t i; + + if (rss_key_size > sizeof(default_key)) { + PMD_DRV_LOG(WARNING, + "requested size %u is larger than default %zu, " + "only %zu bytes are gotten for key\n", + rss_key_size, sizeof(default_key), + sizeof(default_key)); + } + + if (!default_key_done) { + /* Calculate the default hash key */ + for (i = 0; i < sizeof(default_key); i++) + key[i] = (uint8_t)rte_rand(); + default_key_done = true; + } + rte_memcpy(rss_key, key, RTE_MIN(rss_key_size, sizeof(default_key))); +} + static int ice_init_rss(struct ice_pf *pf) { struct ice_hw *hw = ICE_PF_TO_HW(pf); @@ -3225,15 +3250,13 @@ static int ice_init_rss(struct ice_pf *pf) } } /* configure RSS key */ - if (!rss_conf->rss_key) { - /* Calculate the default hash key */ - for (i = 0; i < vsi->rss_key_size; i++) - vsi->rss_key[i] = (uint8_t)rte_rand(); - } else { + if (!rss_conf->rss_key) + ice_get_default_rss_key(vsi->rss_key, vsi->rss_key_size); + else rte_memcpy(vsi->rss_key, rss_conf->rss_key, RTE_MIN(rss_conf->rss_key_len, vsi->rss_key_size)); - } + rte_memcpy(key.standard_rss_key, vsi->rss_key, vsi->rss_key_size); ret = ice_aq_set_rss_key(hw, vsi->idx, &key); if (ret) -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:37.776684642 +0100 +++ 0018-net-ice-fix-default-RSS-key-generation.patch 2021-07-12 13:41:36.234117278 +0100 @@ -1 +1 @@ -From 03a91d7efb7098ba739ba458bcc118c3e348fae1 Mon Sep 17 00:00:00 2001 +From ea3ef0c977a74d33b54c86f811374e6df7dcb3c8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 03a91d7efb7098ba739ba458bcc118c3e348fae1 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 5fd5f99b6f..ad20f6baff 100644 +index 40498f038a..3541cc2381 100644 @@ -26 +27 @@ -@@ -2990,6 +2990,31 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf) +@@ -3177,6 +3177,31 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf) @@ -58 +59 @@ -@@ -3038,15 +3063,13 @@ static int ice_init_rss(struct ice_pf *pf) +@@ -3225,15 +3250,13 @@ static int ice_init_rss(struct ice_pf *pf)