[dpdk-dev] [PATCH v6 1/2] librte_ether: modify internal callback function

Thomas Monjalon thomas.monjalon at 6wind.com
Fri Oct 7 14:29:42 CEST 2016


2016-10-06 17:48, Bernard Iremonger:
> @@ -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);
[...]
> @@ -3047,6 +3048,11 @@ typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
>   * @param cb_arg
>   *  Pointer to the parameters for the registered callback.
>   *
> + *  The cb_arg must not be NULL if the application requires
> + *  data to be returned when the callback is processed.
> + *  For the RTE_ETH_EVENT_VF_MBOX data is returned to the
> + *  application.

This comment is wrong.
You should say that the user data is overwritten in the case of
RTE_ETH_EVENT_VF_MBOX. And you should point to where the meaning
of this parameter is documented (ixgbe.h) or document it here.



More information about the dev mailing list