Signed-off-by: Nikita Kalyazin <[email protected]>
Reviewed-by: Ilya Maximets <[email protected]>
---
include/odp/api/packet_io.h | 118 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index e00d011..8df5ad5 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -111,6 +111,47 @@ odp_pktio_t odp_pktio_open(const char *dev, odp_pool_t
pool,
const odp_pktio_param_t *param);
/**
+ * Get maximum number of hardware Rx and Tx queues
+ *
+ * @param[in] pktio Packet IO handle
+ * @param[out] num_rx_queues Number of hardware Rx queues
+ * @param[out] num_tx_queues Number of hardware Tx queues
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_pktio_max_num_queues(odp_pktio_t pktio, uint32_t *num_rx_queues,
+ uint32_t *num_tx_queues);
+
+/**
+ * Configure number of hardware Rx and Tx queues
+ *
+ * @param pktio Packet IO handle
+ * @param num_rx_queues Number of hardware Rx queues
+ * @param num_tx_queues Number of hardware Tx queues
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ *
+ * @note should be called when the pktio is in STATE_STOP only
+ */
+int odp_pktio_configure(odp_pktio_t pktio, uint32_t num_rx_queues,
+ uint32_t num_tx_queues);
+
+/**
+ * Get number of configured hardware Rx and Tx queues
+ *
+ * @param[in] pktio Packet IO handle
+ * @param[out] num_rx_queues Number of hardware Rx queues
+ * @param[out] num_tx_queues Number of hardware Tx queues
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_pktio_num_queues(odp_pktio_t pktio, uint32_t *num_rx_queues,
+ uint32_t *num_tx_queues);
+
+/**
* Start packet receive and transmit
*
* @param pktio Packet IO handle
@@ -163,6 +204,20 @@ odp_pktio_t odp_pktio_lookup(const char *dev);
int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
/**
+ * Receive packets from specified queue
+ *
+ * @param pktio ODP packet IO handle
+ * @param queue_index Index of a hardware queue
+ * @param pkt_table[] Storage for received packets (filled by function)
+ * @param len Length of pkt_table[], i.e. max number of pkts to receive
+ *
+ * @return Number of packets received
+ * @retval <0 on failure
+ */
+int odp_pktio_recv_queue(odp_pktio_t pktio, uint32_t queue_index,
+ odp_packet_t pkt_table[], int len);
+
+/**
* Send packets
*
* Sends out a number of packets. A successful call returns the actual number
of
@@ -180,6 +235,20 @@ int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t
pkt_table[], int len);
int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
/**
+ * Send packets to specified queue
+ *
+ * @param pktio ODP packet IO handle
+ * @param queue_index Index of a hardware queue
+ * @param pkt_table[] Array of packets to send
+ * @param len Length of pkt_table[]
+ *
+ * @return Number of packets sent
+ * @retval <0 on failure
+ */
+int odp_pktio_send_queue(odp_pktio_t pktio, uint32_t queue_index,
+ odp_packet_t pkt_table[], int len);
+
+/**
* Set the default input queue to be associated with a pktio handle
*
* @param pktio Packet IO handle
@@ -190,6 +259,19 @@ int odp_pktio_send(odp_pktio_t pktio, odp_packet_t
pkt_table[], int len);
int odp_pktio_inq_setdef(odp_pktio_t pktio, odp_queue_t queue);
/**
+ * Set the default input queues to be associated with a pktio handle
+ *
+ * @param pktio Packet IO handle
+ * @param queues[] Array of default input queues set
+ * @retval 0 on success
+ * @retval <0 on failure
+ *
+ * @warning queues[] length must match the number of hardware Rx queues
+ * configured
+ */
+int odp_pktio_inqs_setdef(odp_pktio_t pktio, odp_queue_t queues[]);
+
+/**
* Get default input queue associated with a pktio handle
*
* @param pktio Packet IO handle
@@ -200,6 +282,19 @@ int odp_pktio_inq_setdef(odp_pktio_t pktio, odp_queue_t
queue);
odp_queue_t odp_pktio_inq_getdef(odp_pktio_t pktio);
/**
+ * Get default input queues associated with a pktio handle
+ *
+ * @param[in] pktio Packet IO handle
+ * @param[out] queues[] Array of default input queues set
+ * @retval 0 on success
+ * @retval <0 on failure
+ *
+ * @warning queues[] length must match the number of hardware Rx queues
+ * configured
+ */
+int odp_pktio_inqs_getdef(odp_pktio_t pktio, odp_queue_t queues[]);
+
+/**
* Remove default input queue (if set)
*
* @param pktio Packet IO handle
@@ -210,6 +305,16 @@ odp_queue_t odp_pktio_inq_getdef(odp_pktio_t pktio);
int odp_pktio_inq_remdef(odp_pktio_t pktio);
/**
+ * Remove default input queues (if set)
+ *
+ * @param pktio Packet IO handle
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_pktio_inqs_remdef(odp_pktio_t pktio);
+
+/**
* Query default output queue
*
* @param pktio Packet IO handle
@@ -220,6 +325,19 @@ int odp_pktio_inq_remdef(odp_pktio_t pktio);
odp_queue_t odp_pktio_outq_getdef(odp_pktio_t pktio);
/**
+ * Query default output queues
+ *
+ * @param[in] pktio Packet IO handle
+ * @param[out] queues[] Array of default output queues set
+ * @retval 0 on success
+ * @retval <0 on failure
+ *
+ * @warning queues[] length must match the number of hardware Tx queues
+ * configured
+ */
+int odp_pktio_outqs_getdef(odp_pktio_t pktio, odp_queue_t queues[]);
+
+/**
* Return the currently configured MTU value of a packet IO interface.
*
* @param[in] pktio Packet IO handle.
--
2.5.3
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp