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 04D82A0511; Fri, 8 Apr 2022 04:32:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D3F1E4067E; Fri, 8 Apr 2022 04:32:36 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id D4FC14003F for ; Fri, 8 Apr 2022 04:32:35 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KZMhh0VjXz1HBWd; Fri, 8 Apr 2022 10:32:04 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 8 Apr 2022 10:32:32 +0800 Subject: Re: [PATCH] net/bonding: fix rss key configuration when the key length is 52 To: Ke Zhang , , References: <20220407093642.44900-1-ke1x.zhang@intel.com> From: "Min Hu (Connor)" Message-ID: <66552a01-6f88-b0b2-a69f-24d0484ea36d@huawei.com> Date: Fri, 8 Apr 2022 10:32:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20220407093642.44900-1-ke1x.zhang@intel.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected 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 Hi, ÔÚ 2022/4/7 17:36, Ke Zhang дµÀ: > 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. wrong spelling. > > 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 */ I think the comment should be more common, no need to emphysize '52'. > + 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++) { >