DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] cryptodev: decouple from PCI device
@ 2017-01-18  9:16 Hemant Agrawal
  2017-01-24 18:10 ` Griffin, John
  2017-01-25  4:48 ` Shreyansh Jain
  0 siblings, 2 replies; 8+ messages in thread
From: Hemant Agrawal @ 2017-01-18  9:16 UTC (permalink / raw)
  To: dev
  Cc: thomas.monjalon, declan.doherty, shreyansh.jain,
	pablo.de.lara.guarch, jblunck

This makes struct rte_cryptodev independent of struct rte_pci_device by
replacing it with a pointer to the generic struct rte_device.

This is inline with the recent changes in ethdev

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/crypto/qat/qat_qp.c            | 12 +++++++++---
 drivers/crypto/qat/rte_qat_cryptodev.c |  6 +++---
 lib/librte_cryptodev/rte_cryptodev.c   |  6 +++---
 lib/librte_cryptodev/rte_cryptodev.h   |  4 ++--
 4 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c
index 2e7188b..07e63fc 100644
--- a/drivers/crypto/qat/qat_qp.c
+++ b/drivers/crypto/qat/qat_qp.c
@@ -135,6 +135,7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
 	int socket_id)
 {
 	struct qat_qp *qp;
+	struct rte_pci_device *pci_dev;
 	int ret;
 
 	PMD_INIT_FUNC_TRACE();
@@ -153,7 +154,9 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
 		return -EINVAL;
 	}
 
