summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Conole <aconole@redhat.com>2019-08-08 13:38:35 -0400
committerThomas Monjalon <thomas@monjalon.net>2019-09-13 17:00:19 +0200
commit73afc9df00d8ba4ff58d4a7a86691ca10520d462 (patch)
treeefb67fa72325818c97a2b0477f8f8502c8c310f2
parenta6069abe0288371f67fa5dffa81e4ec8b6bcf761 (diff)
downloaddpdk-73afc9df00d8ba4ff58d4a7a86691ca10520d462.zip
dpdk-73afc9df00d8ba4ff58d4a7a86691ca10520d462.tar.gz
dpdk-73afc9df00d8ba4ff58d4a7a86691ca10520d462.tar.xz
test/interrupt: account for race with callback
Because the eal interrupt framework can race when invoking the callback and a separate unregister call, the test needs to accommodate the chance that the two collide. Do this by checking the return value of unregister against the race-condition flag (EAGAIN). Fixes: f1a6c22424ce ("app/test: update interrupts test") Cc: stable@dpdk.org Signed-off-by: Aaron Conole <aconole@redhat.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
-rw-r--r--app/test/test_interrupts.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/test/test_interrupts.c b/app/test/test_interrupts.c
index d8c2d81..233b14a 100644
--- a/app/test/test_interrupts.c
+++ b/app/test/test_interrupts.c
@@ -370,9 +370,13 @@ test_interrupt_full_path_check(enum test_interrupt_handle_type intr_type)
rte_delay_ms(TEST_INTERRUPT_CHECK_INTERVAL);
rte_delay_ms(TEST_INTERRUPT_CHECK_INTERVAL);
- if (rte_intr_callback_unregister(&test_intr_handle,
- test_interrupt_callback, &test_intr_handle) < 0)
- return -1;
+ while ((count =
+ rte_intr_callback_unregister(&test_intr_handle,
+ test_interrupt_callback,
+ &test_intr_handle)) < 0) {
+ if (count != -EAGAIN)
+ return -1;
+ }
if (flag == 0) {
printf("callback has not been called\n");