]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_ether/rte_ethdev.c
ethdev: add an argument to internal callback function
[dpdk.git] / lib / librte_ether / rte_ethdev.c
index 88fa38269e97aeb7fc9fe31e5da56f5749e0df85..0d9d9c1a711a7a167fee8ed7ab036a1cbfd60135 100644 (file)
@@ -2508,7 +2508,7 @@ rte_eth_dev_callback_unregister(uint8_t port_id,
 
 void
 _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-       enum rte_eth_event_type event)
+       enum rte_eth_event_type event, void *cb_arg)
 {
        struct rte_eth_dev_callback *cb_lst;
        struct rte_eth_dev_callback dev_cb;
@@ -2519,6 +2519,9 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
                        continue;
                dev_cb = *cb_lst;
                cb_lst->active = 1;
+               if (cb_arg != NULL)
+                       dev_cb.cb_arg = (void *) cb_arg;
+
                rte_spinlock_unlock(&rte_eth_dev_cb_lock);
                dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
                                                dev_cb.cb_arg);