DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] common/cnxk: unregister IRQ before reconfigure
@ 2024-09-06 14:25 pbhagavatula
  2024-09-19 18:02 ` [PATCH v2] " pbhagavatula
  0 siblings, 1 reply; 7+ messages in thread
From: pbhagavatula @ 2024-09-06 14:25 UTC (permalink / raw)
  To: jerinj, hkalra, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Unregister SSO device and NPA IRQs before resizing
them.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/common/cnxk/roc_dev.c      | 16 +++++++---------
 drivers/common/cnxk/roc_dev_priv.h |  2 ++
 drivers/common/cnxk/roc_sso.c      |  7 +++++++
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index daf7684d8e..4a5787e7f9 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -1017,8 +1017,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 			   RVU_VF_INT_VEC_MBOX);
 }
 
-static void
-mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	if (dev_is_vf(dev))
 		mbox_unregister_vf_irq(pci_dev, dev);
@@ -1096,8 +1096,8 @@ roc_pf_vf_flr_irq(void *param)
 	}
 }
 
-static int
-vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	struct plt_intr_handle *intr_handle = pci_dev->intr_handle;
 	int i;
@@ -1113,8 +1113,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
 
 	dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev,
 			   RVU_PF_INT_VEC_VFFLR1);
-
-	return 0;
 }
 
 int
@@ -1600,7 +1598,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev)
 iounmap:
 	dev_vf_mbase_put(pci_dev, vf_mbase);
 mbox_unregister:
-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);
 	if (dev->ops)
 		plt_free(dev->ops);
 mbox_fini:
@@ -1636,10 +1634,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *pci_dev)
 	if (dev->lmt_mz)
 		plt_memzone_free(dev->lmt_mz);
 
-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);
 
 	if (!dev_is_vf(dev))
-		vf_flr_unregister_irqs(pci_dev, dev);
+		dev_vf_flr_unregister_irqs(pci_dev, dev);
 	/* Release PF - VF */
 	mbox = &dev->mbox_vfpf;
 	if (mbox->hwbase && mbox->dev)
diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h
index 50e12cbf17..df7dc222ed 100644
--- a/drivers/common/cnxk/roc_dev_priv.h
+++ b/drivers/common/cnxk/roc_dev_priv.h
@@ -131,6 +131,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_handle);
 int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t max_intr);
 
 int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev);
 int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
 
 #endif /* _ROC_DEV_PRIV_H */
diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c
index 293b0c81a1..7a2f9482fa 100644
--- a/drivers/common/cnxk/roc_sso.c
+++ b/drivers/common/cnxk/roc_sso.c
@@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, uint16_t sso_vec_cnt)
 		return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt);
 	}
 
+	/* Before re-configuring unregister irqs */
+	dev_mbox_unregister_irq(pci_dev, dev);
+	if (!dev_is_vf(dev))
+		dev_vf_flr_unregister_irqs(pci_dev, dev);
+
 	npa_vec_cnt = (dev->npa.pci_dev == pci_dev) ? NPA_LF_INT_VEC_POISON + 1 : 0;
+	if (npa_vec_cnt)
+		npa_unregister_irqs(&dev->npa);
 
 	/* Re-configure to include SSO vectors */
 	rc = dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt + sso_vec_cnt);
-- 
2.25.1


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

* [PATCH v2] common/cnxk: unregister IRQ before reconfigure
  2024-09-06 14:25 [PATCH] common/cnxk: unregister IRQ before reconfigure pbhagavatula
@ 2024-09-19 18:02 ` pbhagavatula
  2024-09-23 15:47   ` Jerin Jacob
  2024-09-29 16:08   ` [PATCH v3] common/cnxk: fix IRQ reconfiguration pbhagavatula
  0 siblings, 2 replies; 7+ messages in thread
From: pbhagavatula @ 2024-09-19 18:02 UTC (permalink / raw)
  To: jerinj, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Harman Kalra
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Unregister SSO device and NPA IRQs before resizing
them.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
v2 Changes:
- Reorder npa interrupt un-registration.

 drivers/common/cnxk/roc_dev.c      | 16 +++++++---------
 drivers/common/cnxk/roc_dev_priv.h |  2 ++
 drivers/common/cnxk/roc_sso.c      |  7 +++++++
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index daf7684d8e..4a5787e7f9 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -1017,8 +1017,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 			   RVU_VF_INT_VEC_MBOX);
 }

