Added odp_pktio_send_queue for direct packet send to
a pktio output queue.
Signed-off-by: Petri Savolainen <[email protected]>
---
include/odp/api/packet_io.h | 42 ++++++++++++++++++++++++++++++++++--------
1 file changed, 34 insertions(+), 8 deletions(-)
diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index aa218f2..6b72482 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -384,21 +384,47 @@ int odp_pktio_recv_queue(odp_pktio_t pktio, unsigned
queue_id,
odp_packet_t packets[], int num);
/**
- * Send packets
+ * Send packets directly to an interface
*
- * Sends out a number of packets. A successful call returns the actual number
of
- * packets sent. If return value is less than 'len', the remaining packets at
- * the end of pkt_table[] are not consumed, and the caller has to take care of
- * them.
+ * Sends out a number of packets to the interface. The operation is
+ * multi-thread safe. A successful call returns the actual number of
+ * packets sent. If return value is less than 'num', the remaining packets at
+ * the end of packets[] array are not consumed, and the caller has to take
+ * care of them.
*
* @param pktio Packet IO handle
- * @param pkt_table[] Array of packets to send
- * @param len length of pkt_table[]
+ * @param packets[] Array of packets to send
+ * @param num Number of packets to send
*
* @return Number of packets sent
* @retval <0 on failure
*/
-int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
+int odp_pktio_send(odp_pktio_t pktio, odp_packet_t packets[], int num);
+
+/**
+ * Send packets directly to an interface output queue
+ *
+ * Sends out a number of packets to the interface output queue defined by the
+ * queue index. The operation is lock-free if 'lock_free' output queue
parameter
+ * has been set. Application must not share a lock-free output queue between
+ * multiple threads.
+ *
+ * A successful call returns the actual number of packets sent. If return value
+ * is less than 'num', the remaining packets at the end of packets[] array
+ * are not consumed, and the caller has to take care of them.
+ *
+ * @param pktio Packet IO handle
+ * @param queue_id The output queue index to send packets.
+ * The index must be between 0 and number of output queues
+ * minus one.
+ * @param packets[] Array of packets to send
+ * @param num Number of packets to send
+ *
+ * @return Number of packets sent
+ * @retval <0 on failure
+ */
+int odp_pktio_send_queue(odp_pktio_t pktio, unsigned queue_id,
+ odp_packet_t packets[], int num);
/**
* Set the default input queue to be associated with a pktio handle
--
2.6.2
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp