Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp107212imu; Mon, 19 Nov 2018 18:44:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VJggXvS9xX511KE6rvMTrzBcV8kpEfo9CQvmvo1ZsntCXHwT72zdBWQaWXMFQdB7VvJTeU X-Received: by 2002:a63:2141:: with SMTP id s1mr246111pgm.148.1542681877199; Mon, 19 Nov 2018 18:44:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542681877; cv=none; d=google.com; s=arc-20160816; b=YOyGpruW8UZIcB0BNY48xpNhfaOIU6LAZAQ8SIgnVbjEIW31cuzvXNKA+nOIN5f7WV UbUcwctReG9C2lJDhsAuqiekt64OTeCuVsmprkGGyumHTu/5T2II10yPjizzDhbKLrkU InMPrH3kBh3qic7/ySB4nzDBXhDQnzXnuwIAqV14a2TOVe+zrzuiOE+IogI5SqWxB0oT etrD7O3BuY32XJyqifHfp7BEC+41hab0FOt6RN0zhsqMR+PqMNrihILem9Zb0UIWsJum Uom2pni7dkPStzxqO0CZBPY/f/CgppWf/VEg7Vv/JocHCsfPA3ee4gWQ6L3nh10MSKRF Z+jg== 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:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=YzoUgBCasnWNfJxsOJqNvU8laOj5o30zvjpkG+DZDxM=; b=dzoA7b0How33CokCndZDC9A0r46UXTJih7OWatD1GtXiaESjYrXdm7PlWRWRB4VHoi J7kaWcMEJG365gm4RTZ1dv6v2VY3GwtRuBlpSVSwkZce9AK76YEn3U7RINNnrM81cjYf o+6o9hSFv8xRxNOgfKGmDZYHLamzvRhxj1uyBSyRwl58A6x/2/9bVLHuZDomsgv0Vyb/ n0uo3Wjkl1daQPFjmsB7DqqFYf28Wfpny3OWae54NIWXa5eiQ7rEEdJbIAtZenlU6lqP KhHliS/Jtx1rY414sYQWHlImDR7jllDWnwjWugIKmIS7sgagdEx5Cjx5Nc8kDXc9O+KO uQPA== 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 u7si41414694pgg.357.2018.11.19.18.44.22; Mon, 19 Nov 2018 18:44:37 -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 S1732651AbeKTM7K (ORCPT + 99 others); Tue, 20 Nov 2018 07:59:10 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:56906 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbeKTM7K (ORCPT ); Tue, 20 Nov 2018 07:59:10 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 3B1BD14D70696; Mon, 19 Nov 2018 18:32:25 -0800 (PST) Date: Mon, 19 Nov 2018 18:32:24 -0800 (PST) Message-Id: <20181119.183224.87651627805917399.davem@davemloft.net> To: tanxiaojun@huawei.com Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com, lipeng321@huawei.com, linyunsheng@huawei.com, shenjian15@huawei.com, tanhuazhong@huawei.com, liangfuyun1@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: hns3: add common validation in hclge_dcb From: David Miller In-Reply-To: <1542632535-18210-1-git-send-email-tanxiaojun@huawei.com> References: <1542632535-18210-1-git-send-email-tanxiaojun@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 19 Nov 2018 18:32:25 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tan Xiaojun Date: Mon, 19 Nov 2018 21:02:15 +0800 > 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. > > Signed-off-by: Yunsheng Lin > Signed-off-by: Tan Xiaojun Looks good, applied, thanks!