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 D8A7BA051C; Sat, 18 Jan 2020 11:49:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B44F4316B; Sat, 18 Jan 2020 11:49:54 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id F2B4229D6 for ; Sat, 18 Jan 2020 11:49:53 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00IAmMHk018888; Sat, 18 Jan 2020 02:49:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=ALnP0KttQ2ckBVZnHJpRnkIB053Mqdnv1Hapk6Y2HnY=; b=A+DPsp1zD6rs8JMV0bTJk9RFgVOpwy7feqjjRz6Tamw40RjxBPzK3Ot7RqeFwzgctyWi 9mCQuJ96rVOllYZvnTyqKpsiR+iy3/JCG0YslnLFjU7jV5fcyKddTnSp9KMeksi36l2Y oLUeepLC9VmKtk3lY7H7w31qXbRZF7266FZZZUhB27Q9rQkECH1xFVsDOKnZhduOrZMW KUBJFr/ubgfGmOUfqioKOo7ZiTFVZcahQmDdIlVdXNyIgbZUu8W1d6HKIPNDtUKDqhw3 LmdYqEfxlPzAOXOTepyVjZZ7XTH691vtXUXJwVkrnXfpbBA/fi4gFU68MzUnh4SOSlUr sg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2xk0sn6een-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 18 Jan 2020 02:49:53 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 18 Jan 2020 02:49:51 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 18 Jan 2020 02:49:51 -0800 Received: from ajoseph83.caveonetworks.com (unknown [10.29.45.60]) by maili.marvell.com (Postfix) with ESMTP id D2C893F703F; Sat, 18 Jan 2020 02:49:46 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Declan Doherty , Thomas Monjalon CC: Vamsi Attunuru , Jerin Jacob , Narayana Prasad , Kiran Kumar K , Nithin Dabilpuram , "Pavan Nikhilesh" , Ankur Dwivedi , Anoob Joseph , Archana Muniganti , Tejasree Kondoj , Lukasz Bartosik , Date: Sat, 18 Jan 2020 16:19:00 +0530 Message-ID: <1579344553-11428-3-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579344553-11428-1-git-send-email-anoobj@marvell.com> References: <1575806094-28391-1-git-send-email-anoobj@marvell.com> <1579344553-11428-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-18_02:2020-01-16, 2020-01-18 signatures=0 Subject: [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" 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 --- 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