common/octeontx2: add security capability routine
[dpdk.git] / drivers / common / octeontx2 / otx2_sec_idev.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2020 Marvell International Ltd.
3  */
4
5 #include <rte_bus_pci.h>
6 #include <rte_ethdev.h>
7
8 #include "otx2_common.h"
9 #include "otx2_sec_idev.h"
10
11 /**
12  * @internal
13  * Check if rte_eth_dev is security offload capable otx2_eth_dev
14  */
15 uint8_t
16 otx2_eth_dev_is_sec_capable(struct rte_eth_dev *eth_dev)
17 {
18         struct rte_pci_device *pci_dev;
19
20         pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
21
22         if (pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_PF ||
23             pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_VF ||
24             pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_AF_VF)
25                 return 1;
26
27         return 0;
28 }