[dpdk-dev] [EXT] Re: [PATCH v4 3/7] eal/interrupts: avoid direct access to interrupt handle

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Wed Oct 20 11:52:05 CEST 2021


2021-10-20 09:25 (UTC+0000), Harman Kalra:
> [...]
> > > diff --git a/lib/eal/freebsd/eal_interrupts.c
> > > b/lib/eal/freebsd/eal_interrupts.c  
> > [...]  
> > > @@ -135,9 +137,18 @@ rte_intr_callback_register(const struct  
> > rte_intr_handle *intr_handle,  
> > >  				ret = -ENOMEM;
> > >  				goto fail;
> > >  			} else {
> > > -				src->intr_handle = *intr_handle;
> > > -				TAILQ_INIT(&src->callbacks);
> > > -				TAILQ_INSERT_TAIL(&intr_sources, src, next);
> > > +				src->intr_handle = rte_intr_instance_alloc();
> > > +				if (src->intr_handle == NULL) {
> > > +					RTE_LOG(ERR, EAL, "Can not create  
> > intr instance\n");  
> > > +					free(callback);
> > > +					ret = -ENOMEM;  
> > 
> > goto fail?  
> 
> I think goto not required, as we not setting wake_thread = 1 here,
> API will just return error after unlocking the spinlock and trace.

Just to emphasize, we're talking about FreeBSD implementation.
There is no "wake_thread" variable there, so "goto fail" is needed.
Your consideration would be valid for similar code in Linux EAL.



More information about the dev mailing list