From: Jan Blunck <jblunck@infradead.org>
To: Qi Zhang <qi.z.zhang@intel.com>
Cc: Thomas Monjalon <thomas.monjalon@6wind.com>, dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] eal: clean up interrupt handle
Date: Mon, 27 Feb 2017 17:19:12 +0100 [thread overview]
Message-ID: <CALe+Z03t0SQh+Rx0ZX8TNtaXDUj8f=nWoH8CpWbjru+qFTOLCg@mail.gmail.com> (raw)
In-Reply-To: <1487801822-30938-2-git-send-email-qi.z.zhang@intel.com>
On Wed, Feb 22, 2017 at 11:17 PM, Qi Zhang <qi.z.zhang@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?
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.
next prev parent reply other threads:[~2017-02-27 16:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 22:17 [dpdk-dev] [PATCH 0/2] " Qi Zhang
2017-02-22 22:17 ` [dpdk-dev] [PATCH 1/2] " Qi Zhang
2017-02-27 16:19 ` Jan Blunck [this message]
2017-02-28 1:22 ` Zhang, Qi Z
2017-02-22 22:17 ` [dpdk-dev] [PATCH 2/2] test: update test code Qi Zhang
2017-03-07 9:19 ` [dpdk-dev] [PATCH v2 0/3] clean up interrupt handle Qi Zhang
2017-03-07 9:19 ` [dpdk-dev] [PATCH v2 1/3] vfio: keep interrupt source read only Qi Zhang
2017-03-10 13:05 ` Thomas Monjalon
2017-03-10 13:26 ` Burakov, Anatoly
2017-03-07 9:19 ` [dpdk-dev] [PATCH v2 2/3] eal: clean up interrupt handle Qi Zhang
2017-03-30 16:39 ` Thomas Monjalon
2017-03-31 0:57 ` Zhang, Qi Z
2017-03-07 9:19 ` [dpdk-dev] [PATCH v2 3/3] app/test: update test code Qi Zhang
2017-03-10 13:04 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALe+Z03t0SQh+Rx0ZX8TNtaXDUj8f=nWoH8CpWbjru+qFTOLCg@mail.gmail.com' \
--to=jblunck@infradead.org \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=thomas.monjalon@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).