-static void
-mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	if (dev_is_vf(dev))
 		mbox_unregister_vf_irq(pci_dev, dev);
@@ -1096,8 +1096,8 @@ roc_pf_vf_flr_irq(void *param)
 	}
 }

-static int
-vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	struct plt_intr_handle *intr_handle = pci_dev->intr_handle;
 	int i;
@@ -1113,8 +1113,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)

 	dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev,
 			   RVU_PF_INT_VEC_VFFLR1);
-
-	return 0;
 }

 int
@@ -1600,7 +1598,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev)
 iounmap:
 	dev_vf_mbase_put(pci_dev, vf_mbase);
 mbox_unregister:
-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);
 	if (dev->ops)
 		plt_free(dev->ops);
 mbox_fini:
@@ -1636,10 +1634,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *pci_dev)
 	if (dev->lmt_mz)
 		plt_memzone_free(dev->lmt_mz);

-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);

 	if (!dev_is_vf(dev))
-		vf_flr_unregister_irqs(pci_dev, dev);
+		dev_vf_flr_unregister_irqs(pci_dev, dev);
 	/* Release PF - VF */
 	mbox = &dev->mbox_vfpf;
 	if (mbox->hwbase && mbox->dev)
diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h
index 50e12cbf17..df7dc222ed 100644
--- a/drivers/common/cnxk/roc_dev_priv.h
+++ b/drivers/common/cnxk/roc_dev_priv.h
@@ -131,6 +131,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_handle);
 int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t max_intr);

 int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev);
 int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev);

 #endif /* _ROC_DEV_PRIV_H */
diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c
index 293b0c81a1..7d45b06dda 100644
--- a/drivers/common/cnxk/roc_sso.c
+++ b/drivers/common/cnxk/roc_sso.c
@@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, uint16_t sso_vec_cnt)
 		return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt);
 	}

+	/* Before re-configuring unregister irqs */
 	npa_vec_cnt = (dev->npa.pci_dev == pci_dev) ? NPA_LF_INT_VEC_POISON + 1 : 0;
+	if (npa_vec_cnt)
+		npa_unregister_irqs(&dev->npa);
+
+	dev_mbox_unregister_irq(pci_dev, dev);
+	if (!dev_is_vf(dev))
+		dev_vf_flr_unregister_irqs(pci_dev, dev);

 	/* Re-configure to include SSO vectors */
 	rc = dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt + sso_vec_cnt);
--
2.25.1


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

