DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nipun Gupta <nipun.gupta@amd.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, thomas@monjalon.net, hkalra@marvell.com,
	anatoly.burakov@intel.com, stephen@networkplumber.org,
	ferruh.yigit@amd.com, harpreet.anand@amd.com,
	nikhil.agarwal@amd.com
Subject: Re: [PATCH v5 3/5] eal/interrupts: add IRQ count in interrupt handle
Date: Thu, 1 Jun 2023 23:34:21 +0530	[thread overview]
Message-ID: <aeea4669-c8cc-6d9e-ca2d-b2b1fc999022@amd.com> (raw)
In-Reply-To: <CAJFAV8xZTCdMcp_4m-j4UQtojL0ry+cPRg+pbLjVQBSsat5xAA@mail.gmail.com>

Hi David,

On 6/1/2023 8:55 PM, David Marchand wrote:
> 
> On Thu, May 25, 2023 at 12:08 PM Nipun Gupta <nipun.gupta@amd.com> wrote:
>>
>> Have total number of IRQ count support in interrupt handle.
>> In case of VFIO this IRQ count is returned when
>> VFIO_DEVICE_GET_IRQ_INFO ioctl is invoked. This IRQ_count can
>> used by the devices to store/provide total number of interrupts
>> available and to enable or disable these interrupts.
>>
>> Signed-off-by: Nipun Gupta <nipun.gupta@amd.com>
>> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
>> ---
>>   lib/eal/common/eal_common_interrupts.c | 21 +++++++++++++++++
>>   lib/eal/common/eal_interrupts.h        |  1 +
>>   lib/eal/include/rte_interrupts.h       | 32 ++++++++++++++++++++++++++
>>   lib/eal/version.map                    |  2 ++
>>   4 files changed, 56 insertions(+)
>>
>> diff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c
>> index 97b64fed58..a0167d9ad4 100644
>> --- a/lib/eal/common/eal_common_interrupts.c
>> +++ b/lib/eal/common/eal_common_interrupts.c
>> @@ -398,6 +398,27 @@ int rte_intr_elist_index_set(struct rte_intr_handle *intr_handle,
>>          return -rte_errno;
>>   }
>>
>> +int rte_intr_irq_count_set(struct rte_intr_handle *intr_handle,
>> +       int irq_count)
>> +{
>> +       CHECK_VALID_INTR_HANDLE(intr_handle);
>> +
>> +       intr_handle->irq_count = irq_count;
>> +
>> +       return 0;
>> +fail:
>> +       return -rte_errno;
>> +}
>> +
>> +int rte_intr_irq_count_get(const struct rte_intr_handle *intr_handle)
>> +{
>> +       CHECK_VALID_INTR_HANDLE(intr_handle);
>> +
>> +       return intr_handle->irq_count;
>> +fail:
>> +       return -rte_errno;
>> +}
>> +
>>   int rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle,
>>          const char *name, int size)
>>   {
>> diff --git a/lib/eal/common/eal_interrupts.h b/lib/eal/common/eal_interrupts.h
>> index 482781b862..eaf8e20187 100644
>> --- a/lib/eal/common/eal_interrupts.h
>> +++ b/lib/eal/common/eal_interrupts.h
>> @@ -16,6 +16,7 @@ struct rte_intr_handle {
>>          };
>>          uint32_t alloc_flags;   /**< flags passed at allocation */
>>          enum rte_intr_handle_type type;  /**< handle type */
>> +       uint32_t irq_count;             /**< Total IRQ count */
>>          uint32_t max_intr;             /**< max interrupt requested */
>>          uint32_t nb_efd;               /**< number of available efd(event fd) */
>>          uint8_t efd_counter_size;      /**< size of efd counter, used for vdev */
>> diff --git a/lib/eal/include/rte_interrupts.h b/lib/eal/include/rte_interrupts.h
>> index 487e3c8875..415d1fcac0 100644
>> --- a/lib/eal/include/rte_interrupts.h
>> +++ b/lib/eal/include/rte_interrupts.h
>> @@ -506,6 +506,38 @@ __rte_internal
>>   int
>>   rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);
>>
>> +/**
>> + * @internal
>> + * Set the IRQ count field of interrupt handle with user
>> + * provided IRQ count value.
> 
> I am intrigued by this new notion.
> We already have different sizes in the intr_handle, why do we need a new one?
> 
> Plus, in the cdx patch using this new API, I see that an fd array is
> filled based on nb_efd.
> So it seems to me that this new irq_count is just a duplicate of nb_efd.

The API rte_intr_efd_enable() sets the nb_efd and max_intr to values 
provided by the caller (+ NB_OTHER_INTR for max_intr). These values are 
dependent on the number of interrupts which are enabled by any DPDK 
driver rather than the actual number of interrupts supported or provided 
by the Linux driver.

With CDX bus the devices can have interrupts which are not really bound 
by the number of queues, and as these devices are programmable (FPGA 
based), users are free to implement the interrupts as per the need. I 
need to provide the total number of interrupts supported by the device 
to the drivers.

nb_intr is also there, which is default initialized by 
RTE_MAX_RXTX_INTR_VEC_ID, due to which this does not seem to be best 
fit. Though as per the meaning it shall represent the total number of 
interrupts supported by the device. Maybe we can remove the default 
value and use this as a total interrupt count supported for the device?

w.r.t. comments on the other patches, I will fix them in the next respin.

Regards,
Nipun

> 
> 
>> + * @param intr_handle
>> + *  pointer to the interrupt handle.
>> + * @param irq_count
>> + *  IRQ count
>> + *
>> + * @return
>> + *  - On success, zero.
>> + *  - On failure, a negative value and rte_errno is set.
>> + */
>> +__rte_internal
>> +int
>> +rte_intr_irq_count_set(struct rte_intr_handle *intr_handle, int irq_count);
>> +
> 
> 
> --
> David Marchand
> 

  reply	other threads:[~2023-06-01 18:05 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 14:07 [RFC PATCH 0/6] add support for CDX bus Nipun Gupta
2023-01-24 14:07 ` [RFC PATCH 1/6] bus/cdx: introduce cdx bus Nipun Gupta
2023-01-24 14:07 ` [RFC PATCH 2/6] bus/cdx: add dma map and unmap support Nipun Gupta
2023-01-24 14:07 ` [RFC PATCH 3/6] bus/cdx: add support for MSI Nipun Gupta
2023-01-24 14:07 ` [RFC PATCH 4/6] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-01-24 14:07 ` [RFC PATCH 5/6] bus: enable cdx bus Nipun Gupta
2023-01-24 14:07 ` [RFC PATCH 6/6] config/arm: add AMD CDX Nipun Gupta
2023-04-07  6:01 ` [PATCH 0/6] add support for CDX bus Nipun Gupta
2023-04-07  6:01   ` [PATCH 1/6] bus/cdx: introduce cdx bus Nipun Gupta
2023-04-07  6:01   ` [PATCH 2/6] bus/cdx: add dma map and unmap support Nipun Gupta
2023-04-07  6:01   ` [PATCH 3/6] bus/cdx: add support for MSI Nipun Gupta
2023-04-07  6:01   ` [PATCH 4/6] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-04-07  6:01   ` [PATCH 5/6] bus: enable cdx bus Nipun Gupta
2023-04-07  6:01   ` [PATCH 6/6] config/arm: add AMD CDX Nipun Gupta
2023-04-07  7:18   ` [PATCH 0/6] add support for CDX bus David Marchand
2023-04-07  7:29     ` Nipun Gupta
2023-04-13 13:25       ` Gupta, Nipun
2023-04-13 13:26 ` [PATCH v2 " Nipun Gupta
2023-04-13 13:26   ` [PATCH v2 1/6] bus/cdx: introduce cdx bus Nipun Gupta
2023-04-14 16:45     ` Ferruh Yigit
2023-04-16  9:20       ` Gupta, Nipun
2023-04-13 13:27   ` [PATCH v2 2/6] bus/cdx: add dma map and unmap support Nipun Gupta
2023-04-13 13:27   ` [PATCH v2 3/6] bus/cdx: add support for MSI Nipun Gupta
2023-04-14 16:45     ` Ferruh Yigit
2023-04-16  9:20       ` Gupta, Nipun
2023-04-13 13:27   ` [PATCH v2 4/6] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-04-13 13:27   ` [PATCH v2 5/6] bus: enable cdx bus Nipun Gupta
2023-04-14 16:45     ` Ferruh Yigit
2023-04-16  9:21       ` Gupta, Nipun
2023-04-13 13:27   ` [PATCH v2 6/6] config/arm: add AMD CDX Nipun Gupta
2023-04-14 16:45   ` [PATCH v2 0/6] add support for CDX bus Ferruh Yigit
2023-04-21 14:54 ` [PATCH v3 0/5] Support AMD CDX bus, for FPGA based CDX devices. The CDX Nipun Gupta
2023-04-21 14:54   ` [PATCH v3 1/5] bus/cdx: introduce cdx bus Nipun Gupta
2023-04-21 14:54   ` [PATCH v3 2/5] bus/cdx: add DMA map and unmap support Nipun Gupta
2023-04-21 14:54   ` [PATCH v3 3/5] bus/cdx: add support for MSI Nipun Gupta
2023-04-21 14:54   ` [PATCH v3 4/5] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-04-21 14:54   ` [PATCH v3 5/5] config/arm: add AMD CDX Nipun Gupta
2023-05-04 15:28     ` Ferruh Yigit
2023-05-08 10:24       ` Gupta, Nipun
2023-05-08 10:44         ` Thomas Monjalon
2023-05-08 10:48           ` Gupta, Nipun
2023-05-08 11:26         ` Ferruh Yigit
2023-05-08 17:16           ` Honnappa Nagarahalli
2023-05-08 17:47             ` Ferruh Yigit
2023-05-09  4:35               ` Gupta, Nipun
2023-05-09  5:55           ` Ruifeng Wang
2023-06-14 10:30             ` Ferruh Yigit
2023-06-15  7:00               ` Ruifeng Wang
2023-05-08 11:18 ` [PATCH v4 0/4] Support AMD CDX bus, for FPGA based CDX devices. The CDX Nipun Gupta
2023-05-08 11:18   ` [PATCH v4 1/4] bus/cdx: introduce cdx bus Nipun Gupta
2023-05-09  6:54     ` Xia, Chenbo
2023-05-09 11:09       ` Gupta, Nipun
2023-05-09 11:25         ` Ferruh Yigit
2023-05-10  1:29           ` Xia, Chenbo
2023-05-24 11:14     ` Thomas Monjalon
2023-05-24 17:04       ` Gupta, Nipun
2023-05-08 11:18   ` [PATCH v4 2/4] bus/cdx: add DMA map and unmap support Nipun Gupta
2023-05-08 11:18   ` [PATCH v4 3/4] bus/cdx: add support for MSI Nipun Gupta
2023-05-24 11:06     ` Thomas Monjalon
2023-05-24 17:06       ` Gupta, Nipun
2023-05-08 11:18   ` [PATCH v4 4/4] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-05-12 10:25   ` [PATCH v4 0/4] Support AMD CDX bus, for FPGA based CDX devices. The CDX Ferruh Yigit
2023-05-25 10:08 ` [PATCH v5 0/5] Support AMD CDX bus Nipun Gupta
2023-05-25 10:08   ` [PATCH v5 1/5] bus/cdx: introduce " Nipun Gupta
2023-06-01 15:00     ` David Marchand
2023-06-01 18:10       ` Nipun Gupta
2023-06-05  8:04       ` Nipun Gupta
2023-05-25 10:08   ` [PATCH v5 2/5] bus/cdx: add DMA map and unmap support Nipun Gupta
2023-06-01 15:07     ` David Marchand
2023-05-25 10:08   ` [PATCH v5 3/5] eal/interrupts: add IRQ count in interrupt handle Nipun Gupta
2023-06-01 15:25     ` David Marchand
2023-06-01 18:04       ` Nipun Gupta [this message]
2023-06-01 18:18         ` Gupta, Nipun
2023-06-06  7:18     ` [EXT] " Harman Kalra
2023-06-06  7:27       ` Nipun Gupta
2023-06-07  5:45         ` Harman Kalra
2023-05-25 10:08   ` [PATCH v5 4/5] bus/cdx: add support for MSI Nipun Gupta
2023-06-01 15:09     ` David Marchand
2023-06-05  8:05       ` Nipun Gupta
2023-05-25 10:08   ` [PATCH v5 5/5] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-06-05 13:26 ` [PATCH v6 0/4] Support AMD CDX bus Nipun Gupta
2023-06-05 13:26   ` [PATCH v6 1/4] bus/cdx: introduce " Nipun Gupta
2023-06-06  8:55     ` Thomas Monjalon
2023-06-05 13:26   ` [PATCH v6 2/4] bus/cdx: add DMA map and unmap support Nipun Gupta
2023-06-05 13:26   ` [PATCH v6 3/4] bus/cdx: add support for MSI Nipun Gupta
2023-06-06  9:30     ` David Marchand
2023-06-06  9:42       ` Nipun Gupta
2023-06-05 13:26   ` [PATCH v6 4/4] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-06-06 10:02 ` [PATCH v7 0/4] Support AMD CDX bus Nipun Gupta
2023-06-06 10:02   ` [PATCH v7 1/4] bus/cdx: introduce " Nipun Gupta
2023-06-06 13:00     ` Thomas Monjalon
2023-06-06 13:38       ` Nipun Gupta
2023-06-06 13:43         ` Thomas Monjalon
2023-06-06 10:02   ` [PATCH v7 2/4] bus/cdx: add DMA map and unmap support Nipun Gupta
2023-06-06 10:02   ` [PATCH v7 3/4] bus/cdx: add support for MSI Nipun Gupta
2023-06-06 10:02   ` [PATCH v7 4/4] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-06-07  4:24 ` [PATCH v8 0/4] Support AMD CDX bus Nipun Gupta
2023-06-07  4:24   ` [PATCH v8 1/4] bus/cdx: introduce " Nipun Gupta
2023-06-07  4:24   ` [PATCH v8 2/4] bus/cdx: add DMA map and unmap support Nipun Gupta
2023-06-07  4:24   ` [PATCH v8 3/4] bus/cdx: add support for MSI Nipun Gupta
2023-06-07  4:24   ` [PATCH v8 4/4] bus/cdx: support plug unplug and dev iterator Nipun Gupta
2023-06-07 13:36   ` [PATCH v8 0/4] Support AMD CDX bus 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=aeea4669-c8cc-6d9e-ca2d-b2b1fc999022@amd.com \
    --to=nipun.gupta@amd.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=harpreet.anand@amd.com \
    --cc=hkalra@marvell.com \
    --cc=nikhil.agarwal@amd.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).