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 64BBFA0531; Tue, 4 Feb 2020 12:18:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD7A91C0BD; Tue, 4 Feb 2020 12:18:20 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id B54091BFA3 for ; Tue, 4 Feb 2020 12:18:19 +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 014BFNTM011176; Tue, 4 Feb 2020 03:18:19 -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=DoQtwZF161WIKcvYB8PO7xRUGOpatxKnyzbMmuKoxos=; b=mqp5CBHiJV0UMuLW5YbcCyOUIxCAD8JmqrOoApC1S++amUnt8ldWSlaGJI5PxgZ8ZtCj vFKMDeCxQwKVUhZOgy+6R81V8Mndo6+/DwPwIObj/OPf77L7fMcM7YF4voaMqK0aPZ18 Ww8ymYRhu7EHWNO9scJTpAkCCehI3r9GdCRSUj5ZKFODFP0U/Q7az4JxCO8Ksjoa/1z6 OBuDx832GlB/clQnhf2oPCMkBE0MGPiJrShZ0Pkz/p+KsM4QWAd9xANekkeTNDNLn5Z0 YdFx3DrZiLyN1h13eqi5dl7jwoNt53rtWC1JlRDGLGenkezvNo67DIu0dvA8qoyaTRDL 5Q== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2xw9qukg08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 04 Feb 2020 03:18:19 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 4 Feb 2020 03:18:16 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 4 Feb 2020 03:18:16 -0800 Received: from ajoseph83.caveonetworks.com (unknown [10.29.45.60]) by maili.marvell.com (Postfix) with ESMTP id 677703F7068; Tue, 4 Feb 2020 03:18:12 -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: Tue, 4 Feb 2020 16:47:12 +0530 Message-ID: <1580815045-32132-3-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580815045-32132-1-git-send-email-anoobj@marvell.com> References: <1580465035-30455-1-git-send-email-anoobj@marvell.com> <1580815045-32132-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-02-04_02:2020-02-04, 2020-02-04 signatures=0 Subject: [dpdk-dev] [PATCH v4 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 --- MAINTAINERS | 5 ++++ drivers/common/octeontx2/Makefile | 1 + drivers/common/octeontx2/meson.build | 1 + drivers/common/octeontx2/otx2_sec_idev.c | 28 ++++++++++++++++++++++ drivers/common/octeontx2/otx2_sec_idev.h | 12 ++++++++++ .../octeontx2/rte_common_octeontx2_version.map | 1 + 6 files changed, 48 insertions(+) create mode 100644 drivers/common/octeontx2/otx2_sec_idev.c create mode 100644 drivers/common/octeontx2/otx2_sec_idev.h diff --git a/MAINTAINERS b/MAINTAINERS index 94bccae..7b1ea56 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -724,6 +724,11 @@ F: drivers/net/octeontx2/ F: doc/guides/nics/features/octeontx2*.ini F: doc/guides/nics/octeontx2.rst +Marvell OCTEON TX2 - security +M: Anoob Joseph +T: git://dpdk.org/next/dpdk-next-crypto +F: drivers/common/octeontx2/otx2_sec* + Mellanox mlx4 M: Matan Azrad M: Shahaf Shuler diff --git a/drivers/common/octeontx2/Makefile b/drivers/common/octeontx2/Makefile index eaff294..efe3da2 100644 --- a/drivers/common/octeontx2/Makefile +++ b/drivers/common/octeontx2/Makefile @@ -31,6 +31,7 @@ SRCS-y += otx2_dev.c SRCS-y += otx2_irq.c SRCS-y += otx2_mbox.c SRCS-y += otx2_common.c +SRCS-y += otx2_sec_idev.c LDLIBS += -lrte_eal LDLIBS += -lrte_ethdev diff --git a/drivers/common/octeontx2/meson.build b/drivers/common/octeontx2/meson.build index b791457..996ddba 100644 --- a/drivers/common/octeontx2/meson.build +++ b/drivers/common/octeontx2/meson.build @@ -6,6 +6,7 @@ sources= files('otx2_dev.c', 'otx2_irq.c', 'otx2_mbox.c', 'otx2_common.c', + 'otx2_sec_idev.c', ) extra_flags = [] diff --git a/drivers/common/octeontx2/otx2_sec_idev.c b/drivers/common/octeontx2/otx2_sec_idev.c new file mode 100644 index 0000000..532abde --- /dev/null +++ b/drivers/common/octeontx2/otx2_sec_idev.c @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2020 Marvell International Ltd. + */ + +#include +#include + +#include "otx2_common.h" +#include "otx2_sec_idev.h" + +/** + * @internal + * Check if rte_eth_dev is security offload capable otx2_eth_dev + */ +uint8_t +otx2_eth_dev_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; +} diff --git a/drivers/common/octeontx2/otx2_sec_idev.h b/drivers/common/octeontx2/otx2_sec_idev.h new file mode 100644 index 0000000..a5d929e --- /dev/null +++ b/drivers/common/octeontx2/otx2_sec_idev.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2020 Marvell International Ltd. + */ + +#ifndef _OTX2_SEC_IDEV_H_ +#define _OTX2_SEC_IDEV_H_ + +#include + +uint8_t otx2_eth_dev_is_sec_capable(struct rte_eth_dev *eth_dev); + +#endif /* _OTX2_SEC_IDEV_H_ */ diff --git a/drivers/common/octeontx2/rte_common_octeontx2_version.map b/drivers/common/octeontx2/rte_common_octeontx2_version.map index a51d719..724fa35 100644 --- a/drivers/common/octeontx2/rte_common_octeontx2_version.map +++ b/drivers/common/octeontx2/rte_common_octeontx2_version.map @@ -5,6 +5,7 @@ DPDK_20.0 { otx2_dev_fini; otx2_dev_priv_init; otx2_disable_irqs; + otx2_eth_dev_is_sec_capable; otx2_intra_dev_get_cfg; otx2_logtype_base; otx2_logtype_dpi; -- 2.7.4