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 83B20A09E4; Thu, 28 Jan 2021 17:55:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16EBF40682; Thu, 28 Jan 2021 17:55:42 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id B3EDD4067A for ; Thu, 28 Jan 2021 17:55:40 +0100 (CET) IronPort-SDR: WpXmdnVpiaA6Zljc6PsjuXhvV7I9Tw/gRLBGqgxKwMaimlH9AQtJPrGpHF7jWLKE8uW3nyZ6bz 8VvZbXSn9zZw== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="244355031" X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="244355031" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 08:55:37 -0800 IronPort-SDR: DKFz+A+RjJuc9hsAmMcvafVnJJwd4ZtjBEpytnDyvPO0uHnteLyYpjYrYLy62pxtCsm6Rftoqc Bhp8/27RQyQw== X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="388896484" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.197.127]) ([10.213.197.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 08:55:35 -0800 To: Nalla Pradeep , Jerin Jacob , Nithin Dabilpuram , Radha Mohan Chintakuntla , Veerasenareddy Burru , Anatoly Burakov Cc: sburla@marvell.com, dev@dpdk.org References: <20210118093602.5449-1-pnalla@marvell.com> <20210128152220.214485-4-pnalla@marvell.com> From: Ferruh Yigit Message-ID: <1e7e76f2-3e2d-54cb-1932-7edd57bb57f9@intel.com> Date: Thu, 28 Jan 2021 16:55:30 +0000 MIME-Version: 1.0 In-Reply-To: <20210128152220.214485-4-pnalla@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v5 03/11] net/octeontx_ep: add device init and uninit 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" On 1/28/2021 3:22 PM, Nalla Pradeep wrote: > Add basic init and uninit function which includes > initializing fields of ethdev private structure. > > Signed-off-by: Nalla Pradeep > --- > drivers/common/octeontx2/otx2_common.h | 2 +- > drivers/net/octeontx_ep/otx_ep_common.h | 19 ++++++- > drivers/net/octeontx_ep/otx_ep_ethdev.c | 72 +++++++++++++++++++++++-- > 3 files changed, 86 insertions(+), 7 deletions(-) > > diff --git a/drivers/common/octeontx2/otx2_common.h b/drivers/common/octeontx2/otx2_common.h > index 96021eda2..cd52e098e 100644 > --- a/drivers/common/octeontx2/otx2_common.h > +++ b/drivers/common/octeontx2/otx2_common.h > @@ -136,7 +136,7 @@ extern int otx2_logtype_ree; > #define PCI_DEVID_OCTEONTX2_RVU_CPT_VF 0xA0FE > #define PCI_DEVID_OCTEONTX2_RVU_AF_VF 0xA0f8 > #define PCI_DEVID_OCTEONTX2_DPI_VF 0xA081 > -#define PCI_DEVID_OCTEONTX2_EP_VF 0xB203 /* OCTEON TX2 EP mode */ > +#define PCI_DEVID_OCTEONTX2_EP_NET_VF 0xB203 /* OCTEON TX2 EP mode */ Hi Nalla, Can you prepare a patch as a first patch of your series, that 1) renames 'PCI_DEVID_OCTEONTX2_EP_VF' -> 'PCI_DEVID_OCTEONTX2_EP_NET_VF' 2) adds 'PCI_DEVID_OCTEONTX2_EP_RAW_VF' And does required driver changes for above. Since that change requires update in the existing driver, 'raw/octeontx2_ep', better to get it out of way before 'net/octeontx_ep' changes, instead of spreading this into the 'net/octeontx_ep' patches. What do you think? > /* OCTEON TX2 98xx EP mode */ > #define PCI_DEVID_CN98XX_EP_NET_VF 0xB103 > #define PCI_DEVID_OCTEONTX2_EP_RAW_VF 0xB204 /* OCTEON TX2 EP mode */ > diff --git a/drivers/net/octeontx_ep/otx_ep_common.h b/drivers/net/octeontx_ep/otx_ep_common.h > index 35ea99a79..0d6484c87 100644 > --- a/drivers/net/octeontx_ep/otx_ep_common.h > +++ b/drivers/net/octeontx_ep/otx_ep_common.h > @@ -4,11 +4,28 @@ > #ifndef _OTX_EP_COMMON_H_ > #define _OTX_EP_COMMON_H_ > > +#define otx_ep_info(fmt, args...) \ > + RTE_LOG(INFO, PMD, fmt "\n", ## args) > + > +#define otx_ep_err(fmt, args...) \ > + RTE_LOG(ERR, PMD, "%s():%u " fmt "\n", \ > + __func__, __LINE__, ## args) Below is using new log type, 'otx_net_ep_logtype', but why above two, 'info' & 'err' types continue to use 'RTE_LOGTYPE_PMD'? Can you switch them to new log type please? > + > +#define otx_ep_dbg(fmt, args...) \ > + rte_log(RTE_LOG_DEBUG, otx_net_ep_logtype, \ > + "%s():%u " fmt "\n", \ > + __func__, __LINE__, ##args) > + I think you need to move 'RTE_LOG_REGISTER' into this patch, that macro creates the 'otx_net_ep_logtype' logtype variable. Currently that macro is in next patch. <...> > static int > otx_ep_eth_dev_init(struct rte_eth_dev *eth_dev) > { > - RTE_SET_USED(eth_dev); > + struct rte_pci_device *pdev = RTE_ETH_DEV_TO_PCI(eth_dev); > + struct otx_ep_device *otx_epvf = OTX_EP_DEV(eth_dev); > + struct rte_ether_addr vf_mac_addr; > + > + /* Single process support */ > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + return 0; > + > + otx_epvf->eth_dev = eth_dev; > + otx_epvf->port_id = eth_dev->data->port_id; > + eth_dev->data->mac_addrs = rte_zmalloc("otx_ep", RTE_ETHER_ADDR_LEN, 0); > + if (eth_dev->data->mac_addrs == NULL) { > + otx_ep_err("MAC addresses memory allocation failed\n"); > + return -ENOMEM; > + } > + rte_eth_random_addr(vf_mac_addr.addr_bytes); > + rte_ether_addr_copy(eth_dev->data->mac_addrs, &vf_mac_addr); The API is 'rte_ether_addr_copy(from, to)', _unfortunately it is reverse of the more standard (dst, src) order_, can parameters be used wrong above?