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 3DBEBA00C4; Mon, 11 Apr 2022 05:07:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25B3C40698; Mon, 11 Apr 2022 05:07:37 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 7A83E4067B for ; Mon, 11 Apr 2022 05:07:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649646455; x=1681182455; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zcQa34UOHNLDhL07fGQqwGJO5QQ9T8SuLezNnH73ptA=; b=ESPuNeO2sZbPxDBLK+JczesZ2ubP1VKrnX3g4YnZs2q8cInYiDBs/+zj 5iIZhDl6KYvYwnmStZASPjlOz/u8twmE7GRkgc4sKJ27yddJaYdOHepqY HKEjCDFIdEPXQIIJ6xWKOOBgwchLRP1Qkv6WWMhFHvkG+mXDDfp0UK1OM 8/LTDdY4MU2n+r/qRC4NnMSJkkoMgp81TnwAZeZYh3YQn2FzhW8F4trai HUibpLbSD8T98ZXZL3Bv5Rfznk/XlN6D4ODfCsTfxvw2Y6sqlwKyfnKdr +/9vvvhUdnEKfj4JNFu85j+usi1AILNgygJiggBa8t2zstnDjN3sQiGWH Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10313"; a="261765151" X-IronPort-AV: E=Sophos;i="5.90,250,1643702400"; d="scan'208";a="261765151" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2022 20:07:34 -0700 X-IronPort-AV: E=Sophos;i="5.90,250,1643702400"; d="scan'208";a="571923481" Received: from unknown (HELO localhost.localdomain) ([10.239.251.104]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2022 20:07:33 -0700 From: Ke Zhang To: chas3@att.com, humin29@huawei.com, dev@dpdk.org Cc: Ke Zhang Subject: [PATCH v2 1/1] net/bonding: fix rss key configuration when the key length is 52 Date: Mon, 11 Apr 2022 03:02:31 +0000 Message-Id: <20220411030231.58268-1-ke1x.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220407093642.44900-1-ke1x.zhang@intel.com> References: <20220407093642.44900-1-ke1x.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 creating a bonding device, if the slave device's rss key length is 52, then bonding device will be same as slave, in function bond_ethdev_configure(), the default_rss_key length is 40, it is not matched, so it should calculate a new key for bonding device if the deault key could not be used. Signed-off-by: Ke Zhang --- drivers/net/bonding/rte_eth_bond_pmd.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index b305b6a35b..027339b0d9 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3617,13 +3617,18 @@ bond_ethdev_configure(struct rte_eth_dev *dev) internals->rss_key_len); } else { if (internals->rss_key_len > sizeof(default_rss_key)) { - RTE_BOND_LOG(ERR, - "There is no suitable default hash key"); - return -EINVAL; + /* + * If the rss_key includes standard_rss_key and + * extended_hash_key, the rss key length will + * larger than default rss key length, so it should + * re-calculate the hash key + */ + for (i = 0; i < internals->rss_key_len; i++) + internals->rss_key[i] = (uint8_t)rte_rand(); + } else { + memcpy(internals->rss_key, default_rss_key, + internals->rss_key_len); } - - memcpy(internals->rss_key, default_rss_key, - internals->rss_key_len); } for (i = 0; i < RTE_DIM(internals->reta_conf); i++) { -- 2.25.1