From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19F05A046B; Sat, 9 May 2020 05:41:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C0FFA1D998; Sat, 9 May 2020 05:41:09 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id B5C101D97B for ; Sat, 9 May 2020 05:40:58 +0200 (CEST) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C8CB4BBD5E07F0D182A1; Sat, 9 May 2020 11:40:50 +0800 (CST) Received: from tester.localdomain (10.175.119.39) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Sat, 9 May 2020 11:40:40 +0800 From: Xiaoyun wang To: CC: , , , , , , , , , , Xiaoyun wang Date: Sat, 9 May 2020 12:04:15 +0800 Message-ID: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.119.39] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v5 3/4] net/hinic: increase judgment for support NIC or not X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" If hardware mode for this card does not support nic, the network features for this card will not be supported and driver will be initialized failed. Signed-off-by: Xiaoyun wang --- drivers/net/hinic/base/hinic_pmd_cfg.c | 3 ++- drivers/net/hinic/hinic_pmd_ethdev.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/hinic/base/hinic_pmd_cfg.c b/drivers/net/hinic/base/hinic_pmd_cfg.c index aa883e0..2d25dc9 100644 --- a/drivers/net/hinic/base/hinic_pmd_cfg.c +++ b/drivers/net/hinic/base/hinic_pmd_cfg.c @@ -129,7 +129,7 @@ static void hinic_parse_pub_res_cap(struct service_cap *cap, cap->max_rqs = dev_cap->nic_max_rq; } - cap->chip_svc_type = CFG_SVC_NIC_BIT0; + cap->chip_svc_type = dev_cap->svc_cap_en; cap->host_total_function = dev_cap->host_total_func; cap->host_oq_id_mask_val = dev_cap->host_oq_id_mask_val; @@ -140,6 +140,7 @@ static void hinic_parse_pub_res_cap(struct service_cap *cap, PMD_DRV_LOG(INFO, "host_total_function: 0x%x, host_oq_id_mask_val: 0x%x, max_vf: 0x%x", cap->host_total_function, cap->host_oq_id_mask_val, cap->max_vf); + PMD_DRV_LOG(INFO, "chip_svc_type: 0x%x", cap->chip_svc_type); PMD_DRV_LOG(INFO, "pf_num: 0x%x, pf_id_start: 0x%x, vf_num: 0x%x, vf_id_start: 0x%x", cap->pf_num, cap->pf_id_start, cap->vf_num, cap->vf_id_start); diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 85e7c3c..cea026a 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -2811,8 +2811,12 @@ static int hinic_nic_dev_create(struct rte_eth_dev *eth_dev) } /* get nic capability */ - if (!hinic_support_nic(nic_dev->hwdev, &nic_dev->nic_cap)) + if (!hinic_support_nic(nic_dev->hwdev, &nic_dev->nic_cap)) { + PMD_DRV_LOG(ERR, "Hw doesn't support nic, dev_name: %s", + eth_dev->data->name); + rc = -EINVAL; goto nic_check_fail; + } /* init root cla and function table */ rc = hinic_init_nicio(nic_dev->hwdev); -- 1.8.3.1