From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v6 1/2] librte_ether: modify internal callback function Date: Fri, 07 Oct 2016 14:29:42 +0200 Message-ID: <1948203.6ATyv1RgPu@xps13> References: <1475753191-17391-1-git-send-email-bernard.iremonger@intel.com> <1475772490-10491-2-git-send-email-bernard.iremonger@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, rahul.r.shah@intel.com, wenzhuo.lu@intel.com, az5157@att.com, jerin.jacob@caviumnetworks.com To: Bernard Iremonger Return-path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 2C42F37B4 for ; Fri, 7 Oct 2016 14:29:44 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id b201so35129655wmb.0 for ; Fri, 07 Oct 2016 05:29:44 -0700 (PDT) In-Reply-To: <1475772490-10491-2-git-send-email-bernard.iremonger@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.