bus/fslmc: support static dequeue from portal
authorNipun Gupta <nipun.gupta@nxp.com>
Fri, 30 Jun 2017 08:54:26 +0000 (14:24 +0530)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 7 Jul 2017 07:26:33 +0000 (09:26 +0200)
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
drivers/bus/fslmc/mc/dpio.c
drivers/bus/fslmc/mc/fsl_dpio.h
drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
drivers/bus/fslmc/rte_bus_fslmc_version.map

index d84232a..3553952 100644 (file)
@@ -257,6 +257,50 @@ int dpio_get_stashing_destination(struct fsl_mc_io *mc_io,
        return 0;
 }
 
+int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io,
+                                   uint32_t cmd_flags,
+                                   uint16_t token,
+                                   int dpcon_id,
+                                   uint8_t *channel_index)
+{
+       struct mc_command cmd = { 0 };
+       int err;
+
+       /* prepare command */
+       cmd.header = mc_encode_cmd_header(DPIO_CMDID_ADD_STATIC_DEQUEUE_CHANNEL,
+                                         cmd_flags,
+                                         token);
+       DPIO_CMD_ADD_STATIC_DEQUEUE_CHANNEL(cmd, dpcon_id);
+
+       /* send command to mc*/
+       err = mc_send_command(mc_io, &cmd);
+       if (err)
+               return err;
+
+       /* retrieve response parameters */
+       DPIO_RSP_ADD_STATIC_DEQUEUE_CHANNEL(cmd, *channel_index);
+
+       return 0;
+}
+
+int dpio_remove_static_dequeue_channel(struct fsl_mc_io *mc_io,
+                                      uint32_t cmd_flags,
+                                      uint16_t token,
+                                      int dpcon_id)
+{
+       struct mc_command cmd = { 0 };
+
+       /* prepare command */
+       cmd.header = mc_encode_cmd_header(
+                               DPIO_CMDID_REMOVE_STATIC_DEQUEUE_CHANNEL,
+                               cmd_flags,
+                               token);
+       DPIO_CMD_REMOVE_STATIC_DEQUEUE_CHANNEL(cmd, dpcon_id);
+
+       /* send command to mc*/
+       return mc_send_command(mc_io, &cmd);
+}
+
 int dpio_get_api_version(struct fsl_mc_io *mc_io,
                         uint32_t cmd_flags,
                           uint16_t *major_ver,
index 6d86f07..39b572d 100644 (file)
@@ -229,6 +229,36 @@ int dpio_get_stashing_destination(struct fsl_mc_io *mc_io,
                                  uint16_t              token,
                                  uint8_t               *sdest);
 
+/**
+ * dpio_add_static_dequeue_channel() - Add a static dequeue channel.
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPIO object
+ * @dpcon_id:  DPCON object ID
+ * @channel_index: Returned channel index to be used in qbman API
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpio_add_static_dequeue_channel(struct fsl_mc_io   *mc_io,
+                                   uint32_t            cmd_flags,
+                                   uint16_t            token,
+                                   int                 dpcon_id,
+                                   uint8_t             *channel_index);
+
+/**
+ * dpio_remove_static_dequeue_channel() - Remove a static dequeue channel.
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPIO object
+ * @dpcon_id:  DPCON object ID
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpio_remove_static_dequeue_channel(struct fsl_mc_io        *mc_io,
+                                      uint32_t         cmd_flags,
+                                      uint16_t         token,
+                                      int              dpcon_id);
+
 /**
  * struct dpio_attr - Structure representing DPIO attributes
  * @id: DPIO object ID
index 4269800..77efe37 100644 (file)
@@ -42,6 +42,7 @@ struct dpaa2_io_portal_t {
        struct dpaa2_dpio_dev *sec_dpio_dev;
        uint64_t net_tid;
        uint64_t sec_tid;
+       void *eventdev;
 };
 
 /*! Global per thread DPIO portal */
index 4509051..c879e2f 100644 (file)
@@ -58,6 +58,8 @@ DPDK_17.08 {
        dpci_set_rx_queue;
        dpcon_open;
        dpcon_get_attributes;
+       dpio_add_static_dequeue_channel;
+       dpio_remove_static_dequeue_channel;
        mc_get_soc_version;
        mc_get_version;
        qbman_eq_desc_set_dca;