From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 94FFDA00E6 for ; Fri, 9 Aug 2019 11:18:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACA652082; Fri, 9 Aug 2019 11:18:38 +0200 (CEST) Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by dpdk.org (Postfix) with ESMTP id 616D6DE3 for ; Fri, 9 Aug 2019 11:18:37 +0200 (CEST) Received: by mail-vs1-f68.google.com with SMTP id a186so8002605vsd.7 for ; Fri, 09 Aug 2019 02:18:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+H9ZTIKkJ6QvABpFmIt3DJrzxUxXbyRxVHH0UuI4wjY=; b=c7avl4ANTCLykRzC7UX6NFUYOjT5kqG/iU6yQHckDBsu1y+qrMMDoWs2YOOnLKiNkv ywlU4MaZpnmHx/bFAdwu15S6UAokRHGD39PgQzN6trFUbTPAKm/0S/Kac+dTcETYa6X2 TN0esGhqd/5gO13zP0qOqmr7wytB9iLK+JMn1zycyqC/ILK+xsx+9KPU7BGXePB00sA8 eH3C/Lq2V2rqSOJb+wiwIWpfhSnXaPxarmf3SPiTNS1VyteBuEy55TN8O5fuL6SXj0IN WCG58nKlZMKBgcPXAmyteTlR/lvumSpfV5VOhAcAfxg2J1VA+ac7QWtvcRj+DC2lSGGT 1qng== X-Gm-Message-State: APjAAAU2JTcG97zw54hZoz1/fHrDHtO1AHwG2NfTUkXczNt/ehTSSNlX uKz7RK5tZadgwWysUWLG5sgeDrS98yBy0ZbGt7YYGQ== X-Google-Smtp-Source: APXvYqx+EXQalFm8QOR1Jbyfs36tuH50muXm3QlTO+hOxr7JmR+kul+tGrqeXSRp1n7K76MAIkk0bg7EmiaTaePt0mY= X-Received: by 2002:a67:da99:: with SMTP id w25mr12709601vsj.141.1565342316725; Fri, 09 Aug 2019 02:18:36 -0700 (PDT) MIME-Version: 1.0 References: <20190808173835.5949-1-aconole@redhat.com> In-Reply-To: <20190808173835.5949-1-aconole@redhat.com> From: David Marchand Date: Fri, 9 Aug 2019 11:18:25 +0200 Message-ID: To: Aaron Conole Cc: dev , Jeff Guo , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] test/interrupt: account for race with callback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Aug 8, 2019 at 7:38 PM Aaron Conole wrote: > > 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") Not too sure about this tag, but anyway, this is old enough to apply to every stable releases we have. Cc: stable@dpdk.org ? > Signed-off-by: Aaron Conole > --- > NOTE: it's difficult to reproduce this race. I tried a bit, but have > only seen it sporadically. In Travis environment, the CPU > resource can be very limited and this test is quite racy. Managed to reproduce it: # time (log=/tmp/$$.log; while true; do echo interrupt_autotest |taskset -c 0-1 ./build-gcc-static/app/test/dpdk-test -l 0-1 >$log 2>&1; grep -q 'Test OK' $log || break; done; cat $log; rm -f $log) EAL: Detected 8 lcore(s) EAL: Detected 1 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'PA' EAL: No available hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... EAL: PCI device 0000:00:1f.6 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:15d7 net_e1000_em APP: HPET is not enabled, using TSC as default timer RTE>>interrupt_autotest Check unknown valid interrupt full path Check valid UIO interrupt full path Check valid device event interrupt full path count=-11 Resource temporarily unavailable failure occurred during checking valid device event interrupt full path Clearing for interrupt tests Test Failed RTE>> real 0m38.081s user 0m35.836s sys 0m2.171s > > app/test/test_interrupts.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/app/test/test_interrupts.c b/app/test/test_interrupts.c > index d8c2d8124..233b14a70 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"); > -- > 2.21.0 > With this patch, my loop has been running for more than 10 minutes now. Reviewed-by: David Marchand -- David Marchand