Hi Jeff: > -----Original Message----- > From: Guo, Jia > Sent: Monday, July 9, 2018 7:46 PM > To: [email protected]; Richardson, Bruce > <[email protected]>; Yigit, Ferruh <[email protected]>; > Ananyev, Konstantin <[email protected]>; > [email protected]; Wu, Jingjing <[email protected]>; > [email protected]; [email protected]; [email protected]; Van > Haaren, Harry <[email protected]>; Zhang, Qi Z > <[email protected]>; He, Shaopeng <[email protected]>; Iremonger, > Bernard <[email protected]>; [email protected]; Lu, > Wenzhuo <[email protected]> > Cc: [email protected]; [email protected]; [email protected]; Guo, Jia > <[email protected]>; Zhang, Helin <[email protected]> > Subject: [PATCH v3 1/4] ethdev: Add eal device event callback > > Implement a eal device event callback "rte_eth_dev_event_callback" > in ethdev, it could let pmd driver have chance to manage the eal device event, > such as process hotplug event. > > Signed-off-by: Jeff Guo <[email protected]> > --- <...> > > /** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Implement a rte eth eal device event callbacks for the specific device. > + * > + * @param device_name > + * Pointer to the name of the rte device. > + * @param event > + * Eal device event type. > + * @param ret_param > + * To pass data back to user application. > + * > + * @return > + * void > + */ > +void __rte_experimental > +rte_eth_dev_event_callback(char *device_name, > + enum rte_dev_event_type event, void *cb_arg);
I don't think we should expose the callback function to PMD directly It should be a function like rte_eth_dev_event_callback_register(struct rte_ethdev *dev) which looks more like an ethdev help API for drivers. And inside the function , we do the rte_dev_event_callback_register ... And rte_eth_dev_event_callback should be rename to eth_dev_event_callback as a static function. Regards Qi > + > +/** > * @internal Executes all the user application registered callbacks for > * the specific device. It is for DPDK internal user only. User > * application should not call it directly. > -- > 2.7.4

