DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
@ 2023-06-14 13:40 Vladimir Ratnikov
  2023-06-14 16:46 ` Stephen Hemminger
  2023-07-03  7:19 ` [EXT] " Harman Kalra
  0 siblings, 2 replies; 9+ messages in thread
From: Vladimir Ratnikov @ 2023-06-14 13:40 UTC (permalink / raw)
  To: hkalra; +Cc: dev, Vladimir Ratnikov

 Some drivers and devices(ex: igc + i225/i226) use
RTE_INTR_HANDLE_UIO handler when captured under igb_uio
so just let them use it.

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
---
 lib/eal/linux/eal_interrupts.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index c9881143be..037db09cfd 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1596,6 +1596,9 @@ rte_intr_cap_multiple(struct rte_intr_handle *intr_handle)
 	if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV)
 		return 1;
 
+	if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_UIO)
+		return 1;
+
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-06-14 13:40 [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio Vladimir Ratnikov
@ 2023-06-14 16:46 ` Stephen Hemminger
  2023-07-03 15:32   ` Thomas Monjalon
  2023-07-03  7:19 ` [EXT] " Harman Kalra
  1 sibling, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2023-06-14 16:46 UTC (permalink / raw)
  To: Vladimir Ratnikov; +Cc: hkalra, dev

On Wed, 14 Jun 2023 13:40:18 +0000
Vladimir Ratnikov <vratnikov@netgate.com> wrote:

>  Some drivers and devices(ex: igc + i225/i226) use
> RTE_INTR_HANDLE_UIO handler when captured under igb_uio
> so just let them use it.
> 
> Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>

This doesn't look right.

With UIO only a single interrupt is possible, there is no MSI-X support.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [EXT] [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-06-14 13:40 [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio Vladimir Ratnikov
  2023-06-14 16:46 ` Stephen Hemminger
@ 2023-07-03  7:19 ` Harman Kalra
  1 sibling, 0 replies; 9+ messages in thread
From: Harman Kalra @ 2023-07-03  7:19 UTC (permalink / raw)
  To: Vladimir Ratnikov; +Cc: dev


>  Some drivers and devices(ex: igc + i225/i226) use RTE_INTR_HANDLE_UIO
> handler when captured under igb_uio so just let them use it.
> 
> Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>


Reviewed-by: Harman Kalra <hkalra@marvell.com>

Thanks
Harman 

> ---
>  lib/eal/linux/eal_interrupts.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
> index c9881143be..037db09cfd 100644
> --- a/lib/eal/linux/eal_interrupts.c
> +++ b/lib/eal/linux/eal_interrupts.c
> @@ -1596,6 +1596,9 @@ rte_intr_cap_multiple(struct rte_intr_handle
> *intr_handle)
>  	if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV)
>  		return 1;
> 
> +	if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_UIO)
> +		return 1;
> +
>  	return 0;
>  }
> 
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-06-14 16:46 ` Stephen Hemminger
@ 2023-07-03 15:32   ` Thomas Monjalon
  2023-07-04 10:45     ` Vladimir Ratnikov
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2023-07-03 15:32 UTC (permalink / raw)
  To: Vladimir Ratnikov, hkalra
  Cc: dev, Stephen Hemminger, Junfeng Guo, Simei Su, qi.z.zhang

14/06/2023 18:46, Stephen Hemminger:
> On Wed, 14 Jun 2023 13:40:18 +0000
> Vladimir Ratnikov <vratnikov@netgate.com> wrote:
> 
> >  Some drivers and devices(ex: igc + i225/i226) use
> > RTE_INTR_HANDLE_UIO handler when captured under igb_uio
> > so just let them use it.
> > 
> > Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
> 
> This doesn't look right.
> 
> With UIO only a single interrupt is possible, there is no MSI-X support.

Please Vladimir, could you reply to Stephen?
I think he is suggesting a better fix in the igc driver.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-07-03 15:32   ` Thomas Monjalon
@ 2023-07-04 10:45     ` Vladimir Ratnikov
  2023-07-04 15:55       ` Stephen Hemminger
  0 siblings, 1 reply; 9+ messages in thread
From: Vladimir Ratnikov @ 2023-07-04 10:45 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: hkalra, dev, Junfeng Guo, Simei Su, qi.z.zhang, Thomas Monjalon

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

Sorry for a long reply, sure.

Stephen,
am I right that the most concern is about a place where interrupt
capabilities check appears for non MSI-X support?
What if having dedicated rte_intr_cap_single analog when there's no support
for MSI-X and just do the same(check capability, allocate interrupt vector
etc) ?


Regards,
-Vladimir

On Mon, Jul 3, 2023 at 5:32 PM Thomas Monjalon <thomas@monjalon.net> wrote:

> 14/06/2023 18:46, Stephen Hemminger:
> > On Wed, 14 Jun 2023 13:40:18 +0000
> > Vladimir Ratnikov <vratnikov@netgate.com> wrote:
> >
> > >  Some drivers and devices(ex: igc + i225/i226) use
> > > RTE_INTR_HANDLE_UIO handler when captured under igb_uio
> > > so just let them use it.
> > >
> > > Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
> >
> > This doesn't look right.
> >
> > With UIO only a single interrupt is possible, there is no MSI-X support.
>
> Please Vladimir, could you reply to Stephen?
> I think he is suggesting a better fix in the igc driver.
>
>
>

[-- Attachment #2: Type: text/html, Size: 1955 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-07-04 10:45     ` Vladimir Ratnikov
@ 2023-07-04 15:55       ` Stephen Hemminger
  2023-07-04 18:19         ` Vladimir Ratnikov
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2023-07-04 15:55 UTC (permalink / raw)
  To: Vladimir Ratnikov
  Cc: hkalra, dev, Junfeng Guo, Simei Su, qi.z.zhang, Thomas Monjalon

On Tue, 4 Jul 2023 12:45:54 +0200
Vladimir Ratnikov <vratnikov@netgate.com> wrote:

> Sorry for a long reply, sure.
> 
> Stephen,
> am I right that the most concern is about a place where interrupt
> capabilities check appears for non MSI-X support?
> What if having dedicated rte_intr_cap_single analog when there's no support
> for MSI-X and just do the same(check capability, allocate interrupt vector
> etc) ?
> 
> 
> Regards,
> -Vladimir

With single interrupt, only link state interrupt is possible.
Does that work with igb_uio?  It should, if not then yes rte_intr_cap_single
or something like that is needed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-07-04 15:55       ` Stephen Hemminger
@ 2023-07-04 18:19         ` Vladimir Ratnikov
  2023-07-05 23:27           ` Stephen Hemminger
  2023-10-31 17:17           ` Stephen Hemminger
  0 siblings, 2 replies; 9+ messages in thread
From: Vladimir Ratnikov @ 2023-07-04 18:19 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: hkalra, dev, Junfeng Guo, Simei Su, qi.z.zhang, Thomas Monjalon

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

On systems with I225 interfaces it works in interrupt mode(rx), so not only
LSE interrupts are supported.
I could try add  rte_intr_cap_single functionality and recheck it twice(if
several interfaces works in rx_mode=interrupt)
But actually it worked with changes above(CPU utilization close to the
zero, data passes through the interface etc)

On Tue, Jul 4, 2023 at 5:55 PM Stephen Hemminger <stephen@networkplumber.org>
wrote:

> On Tue, 4 Jul 2023 12:45:54 +0200
> Vladimir Ratnikov <vratnikov@netgate.com> wrote:
>
> > Sorry for a long reply, sure.
> >
> > Stephen,
> > am I right that the most concern is about a place where interrupt
> > capabilities check appears for non MSI-X support?
> > What if having dedicated rte_intr_cap_single analog when there's no
> support
> > for MSI-X and just do the same(check capability, allocate interrupt
> vector
> > etc) ?
> >
> >
> > Regards,
> > -Vladimir
>
> With single interrupt, only link state interrupt is possible.
> Does that work with igb_uio?  It should, if not then yes
> rte_intr_cap_single
> or something like that is needed.
>

[-- Attachment #2: Type: text/html, Size: 1547 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-07-04 18:19         ` Vladimir Ratnikov
@ 2023-07-05 23:27           ` Stephen Hemminger
  2023-10-31 17:17           ` Stephen Hemminger
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2023-07-05 23:27 UTC (permalink / raw)
  To: Vladimir Ratnikov
  Cc: hkalra, dev, Junfeng Guo, Simei Su, qi.z.zhang, Thomas Monjalon

On Tue, 4 Jul 2023 20:19:05 +0200
Vladimir Ratnikov <vratnikov@netgate.com> wrote:

> On systems with I225 interfaces it works in interrupt mode(rx), so not only
> LSE interrupts are supported.
> I could try add  rte_intr_cap_single functionality and recheck it twice(if
> several interfaces works in rx_mode=interrupt)
> But actually it worked with changes above(CPU utilization close to the
> zero, data passes through the interface etc)
> 

But this will cause mess with other devices.
For example igb has code that does:

        /* check and configure queue intr-vector mapping */                                          
        if ((rte_intr_cap_multiple(intr_handle) ||                                                   
             !RTE_ETH_DEV_SRIOV(dev).active) &&                                                      
            dev->data->dev_conf.intr_conf.rxq != 0) {                                                
                intr_vector = dev->data->nb_rx_queues;                                               
                if (rte_intr_efd_enable(intr_handle, intr_vector))                                   
                        return -1;                                                                   
        }                                                                                            
                                                                                                     
        /* Allocate the vector list */                                                               
        if (rte_intr_dp_is_en(intr_handle)) {                                                        
                if (rte_intr_vec_list_alloc(intr_handle, "intr_vec",                                 
                                                   dev->data->nb_rx_queues)) {                       
                        PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues"                          
                                     " intr_vec", dev->data->nb_rx_queues);                          
                        return -ENOMEM;                                                              
                }                                                                                    
        }                                                                                            
                                                                                                     
        /* configure MSI-X for Rx interrupt */                                                       
        eth_igb_configure_msix_intr(dev);   

MSI-X won't work with igb_uio because the interrupt vector region is not shared with userspace.
                                                         
                                                 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio
  2023-07-04 18:19         ` Vladimir Ratnikov
  2023-07-05 23:27           ` Stephen Hemminger
@ 2023-10-31 17:17           ` Stephen Hemminger
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2023-10-31 17:17 UTC (permalink / raw)
  To: Vladimir Ratnikov
  Cc: hkalra, dev, Junfeng Guo, Simei Su, qi.z.zhang, Thomas Monjalon

On Tue, 4 Jul 2023 20:19:05 +0200
Vladimir Ratnikov <vratnikov@netgate.com> wrote:

> On systems with I225 interfaces it works in interrupt mode(rx), so not only
> LSE interrupts are supported.
> I could try add  rte_intr_cap_single functionality and recheck it twice(if
> several interfaces works in rx_mode=interrupt)
> But actually it worked with changes above(CPU utilization close to the
> zero, data passes through the interface etc)

If you want to use interrupts please use VFIO where it is possible to
support MSI-X correctly.

In the past, there was a proposed patch to handle multiple IRQ vectors
with igb_uio but it needed other kernel changes to work. These changes were
rejected upstream and led to the changes to VFIO to work without IOMMU.
That is a better and supported upstream.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-31 17:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 13:40 [PATCH] eal/interrupts: Allow UIO interrupts when using igb_uio Vladimir Ratnikov
2023-06-14 16:46 ` Stephen Hemminger
2023-07-03 15:32   ` Thomas Monjalon
2023-07-04 10:45     ` Vladimir Ratnikov
2023-07-04 15:55       ` Stephen Hemminger
2023-07-04 18:19         ` Vladimir Ratnikov
2023-07-05 23:27           ` Stephen Hemminger
2023-10-31 17:17           ` Stephen Hemminger
2023-07-03  7:19 ` [EXT] " Harman Kalra

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).