virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] eni_vdpa: improve IRQ error logging for config vector
@ 2025-10-18 19:15 Alok Tiwari
  2025-11-17 10:10 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Alok Tiwari @ 2025-10-18 19:15 UTC (permalink / raw)
  To: wuzongyong, arnd, eperezma, mst, jasowang, xuanzhuo,
	virtualization, alok.a.tiwari
  Cc: alok.a.tiwarilinux

In eni_vdpa_request_irq(), the error message for requesting the config
vector IRQ prints the loop index i. However, i is only valid inside the
queue setup loop. At the point of requesting the config IRQ, i has gone
out of scope and does not correspond to any vector, which makes the log
misleading.

Update the error message to print the actual return code ret instead of
the stale i value.

Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/vdpa/alibaba/eni_vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/alibaba/eni_vdpa.c b/drivers/vdpa/alibaba/eni_vdpa.c
index e476504db0c8..e3b20ea7c423 100644
--- a/drivers/vdpa/alibaba/eni_vdpa.c
+++ b/drivers/vdpa/alibaba/eni_vdpa.c
@@ -196,7 +196,7 @@ static int eni_vdpa_request_irq(struct eni_vdpa *eni_vdpa)
 	ret = devm_request_irq(&pdev->dev, irq, eni_vdpa_config_handler, 0,
 			       eni_vdpa->msix_name, eni_vdpa);
 	if (ret) {
-		ENI_ERR(pdev, "failed to request irq for config vq %d\n", i);
+		ENI_ERR(pdev, "failed to request irq for config vector ret=%d\n", ret);
 		goto err;
 	}
 	vp_legacy_config_vector(ldev, queues);
-- 
2.50.1


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

* Re: [PATCH] eni_vdpa: improve IRQ error logging for config vector
  2025-10-18 19:15 [PATCH] eni_vdpa: improve IRQ error logging for config vector Alok Tiwari
@ 2025-11-17 10:10 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2025-11-17 10:10 UTC (permalink / raw)
  To: Alok Tiwari
  Cc: wuzongyong, arnd, eperezma, jasowang, xuanzhuo, virtualization,
	alok.a.tiwarilinux

On Sat, Oct 18, 2025 at 12:15:00PM -0700, Alok Tiwari wrote:
> In eni_vdpa_request_irq(), the error message for requesting the config
> vector IRQ prints the loop index i. However, i is only valid inside the
> queue setup loop. At the point of requesting the config IRQ, i has gone
> out of scope and does not correspond to any vector, which makes the log
> misleading.

It's not that it has gone out of scope - it equals queues.
which happens to be the right thing to report:
        irq = pci_irq_vector(pdev, queues);

both the code and the message are confusing though,
I agree.



> Update the error message to print the actual return code ret instead of
> the stale i value.
> 
> Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> ---
>  drivers/vdpa/alibaba/eni_vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/alibaba/eni_vdpa.c b/drivers/vdpa/alibaba/eni_vdpa.c
> index e476504db0c8..e3b20ea7c423 100644
> --- a/drivers/vdpa/alibaba/eni_vdpa.c
> +++ b/drivers/vdpa/alibaba/eni_vdpa.c
> @@ -196,7 +196,7 @@ static int eni_vdpa_request_irq(struct eni_vdpa *eni_vdpa)
>  	ret = devm_request_irq(&pdev->dev, irq, eni_vdpa_config_handler, 0,
>  			       eni_vdpa->msix_name, eni_vdpa);
>  	if (ret) {
> -		ENI_ERR(pdev, "failed to request irq for config vq %d\n", i);
> +		ENI_ERR(pdev, "failed to request irq for config vector ret=%d\n", ret);


you do not really need to print err it is reported up the stack.

I would probably go with:

		ENI_ERR(pdev, "failed to request irq %d for config\n", queues);



>  		goto err;
>  	}
>  	vp_legacy_config_vector(ldev, queues);
> -- 
> 2.50.1


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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18 19:15 [PATCH] eni_vdpa: improve IRQ error logging for config vector Alok Tiwari
2025-11-17 10:10 ` Michael S. Tsirkin

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