-	if (dev->pci_dev->mem_resource[0].addr == NULL) {
+	pci_dev = RTE_DEV_TO_PCI(dev->device);
+
+	if (pci_dev->mem_resource[0].addr == NULL) {
 		PMD_DRV_LOG(ERR, "Could not find VF config space "
 				"(UIO driver attached?).");
 		return -EINVAL;
@@ -174,7 +177,7 @@ int qat_crypto_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
 		PMD_DRV_LOG(ERR, "Failed to alloc mem for qp struct");
 		return -ENOMEM;
 	}
-	qp->mmap_bar_addr = dev->pci_dev->mem_resource[0].addr;
+	qp->mmap_bar_addr = pci_dev->mem_resource[0].addr;
 	rte_atomic16_init(&qp->inflights16);
 
 	if (qat_tx_queue_create(dev, &(qp->tx_q),
@@ -289,6 +292,7 @@ static void qat_queue_delete(struct qat_queue *queue)
 	void *io_addr;
 	const struct rte_memzone *qp_mz;
 	uint32_t queue_size_bytes = nb_desc*desc_size;
+	struct rte_pci_device *pci_dev;
 
 	PMD_INIT_FUNC_TRACE();
 	if (desc_size > ADF_MSG_SIZE_TO_BYTES(ADF_MAX_MSG_SIZE)) {
@@ -349,7 +353,9 @@ static void qat_queue_delete(struct qat_queue *queue)
 
 	queue_base = BUILD_RING_BASE_ADDR(queue->base_phys_addr,
 					queue->queue_size);
-	io_addr = dev->pci_dev->mem_resource[0].addr;
+	pci_dev = RTE_DEV_TO_PCI(dev->device);
+
+	io_addr = pci_dev->mem_resource[0].addr;
 
 	WRITE_CSR_RING_BASE(io_addr, queue->hw_bundle_number,
 			queue->hw_queue_number, queue_base);
diff --git a/drivers/crypto/qat/rte_qat_cryptodev.c b/drivers/crypto/qat/rte_qat_cryptodev.c
index 1e7ee61..840d828 100644
--- a/drivers/crypto/qat/rte_qat_cryptodev.c
+++ b/drivers/crypto/qat/rte_qat_cryptodev.c
@@ -88,9 +88,9 @@
 
 	PMD_INIT_FUNC_TRACE();
 	PMD_DRV_LOG(DEBUG, "Found crypto device at %02x:%02x.%x",
-		cryptodev->pci_dev->addr.bus,
-		cryptodev->pci_dev->addr.devid,
-		cryptodev->pci_dev->addr.function);
+		RTE_DEV_TO_PCI(cryptodev->device)->addr.bus,
+		RTE_DEV_TO_PCI(cryptodev->device)->addr.devid,
+		RTE_DEV_TO_PCI(cryptodev->device)->addr.function);
 
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 127e8d0..8402b6a 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -446,7 +446,7 @@ struct rte_cryptodev *
 					"device data");
 	}
 
-	cryptodev->pci_dev = pci_dev;
+	cryptodev->device = &pci_dev->device;
 	cryptodev->driver = cryptodrv;
 
 	/* init user callbacks */
@@ -506,7 +506,7 @@ struct rte_cryptodev *
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
 		rte_free(cryptodev->data->dev_private);
 
-	cryptodev->pci_dev = NULL;
+	cryptodev->device = NULL;
 	cryptodev->driver = NULL;
 	cryptodev->data = NULL;
 
@@ -867,7 +867,7 @@ struct rte_cryptodev *
 	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
 
-	dev_info->pci_dev = dev->pci_dev;
+	dev_info->pci_dev = RTE_DEV_TO_PCI(dev->device);
 	if (dev->driver)
 		dev_info->driver_name = dev->driver->pci_drv.driver.name;
 }
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 8f63e8f..ef072d2 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -621,8 +621,8 @@ struct rte_cryptodev {
 	/**< Functions exported by PMD */
 	uint64_t feature_flags;
 	/**< Supported features */
-	struct rte_pci_device *pci_dev;
-	/**< PCI info. supplied by probing */
+	struct rte_device *device;
+	/**< Backing device */
 
 	enum rte_cryptodev_type dev_type;
 	/**< Crypto device type */
-- 
1.9.1

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCHv4 00/33]  NXP DPAA2 PMD
@ 2017-01-17 18:52 Hemant Agrawal
  2017-01-19 13:23 ` [dpdk-dev] [PATCHv5 " Hemant Agrawal
  0 siblings, 1 reply; 8+ messages in thread
From: Hemant Agrawal @ 2017-01-17 18:52 UTC (permalink / raw)
  To: dev
  Cc: thomas.monjalon, bruce.richardson, shreyansh.jain, john.mcnamara,
	ferruh.yigit, jerin.jacob

The patch series adds NXP’s QorIQ-Layerscape DPAA2 Architecture based
fsl-mc bus driver and network SoC PMD.  This version of the driver
supports NXP LS208xA, LS204xA and LS108x families Network SoCs.

DPAA2, or Data Path Acceleration Architecture, is a hardware architecture
designed for high-speed network packet processing. It uses a bus name
‘fsl-mc’, part of Linux Kernel Staging tree [3], for resource management.

A brief description of architecture is given below; detailed description
is part of the documentation in the patches itself.

DPAA2 contains hardware component called the Management Complex (or MC).
It manages the DPAA2 hardware resources.  The MC provides an object-based
abstraction for software drivers to use the DPAA2 hardware.

Some of the key objects are:
    - DPNI, which refers to the network interface object.
    - DPBP, which refers to HW based memory pool object
    - DPIO, refers to processing context for accessing QBMAN

Besides the MC, DPAA2 also includes a Hardware based Queue and Buffer Manager
called QBMAN. Prime responsibility of QBMAN is to allow lockless access to
software/user-space to the queues and buffers implemented in the hardware.

The patch series could be logically structured into following sub-areas:
2. (Patch 0001) Enabling crc in armv8 core machine type
3. (Patch 0002) DPAA2 Architecture overview document
4. (Patch 0003) Common dpaa2 hw accelerator drivers for QBMAN.
5. (Patches 0004-0012) introduce fsl-mc bus
6. (Patches 0013-0017) introduce DPAA2 PMD, DPIO and mempool
7. (Patches 0018-0031) Support for DPAA2 Ethernet Device (ethdev)
7. (Patches 0032-0033) Additional functionality in DPAA2 ethdev.

The following design decisions are made during development:

1. DPAA2 implements a new bus called "fsl-mc" and some common accelerator drivers.
   These drivers will be shared with dpaa2 based crypto drivers.
 - For this, patch series from Shreyansh [1] has been used for creating a
   bus handler.

2. DPAA2 implements the HW mempool offload with DPBP object.
 - The new pool is being configured using compile time option and pool name
   as "dpaa2".

3. It maintains per lcore DPIO objects and affine the DPIO instance to the
   processing threads accessing the QBMAN HW.

Prerequisites:
 - For running the PMD, NXP's SoC (board) and SDK (software/BSP) is required.
   Information about obtaining relevant software is available in the docs
   as part of the patch.
 - At present the series has limited support for Ethernet functions. But,
   more functionality would be made available in a phased manner.
 - This PMD has been validated over the Bus Model [1] or/and SoC Patchset [3]

Future Changes/Caveats:

1. VFIO code for fsl-mc bus is different than eal-vfio code for pci bus.
   This need to be re-worked to make possible re-use of the existing code.

2. shared lib support in case of parallel build fails due to dependency of
   drivers/common, pool, etc on other driver components. The dependency graph
   need to be improved to support it.

Dependencies:

[1] http://dpdk.org/dev/patchwork/patch/19557/

References:

[2] https://www.kernel.org/doc/readme/drivers-staging-fsl-mc-README.txt
[3] http://dpdk.org/ml/archives/dev/2016-October/048949.html

---
v4:
* rebased over master (1feda4d8) and patches from Shreyansh [1] for Bus Arch.

v3:
* rebased over master (eac901ce2) and patches from Shreyansh [1] for Bus Arch.
* Fixed comment from John on Patch-0003 for documentation
* Removed Patch-0001 for rte_device in rte_eth_dev; Already upstreamed through
  another series

v2:
* separated the "fsl-mc" bus from the dpaa2 pmd driver - introduced drivers/bus
* separated the "dpaa2" hw mempool from dpaa2 pmd driver - introduced drivers/pool
* removed documentation warnings and missing information.
* removed arm64 part specific code from driver
* changed rte_panic to errors
* reduced checkpatch warnings


Hemant Agrawal (33):
  mk/dpaa2: add the crc support to the machine type
  doc: add dpaa2 nic details
  drivers/common/dpaa2: adding qbman driver
  bus/fslmc: introducing fsl-mc bus driver
  bus/fslmc: introduce mc object functions
  bus/fslmc: add mc dpni object support
  bus/fslmc: add mc dpio object support
  bus/fslmc: add mc dpbp object support
  bus/fslmc: add mc dpseci object support
  eal/vfio: adding vfio utility functions in map file
  bus/fslmc: add vfio support
  bus/fslmc: scan for net and sec devices
  net/dpaa2: introducing NXP dpaa2 pmd driver
  bus/fslmc: add debug log message support
  drivers/common/dpaa2: dpio portal driver
  drivers/pool/dpaa2: adding hw offloaded mempool
  drivers/common/dpaa2: dpio routine to affine to crypto threads
  net/dpaa2: adding eth ops to dpaa2
  net/dpaa2: add rss flow distribution
  net/dpaa2: configure mac address at init
  net/dpaa2: attach the buffer pool to dpni
  net/dpaa2: add support for l3 and l4 checksum offload
  net/dpaa2: add support for promiscuous mode
  net/dpaa2: add mtu config support
  net/dpaa2: add packet rx and tx support
  net/dpaa2: rx packet parsing and packet type support
  net/dpaa2: link status update
  net/dpaa2: basic stats support
  net/dpaa2: enable stashing for LS2088A devices
  net/dpaa2: add support for non hw buffer pool packet transmit
  net/dpaa2: enabling the use of physical addresses
  bus/fslmc: add support for dmamap to ARM SMMU
  drivers/common/dpaa2: frame queue based dq storage alloc

 MAINTAINERS                                        |    8 +
 config/common_base                                 |   22 +
 config/defconfig_arm64-dpaa2-linuxapp-gcc          |   28 +-
 doc/guides/nics/dpaa2.rst                          |  594 ++++++++
 doc/guides/nics/features/dpaa2.ini                 |   18 +
 doc/guides/nics/index.rst                          |    1 +
 doc/guides/rel_notes/release_17_02.rst             |   11 +
 drivers/Makefile                                   |    3 +
 drivers/bus/Makefile                               |   38 +
 drivers/bus/fslmc/Makefile                         |   75 +
 drivers/bus/fslmc/fslmc_bus.c                      |  149 ++
 drivers/bus/fslmc/fslmc_logs.h                     |   76 +
 drivers/bus/fslmc/fslmc_vfio.c                     |  629 +++++++++
 drivers/bus/fslmc/fslmc_vfio.h                     |   82 ++
 drivers/bus/fslmc/mc/dpbp.c                        |  230 +++
 drivers/bus/fslmc/mc/dpio.c                        |  272 ++++
 drivers/bus/fslmc/mc/dpni.c                        |  732 ++++++++++
 drivers/bus/fslmc/mc/dpseci.c                      |  527 +++++++
 drivers/bus/fslmc/mc/fsl_dpbp.h                    |  220 +++
 drivers/bus/fslmc/mc/fsl_dpbp_cmd.h                |   76 +
 drivers/bus/fslmc/mc/fsl_dpio.h                    |  275 ++++
 drivers/bus/fslmc/mc/fsl_dpio_cmd.h                |  114 ++
 drivers/bus/fslmc/mc/fsl_dpkg.h                    |  177 +++
 drivers/bus/fslmc/mc/fsl_dpni.h                    | 1210 ++++++++++++++++
 drivers/bus/fslmc/mc/fsl_dpni_cmd.h                |  327 +++++
 drivers/bus/fslmc/mc/fsl_dpseci.h                  |  661 +++++++++
 drivers/bus/fslmc/mc/fsl_dpseci_cmd.h              |  248 ++++
 drivers/bus/fslmc/mc/fsl_mc_cmd.h                  |  231 +++
 drivers/bus/fslmc/mc/fsl_mc_sys.h                  |   98 ++
 drivers/bus/fslmc/mc/fsl_net.h                     |  480 +++++++
 drivers/bus/fslmc/mc/mc_sys.c                      |  107 ++
 drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c           |  137 ++
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c           |  441 ++++++
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h           |   70 +
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h            |  247 ++++
 drivers/bus/fslmc/rte_fslmc.h                      |  147 ++
 drivers/bus/fslmc/rte_pmd_fslmcbus_version.map     |   62 +
 drivers/common/Makefile                            |   45 +
 drivers/common/dpaa2/Makefile                      |   36 +
 drivers/common/dpaa2/qbman/Makefile                |   58 +
 drivers/common/dpaa2/qbman/include/compat.h        |  403 ++++++
 .../common/dpaa2/qbman/include/fsl_qbman_base.h    |  157 ++
 .../common/dpaa2/qbman/include/fsl_qbman_portal.h  | 1090 ++++++++++++++
 drivers/common/dpaa2/qbman/qbman_portal.c          | 1492 ++++++++++++++++++++
 drivers/common/dpaa2/qbman/qbman_portal.h          |  274 ++++
 drivers/common/dpaa2/qbman/qbman_private.h         |  167 +++
 drivers/common/dpaa2/qbman/qbman_sys.h             |  382 +++++
 drivers/common/dpaa2/qbman/qbman_sys_decl.h        |   70 +
 .../dpaa2/qbman/rte_pmd_dpaa2_qbman_version.map    |   27 +
 drivers/net/Makefile                               |    2 +-
 drivers/net/dpaa2/Makefile                         |   72 +
 drivers/net/dpaa2/base/dpaa2_hw_dpni.c             |  344 +++++
 drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h       |  257 ++++
 drivers/net/dpaa2/dpaa2_ethdev.c                   | 1053 ++++++++++++++
 drivers/net/dpaa2/dpaa2_ethdev.h                   |   83 ++
 drivers/net/dpaa2/dpaa2_rxtx.c                     |  421 ++++++
 drivers/net/dpaa2/rte_pmd_dpaa2_version.map        |    4 +
 drivers/pool/Makefile                              |   38 +
 drivers/pool/dpaa2/Makefile                        |   67 +
 drivers/pool/dpaa2/dpaa2_hw_mempool.c              |  352 +++++
 drivers/pool/dpaa2/dpaa2_hw_mempool.h              |   95 ++
 drivers/pool/dpaa2/rte_pmd_dpaa2_pool_version.map  |    8 +
 lib/librte_eal/bsdapp/eal/rte_eal_version.map      |    3 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map    |    3 +
 mk/machine/dpaa2/rte.vars.mk                       |    5 +-
 mk/rte.app.mk                                      |    6 +
 66 files changed, 15833 insertions(+), 4 deletions(-)
 create mode 100644 doc/guides/nics/dpaa2.rst
 create mode 100644 doc/guides/nics/features/dpaa2.ini
 create mode 100644 drivers/bus/Makefile
 create mode 100644 drivers/bus/fslmc/Makefile
 create mode 100644 drivers/bus/fslmc/fslmc_bus.c
 create mode 100644 drivers/bus/fslmc/fslmc_logs.h
 create mode 100644 drivers/bus/fslmc/fslmc_vfio.c
 create mode 100644 drivers/bus/fslmc/fslmc_vfio.h
 create mode 100644 drivers/bus/fslmc/mc/dpbp.c
 create mode 100644 drivers/bus/fslmc/mc/dpio.c
 create mode 100644 drivers/bus/fslmc/mc/dpni.c
 create mode 100644 drivers/bus/fslmc/mc/dpseci.c
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpbp.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpbp_cmd.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpio.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpio_cmd.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpkg.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpni.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpni_cmd.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpseci.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_dpseci_cmd.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_mc_cmd.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_mc_sys.h
 create mode 100644 drivers/bus/fslmc/mc/fsl_net.h
 create mode 100644 drivers/bus/fslmc/mc/mc_sys.c
 create mode 100644 drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
 create mode 100644 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
 create mode 100644 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
 create mode 100644 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
 create mode 100644 drivers/bus/fslmc/rte_fslmc.h
 create mode 100644 drivers/bus/fslmc/rte_pmd_fslmcbus_version.map
 create mode 100644 drivers/common/Makefile
 create mode 100644 drivers/common/dpaa2/Makefile
 create mode 100644 drivers/common/dpaa2/qbman/Makefile
 create mode 100644 drivers/common/dpaa2/qbman/include/compat.h
 create mode 100644 drivers/common/dpaa2/qbman/include/fsl_qbman_base.h
 create mode 100644 drivers/common/dpaa2/qbman/include/fsl_qbman_portal.h
 create mode 100644 drivers/common/dpaa2/qbman/qbman_portal.c
 create mode 100644 drivers/common/dpaa2/qbman/qbman_portal.h
 create mode 100644 drivers/common/dpaa2/qbman/qbman_private.h
 create mode 100644 drivers/common/dpaa2/qbman/qbman_sys.h
 create mode 100644 drivers/common/dpaa2/qbman/qbman_sys_decl.h
 create mode 100644 drivers/common/dpaa2/qbman/rte_pmd_dpaa2_qbman_version.map
 create mode 100644 drivers/net/dpaa2/Makefile
 create mode 100644 drivers/net/dpaa2/base/dpaa2_hw_dpni.c
 create mode 100644 drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h
 create mode 100644 drivers/net/dpaa2/dpaa2_ethdev.c
 create mode 100644 drivers/net/dpaa2/dpaa2_ethdev.h
 create mode 100644 drivers/net/dpaa2/dpaa2_rxtx.c
 create mode 100644 drivers/net/dpaa2/rte_pmd_dpaa2_version.map
 create mode 100644 drivers/pool/Makefile
 create mode 100644 drivers/pool/dpaa2/Makefile
 create mode 100644 drivers/pool/dpaa2/dpaa2_hw_mempool.c
 create mode 100644 drivers/pool/dpaa2/dpaa2_hw_mempool.h
 create mode 100644 drivers/pool/dpaa2/rte_pmd_dpaa2_pool_version.map

-- 
1.9.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-01-25  9:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-18  9:16 [dpdk-dev] [PATCH] cryptodev: decouple from PCI device Hemant Agrawal
2017-01-24 18:10 ` Griffin, John
2017-01-25  4:48 ` Shreyansh Jain
2017-01-25  4:54   ` Stephen Hemminger
2017-01-25  9:07   ` De Lara Guarch, Pablo
  -- strict thread matches above, loose matches on Subject: below --
2017-01-17 18:52 [dpdk-dev] [PATCHv4 00/33] NXP DPAA2 PMD Hemant Agrawal
2017-01-19 13:23 ` [dpdk-dev] [PATCHv5 " Hemant Agrawal
2017-01-19 13:23   ` [dpdk-dev] [PATCH] cryptodev: decouple from PCI device Hemant Agrawal
2017-01-19 13:27     ` Hemant Agrawal
2017-01-20 12:28       ` De Lara Guarch, Pablo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).