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 E889CA04F1; Mon, 9 Dec 2019 08:42:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37F722BAB; Mon, 9 Dec 2019 08:42:35 +0100 (CET) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id D2BF223D for ; Mon, 9 Dec 2019 08:42:33 +0100 (CET) Received: by mail-io1-f65.google.com with SMTP id z193so13708528iof.1 for ; Sun, 08 Dec 2019 23:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WgLXWvK1ceU1ZP/Rrdc/6yl0WRwm11pkjMUEmOsUNTo=; b=Loa6pIoFeOhbYS6a7fDU10cF/dWr/BzsFJttamc+UJI4Zp++Cr0btmDFBPCRAOkoX3 leyGk1kIZJb9/B7HEL6iwVyu0pagh0pxqZyAx5i3uCAQTWiaOZfeTENFRJkFeqWGmYf/ phy93UW8SvP+RvvJCR8hBwcVIFwE1gYyNZrbbNB6oPIzoDWMnShoD3e1k9DHwfA00d9J YU4qXlNwHrpyq2EEBjK6jmoDJQT+Ry+8chygkJEInqrJt2hKr/BlP7sOSX534hZXl8hF G9ShAucPADK0gOa7Y53soYkuFFbxf5Y0/jwlJ5JPEfBC8w7xeQ+0pi3Ha9Q8CMg6Xzf4 M1Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WgLXWvK1ceU1ZP/Rrdc/6yl0WRwm11pkjMUEmOsUNTo=; b=piCsHVU/uWquMDLyuzLaK3vsfS09SR1oPi9sWTUOkULYrOPTRZuVPnB6SGf3MdjPz5 CQ7okdJLuSxPHQJ7eH6GLW/i+W034oHXjieg8Xf1rbcs3rHUzx9Zdv/LqibtEfp7R9xi bTjaji3AnO4DXKcA6N9s1AiDwqMK/Zy3wPYUzGxq4A4I4IjwKw/VunMx69cQi9X4AFZa vIzpuqPNBU9SC2h3iUgMb866u/+KcMspRPLqk13z5G6/ZRcSEHkSqNd85pTmBwDSSc7p 24dXck1QWUGDtuI7cBgpGzFZUTMAiTRRXLoVujh7lrFqo59B5FASZPLzCkasvQg1uONo gNSg== X-Gm-Message-State: APjAAAUsDKdyHEX2p6ImHnpq/T55JmFay8vX/MPCs6oqAQUkhg1fKHcT HIpKmWhSx77IfrZDswMCWcB96Fce++IjTD1fJw8= X-Google-Smtp-Source: APXvYqwT4aQjmCTnEEqPpurPgdJgniRa3Koj0NOpHU36DD76Edbca39UJ2Tf75UISVvde5JJ/SBSa/eThiRqY7CFJNY= X-Received: by 2002:a05:6602:14d:: with SMTP id v13mr2458002iot.162.1575877353050; Sun, 08 Dec 2019 23:42:33 -0800 (PST) MIME-Version: 1.0 References: <1575806094-28391-1-git-send-email-anoobj@marvell.com> <1575806094-28391-3-git-send-email-anoobj@marvell.com> In-Reply-To: <1575806094-28391-3-git-send-email-anoobj@marvell.com> From: Jerin Jacob Date: Mon, 9 Dec 2019 13:12:17 +0530 Message-ID: To: Anoob Joseph Cc: Akhil Goyal , Declan Doherty , Thomas Monjalon , Vamsi Attunuru , Jerin Jacob , Narayana Prasad , Kiran Kumar K , Nithin Dabilpuram , Pavan Nikhilesh , Ankur Dwivedi , Archana Muniganti , Tejasree Kondoj , Lukasz Bartosik , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 02/15] common/octeontx2: add routine to check if rte_eth_dev belongs to otx2 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" On Sun, Dec 8, 2019 at 5:25 PM Anoob Joseph wrote: > > From: Vamsi Attunuru > > This routine returns true if given rte_eth_dev belongs to octeontx2 > > Signed-off-by: Anoob Joseph > Signed-off-by: Tejasree Kondoj > Signed-off-by: Vamsi Attunuru > --- > drivers/common/octeontx2/otx2_common.c | 20 ++++++++++++++++++++ > drivers/common/octeontx2/otx2_common.h | 2 ++ > .../octeontx2/rte_common_octeontx2_version.map | 1 + > 3 files changed, 23 insertions(+) > > diff --git a/drivers/common/octeontx2/otx2_common.c b/drivers/common/octeontx2/otx2_common.c > index 7e45366..116db0f 100644 > --- a/drivers/common/octeontx2/otx2_common.c > +++ b/drivers/common/octeontx2/otx2_common.c > @@ -3,6 +3,7 @@ > */ > > #include > +#include > #include > #include > > @@ -23,6 +24,25 @@ otx2_npa_set_defaults(struct otx2_idev_cfg *idev) > > /** > * @internal > + * Check if rte_eth_dev is otx2_eth_dev > + */ > +uint8_t > +otx2_is_ethdev(struct rte_eth_dev *eth_dev) > +{ > + struct rte_pci_device *pci_dev; > + > + pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); > + > + if (pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_PF || > + pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_VF || > + pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_AF_VF) Is PCI_DEVID_OCTEONTX2_RVU_SDP_VF and PCI_DEVID_OCTEONTX2_RVU_SDP_PF also comes here? If yes. update the patch. > + return 1; > + > + return 0; > +} > + > +/** > + * @internal > * Get intra device config structure. > */ > struct otx2_idev_cfg * > diff --git a/drivers/common/octeontx2/otx2_common.h b/drivers/common/octeontx2/otx2_common.h > index f62c45d..d32e59a 100644 > --- a/drivers/common/octeontx2/otx2_common.h > +++ b/drivers/common/octeontx2/otx2_common.h > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -70,6 +71,7 @@ struct otx2_idev_cfg *otx2_intra_dev_get_cfg(void); > void otx2_sso_pf_func_set(uint16_t sso_pf_func); > uint16_t otx2_sso_pf_func_get(void); > uint16_t otx2_npa_pf_func_get(void); > +uint8_t otx2_is_ethdev(struct rte_eth_dev *eth_dev); > struct otx2_npa_lf *otx2_npa_lf_obj_get(void); > void otx2_npa_set_defaults(struct otx2_idev_cfg *idev); > int otx2_npa_lf_active(void *dev); > diff --git a/drivers/common/octeontx2/rte_common_octeontx2_version.map b/drivers/common/octeontx2/rte_common_octeontx2_version.map > index adad21a..dac2283 100644 > --- a/drivers/common/octeontx2/rte_common_octeontx2_version.map > +++ b/drivers/common/octeontx2/rte_common_octeontx2_version.map > @@ -6,6 +6,7 @@ DPDK_20.0 { > otx2_dev_priv_init; > otx2_disable_irqs; > otx2_intra_dev_get_cfg; > + otx2_is_ethdev; > otx2_logtype_base; > otx2_logtype_dpi; > otx2_logtype_mbox; > -- > 2.7.4 >