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 068F2A050B; Thu, 7 Apr 2022 11:41:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E7004068B; Thu, 7 Apr 2022 11:41:42 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 46D3B40689 for ; Thu, 7 Apr 2022 11:41:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649324500; x=1680860500; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DjOrmo2+8lK8SLAYowNOgGeLTEJNQSrp6gCFnolWqeM=; b=S/Em+qTcfBz1PMBWFWJVEBMs6qThdtFwmtm9hKPtMf4XB1KmmCAGsMHw cA876jQv+K4pk+jcDrjuxu9pJ2Z4xPF7oCjS/J66KbE+MYaMisjoEyqqq 814/FpXvWBw5Y6Hu1Wzyilc7D/w4k4eSJctEwfUrNuTO5io2UhsOG7js8 2VPXvJlxdAhe6CAFEBkbw6lJcDeM2pLj2dKlafhnTa2tmo+0SuIho8EJi UwXhu/t3j46gAxNBy509vyPiU2OsvXVX9cnWpMl8sCEtPRr1gJKzfMzFM 916LP5Fn2E4HER7aGC/8ONcYLqS34xkfEUN6l77ThvNgWwKY77xSk63LN w==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="248800663" X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="248800663" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 02:41:19 -0700 X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="697732612" Received: from unknown (HELO localhost.localdomain) ([10.239.251.104]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 02:41:17 -0700 From: Ke Zhang To: chas3@att.com, humin29@huawei.com, dev@dpdk.org Cc: Ke Zhang Subject: [PATCH] net/bonding: fix rss key configuration when the key length is 52 Date: Thu, 7 Apr 2022 09:36:42 +0000 Message-Id: <20220407093642.44900-1-ke1x.zhang@intel.com> X-Mailer: git-send-email 2.25.1 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 | 12 ++++++------ 1 file changed, 6 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..4214b33f40 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3617,13 +3617,13 @@ 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_len is 52, it should 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