cb->fn.rx = fn;
cb->param = user_param;
- cb->next = rte_eth_devices[port_id].post_rx_burst_cbs[queue_id];
- rte_eth_devices[port_id].post_rx_burst_cbs[queue_id] = cb;
+
+ /* Add the callbacks in fifo order. */
+ struct rte_eth_rxtx_callback *tail =
+ rte_eth_devices[port_id].post_rx_burst_cbs[queue_id];
+
+ if (!tail) {
+ rte_eth_devices[port_id].post_rx_burst_cbs[queue_id] = cb;
+
+ } else {
+ while (tail->next)
+ tail = tail->next;
+ tail->next = cb;
+ }
+
return cb;
}
cb->fn.tx = fn;
cb->param = user_param;
- cb->next = rte_eth_devices[port_id].pre_tx_burst_cbs[queue_id];
- rte_eth_devices[port_id].pre_tx_burst_cbs[queue_id] = cb;
+
+ /* Add the callbacks in fifo order. */
+ struct rte_eth_rxtx_callback *tail =
+ rte_eth_devices[port_id].pre_tx_burst_cbs[queue_id];
+
+ if (!tail) {
+ rte_eth_devices[port_id].pre_tx_burst_cbs[queue_id] = cb;
+
+ } else {
+ while (tail->next)
+ tail = tail->next;
+ tail->next = cb;
+ }
+
return cb;
}
* that can be used to later remove the callback using
* rte_eth_remove_rx_callback().
*
+ * Multiple functions are called in the order that they are added.
+ *
* @param port_id
* The port identifier of the Ethernet device.
* @param queue_id
* that can be used to later remove the callback using
* rte_eth_remove_tx_callback().
*
+ * Multiple functions are called in the order that they are added.
+ *
* @param port_id
* The port identifier of the Ethernet device.
* @param queue_id