From patchwork Wed Jan 25 07:26:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yankejian X-Patchwork-Id: 9536491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9157F601D7 for ; Wed, 25 Jan 2017 07:21:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7074126E47 for ; Wed, 25 Jan 2017 07:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6507E26E55; Wed, 25 Jan 2017 07:21:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1FED426E47 for ; Wed, 25 Jan 2017 07:21:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cWHtx-0006Sk-57; Wed, 25 Jan 2017 07:21:53 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cWHtS-0005Df-8L for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2017 07:21:29 +0000 Received: from 172.24.1.36 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.36]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DYH80255; Wed, 25 Jan 2017 15:11:47 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Wed, 25 Jan 2017 15:11:39 +0800 From: Kejian Yan To: , , , , , , , , , , , , Subject: [patch] {1620} net: hns3: add dcb cap flag in init sequence Date: Wed, 25 Jan 2017 15:26:40 +0800 Message-ID: <1485329200-64453-1-git-send-email-yankejian@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.58884FB8.0032, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 2875ce45a1bd9a20f7fb0b93c3292260 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170124_232123_929121_FC80B00B X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If enable DCB feature, we need to add the capacity, and the current procedure cannot setting the dcb because of no capacity flag and every ops interface will implement by the capicity flag is enable. Signed-off-by: Kejian Yan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 ++++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 26b9b46..fffe781 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -314,12 +314,14 @@ static int hclge_configure(struct hclge_dev *hdev) hdev->tx_sch_mode = HCLGE_FLAG_TC_BASE_SCH_MODE; #ifdef CONFIG_HNS3_DCB hdev->dcbx_cap = DCB_CAP_DCBX_VER_CEE | - DCB_CAP_DCBX_VER_IEEE; + DCB_CAP_DCBX_VER_IEEE | DCB_CAP_DCBX_HOST; + hdev->flag |= HCLGE_FLAG_DCB_CAPABLE; #endif /* #ifdef CONFIG_HNS3_DCB */ } else { hdev->tx_sch_mode = HCLGE_FLAG_VNET_BASE_SCH_MODE; #ifdef CONFIG_HNS3_DCB - hdev->dcbx_cap = DCB_CAP_DCBX_VER_IEEE; + hdev->dcbx_cap = DCB_CAP_DCBX_VER_IEEE | DCB_CAP_DCBX_HOST; + hdev->flag |= HCLGE_FLAG_DCB_CAPABLE; #endif /* #ifdef CONFIG_HNS3_DCB */ } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c index 903c413..6b00982 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c @@ -687,6 +687,11 @@ static void hclge_tm_tc_info_init(struct hclge_dev *hdev) hdev->dcb_info_tmp.num_tc = hdev->dcb_info.num_tc; memcpy(hdev->dcb_info_tmp.tc_info, hdev->dcb_info.tc_info, HNAE3_MAX_TC * sizeof(*hdev->dcb_info.tc_info)); + + if (hdev->dcb_info.num_tc > 1) + hdev->flag |= HCLGE_FLAG_DCB_ENABLE; + else + hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE; } static void hclge_tm_pg_info_init(struct hclge_dev *hdev)