[v4] eal: read data buffer on RTE_INTR_HANDLE_VFIO_REQ

Message ID 20210824095556.740201-1-maciej.szwed@intel.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series [v4] eal: read data buffer on RTE_INTR_HANDLE_VFIO_REQ |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-x86_64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-unit-testing fail Testing issues

Commit Message

Maciej Szwed Aug. 24, 2021, 9:55 a.m. UTC
  We should call read() on RTE_INTR_HANDLE_VFIO_REQ event
to confirm that event.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
---
 lib/eal/linux/eal_interrupts.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
  

Comments

David Marchand Oct. 14, 2021, 1:06 p.m. UTC | #1
On Tue, Aug 24, 2021 at 12:28 PM Maciej Szwed <maciej.szwed@intel.com> wrote:
>
> We should call read() on RTE_INTR_HANDLE_VFIO_REQ event
> to confirm that event.

Still no review, Cc: maintainers / contributors to this code.

This looks like a fix, if so, please add a Fixes: tag.
Should this be backported to stable branches?


>
> Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
> ---
>  lib/eal/linux/eal_interrupts.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
> index 22b3b7bcd9..dc42527344 100644
> --- a/lib/eal/linux/eal_interrupts.c
> +++ b/lib/eal/linux/eal_interrupts.c
> @@ -918,17 +918,16 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
>                         bytes_read = sizeof(buf.timerfd_num);
>                         break;
>  #ifdef VFIO_PRESENT
> +#ifdef HAVE_VFIO_DEV_REQ_INTERFACE
> +               case RTE_INTR_HANDLE_VFIO_REQ:
> +                       call = true;

Afaiu, call should be set only if the read() call succeeds.


> +#endif
> +                       /* fall through */
>                 case RTE_INTR_HANDLE_VFIO_MSIX:
>                 case RTE_INTR_HANDLE_VFIO_MSI:
>                 case RTE_INTR_HANDLE_VFIO_LEGACY:
>                         bytes_read = sizeof(buf.vfio_intr_count);
>                         break;
> -#ifdef HAVE_VFIO_DEV_REQ_INTERFACE
> -               case RTE_INTR_HANDLE_VFIO_REQ:
> -                       bytes_read = 0;
> -                       call = true;
> -                       break;
> -#endif
>  #endif
>                 case RTE_INTR_HANDLE_VDEV:
>                 case RTE_INTR_HANDLE_EXT:
> --
> 2.27.0
>
  

Patch

diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 22b3b7bcd9..dc42527344 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -918,17 +918,16 @@  eal_intr_process_interrupts(struct epoll_event *events, int nfds)
 			bytes_read = sizeof(buf.timerfd_num);
 			break;
 #ifdef VFIO_PRESENT
+#ifdef HAVE_VFIO_DEV_REQ_INTERFACE
+		case RTE_INTR_HANDLE_VFIO_REQ:
+			call = true;
+#endif
+			/* fall through */
 		case RTE_INTR_HANDLE_VFIO_MSIX:
 		case RTE_INTR_HANDLE_VFIO_MSI:
 		case RTE_INTR_HANDLE_VFIO_LEGACY:
 			bytes_read = sizeof(buf.vfio_intr_count);
 			break;
-#ifdef HAVE_VFIO_DEV_REQ_INTERFACE
-		case RTE_INTR_HANDLE_VFIO_REQ:
-			bytes_read = 0;
-			call = true;
-			break;
-#endif
 #endif
 		case RTE_INTR_HANDLE_VDEV:
 		case RTE_INTR_HANDLE_EXT: