net/ice/base: add more capability to admin queue
[dpdk.git] / drivers / bus / fslmc / rte_fslmc.h
index cea5b78..37d45df 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- *   Copyright 2016 NXP
+ *   Copyright 2016,2019 NXP
  *
  */
 
@@ -32,11 +32,34 @@ extern "C" {
 #include <rte_bus.h>
 #include <rte_tailq.h>
 #include <rte_devargs.h>
+#include <rte_mbuf.h>
+#include <rte_mbuf_dyn.h>
 
 #include <fslmc_vfio.h>
 
 #define FSLMC_OBJECT_MAX_LEN 32   /**< Length of each device on bus */
 
+#define DPAA2_INVALID_MBUF_SEQN        0
+
+typedef uint32_t dpaa2_seqn_t;
+extern int dpaa2_seqn_dynfield_offset;
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Read dpaa2 sequence number from mbuf.
+ *
+ * @param mbuf Structure to read from.
+ * @return pointer to dpaa2 sequence number.
+ */
+__rte_experimental
+static inline dpaa2_seqn_t *
+dpaa2_seqn(struct rte_mbuf *mbuf)
+{
+       return RTE_MBUF_DYNFIELD(mbuf, dpaa2_seqn_dynfield_offset,
+               dpaa2_seqn_t *);
+}
 
 /** Device driver supports link state interrupt */
 #define RTE_DPAA2_DRV_INTR_LSC 0x0008
@@ -66,6 +89,8 @@ enum rte_dpaa2_dev_type {
        DPAA2_CI,       /**< DPCI type device */
        DPAA2_MPORTAL,  /**< DPMCP type device */
        DPAA2_QDMA,     /**< DPDMAI type device */
+       DPAA2_MUX,      /**< DPDMUX type device */
+       DPAA2_DPRTC,    /**< DPRTC type device */
        /* Unknown device placeholder */
        DPAA2_UNKNOWN,
        DPAA2_DEVTYPE_MAX,
@@ -135,24 +160,6 @@ struct rte_fslmc_bus {
                                /**< Count of all devices scanned */
 };
 
-#define DPAA2_PORTAL_DEQUEUE_DEPTH     32
-
-/* Create storage for dqrr entries per lcore */
-struct dpaa2_portal_dqrr {
-       struct rte_mbuf *mbuf[DPAA2_PORTAL_DEQUEUE_DEPTH];
-       uint64_t dqrr_held;
-       uint8_t dqrr_size;
-};
-
-RTE_DECLARE_PER_LCORE(struct dpaa2_portal_dqrr, dpaa2_held_bufs);
-
-#define DPAA2_PER_LCORE_DQRR_SIZE \
-       RTE_PER_LCORE(dpaa2_held_bufs).dqrr_size
-#define DPAA2_PER_LCORE_DQRR_HELD \
-       RTE_PER_LCORE(dpaa2_held_bufs).dqrr_held
-#define DPAA2_PER_LCORE_DQRR_MBUF(i) \
-       RTE_PER_LCORE(dpaa2_held_bufs).mbuf[i]
-
 /**
  * Register a DPAA2 driver.
  *
@@ -160,6 +167,7 @@ RTE_DECLARE_PER_LCORE(struct dpaa2_portal_dqrr, dpaa2_held_bufs);
  *   A pointer to a rte_dpaa2_driver structure describing the driver
  *   to be registered.
  */
+__rte_internal
 void rte_fslmc_driver_register(struct rte_dpaa2_driver *driver);
 
 /**
@@ -169,6 +177,7 @@ void rte_fslmc_driver_register(struct rte_dpaa2_driver *driver);
  *   A pointer to a rte_dpaa2_driver structure describing the driver
  *   to be unregistered.
  */
+__rte_internal
 void rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver);
 
 /** Helper for DPAA2 device registration from driver (eth, crypto) instance */
@@ -187,6 +196,7 @@ RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
  *   A pointer to a rte_dpaa_object structure describing the mc object
  *   to be registered.
  */
+__rte_internal
 void rte_fslmc_object_register(struct rte_dpaa2_object *object);
 
 /**
@@ -198,6 +208,7 @@ void rte_fslmc_object_register(struct rte_dpaa2_object *object);
  *   >=0 for count; 0 indicates either no device of the said type scanned or
  *   invalid device type.
  */
+__rte_internal
 uint32_t rte_fslmc_get_device_count(enum rte_dpaa2_dev_type device_type);
 
 /** Helper for DPAA2 object registration */