[PATCH] net/failsafe: fix interrupt handle leak

David Marchand david.marchand at redhat.com
Fri Apr 29 16:25:04 CEST 2022


Hello Ferruh,

On Fri, Apr 29, 2022 at 3:56 PM Ferruh Yigit <ferruh.yigit at xilinx.com> wrote:
> > @@ -442,12 +428,16 @@ fs_rx_queue_setup(struct rte_eth_dev *dev,
> >       rxq->info.nb_desc = nb_rx_desc;
> >       rxq->priv = PRIV(dev);
> >       rxq->sdev = PRIV(dev)->subs;
> > -     ret = rte_intr_efd_enable(intr_handle, 1);
> > -     if (ret < 0) {
> > +#ifdef RTE_EXEC_ENV_LINUX
> > +     rxq->event_fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
> > +     if (rxq->event_fd < 0) {
> > +             ERROR("Failed to create an eventfd: %s", strerror(errno));
> >               fs_unlock(dev, 0);
> > -             return ret;
> > +             return -errno;
> >       }
> > -     rxq->event_fd = rte_intr_efds_index_get(intr_handle, 0);
> > +#else
> > +     rxq->event_fd = -1;
> > +#endif
>
> How this impacts the BSD? I don't know if driver used on BSD but
> technically it looks supported.

Atm, the driver calls rte_intr_efd_enable() which on Linux triggers an
eventfd creation and a intr_handle->nb_intr++, but does nothing on
FreeBSD.
I did not test it with FreeBSD but I expect the previous call to
rte_intr_efds_index_get(intr_handle, 0); return -1 (because of a
earlier call to rte_intr_efds_index_set(intr_handle, 0, -1)).


-- 
David Marchand



More information about the stable mailing list