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 8F1EFA051C; Sat, 18 Jan 2020 15:35:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 647281B9B5; Sat, 18 Jan 2020 15:35:19 +0100 (CET) Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by dpdk.org (Postfix) with ESMTP id 248F24C93 for ; Sat, 18 Jan 2020 15:35:18 +0100 (CET) Received: by mail-il1-f195.google.com with SMTP id x5so23749491ila.6 for ; Sat, 18 Jan 2020 06:35:18 -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=36HGZqZQ6tUShxvuq9qvFzNpcTq2ftzzaUUyS+sI3h8=; b=Kk8Rr8Vd326uYK7zSibdFr1XtFtumtcPZBBW7fYkA9RYNQsCgo06jrdDaX4X6g5ccq h3MgO74DsyDZoWJr7GhOUa+cqV+NMq6vFCGr5Eq7Kzetcky4GomWismwxq137xK1m9Zn HmBQwEfYib0zhdFGIzIBD0yLywG0LT/RJ/8/mtCQEcRnG9TMUcsBvv7tel4Oz2gY9TW7 8Pk9QhSos4uasONqtt1UuF1b0STwNgT7ohDn4yTfEjjMS2Medxw46mChHiZaIX+75uyd mis8/yC+Ul5gUKpCSZHcT/WCVIG+J4gLWJjjoakTrzfzVSm2g5DerqLnqiqhLVI9gMyt rebQ== 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=36HGZqZQ6tUShxvuq9qvFzNpcTq2ftzzaUUyS+sI3h8=; b=YcrtpKSGvIjA2xijUpwY1aV8RxWshNlfiyVs3g6waJyIaLnwA5XkEWiHLfPIkMxrrN 3MDsBsFmugIQJTyA5J2Hb8uZY5KMQ0M7hZ/WjHfvS2UsN+0ylMoYevuu51LTbpFi3rPp 9BXM1XeaSuyO6DR1w5R60GZrkHRebLE5nWHDL4tEpNhHF+lm6Fs3pBTyu6K/2MirAroa 3ysteVVziubruNWJP8T4YgNonnpWbqlp9g+40uz43aCzuakleWrSEMiJa0VIFBuFgDMT Xt2TueGo1AFGhkJF6G3Pha+VnY0GXVK+0/8H2RlyfVQ+85iF5d1s2OlNc8GqzcjOhs8A tChg== X-Gm-Message-State: APjAAAV7aouQM+Q3ytwZBxSkyabIBPkArFSbVRahvaVgLaN+R/0yBF7+ 39jWcu6sp/XLgxyBFOb5hkVzEOlQFff9tlereWM= X-Google-Smtp-Source: APXvYqywjwuQVROl+iG7dRfyql3lbo7GHIiPW9IGyutHC+FRa3osmVJomBFEtJlj3VasZm38cjFCxaYrmYak4V37+2c= X-Received: by 2002:a92:5e46:: with SMTP id s67mr3390346ilb.162.1579358117495; Sat, 18 Jan 2020 06:35:17 -0800 (PST) MIME-Version: 1.0 References: <1575806094-28391-1-git-send-email-anoobj@marvell.com> <1579344553-11428-1-git-send-email-anoobj@marvell.com> <1579344553-11428-3-git-send-email-anoobj@marvell.com> In-Reply-To: <1579344553-11428-3-git-send-email-anoobj@marvell.com> From: Jerin Jacob Date: Sat, 18 Jan 2020 20:05:01 +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 v2 02/15] common/octeontx2: add routine to check if sec capable 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 Sat, Jan 18, 2020 at 4:19 PM Anoob Joseph wrote: > > From: Vamsi Attunuru > > This routine returns true if given rte_eth_dev is security offload > capable and belongs to octeontx2. > > Signed-off-by: Anoob Joseph > Signed-off-by: Tejasree Kondoj > Signed-off-by: Vamsi Attunuru Acked-by: Jerin Jacob > --- > 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..2f9b167 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 security offload capable otx2_eth_dev > + */ > +uint8_t > +otx2_ethdev_is_sec_capable(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) > + 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..db0cde1 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_ethdev_is_sec_capable(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..bd9fc41 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_ethdev_is_sec_capable; > otx2_logtype_base; > otx2_logtype_dpi; > otx2_logtype_mbox; > -- > 2.7.4 >