Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp65779imu; Mon, 19 Nov 2018 17:51:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/W/SH602+Qoz3L+k8e8k4nRE2tlGtj05u5fKWKpFcO4hMRl5VozUI458YXd1IwqUMhHiXDL X-Received: by 2002:a63:902:: with SMTP id 2mr73019pgj.219.1542678677645; Mon, 19 Nov 2018 17:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542678677; cv=none; d=google.com; s=arc-20160816; b=o3wGK7uYgSYXLGcMVzEgL3Lqg5aLs/2B1iux/CHAlFup40GgjOCxUFmf6jEWizK3YC /81GG9hu7ay6pozj3CCQrhBXNsQCOh6wgip7En2gCLKqq4L2qeLltsNRUV5kqhq7HtFo VNfP6vik9v0r1H3iUaX9Q0vuhpaRXuuXhYqS94rCc5E/md+pmQSzk94yE22IyUhuODWI IqSwlbscWHfLNfiq1LiLQv5TQrKOgCufjLbWQDC7MVIfXtgN6nFscz/AbjhYk7JrjPCB eAMyq7LhtPIBT8WfuPoRe//hQrcNjMDgxjLraA1rGD7Hlot1ZjKQ0DrXZrjFaRCYgf7A C3MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xCRiiLMmMqBo0xg18QPXgHX3x4/6yCRr4D+ydI6Hi08=; b=wn6JjUrL7h5Tp58dKY2WNa3v6y5OlUEvyzIFDXhTo/kZ45l5A2+08I5Od6d1EVoqVl 7K1L0xxk/c9bJ+x5mXRxE8F7trf3vmT2eY7uhtG0vvsG5lTQ/U21c8+zuIjgSMewoHt5 sMIOIX9Ry/qn2+kHlKJpBi7Qyz8WMxOcRZnE78ScWeRaFV9LZVO4nb68lKaijgrL6CFD z7BwbrqzSrueyF1lsK8PD2DIl1Lwjpdd/RSj4AcmsDicbLmCYXf6//mvUwRw1jzRp20H 9i2EGmoC+tYjtMyrcL0kUYrzIorGypOk0BqEKNQx2VpouGP+2kj5ADoz5lDXMvnmYGn5 STow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si24421508pll.384.2018.11.19.17.51.02; Mon, 19 Nov 2018 17:51:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732662AbeKTMQ7 (ORCPT + 99 others); Tue, 20 Nov 2018 07:16:59 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:46240 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730272AbeKTMQ7 (ORCPT ); Tue, 20 Nov 2018 07:16:59 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id EF1BA3C3E090F; Tue, 20 Nov 2018 09:50:19 +0800 (CST) Received: from [127.0.0.1] (10.74.191.121) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.408.0; Tue, 20 Nov 2018 09:50:11 +0800 Subject: Re: [PATCH net-next] net: hns3: add common validation in hclge_dcb To: Tan Xiaojun , , , , , , , CC: , , References: <1542632535-18210-1-git-send-email-tanxiaojun@huawei.com> From: Yunsheng Lin Message-ID: Date: Tue, 20 Nov 2018 09:50:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1542632535-18210-1-git-send-email-tanxiaojun@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.191.121] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/11/19 21:02, Tan Xiaojun wrote: > From: Yunsheng Lin > > Before setting tm related configuration to hardware, driver > needs to check the configuration provided by user is valid. > Currently hclge_ieee_setets and hclge_setup_tc both implement > their own checking, which has a lot in common. > > This patch addes hclge_dcb_common_validate to do the common > checking. The checking in hclge_tm_prio_tc_info_update > and hclge_tm_schd_info_update is unnecessary now, so change > the return type to void, which removes the need to do error > handling when one of the checking fails. > > Also, ets->prio_tc is indexed by user prio and ets->tc_tsa is > indexed by tc num, so this patch changes them to use different > index. +cc Neil > > Signed-off-by: Yunsheng Lin > Signed-off-by: Tan Xiaojun