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 3EF78A2EDB for ; Fri, 6 Sep 2019 08:20:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C1DE1F118; Fri, 6 Sep 2019 08:20:40 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 4673E1EE4F for ; Fri, 6 Sep 2019 08:20:39 +0200 (CEST) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4704DDFC3CA0D77D2C91; Fri, 6 Sep 2019 14:20:37 +0800 (CST) Received: from [127.0.0.1] (10.57.115.182) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Sep 2019 14:20:30 +0800 To: Ferruh Yigit , References: <1566568031-45991-1-git-send-email-xavier.huwei@huawei.com> <1566568031-45991-4-git-send-email-xavier.huwei@huawei.com> <763b0d93-3e5a-d12d-663a-65ba94189f0e@intel.com> CC: , , , From: "Wei Hu (Xavier)" Message-ID: <4ca1a65c-04e2-20cc-149c-22d50810534d@huawei.com> Date: Fri, 6 Sep 2019 14:20:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <763b0d93-3e5a-d12d-663a-65ba94189f0e@intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.57.115.182] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 03/22] net/hns3: register hns3 PMD driver 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" Hi, Ferruh Yigit On 2019/8/30 23:01, Ferruh Yigit wrote: > On 8/23/2019 2:46 PM, Wei Hu (Xavier) wrote: >> This patch registers hns3 PMD driver and adds the definition for log >> interfaces. >> >> Signed-off-by: Wei Hu (Xavier) >> Signed-off-by: Chunsong Feng >> Signed-off-by: Min Hu (Connor) >> Signed-off-by: Hao Chen >> Signed-off-by: Huisong Li > <...> > >> diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c >> new file mode 100644 >> index 0000000..0587a9c >> --- /dev/null >> +++ b/drivers/net/hns3/hns3_ethdev.c >> @@ -0,0 +1,141 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2018-2019 Hisilicon Limited. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include > Are all these headers really used at this stage? Can you please clean them and > add later patches when they are required? > > <...> > >> +static int >> +hns3_dev_init(struct rte_eth_dev *eth_dev) >> +{ >> + struct rte_device *dev = eth_dev->device; >> + struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev); >> + struct hns3_adapter *hns = eth_dev->data->dev_private; >> + struct hns3_hw *hw = &hns->hw; >> + uint16_t device_id = pci_dev->id.device_id; >> + int ret; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) >> + return 0; >> + >> + eth_dev->dev_ops = &hns3_eth_dev_ops; >> + rte_eth_copy_pci_info(eth_dev, pci_dev); > I think no need to call 'rte_eth_copy_pci_info()', it is called by > 'rte_eth_dev_pci_generic_probe()' before 'hns3_dev_init()' called. I will fix it in patch V2. > >> + >> + hns->is_vf = false; > There is a separate VF driver, is this field still needed? hns3 PMD driver includes PF and VF drivers. In the struct hns3_adapter data, the memeber named is_vf is used to distinguish PF from VF devices. >> + hw->data = eth_dev->data; >> + hw->adapter_state = HNS3_NIC_INITIALIZED; >> + >> + return 0; > Init should set 'RTE_ETH_DEV_CLOSE_REMOVE' flag, and '.dev_close' should free > the driver allocated resources, which there is not up until this patch: > > +eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; > I will fix it in patch V2. Thanks for your suggestion. Regards Xavier