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 F1ACBA034E for ; Mon, 21 Feb 2022 16:37:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC485410F2; Mon, 21 Feb 2022 16:37:35 +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 30268410F0 for ; Mon, 21 Feb 2022 16:37:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645457853; 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=l2fb4pUk9Rg9SRF8TaejGHROUa0YU1ybbd6otZ0U2eo=; b=X8gZRSkvDwazQIL3D37KXJUiD0yhq+mxb9n7rCKClAX56lBWpfxOcTZs43Qj+Lq8qrfKWH vBhz1POq2UHwj40FPUPjiQm2Bp+eBk7wkRB7MfdqhoCNpzCd1zcX6bVrfJ+knyjHVEWBaD iyXUV1dNmd6cawUFtrj2GbY6qC28jz0= 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-572-JCuWlyFtNlesWDWOqliadw-1; Mon, 21 Feb 2022 10:37:30 -0500 X-MC-Unique: JCuWlyFtNlesWDWOqliadw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 450E4814243; Mon, 21 Feb 2022 15:37:29 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39BA57E131; Mon, 21 Feb 2022 15:37:28 +0000 (UTC) From: Kevin Traynor To: Pavan Nikhilesh Cc: Jerin Jacob , dpdk stable Subject: patch 'common/cnxk: add workaround for vWQE flush' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:33:26 +0000 Message-Id: <20220221153625.152324-17-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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 02/26/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/7ee503d33f87a935ccf18c3382a6af9a12a2097f Thanks. Kevin --- >From 7ee503d33f87a935ccf18c3382a6af9a12a2097f Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Tue, 14 Dec 2021 02:24:23 +0530 Subject: [PATCH] common/cnxk: add workaround for vWQE flush [ upstream commit e9d33faa8cf7449869588a88673b34bc0aaff657 ] Due to an errata writing to vWQE flush register might hang NIX. Add workaround for vWQE flush hang by waiting for the max coalescing timeout to flush out any pending vWQEs. Fixes: ee48f711f3b0 ("common/cnxk: support NIX inline inbound and outbound setup") Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- drivers/common/cnxk/roc_nix_inl.c | 3 +-- drivers/common/cnxk/roc_nix_inl_dev.c | 12 ++++++++++++ drivers/common/cnxk/roc_nix_inl_priv.h | 1 + drivers/common/cnxk/roc_nix_priv.h | 1 + drivers/common/cnxk/roc_nix_queue.c | 19 +++++++++++++++++-- 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c index f0fc690417..e8981c4aa4 100644 --- a/drivers/common/cnxk/roc_nix_inl.c +++ b/drivers/common/cnxk/roc_nix_inl.c @@ -596,6 +596,5 @@ roc_nix_inl_dev_rq_put(struct roc_nix_rq *rq) /* Flush NIX LF for CN10K */ - if (roc_model_is_cn10k()) - plt_write64(0, inl_dev->nix_base + NIX_LF_OP_VWQE_FLUSH); + nix_rq_vwqe_flush(rq, inl_dev->vwqe_interval); return rc; diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c index a0fe6ecd82..10912a6c93 100644 --- a/drivers/common/cnxk/roc_nix_inl_dev.c +++ b/drivers/common/cnxk/roc_nix_inl_dev.c @@ -347,4 +347,5 @@ nix_inl_nix_setup(struct nix_inl_dev *inl_dev) struct nix_lf_alloc_rsp *rsp; struct nix_lf_alloc_req *req; + struct nix_hw_info *hw_info; size_t inb_sa_sz; int i, rc = -ENOSPC; @@ -383,4 +384,15 @@ nix_inl_nix_setup(struct nix_inl_dev *inl_dev) inl_dev->cints = rsp->cints; + /* Get VWQE info if supported */ + if (roc_model_is_cn10k()) { + mbox_alloc_msg_nix_get_hw_info(mbox); + rc = mbox_process_msg(mbox, (void *)&hw_info); + if (rc) { + plt_err("Failed to get HW info, rc=%d", rc); + goto lf_free; + } + inl_dev->vwqe_interval = hw_info->vwqe_delay; + } + /* Register nix interrupts */ rc = nix_inl_nix_register_irqs(inl_dev); diff --git a/drivers/common/cnxk/roc_nix_inl_priv.h b/drivers/common/cnxk/roc_nix_inl_priv.h index 3dc526f929..be53a3fa81 100644 --- a/drivers/common/cnxk/roc_nix_inl_priv.h +++ b/drivers/common/cnxk/roc_nix_inl_priv.h @@ -36,4 +36,5 @@ struct nix_inl_dev { uint8_t lf_tx_stats; uint8_t lf_rx_stats; + uint16_t vwqe_interval; uint16_t cints; uint16_t qints; diff --git a/drivers/common/cnxk/roc_nix_priv.h b/drivers/common/cnxk/roc_nix_priv.h index 04575af295..deb2a6ba11 100644 --- a/drivers/common/cnxk/roc_nix_priv.h +++ b/drivers/common/cnxk/roc_nix_priv.h @@ -378,4 +378,5 @@ int nix_rq_ena_dis(struct dev *dev, struct roc_nix_rq *rq, bool enable); int nix_tm_bp_config_get(struct roc_nix *roc_nix, bool *is_enabled); int nix_tm_bp_config_set(struct roc_nix *roc_nix, bool enable); +void nix_rq_vwqe_flush(struct roc_nix_rq *rq, uint16_t vwqe_interval); /* diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c index c8c8401d81..d5f6813e69 100644 --- a/drivers/common/cnxk/roc_nix_queue.c +++ b/drivers/common/cnxk/roc_nix_queue.c @@ -29,4 +29,20 @@ nix_qsize_clampup(uint32_t val) } +void +nix_rq_vwqe_flush(struct roc_nix_rq *rq, uint16_t vwqe_interval) +{ + uint64_t wait_ns; + + if (!roc_model_is_cn10k()) + return; + /* Due to HW errata writes to VWQE_FLUSH might hang, so instead + * wait for max vwqe timeout interval. + */ + if (rq->vwqe_ena) { + wait_ns = rq->vwqe_wait_tmo * (vwqe_interval + 1) * 100; + plt_delay_us((wait_ns / 1E3) + 1); + } +} + int nix_rq_ena_dis(struct dev *dev, struct roc_nix_rq *rq, bool enable) @@ -67,7 +83,6 @@ roc_nix_rq_ena_dis(struct roc_nix_rq *rq, bool enable) rc = nix_rq_ena_dis(&nix->dev, rq, enable); + nix_rq_vwqe_flush(rq, nix->vwqe_interval); - if (roc_model_is_cn10k()) - plt_write64(rq->qid, nix->base + NIX_LF_OP_VWQE_FLUSH); return rc; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:45.043767299 +0000 +++ 0017-common-cnxk-add-workaround-for-vWQE-flush.patch 2022-02-21 15:22:44.042704015 +0000 @@ -1 +1 @@ -From e9d33faa8cf7449869588a88673b34bc0aaff657 Mon Sep 17 00:00:00 2001 +From 7ee503d33f87a935ccf18c3382a6af9a12a2097f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e9d33faa8cf7449869588a88673b34bc0aaff657 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org