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 9D2A6A034F for ; Tue, 1 Mar 2022 11:43:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9421441C3B; Tue, 1 Mar 2022 11:43:54 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C435C426DC for ; Tue, 1 Mar 2022 11:43:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131432; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mo0kn38iu5j2pTHp16+DwP4MZwgW6nGRgiGiinqce80=; b=GHUf6CYBOBETgsHu6p1OsNPmjyNaP6W9cf5YIXM5Q0WdqW+F4SVsu0957AonS3tdT2AuvS GE7vnzYJPdna/VzYE61vkvOyC52chK7NjtkvJ+RST7ddhy7TXZ7BQohoG0HxW0OxYvOX9T qoLIEKB3ndRivSnWTIms4pMd7ehcS7Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-370-6WW9JzgWMgunoBC7Aa6isQ-1; Tue, 01 Mar 2022 05:43:49 -0500 X-MC-Unique: 6WW9JzgWMgunoBC7Aa6isQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 485ED824FA6; Tue, 1 Mar 2022 10:43:48 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7443A7554C; Tue, 1 Mar 2022 10:43:47 +0000 (UTC) From: Kevin Traynor To: Timothy McDaniel Cc: dpdk stable Subject: patch 'event/dlb2: poll HW CQ inflights before mapping queue' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:41:38 +0000 Message-Id: <20220301104300.334382-22-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/06/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/9a552423fd5d7a226fe55cdf509312c221e03e6a Thanks. Kevin --- >From 9a552423fd5d7a226fe55cdf509312c221e03e6a Mon Sep 17 00:00:00 2001 From: Timothy McDaniel Date: Wed, 16 Feb 2022 13:38:27 -0600 Subject: [PATCH] event/dlb2: poll HW CQ inflights before mapping queue [ upstream commit f6ed136aaea6b9f237670891df9c0b8a4b97d6d3 ] When attempting to link a port and queue immediately after unlinking, the CQ inflights may not all be processed. Poll the h/w register for outstanding inflights instead of reading once, in case the inflights are still being processed. Also return EBUSY if the inflight processing is not completed in a suitable amount of time. Fixes: 1857f1922ce2 ("event/dlb2: use new implementation of resource file") Signed-off-by: Timothy McDaniel --- drivers/event/dlb2/pf/base/dlb2_resource.c | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/event/dlb2/pf/base/dlb2_resource.c b/drivers/event/dlb2/pf/base/dlb2_resource.c index 3661b940c3..d4c49c2992 100644 --- a/drivers/event/dlb2/pf/base/dlb2_resource.c +++ b/drivers/event/dlb2/pf/base/dlb2_resource.c @@ -2357,4 +2357,6 @@ static bool dlb2_domain_finish_unmap_port(struct dlb2_hw *hw, u32 infl_cnt; int i; + const int max_iters = 1000; + const int iter_poll_us = 100; if (port->num_pending_removals == 0) @@ -2363,8 +2365,16 @@ static bool dlb2_domain_finish_unmap_port(struct dlb2_hw *hw, /* * The unmap requires all the CQ's outstanding inflights to be - * completed. + * completed. Poll up to 100ms. */ - infl_cnt = DLB2_CSR_RD(hw, DLB2_LSP_CQ_LDB_INFL_CNT(hw->ver, + for (i = 0; i < max_iters; i++) { + infl_cnt = DLB2_CSR_RD(hw, DLB2_LSP_CQ_LDB_INFL_CNT(hw->ver, port->id.phys_id)); + + if (DLB2_BITS_GET(infl_cnt, + DLB2_LSP_CQ_LDB_INFL_CNT_COUNT) == 0) + break; + rte_delay_us_sleep(iter_poll_us); + } + if (DLB2_BITS_GET(infl_cnt, DLB2_LSP_CQ_LDB_INFL_CNT_COUNT) > 0) return false; @@ -5317,4 +5327,5 @@ static void dlb2_log_map_qid(struct dlb2_hw *hw, * the domain is not configured. * EFAULT - Internal error (resp->status not set). + * EBUSY - The requested port has outstanding detach operations. */ int dlb2_hw_map_qid(struct dlb2_hw *hw, @@ -5357,6 +5368,10 @@ int dlb2_hw_map_qid(struct dlb2_hw *hw, * slot for this requested mapping. */ - if (port->num_pending_removals) - dlb2_domain_finish_unmap_port(hw, domain, port); + if (port->num_pending_removals) { + bool bool_ret; + bool_ret = dlb2_domain_finish_unmap_port(hw, domain, port); + if (!bool_ret) + return -EBUSY; + } ret = dlb2_verify_map_qid_slot_available(port, queue, resp); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-01 10:41:01.981030878 +0000 +++ 0022-event-dlb2-poll-HW-CQ-inflights-before-mapping-queue.patch 2022-03-01 10:41:01.269244091 +0000 @@ -1 +1 @@ -From f6ed136aaea6b9f237670891df9c0b8a4b97d6d3 Mon Sep 17 00:00:00 2001 +From 9a552423fd5d7a226fe55cdf509312c221e03e6a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f6ed136aaea6b9f237670891df9c0b8a4b97d6d3 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org