* Re: [PATCH v2] common/cnxk: unregister IRQ before reconfigure
  2024-09-19 18:02 ` [PATCH v2] " pbhagavatula
@ 2024-09-23 15:47   ` Jerin Jacob
  2024-09-29 16:08   ` [PATCH v3] common/cnxk: fix IRQ reconfiguration pbhagavatula
  1 sibling, 0 replies; 7+ messages in thread
From: Jerin Jacob @ 2024-09-23 15:47 UTC (permalink / raw)
  To: pbhagavatula
  Cc: jerinj, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Harman Kalra, dev

On Thu, Sep 19, 2024 at 11:33 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Unregister SSO device and NPA IRQs before resizing
> them.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>


# Add fixes: tag
# Change commit message to common/cnxk: fix...


> ---
> v2 Changes:
> - Reorder npa interrupt un-registration.
>
>  drivers/common/cnxk/roc_dev.c      | 16 +++++++---------
>  drivers/common/cnxk/roc_dev_priv.h |  2 ++
>  drivers/common/cnxk/roc_sso.c      |  7 +++++++
>  3 files changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
> index daf7684d8e..4a5787e7f9 100644
> --- a/drivers/common/cnxk/roc_dev.c
> +++ b/drivers/common/cnxk/roc_dev.c
> @@ -1017,8 +1017,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_dev, struct dev *dev)
>                            RVU_VF_INT_VEC_MBOX);
>  }
>
> -static void
> -mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
> +void
> +dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
>  {
>         if (dev_is_vf(dev))
>                 mbox_unregister_vf_irq(pci_dev, dev);
> @@ -1096,8 +1096,8 @@ roc_pf_vf_flr_irq(void *param)
>         }
>  }
>
> -static int
> -vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
> +void
> +dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
>  {
>         struct plt_intr_handle *intr_handle = pci_dev->intr_handle;
>         int i;
> @@ -1113,8 +1113,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
>
>         dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev,
>                            RVU_PF_INT_VEC_VFFLR1);
> -
> -       return 0;
>  }
>
>  int
> @@ -1600,7 +1598,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev)
>  iounmap:
>         dev_vf_mbase_put(pci_dev, vf_mbase);
>  mbox_unregister:
> -       mbox_unregister_irq(pci_dev, dev);
> +       dev_mbox_unregister_irq(pci_dev, dev);
>         if (dev->ops)
>                 plt_free(dev->ops);
>  mbox_fini:
> @@ -1636,10 +1634,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *pci_dev)
>         if (dev->lmt_mz)
>                 plt_memzone_free(dev->lmt_mz);
>
> -       mbox_unregister_irq(pci_dev, dev);
> +       dev_mbox_unregister_irq(pci_dev, dev);
>
>         if (!dev_is_vf(dev))
> -               vf_flr_unregister_irqs(pci_dev, dev);
> +               dev_vf_flr_unregister_irqs(pci_dev, dev);
>         /* Release PF - VF */
>         mbox = &dev->mbox_vfpf;
>         if (mbox->hwbase && mbox->dev)
> diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h
> index 50e12cbf17..df7dc222ed 100644
> --- a/drivers/common/cnxk/roc_dev_priv.h
> +++ b/drivers/common/cnxk/roc_dev_priv.h
> @@ -131,6 +131,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_handle);
>  int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t max_intr);
>
>  int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev);
> +void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev);
>  int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
> +void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
>
>  #endif /* _ROC_DEV_PRIV_H */
> diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c
> index 293b0c81a1..7d45b06dda 100644
> --- a/drivers/common/cnxk/roc_sso.c
> +++ b/drivers/common/cnxk/roc_sso.c
> @@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, uint16_t sso_vec_cnt)
>                 return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt);
>         }
>
> +       /* Before re-configuring unregister irqs */
>         npa_vec_cnt = (dev->npa.pci_dev == pci_dev) ? NPA_LF_INT_VEC_POISON + 1 : 0;
> +       if (npa_vec_cnt)
> +               npa_unregister_irqs(&dev->npa);
> +
> +       dev_mbox_unregister_irq(pci_dev, dev);
> +       if (!dev_is_vf(dev))
> +               dev_vf_flr_unregister_irqs(pci_dev, dev);
>
>         /* Re-configure to include SSO vectors */
>         rc = dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt + sso_vec_cnt);
> --
> 2.25.1
>

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

* [PATCH v3] common/cnxk: fix IRQ reconfiguration
  2024-09-19 18:02 ` [PATCH v2] " pbhagavatula
  2024-09-23 15:47   ` Jerin Jacob
@ 2024-09-29 16:08   ` pbhagavatula
  2024-10-01  8:25     ` Jerin Jacob
  2024-10-01 13:11     ` [PATCH v4] " pbhagavatula
  1 sibling, 2 replies; 7+ messages in thread
From: pbhagavatula @ 2024-09-29 16:08 UTC (permalink / raw)
  To: jerinj, sthotton, hkalra, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao
  Cc: dev, Pavan Nikhilesh, stable

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Unregister SSO device and NPA IRQs before resizing
IRQs to cleanup stale IRQ handles.

Fixes: 993107f0f440 ("common/cnxk: limit SSO interrupt allocation count")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
v2 Changes:
- Reorder npa interrupt un-registration.
v3 Changes:
- Update commit type to fixes.

 drivers/common/cnxk/roc_dev.c      | 16 +++++++---------
 drivers/common/cnxk/roc_dev_priv.h |  2 ++
 drivers/common/cnxk/roc_sso.c      |  7 +++++++
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index daf7684d8e..4a5787e7f9 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -1017,8 +1017,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 			   RVU_VF_INT_VEC_MBOX);
 }

-static void
-mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	if (dev_is_vf(dev))
 		mbox_unregister_vf_irq(pci_dev, dev);
@@ -1096,8 +1096,8 @@ roc_pf_vf_flr_irq(void *param)
 	}
 }

-static int
-vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	struct plt_intr_handle *intr_handle = pci_dev->intr_handle;
 	int i;
@@ -1113,8 +1113,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)

 	dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev,
 			   RVU_PF_INT_VEC_VFFLR1);
-
-	return 0;
 }

 int
@@ -1600,7 +1598,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev)
 iounmap:
 	dev_vf_mbase_put(pci_dev, vf_mbase);
 mbox_unregister:
-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);
 	if (dev->ops)
 		plt_free(dev->ops);
 mbox_fini:
