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 4302FA0A0C for ; Tue, 3 Aug 2021 14:22:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D22B411A7; Tue, 3 Aug 2021 14:22:51 +0200 (CEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id 28AAC40E3C for ; Tue, 3 Aug 2021 14:22:50 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id h24-20020a1ccc180000b029022e0571d1a0so1998534wmb.5 for ; Tue, 03 Aug 2021 05:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QIY2mf4SUGoS7IsrzoIfMFEAsilEUin+HKBm5L2+RpQ=; b=KTotPFST3g66UiGKPL6F61t5PI4uPTNB1m5px7/fe2wCXlpfYzMXkR6iI26wDlzb9x BpH0Kp0VGvvBLaeSxR021I/KOnGrDxJ1nz8y+iXZZwVxDjZkpJmYH/9Nd3kfBj/Tl9bv Oe9Q5BDjslh8MZwXIwWcl7sk7XyIS5eSlz6eT9n4O3XrLEcGlMeJ6BhY43DWWjt5w/B8 vJaxSUcSkMRDh5reWJpiXutkpBaarX2CAnvWH010xo+Qf27o8Ed4vHwbrC5FLgRY3SSW MYVZZTTeLQ6ZVx1RaVLvW/gwh2Tm07ab4DkKhOaHsSxNFy8FRnlP0ZwN8VD1g7ZW6fdi QHDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QIY2mf4SUGoS7IsrzoIfMFEAsilEUin+HKBm5L2+RpQ=; b=DhynLIc3IqOB9usqhvwjte4SEc9EprXAGdmSxIggn9PvdtJp/Q4YWV2Cw1ZJfdcWC/ no2WonxiJIcAA5vuJ/44BpyKwT/1Z3PM2x3DmWpNKpauhkxWob+0zPekrO5tVBhb6T/t CFPm7VeZAuz+n3AEeFoDS1YnnvRp8fXtpiDo2uqDlgIdq9aLoA343I7UDpYha2ii68C6 xqSG+3VAWAh6nRfQwu7GFmkUZQK5kHQXFwkZE4NokyvHgypek+CYQoxnxC4VJqCaMGzC Qa54pkQXtfXtBxYirRnq6e6JmRyIeAF4g/33jiU2UgDqgzci3GBh7HLwtsx/0bVlx0gB ZLLw== X-Gm-Message-State: AOAM531dY625W1g05dsZwd3OoPAJjmkaqDH7fOuSXPgH/44RjDz6GLtu ECfl5oJ+wXZcCLC2sR5U35E= X-Google-Smtp-Source: ABdhPJy5lNo7p2P9Xq+z9VCHUAFtG4TqnryQu1m+wHD2D5tZR1Hp3XfL66pQ1OgLsB5dCN1b99svaA== X-Received: by 2002:a05:600c:4a12:: with SMTP id c18mr4023070wmp.3.1627993369917; Tue, 03 Aug 2021 05:22:49 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id 12sm2486709wme.17.2021.08.03.05.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 05:22:49 -0700 (PDT) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: dpdk stable Date: Tue, 3 Aug 2021 13:22:00 +0100 Message-Id: <20210803122214.1094992-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210803122214.1094992-1-luca.boccassi@gmail.com> References: <20210726135322.149850-59-luca.boccassi@gmail.com> <20210803122214.1094992-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix timestamp initialization on empty clock queue' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/05/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f46e2c750ac23a6c6f53b64c99c76a6c02111971 Thanks. Luca Boccassi --- >From f46e2c750ac23a6c6f53b64c99c76a6c02111971 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Wed, 28 Jul 2021 17:23:35 +0300 Subject: [PATCH] net/mlx5: fix timestamp initialization on empty clock queue [ upstream commit dab07e489cd5be47a017e0b8558b3fe3ee03b979 ] The committing completions by clock queue might be delayed after queue initialization is done and the only Clock Queue completion entry (CQE) might keep the invalid status till the CQE first update happens. The mlx5_txpp_update_timestamp() wrongly recognized invalid status as error and reported about lost synchronization. The patch recognizes the invalid status as "not updated yet" and accurate scheduling initialization routine waits till CQE first update happens. Some collateral typos in comment are fixed as well. Fixes: 77522be0a56d ("net/mlx5: introduce clock queue service routine") Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_txpp.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c index 72b0690913..cf11048160 100644 --- a/drivers/net/mlx5/mlx5_txpp.c +++ b/drivers/net/mlx5/mlx5_txpp.c @@ -676,8 +676,8 @@ mlx5_atomic_read_cqe(rte_int128_t *from, rte_int128_t *ts) { /* * The only CQE of Clock Queue is being continuously - * update by hardware with soecified rate. We have to - * read timestump and WQE completion index atomically. + * updated by hardware with specified rate. We must + * read timestamp and WQE completion index atomically. */ #if defined(RTE_ARCH_X86_64) rte_int128_t src; @@ -738,15 +738,24 @@ mlx5_txpp_update_timestamp(struct mlx5_dev_ctx_shared *sh) } to; uint64_t ts; uint16_t ci; + uint8_t opcode; static_assert(sizeof(struct mlx5_cqe_ts) == sizeof(rte_int128_t), "Wrong timestamp CQE part size"); mlx5_atomic_read_cqe((rte_int128_t *)&cqe->timestamp, &to.u128); - if (to.cts.op_own >> 4) { - DRV_LOG(DEBUG, "Clock Queue error sync lost."); - __atomic_fetch_add(&sh->txpp.err_clock_queue, + opcode = MLX5_CQE_OPCODE(to.cts.op_own); + if (opcode) { + if (opcode != MLX5_CQE_INVALID) { + /* + * Commit the error state if and only if + * we have got at least one actual completion. + */ + DRV_LOG(DEBUG, + "Clock Queue error sync lost (%X).", opcode); + __atomic_fetch_add(&sh->txpp.err_clock_queue, 1, __ATOMIC_RELAXED); - sh->txpp.sync_lost = 1; + sh->txpp.sync_lost = 1; + } return; } ci = rte_be_to_cpu_16(to.cts.wqe_counter); -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-03 12:35:08.701055993 +0100 +++ 0011-net-mlx5-fix-timestamp-initialization-on-empty-clock.patch 2021-08-03 12:35:08.230819049 +0100 @@ -1 +1 @@ -From dab07e489cd5be47a017e0b8558b3fe3ee03b979 Mon Sep 17 00:00:00 2001 +From f46e2c750ac23a6c6f53b64c99c76a6c02111971 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit dab07e489cd5be47a017e0b8558b3fe3ee03b979 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index d90399afb5..4f6da9f2d1 100644 +index 72b0690913..cf11048160 100644 @@ -32 +33 @@ -@@ -530,8 +530,8 @@ mlx5_atomic_read_cqe(rte_int128_t *from, rte_int128_t *ts) +@@ -676,8 +676,8 @@ mlx5_atomic_read_cqe(rte_int128_t *from, rte_int128_t *ts) @@ -43 +44 @@ -@@ -592,13 +592,22 @@ mlx5_txpp_update_timestamp(struct mlx5_dev_ctx_shared *sh) +@@ -738,15 +738,24 @@ mlx5_txpp_update_timestamp(struct mlx5_dev_ctx_shared *sh) @@ -48,0 +50,2 @@ + static_assert(sizeof(struct mlx5_cqe_ts) == sizeof(rte_int128_t), + "Wrong timestamp CQE part size");