DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] common/cnxk: fix device MSIX greater than default value
@ 2021-11-01 17:44 Harman Kalra
  2021-11-03  7:13 ` David Marchand
  2021-11-03  7:59 ` [dpdk-dev] [PATCH v2] " Harman Kalra
  0 siblings, 2 replies; 4+ messages in thread
From: Harman Kalra @ 2021-11-01 17:44 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, Harman Kalra

Handling the case where number of MSIX interrupts are greater
than default value i.e. PLT_MAX_RXTX_INTR_VEC_ID. On PCI probe
device is queried for supported MSIX interrupts, and respective
interrupt resources are reallocated with this value. Same MSIX
count should be used while registering new interrupt vectors.

Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_irq.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/cnxk/roc_irq.c b/drivers/common/cnxk/roc_irq.c
index 3b34467b96..7a24297d72 100644
--- a/drivers/common/cnxk/roc_irq.c
+++ b/drivers/common/cnxk/roc_irq.c
@@ -14,7 +14,8 @@
 #include <unistd.h>
 
 #define MSIX_IRQ_SET_BUF_LEN                                                   \
-	(sizeof(struct vfio_irq_set) + sizeof(int) * (PLT_MAX_RXTX_INTR_VEC_ID))
+	(sizeof(struct vfio_irq_set) + sizeof(int) *			       \
+			(plt_intr_max_intr_get(intr_handle)))
 
 static int
 irq_get_info(struct plt_intr_handle *intr_handle)
@@ -34,7 +35,7 @@ irq_get_info(struct plt_intr_handle *intr_handle)
 	plt_base_dbg("Flags=0x%x index=0x%x count=0x%x max_intr_vec_id=0x%x",
 		     irq.flags, irq.index, irq.count, PLT_MAX_RXTX_INTR_VEC_ID);
 
