Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp274902ybk; Sat, 9 May 2020 02:30:59 -0700 (PDT) X-Google-Smtp-Source: APiQypLqG6+5rjUxBUxQXwG5ultiFRJKR1reUuO0eNmjjwhi/abj6OQhVJA0JeMZPtMITbsWnaOO X-Received: by 2002:a17:906:33d4:: with SMTP id w20mr5305165eja.284.1589016659020; Sat, 09 May 2020 02:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589016659; cv=none; d=google.com; s=arc-20160816; b=OzrHzyiwiRSKuiMm3E9JXW6DB+Mr1frWNfNhj2CGNeeZBUDS1NhiExsmW2gmkb/mRg 1WlV7z9tDGlXtZuZu1Pdh85oM2Nu0KH7wtayJ2I6jEdLAnpwoUnzXRnlkaTodOK/ZMyC jv3CSoE1o0OreX0iGM5mRxbQa0F+kNLnG12Kgcuf2hK89AxIM7GG37PtGgnuYidOJrFk 7tpLWBvztvRuLBN7VPuc2e4krkwbLJ+UIQc9qHOgz+B54jwzfJsnEIR2Zp0f2EK2884f bzSk/EVKe1zhlcAGYD8R96hZdJS2oisPiiLf6RiETAlUq5rFpGEP13VmKD2g2ZlED+3b fUIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=nBGIiScD991DfrwHBsstMknZcdh8FROIManeSKQ8StQ=; b=w0YArsuHaKoDAmy/+p+wc6Lknu1nOqlmqChWOb8vjHPb6Oz8mBkGcH3DY5l6QXmvif MdMyaarb1wbBrmpfmTjt2Qbq6Q3KW53hFU2Mx+RQATpN7f0ZHmOniDbn4JhojffIJlZV Z3libd8dXlgAWJfrNLaRGj6q6PdHxYqoOLneEZlJEjt+46PS9yPS4D+Kxd0XnxPzcW3Z iVSgyJjT5n0z9XJFb2on2jc/fFiR2cS3TEvJaL7PhWulZbAUztbpw+45F/8zoPPjTRMW FFxkj6eruQrmGohqWTJk7QwGDpwFdHGerzBNFE8WOm8BndZQQ5r9MmhXvaAquuJiXu3x JAxw== 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 e19si2184521ejd.174.2020.05.09.02.30.35; Sat, 09 May 2020 02:30:59 -0700 (PDT) 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 S1728190AbgEIJ3H (ORCPT + 99 others); Sat, 9 May 2020 05:29:07 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4377 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728123AbgEIJ3C (ORCPT ); Sat, 9 May 2020 05:29:02 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 61268B2BE607AE9CF394; Sat, 9 May 2020 17:29:00 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Sat, 9 May 2020 17:28:49 +0800 From: Huazhong Tan To: CC: , , , , , , Huazhong Tan Subject: [PATCH net-next 3/5] net: hns3: provide .get_cmdq_stat interface for the client Date: Sat, 9 May 2020 17:27:39 +0800 Message-ID: <1589016461-10130-4-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589016461-10130-1-git-send-email-tanhuazhong@huawei.com> References: <1589016461-10130-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch provides a new interface for the client to query whether CMDQ is ready to work. Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 5602bf2..7506cab 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -552,6 +552,7 @@ struct hnae3_ae_ops { int (*set_vf_mac)(struct hnae3_handle *handle, int vf, u8 *p); int (*get_module_eeprom)(struct hnae3_handle *handle, u32 offset, u32 len, u8 *data); + bool (*get_cmdq_stat)(struct hnae3_handle *handle); }; struct hnae3_dcb_ops { diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 3ad6a6a..1ff896a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -6402,6 +6402,14 @@ static bool hclge_get_hw_reset_stat(struct hnae3_handle *handle) hclge_read_dev(&hdev->hw, HCLGE_FUN_RST_ING); } +static bool hclge_get_cmdq_stat(struct hnae3_handle *handle) +{ + struct hclge_vport *vport = hclge_get_vport(handle); + struct hclge_dev *hdev = vport->back; + + return test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); +} + static bool hclge_ae_dev_resetting(struct hnae3_handle *handle) { struct hclge_vport *vport = hclge_get_vport(handle); @@ -11311,6 +11319,7 @@ static const struct hnae3_ae_ops hclge_ops = { .set_vf_rate = hclge_set_vf_rate, .set_vf_mac = hclge_set_vf_mac, .get_module_eeprom = hclge_get_module_eeprom, + .get_cmdq_stat = hclge_get_cmdq_stat, }; static struct hnae3_ae_algo ae_algo = { -- 2.7.4