From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0FF39A0C42; Wed, 28 Apr 2021 15:11:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F49640697; Wed, 28 Apr 2021 15:11:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 8738E40147 for ; Wed, 28 Apr 2021 15:11:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619615483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MNm2ifvjDqXlJRbxOMDOcr4/6fbCz4WhDRx+aA3frtk=; b=O/ggRNwMxtn8Vc5yjsb1XNuuYbgUCRsk453SvfX47kolADVLe6reDe5hqdqlWQqsr37FFy ZoPIIxRXRF1OvGzK8xF6zYW+WdMnuzTF5Npx4pfp0kSO1n9mslgGZOg2K3735ekyeaLpeN zirVU+6waRz7pQMgXleL1YXaonoa8+o= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-597-75xRRRGsMsyfFt3w5TKO9w-1; Wed, 28 Apr 2021 09:11:21 -0400 X-MC-Unique: 75xRRRGsMsyfFt3w5TKO9w-1 Received: by mail-vk1-f200.google.com with SMTP id l185-20020a1f57c20000b02901d909b5e911so10676483vkb.15 for ; Wed, 28 Apr 2021 06:11:21 -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=MNm2ifvjDqXlJRbxOMDOcr4/6fbCz4WhDRx+aA3frtk=; b=artZ2I/aR+SlXGjuNu1Vjd0Ed0YklpQjw2k19S/X6NJWmWC4E17hF6ytYrKwfcxGC8 QcqXZ1xPYQbewbJOwGkgqMrDS4qVzVSMSpmxaISdkRoikdUmubCsMnLmsh3hsDNehGVp 5+SykuSi+ztiqcon2ysr5INjEjYgkz2X8WgKsqatRAikxqe4kA0/9AC9X7tSGjZGeRG5 uHgBGmF95AuKGy1eBdnJPFVS5uLi3/ptCgySSFcQ0/qncjn1QMZBzyPxA+hvF8olUGnL i5toSvmPdwiDiN1R6zLjMX73cRgAIcdANUp0b6O+i/JUzrlUtZqsWiiua3I+QB3TMIrt GLMw== X-Gm-Message-State: AOAM531iUVnV5qTvKoXcBX8zLrTCO6YNAZk1FpjV+UTL3LhyQtMFAGXu ZJ0FjRaRrffu71plQ7xE7v0oSUmw3PAfcYMW2RMzAHJnjeupTMlAXmCjBVFglERkO1evSN6bqUB tPTZcGDfCeSDgYSdt+TU= X-Received: by 2002:ab0:60d5:: with SMTP id g21mr23672396uam.53.1619615481302; Wed, 28 Apr 2021 06:11:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWqTNjYm4MRvdsNPp/JaN9xXCPY1NF4yUvFA5O3Y3H5DDGPcrpz6cyZ+Z9HtmSl803Z4KbBshF4De6S20tvnc= X-Received: by 2002:ab0:60d5:: with SMTP id g21mr23672371uam.53.1619615481049; Wed, 28 Apr 2021 06:11:21 -0700 (PDT) MIME-Version: 1.0 References: <20210426163310.1043438-1-kda@semihalf.com> In-Reply-To: <20210426163310.1043438-1-kda@semihalf.com> From: David Marchand Date: Wed, 28 Apr 2021 15:11:10 +0200 Message-ID: To: Stanislaw Kardach Cc: David Hunt , dev , upstream@semihalf.com, Lukasz Wojciechowski Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [RFC PATCH] test/distributor: fix burst flush on worker quit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 Mon, Apr 26, 2021 at 6:33 PM Stanislaw Kardach wrote: > > While working on RISC-V port I have encountered a situation where worker > threads get stuck in the rte_distributor_return_pkt() function in the > burst test. > After investigation some of the threads enter this function with > flag RTE_DISTRIB_GET_BUF set in the d->retptr64[0]. At the same time > main thread has already passed rte_distributor_process() so nobody will > clear this flag and hence workers can't return. > > What I've noticed is that adding a flush just after the last _process(), > similarly to how quit_workers() function is written in the > test_distributor.c fixes the issue. > Additionally the issue disappears when I remove the rdtsc delay code > inside the rte_distributor_request_pkt(). > However I can't get this to reproduce on x86 (even with SIMD forced > off) and with artificial delays, which is why I wonder whether I'm not > actually hiding some other issue. > > Looking at the implementation of the distributor, it is based on > __atomic_* builtins and the only platform related bit in the fast-path > is the rte_rdtsc() and rte_pause(). There may be some issues in the > toolchain (I've tried so far with the Ubuntu one - 10.2.0-8ubuntu1). > I should add that all unit tests for distributor are passing so either > there's some coverage corner case or the implementation works on RISC-V. > As for RDTSC I'm using a sleep-stable time counter with 1MHz frequency > and switching to high resolution cycle counter also removes the issue > but that's the same as removing the rdtsc delay as mentioned above. > > I'd love to hear from You if this fix makes any sense. > > While modifying this test, I've also pulled in a fix from > test_distributor.c which ensures that each thread gets his own wakeup > packet as it's possible that when sending a burst of packets, they won't > be spread over all the workers. Do we have two fixes in a single patch? This is ok if both point at the same originating commit, but else, we need two patches with proper Fixes: line. I see we have reviews, can you submit non-rfc patches? Thanks. -- David Marchand