@@ -1636,10 +1634,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *pci_dev)
 	if (dev->lmt_mz)
 		plt_memzone_free(dev->lmt_mz);

-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);

 	if (!dev_is_vf(dev))
-		vf_flr_unregister_irqs(pci_dev, dev);
+		dev_vf_flr_unregister_irqs(pci_dev, dev);
 	/* Release PF - VF */
 	mbox = &dev->mbox_vfpf;
 	if (mbox->hwbase && mbox->dev)
diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h
index 50e12cbf17..df7dc222ed 100644
--- a/drivers/common/cnxk/roc_dev_priv.h
+++ b/drivers/common/cnxk/roc_dev_priv.h
@@ -131,6 +131,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_handle);
 int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t max_intr);

 int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev);
 int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev);

 #endif /* _ROC_DEV_PRIV_H */
diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c
index 293b0c81a1..7d45b06dda 100644
--- a/drivers/common/cnxk/roc_sso.c
+++ b/drivers/common/cnxk/roc_sso.c
@@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, uint16_t sso_vec_cnt)
 		return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt);
 	}

+	/* Before re-configuring unregister irqs */
 	npa_vec_cnt = (dev->npa.pci_dev == pci_dev) ? NPA_LF_INT_VEC_POISON + 1 : 0;
+	if (npa_vec_cnt)
+		npa_unregister_irqs(&dev->npa);
+
+	dev_mbox_unregister_irq(pci_dev, dev);
+	if (!dev_is_vf(dev))
+		dev_vf_flr_unregister_irqs(pci_dev, dev);

 	/* Re-configure to include SSO vectors */
 	rc = dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt + sso_vec_cnt);
--
2.25.1


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

