Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4486932pxu; Wed, 9 Dec 2020 19:46:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA7cwUcu2E0dxrc+GF5f25bTZSttvzASA74ulFIXlltJxIPNb4JzUlKKJVW8+kNVyEB/kK X-Received: by 2002:a17:906:38c8:: with SMTP id r8mr4790785ejd.39.1607572000720; Wed, 09 Dec 2020 19:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607572000; cv=none; d=google.com; s=arc-20160816; b=ddWTJRKQO0IskEtzthyGyeAss4mOS6T+VpJucQwa3GXl9xPJUcs4epWm6lZXp5Bmdw AkDI+EVuT9r2dneqstQdOx9iXag3qW268iIph/PZHZ6EQtyHilnw5LcKd4+Xoa1Tu67h JQiKzwXcrxhWSlUH9bg768zETpqqoa63psEaNH6ISd4GdLOA1Mm+Le1lRZ7Vi3znDGS+ OuSflYaqBCbMCu3P2XgLt5J+n0w44O2YGYvNRhxlN0SA94n8nZpHoE2Sg4A6CNpUEy9z GC26MijUsAditTYPks5inb3UJHEerjXg2TXchPxV8+H4J/L9TEFkTo9c9PSHmuJSOXKS QiGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=pyXhy+CSUJzQi6RQcYydPGdP06t6wKZm5TSSYvRUPk0=; b=b+eWYp7oGpe4LG+1vbksCjrFN2q/vxtPrPQCNbN7cemxd3QneQPfi9bM1MG9QxzDTG MBuR+rD6oem1OoIcvvtH7orLjxC4aWLdxRB3w+ChgknDjRb65kDKjfqe74YcYvF+Hx2E +5tW27ci8NJy7/hdMwohyhh8uKFykq5F7idPXkzjabQ0dMbb27PuOiWed1t/PrBUZRfq 0sn9xXPK68AaL1h4ldSRnXPkNVOl9OfOTbKP1QGDgkDO+A50qVsBKQYcKksgm2W4wXPN 3BpIX8N/T5uTXezP1sDj1UlNMXgt1AMdLe+8NQUXK6IXhPLt6WsGVnjNzZehISvD1UPK /TEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si2128263edn.334.2020.12.09.19.46.18; Wed, 09 Dec 2020 19:46:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731244AbgLJDo6 (ORCPT + 99 others); Wed, 9 Dec 2020 22:44:58 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:9423 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729094AbgLJDoU (ORCPT ); Wed, 9 Dec 2020 22:44:20 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Cs08x5ND2z7CB5; Thu, 10 Dec 2020 11:42:09 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Thu, 10 Dec 2020 11:42:36 +0800 From: Huazhong Tan To: CC: , , , , Guojia Liao , Huazhong Tan Subject: [PATCH net-next 7/7] net: hns3: adjust rss tc mode configure command Date: Thu, 10 Dec 2020 11:42:12 +0800 Message-ID: <1607571732-24219-8-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607571732-24219-1-git-send-email-tanhuazhong@huawei.com> References: <1607571732-24219-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guojia Liao For the max rss size of PF may be up to 512, the max queue number of single tc may be up to 512 too. For the total queue numbers may be up to 1280, so the queue offset of each tc may be more than 1024. So adjust the rss tc mode configuration command, including extend tc size field from 10 bits to 11 bits, and extend tc size field from 3 bits to 4 bits. Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 4 +++- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index a6c306b..edfadb5 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -572,9 +572,11 @@ struct hclge_rss_indirection_table_cmd { }; #define HCLGE_RSS_TC_OFFSET_S 0 -#define HCLGE_RSS_TC_OFFSET_M GENMASK(9, 0) +#define HCLGE_RSS_TC_OFFSET_M GENMASK(10, 0) +#define HCLGE_RSS_TC_SIZE_MSB_B 11 #define HCLGE_RSS_TC_SIZE_S 12 #define HCLGE_RSS_TC_SIZE_M GENMASK(14, 12) +#define HCLGE_RSS_TC_SIZE_MSB_OFFSET 3 #define HCLGE_RSS_TC_VALID_B 15 struct hclge_rss_tc_mode_cmd { __le16 rss_tc_mode[HCLGE_MAX_TC_NUM]; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 5de45a9..7a16411 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4335,6 +4335,8 @@ static int hclge_set_rss_tc_mode(struct hclge_dev *hdev, u16 *tc_valid, hnae3_set_bit(mode, HCLGE_RSS_TC_VALID_B, (tc_valid[i] & 0x1)); hnae3_set_field(mode, HCLGE_RSS_TC_SIZE_M, HCLGE_RSS_TC_SIZE_S, tc_size[i]); + hnae3_set_bit(mode, HCLGE_RSS_TC_SIZE_MSB_B, + tc_size[i] >> HCLGE_RSS_TC_SIZE_MSB_OFFSET & 0x1); hnae3_set_field(mode, HCLGE_RSS_TC_OFFSET_M, HCLGE_RSS_TC_OFFSET_S, tc_offset[i]); -- 2.7.4