-	if (irq.count > PLT_MAX_RXTX_INTR_VEC_ID) {
+	if (irq.count == 0) {
 		plt_err("HW max=%d > PLT_MAX_RXTX_INTR_VEC_ID: %d", irq.count,
 			PLT_MAX_RXTX_INTR_VEC_ID);
 		plt_intr_max_intr_set(intr_handle, PLT_MAX_RXTX_INTR_VEC_ID);
@@ -92,14 +93,6 @@ irq_init(struct plt_intr_handle *intr_handle)
 	int32_t *fd_ptr;
 	uint32_t i;
 
-	if (plt_intr_max_intr_get(intr_handle) >
-						PLT_MAX_RXTX_INTR_VEC_ID) {
-		plt_err("Max_intr=%d greater than PLT_MAX_RXTX_INTR_VEC_ID=%d",
-			plt_intr_max_intr_get(intr_handle),
-			PLT_MAX_RXTX_INTR_VEC_ID);
-		return -ERANGE;
-	}
-
 	len = sizeof(struct vfio_irq_set) +
 	      sizeof(int32_t) * plt_intr_max_intr_get(intr_handle);
 
-- 
2.18.0


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

* Re: [dpdk-dev] [PATCH] common/cnxk: fix device MSIX greater than default value
  2021-11-01 17:44 [dpdk-dev] [PATCH] common/cnxk: fix device MSIX greater than default value Harman Kalra
@ 2021-11-03  7:13 ` David Marchand
  2021-11-03  7:59 ` [dpdk-dev] [PATCH v2] " Harman Kalra
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2021-11-03  7:13 UTC (permalink / raw)
  To: Harman Kalra
  Cc: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Jerin Jacob Kollanukkaran

On Mon, Nov 1, 2021 at 6:44 PM Harman Kalra <hkalra@marvell.com> wrote:
>
> Handling the case where number of MSIX interrupts are greater
> than default value i.e. PLT_MAX_RXTX_INTR_VEC_ID. On PCI probe
> device is queried for supported MSIX interrupts, and respective
> interrupt resources are reallocated with this value. Same MSIX
> count should be used while registering new interrupt vectors.
>
> Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")

I don't think the issue comes from this change.
I'd rather flag:
Fixes: 8cb5d08db940 ("interrupts: extend event list")

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

-- 
David marchand


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

* [dpdk-dev] [PATCH v2] common/cnxk: fix device MSIX greater than default value
  2021-11-01 17:44 [dpdk-dev] [PATCH] common/cnxk: fix device MSIX greater than default value Harman Kalra
  2021-11-03  7:13 ` David Marchand
@ 2021-11-03  7:59 ` Harman Kalra
  2021-11-03 15:10   ` Jerin Jacob
  1 sibling, 1 reply; 4+ messages in thread
From: Harman Kalra @ 2021-11-03  7:59 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: Harman Kalra

Handling the case where number of MSIX interrupts are greater
than default value i.e. PLT_MAX_RXTX_INTR_VEC_ID. On PCI probe
device is queried for supported MSIX interrupts, and respective
interrupt resources are reallocated with this value. Same MSIX
count should be used while registering new interrupt vectors.

Fixes: 8cb5d08db940 ("interrupts: extend event list")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
V2: 
* Corrected fixes commit which actually introduced this issue.

 drivers/common/cnxk/roc_irq.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/common/cnxk/roc_irq.c b/drivers/common/cnxk/roc_irq.c
index 3b34467b96..7a24297d72 100644
--- a/drivers/common/cnxk/roc_irq.c
+++ b/drivers/common/cnxk/roc_irq.c
@@ -14,7 +14,8 @@
 #include <unistd.h>
 
 #define MSIX_IRQ_SET_BUF_LEN                                                   \
-	(sizeof(struct vfio_irq_set) + sizeof(int) * (PLT_MAX_RXTX_INTR_VEC_ID))
+	(sizeof(struct vfio_irq_set) + sizeof(int) *			       \
+			(plt_intr_max_intr_get(intr_handle)))
 
 static int
 irq_get_info(struct plt_intr_handle *intr_handle)
@@ -34,7 +35,7 @@ irq_get_info(struct plt_intr_handle *intr_handle)
 	plt_base_dbg("Flags=0x%x index=0x%x count=0x%x max_intr_vec_id=0x%x",
 		     irq.flags, irq.index, irq.count, PLT_MAX_RXTX_INTR_VEC_ID);
 
-	if (irq.count > PLT_MAX_RXTX_INTR_VEC_ID) {
+	if (irq.count == 0) {
 		plt_err("HW max=%d > PLT_MAX_RXTX_INTR_VEC_ID: %d", irq.count,
 			PLT_MAX_RXTX_INTR_VEC_ID);
 		plt_intr_max_intr_set(intr_handle, PLT_MAX_RXTX_INTR_VEC_ID);
@@ -92,14 +93,6 @@ irq_init(struct plt_intr_handle *intr_handle)
 	int32_t *fd_ptr;
 	uint32_t i;
 
-	if (plt_intr_max_intr_get(intr_handle) >
-						PLT_MAX_RXTX_INTR_VEC_ID) {
-		plt_err("Max_intr=%d greater than PLT_MAX_RXTX_INTR_VEC_ID=%d",
-			plt_intr_max_intr_get(intr_handle),
-			PLT_MAX_RXTX_INTR_VEC_ID);
-		return -ERANGE;
-	}
-
 	len = sizeof(struct vfio_irq_set) +
 	      sizeof(int32_t) * plt_intr_max_intr_get(intr_handle);
 
-- 
2.18.0


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

* Re: [dpdk-dev] [PATCH v2] common/cnxk: fix device MSIX greater than default value
  2021-11-03  7:59 ` [dpdk-dev] [PATCH v2] " Harman Kalra
@ 2021-11-03 15:10   ` Jerin Jacob
  0 siblings, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2021-11-03 15:10 UTC (permalink / raw)
  To: Harman Kalra
  Cc: dpdk-dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao

On Wed, Nov 3, 2021 at 1:29 PM Harman Kalra <hkalra@marvell.com> wrote:
>
> Handling the case where number of MSIX interrupts are greater
> than default value i.e. PLT_MAX_RXTX_INTR_VEC_ID. On PCI probe
> device is queried for supported MSIX interrupts, and respective
> interrupt resources are reallocated with this value. Same MSIX
> count should be used while registering new interrupt vectors.
>
> Fixes: 8cb5d08db940 ("interrupts: extend event list")
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
> V2:
> * Corrected fixes commit which actually introduced this issue.
>
>  drivers/common/cnxk/roc_irq.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_irq.c b/drivers/common/cnxk/roc_irq.c
> index 3b34467b96..7a24297d72 100644
> --- a/drivers/common/cnxk/roc_irq.c
> +++ b/drivers/common/cnxk/roc_irq.c
> @@ -14,7 +14,8 @@
>  #include <unistd.h>
>
>  #define MSIX_IRQ_SET_BUF_LEN                                                   \
> -       (sizeof(struct vfio_irq_set) + sizeof(int) * (PLT_MAX_RXTX_INTR_VEC_ID))
> +       (sizeof(struct vfio_irq_set) + sizeof(int) *                           \
> +                       (plt_intr_max_intr_get(intr_handle)))
>
>  static int
>  irq_get_info(struct plt_intr_handle *intr_handle)
> @@ -34,7 +35,7 @@ irq_get_info(struct plt_intr_handle *intr_handle)
>         plt_base_dbg("Flags=0x%x index=0x%x count=0x%x max_intr_vec_id=0x%x",
>                      irq.flags, irq.index, irq.count, PLT_MAX_RXTX_INTR_VEC_ID);
>
> -       if (irq.count > PLT_MAX_RXTX_INTR_VEC_ID) {
> +       if (irq.count == 0) {
>                 plt_err("HW max=%d > PLT_MAX_RXTX_INTR_VEC_ID: %d", irq.count,
>                         PLT_MAX_RXTX_INTR_VEC_ID);
>                 plt_intr_max_intr_set(intr_handle, PLT_MAX_RXTX_INTR_VEC_ID);
> @@ -92,14 +93,6 @@ irq_init(struct plt_intr_handle *intr_handle)
>         int32_t *fd_ptr;
>         uint32_t i;
>
> -       if (plt_intr_max_intr_get(intr_handle) >
> -                                               PLT_MAX_RXTX_INTR_VEC_ID) {
> -               plt_err("Max_intr=%d greater than PLT_MAX_RXTX_INTR_VEC_ID=%d",
> -                       plt_intr_max_intr_get(intr_handle),
> -                       PLT_MAX_RXTX_INTR_VEC_ID);
> -               return -ERANGE;
> -       }
> -
>         len = sizeof(struct vfio_irq_set) +
>               sizeof(int32_t) * plt_intr_max_intr_get(intr_handle);
>
> --
> 2.18.0
>

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

end of thread, other threads:[~2021-11-03 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 17:44 [dpdk-dev] [PATCH] common/cnxk: fix device MSIX greater than default value Harman Kalra
2021-11-03  7:13 ` David Marchand
2021-11-03  7:59 ` [dpdk-dev] [PATCH v2] " Harman Kalra
2021-11-03 15:10   ` Jerin Jacob

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