From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3DBEEA054F; Tue, 2 Mar 2021 14:59:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72C6F22A314; Tue, 2 Mar 2021 14:58:26 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 9FAA322A2A0 for ; Tue, 2 Mar 2021 14:58:18 +0100 (CET) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dqdw32tSbz16Fn3; Tue, 2 Mar 2021 21:56:35 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Tue, 2 Mar 2021 21:58:11 +0800 From: Lijun Ou To: CC: , Date: Tue, 2 Mar 2021 21:58:47 +0800 Message-ID: <1614693534-27620-8-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614693534-27620-1-git-send-email-oulijun@huawei.com> References: <1614130139-42926-1-git-send-email-oulijun@huawei.com> <1614693534-27620-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 07/14] net/hns3: fix device capabilities for copper media type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Huisong Li The configuration operation for PHY is implemented by firmware. And a capability flag will be report to driver, which means the firmware supports the PHY driver. However, the current implementation only supports obtaining the capability bit, but some basic functions of copper ports in driver, such as, the query of link status and link info, are not supported. Therefore, it is necessary for driver to set the copper capability bit to zero when the firmware supports the configuration of the PHY. Fixes: 438752358158 ("net/hns3: get device capability from firmware") Fixes: 95e50325864c ("net/hns3: support copper media type") Cc: stable@dpdk.org Signed-off-by: Huisong Li --- drivers/net/hns3/hns3_cmd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index 32cd56b..ec34615 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -423,8 +423,14 @@ static void hns3_parse_capability(struct hns3_hw *hw, hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_PTP_B, 1); if (hns3_get_bit(caps, HNS3_CAPS_TX_PUSH_B)) hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_TX_PUSH_B, 1); + /* + * Currently, the query of link status and link info on copper ports + * are not supported. So it is necessary for driver to set the copper + * capability bit to zero when the firmware supports the configuration + * of the PHY. + */ if (hns3_get_bit(caps, HNS3_CAPS_PHY_IMP_B)) - hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 1); + hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 0); if (hns3_get_bit(caps, HNS3_CAPS_TQP_TXRX_INDEP_B)) hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_INDEP_TXRX_B, 1); if (hns3_get_bit(caps, HNS3_CAPS_STASH_B)) -- 2.7.4