[dpdk-dev] [PATCH V16 3/4] eal/linux: uevent parse and process
Van Haaren, Harry
harry.van.haaren at intel.com
Thu Mar 29 15:32:01 CEST 2018
Two additional input along with Jianfeng's existing comments;
> -----Original Message-----
> From: Tan, Jianfeng
> Sent: Wednesday, March 28, 2018 5:16 PM
> To: Guo, Jia <jia.guo at intel.com>; stephen at networkplumber.org; Richardson,
> Bruce <bruce.richardson at intel.com>; Yigit, Ferruh <ferruh.yigit at intel.com>;
> Ananyev, Konstantin <konstantin.ananyev at intel.com>; gaetan.rivet at 6wind.com;
> Wu, Jingjing <jingjing.wu at intel.com>; thomas at monjalon.net;
> motih at mellanox.com; Van Haaren, Harry <harry.van.haaren at intel.com>
> Cc: jblunck at infradead.org; shreyansh.jain at nxp.com; dev at dpdk.org; Zhang,
> Helin <helin.zhang at intel.com>
> Subject: Re: [PATCH V16 3/4] eal/linux: uevent parse and process
>
> BTW, adding new .c file needs to update meson.build now.
>
> On 3/26/2018 7:20 PM, Jeff Guo wrote:
> > In order to handle the uevent which have been detected from the kernel
> > side, add uevent parse and process function to translate the uevent into
> > device event, which user has subscribe to monitor.
> >
> > Signed-off-by: Jeff Guo <jia.guo at intel.com>
> > ---
> > 1.move all linux specific together
> > ---
> > lib/librte_eal/linuxapp/eal/eal_dev.c | 214
> +++++++++++++++++++++++++++++++++-
> > 1 file changed, 211 insertions(+), 3 deletions(-)
> >
> > diff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c
> b/lib/librte_eal/linuxapp/eal/eal_dev.c
>
> > +static bool monitor_not_started = true;
This variable should be named "monitor_started", as it is a static var it will be zero by default,
and the following code is easier to read:
if ( !not_started ) becomes if (started)
> > int __rte_experimental
> > rte_dev_event_monitor_start(void)
> > {
> > - /* TODO: start uevent monitor for linux */
> > + int ret;
> > +
> > + if (!monitor_not_started)
> > + return 0;
> > +
> > + intr_handle.fd = dev_uev_monitor_fd_new();
> > + intr_handle.type = RTE_INTR_HANDLE_DEV_EVENT;
dev_uev_monitor_fd_new() can return -1 on error, we should check for that case here.
More information about the dev
mailing list