* Re: [PATCH v3] common/cnxk: fix IRQ reconfiguration
  2024-09-29 16:08   ` [PATCH v3] common/cnxk: fix IRQ reconfiguration pbhagavatula
@ 2024-10-01  8:25     ` Jerin Jacob
  2024-10-01 13:11     ` [PATCH v4] " pbhagavatula
  1 sibling, 0 replies; 7+ messages in thread
From: Jerin Jacob @ 2024-10-01  8:25 UTC (permalink / raw)
  To: pbhagavatula
  Cc: jerinj, sthotton, hkalra, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, dev, stable

On Sun, Sep 29, 2024 at 9:38 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Unregister SSO device and NPA IRQs before resizing
> IRQs to cleanup stale IRQ handles.
>
> Fixes: 993107f0f440 ("common/cnxk: limit SSO interrupt allocation count")
> Cc: stable@dpdk.org
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
> v2 Changes:
> - Reorder npa interrupt un-registration.
> v3 Changes:
> - Update commit type to fixes.


Could you rebase to next-net-mrvl/for-main

[for-main]dell[dpdk-next-net-mrvl] $ git pw series apply 33173
Failed to apply patch:
Applying: common/cnxk: fix IRQ reconfiguration
Using index info to reconstruct a base tree...
M       drivers/common/cnxk/roc_dev.c
M       drivers/common/cnxk/roc_dev_priv.h
Falling back to patching base and 3-way merge...
Auto-merging drivers/common/cnxk/roc_dev_priv.h
Auto-merging drivers/common/cnxk/roc_dev.c
CONFLICT (content): Merge conflict in drivers/common/cnxk/roc_dev.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 common/cnxk: fix IRQ reconfiguration

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

* [PATCH v4] common/cnxk: fix IRQ reconfiguration
  2024-09-29 16:08   ` [PATCH v3] common/cnxk: fix IRQ reconfiguration pbhagavatula
  2024-10-01  8:25     ` Jerin Jacob
@ 2024-10-01 13:11     ` pbhagavatula
  2024-10-03 11:25       ` Jerin Jacob
  1 sibling, 1 reply; 7+ messages in thread
From: pbhagavatula @ 2024-10-01 13:11 UTC (permalink / raw)
  To: jerinj, hkalra, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao
  Cc: dev, Pavan Nikhilesh, stable

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Unregister SSO device and NPA IRQs before resizing
IRQs to cleanup stale IRQ handles.

Fixes: 993107f0f440 ("common/cnxk: limit SSO interrupt allocation count")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
v2 Changes:
- Reorder npa interrupt un-registration.
v3 Changes:
- Update commit type to fixes.
v4 Changes:
- Rebase to next-net-mrvl.

 drivers/common/cnxk/roc_dev.c      | 16 +++++++---------
 drivers/common/cnxk/roc_dev_priv.h |  2 ++
 drivers/common/cnxk/roc_sso.c      |  7 +++++++
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index f987410118..399ef94265 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -1047,8 +1047,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 	dev_irq_unregister(intr_handle, roc_pf_vf_mbox_irq, dev, RVU_VF_INT_VEC_MBOX);
 }

-static void
-mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	if (dev_is_vf(dev))
 		mbox_unregister_vf_irq(pci_dev, dev);
@@ -1126,8 +1126,8 @@ roc_pf_vf_flr_irq(void *param)
 	}
 }

-static int
-vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
 {
 	struct plt_intr_handle *intr_handle = pci_dev->intr_handle;
 	int i;
@@ -1143,8 +1143,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)

 	dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev,
 			   RVU_PF_INT_VEC_VFFLR1);
-
-	return 0;
 }

 int
@@ -1723,7 +1721,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev)
 iounmap:
 	dev_vf_mbase_put(pci_dev, vf_mbase);
 mbox_unregister:
-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);
 	if (dev->ops)
 		plt_free(dev->ops);
 mbox_fini:
@@ -1761,10 +1759,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *pci_dev)
 	if (dev->lmt_mz)
 		plt_memzone_free(dev->lmt_mz);

-	mbox_unregister_irq(pci_dev, dev);
+	dev_mbox_unregister_irq(pci_dev, dev);

 	if (!dev_is_vf(dev)) {
-		vf_flr_unregister_irqs(pci_dev, dev);
+		dev_vf_flr_unregister_irqs(pci_dev, dev);
 		/* Releasing memory allocated for mbox region */
 		if (dev->vf_mbox_mz)
 			plt_memzone_free(dev->vf_mbox_mz);
diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h
index 434e165b56..5ab4f72f8f 100644
--- a/drivers/common/cnxk/roc_dev_priv.h
+++ b/drivers/common/cnxk/roc_dev_priv.h
@@ -170,6 +170,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_handle);
 int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t max_intr);

 int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev);
 int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev);

 #endif /* _ROC_DEV_PRIV_H */
diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c
index 293b0c81a1..7d45b06dda 100644
--- a/drivers/common/cnxk/roc_sso.c
+++ b/drivers/common/cnxk/roc_sso.c
@@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, uint16_t sso_vec_cnt)
 		return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt);
 	}

+	/* Before re-configuring unregister irqs */
 	npa_vec_cnt = (dev->npa.pci_dev == pci_dev) ? NPA_LF_INT_VEC_POISON + 1 : 0;
+	if (npa_vec_cnt)
+		npa_unregister_irqs(&dev->npa);
+
+	dev_mbox_unregister_irq(pci_dev, dev);
+	if (!dev_is_vf(dev))
+		dev_vf_flr_unregister_irqs(pci_dev, dev);

 	/* Re-configure to include SSO vectors */
 	rc = dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt + sso_vec_cnt);
--
2.25.1


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

* Re: [PATCH v4] common/cnxk: fix IRQ reconfiguration
  2024-10-01 13:11     ` [PATCH v4] " pbhagavatula
@ 2024-10-03 11:25       ` Jerin Jacob
  0 siblings, 0 replies; 7+ messages in thread
From: Jerin Jacob @ 2024-10-03 11:25 UTC (permalink / raw)
  To: pbhagavatula
  Cc: jerinj, hkalra, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, dev, stable

On Tue, Oct 1, 2024 at 6:41 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Unregister SSO device and NPA IRQs before resizing
> IRQs to cleanup stale IRQ handles.
>
> Fixes: 993107f0f440 ("common/cnxk: limit SSO interrupt allocation count")
> Cc: stable@dpdk.org
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Applied to dpdk-next-net-mrvl/for-main. Thanks

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

end of thread, other threads:[~2024-10-03 11:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-06 14:25 [PATCH] common/cnxk: unregister IRQ before reconfigure pbhagavatula
2024-09-19 18:02 ` [PATCH v2] " pbhagavatula
2024-09-23 15:47   ` Jerin Jacob
2024-09-29 16:08   ` [PATCH v3] common/cnxk: fix IRQ reconfiguration pbhagavatula
2024-10-01  8:25     ` Jerin Jacob
2024-10-01 13:11     ` [PATCH v4] " pbhagavatula
2024-10-03 11:25       ` 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).