[dpdk-dev] [PATCH 1/2] eal: clean up interrupt handle

Zhang, Qi Z qi.z.zhang at intel.com
Tue Feb 28 02:22:15 CET 2017


HI Jan:

> -----Original Message-----
> From: jblunck at gmail.com [mailto:jblunck at gmail.com] On Behalf Of Jan Blunck
> Sent: Tuesday, February 28, 2017 12:19 AM
> To: Zhang, Qi Z <qi.z.zhang at intel.com>
> Cc: Thomas Monjalon <thomas.monjalon at 6wind.com>; dev <dev at dpdk.org>
> Subject: Re: [dpdk-dev] [PATCH 1/2] eal: clean up interrupt handle
> 
> On Wed, Feb 22, 2017 at 11:17 PM, Qi Zhang <qi.z.zhang at intel.com> wrote:
> > --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
> > +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
> > @@ -278,29 +278,6 @@ vfio_disable_msi(const struct rte_intr_handle
> *intr_handle) {
> >         return ret;
> >  }
> >
> > -static int
> > -get_max_intr(const struct rte_intr_handle *intr_handle) -{
> > -       struct rte_intr_source *src;
> > -
> > -       TAILQ_FOREACH(src, &intr_sources, next) {
> > -               if (src->intr_handle.fd != intr_handle->fd)
> > -                       continue;
> > -
> > -               if (src->intr_handle.max_intr < intr_handle->max_intr)
> > -                       src->intr_handle.max_intr =
> intr_handle->max_intr;
> > -               if (!src->intr_handle.max_intr)
> > -                       src->intr_handle.max_intr = 1;
> > -               else if (src->intr_handle.max_intr >
> RTE_MAX_RXTX_INTR_VEC_ID)
> > -                       src->intr_handle.max_intr
> > -                               = RTE_MAX_RXTX_INTR_VEC_ID + 1;
> > -
> > -               return src->intr_handle.max_intr;
> > -       }
> > -
> > -       return -1;
> > -}
> > -
> >  /* enable MSI-X interrupts */
> >  static int
> >  vfio_enable_msix(const struct rte_intr_handle *intr_handle) { @@
> > -313,15 +290,10 @@ vfio_enable_msix(const struct rte_intr_handle
> > *intr_handle) {
> >
> >         irq_set = (struct vfio_irq_set *) irq_set_buf;
> >         irq_set->argsz = len;
> > -
> > -       ret = get_max_intr(intr_handle);
> > -       if (ret < 0) {
> > -               RTE_LOG(ERR, EAL, "Invalid number of MSI-X irqs for
> fd %d\n",
> > -                       intr_handle->fd);
> > -               return -1;
> > -       }
> > -
> > -       irq_set->count = ret;
> > +       /* 0 < irq_set->count < RTE_MAX_RXTX_INTR_VEC_ID + 1 */
> > +       irq_set->count = intr_handle->max_intr ?
> > +               (intr_handle->max_intr > RTE_MAX_RXTX_INTR_VEC_ID
> + 1 ?
> > +               RTE_MAX_RXTX_INTR_VEC_ID + 1 :
> intr_handle->max_intr)
> > + : 1;
> >         irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD |
> VFIO_IRQ_SET_ACTION_TRIGGER;
> >         irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
> >         irq_set->start = 0;
> 
> The changes (to not change the interrupt handle in intr_sources) seems to be
> unrelated to the API changes. Can you split this into two commits, please?

Yes, it's better to split this.
> 
> Also I'm not 100% convinced that the low-level drivers should make extensive
> use of the ethdev's const intr_handle. I believe that the ethdev ops might be
> incomplete in that sense that it would be better to add an rx_intr_ctl()
> operation to the ethdev ops structure and pass control the the low-level device.
I agree your point, abstract the interrupt control should be good, but I want keep this
patch's scope to only focus on eal interrupt layer but not include the ethdev layer, 
there could be a separate patch focus on that.

Thanks
Qi


More information about the dev mailing list