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 687E8A04F3 for ; Thu, 19 Dec 2019 15:36:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F96D330; Thu, 19 Dec 2019 15:36:44 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 29374330 for ; Thu, 19 Dec 2019 15:36:43 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id w15so6232762wru.4 for ; Thu, 19 Dec 2019 06:36:43 -0800 (PST) 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=aaYu0hUAW/TNrJkPikt8YArhKuZFW6unVtTopghLCjw=; b=CAlF2fTY1GSanB6htqYzZjyG7KayuCeFjEwDtIF13R8tSVyK8hgPh1k+7v547eHDw5 UyqNxhGk4/9NtaW4ZtnK0G57hdQvzCUA90CV33qn26Fp54dHG3z9fr4ewQv33AyiPFVk UIjHHzST9XjUKcSm9X+QklEPdXwzQD2kviH1PC7M2nofPvbzrvq0fRraPcGOqKtejdaG 9/ivlBOpfRTlOggrlkTulM47m4R2nw7gqOQNkzsg7UQ9UDL1lOk6l9ZQ028/3yKPs5P7 GVjAaQxfhKyWD3JVAlzvR/GjXk+//nq9UrEuvyqnxsWfplhYc8GVI3ucQD42lLR2p5FT ODQA== 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=aaYu0hUAW/TNrJkPikt8YArhKuZFW6unVtTopghLCjw=; b=jR522CP7kuPKJsMeyM0oriHVTobZ7JM4NphBByfaR6XYtrdQkLDD55MBto1vfaH97v WUYIEWhnetOyqv7sZx7r1M9C5sRE/DjlXMXfR4dgKkBAq+ibOsKdpeHxQnUV/rOVz2Jr UXCge/+m4ydTKdpfTjYML58jyqcxg4yHfMj1EDOxGmahqMYb2JXATlFs1TuAyVnp0zUp vy23S8D6yGExTZwVRlg2AfaJ7DagiuLasOyJGV78kfUPUnVCO8jMDpxpetgqnj40q9hd lRE6/6ZJpdydwOejCiEnRbQ85Tqo2XsMoTzKAmXITvLN8u4w6RoIvMTT6QyEdNHJPvMB BoKg== X-Gm-Message-State: APjAAAVNwgZr9J7NLcn5IL5KuLctBHsdfew6a4cqU5gnIQYeG1bsDoAD m7a02EgmzBsqUPHBY07PFZx/iT2GkTU= X-Google-Smtp-Source: APXvYqwtttWR7dDEExTEq8LBkS8/V8lbepTidSrbVWDFAVxYur+/MEZnz8KZnhek5vlG3kS5qalOSw== X-Received: by 2002:a5d:5273:: with SMTP id l19mr9955221wrc.175.1576766202744; Thu, 19 Dec 2019 06:36:42 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q68sm7454536wme.14.2019.12.19.06.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:36:42 -0800 (PST) From: luca.boccassi@gmail.com To: Gavin Hu Cc: Ajit Khaparde , dpdk stable Date: Thu, 19 Dec 2019 14:33:08 +0000 Message-Id: <20191219143447.21506-41-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: enforce IO barrier for doorbell command' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. 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. Thanks. Luca Boccassi --- >From b8201168460b06b705401564b2c94ba84bcf2cbc Mon Sep 17 00:00:00 2001 From: Gavin Hu Date: Mon, 16 Sep 2019 19:27:18 +0800 Subject: [PATCH] net/bnxt: enforce IO barrier for doorbell command [ upstream commit dda8e0e48723fc90e6222fcc1b04b94f240ae9b2 ] The doorbell ringing operation requires a rte_io_mb immediately to make the command complete and visible to the device before reading the response, otherwise it may read stale or invalid responses. Fixes: ca241d9a0952 ("net/bnxt: use I/O device memory read/write API") Signed-off-by: Gavin Hu Acked-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index a28439f51c..c4f743db05 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -142,6 +142,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, /* Ring channel doorbell */ bar = (uint8_t *)bp->bar0 + 0x100; rte_write32(1, bar); + /* + * Make sure the channel doorbell ring command complete before + * reading the response to avoid getting stale or invalid + * responses. + */ + rte_io_mb(); /* Poll for the valid bit */ for (i = 0; i < HWRM_CMD_TIMEOUT; i++) { -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:27.971134711 +0000 +++ 0041-net-bnxt-enforce-IO-barrier-for-doorbell-command.patch 2019-12-19 14:32:25.913294018 +0000 @@ -1,14 +1,15 @@ -From dda8e0e48723fc90e6222fcc1b04b94f240ae9b2 Mon Sep 17 00:00:00 2001 +From b8201168460b06b705401564b2c94ba84bcf2cbc Mon Sep 17 00:00:00 2001 From: Gavin Hu Date: Mon, 16 Sep 2019 19:27:18 +0800 Subject: [PATCH] net/bnxt: enforce IO barrier for doorbell command +[ upstream commit dda8e0e48723fc90e6222fcc1b04b94f240ae9b2 ] + The doorbell ringing operation requires a rte_io_mb immediately to make the command complete and visible to the device before reading the response, otherwise it may read stale or invalid responses. Fixes: ca241d9a0952 ("net/bnxt: use I/O device memory read/write API") -Cc: stable@dpdk.org Signed-off-by: Gavin Hu Acked-by: Ajit Khaparde @@ -17,12 +18,12 @@ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c -index d7c33d21e2..cdb6fa4f7e 100644 +index a28439f51c..c4f743db05 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c -@@ -146,6 +146,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, +@@ -142,6 +142,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, /* Ring channel doorbell */ - bar = (uint8_t *)bp->bar0 + mb_trigger_offset; + bar = (uint8_t *)bp->bar0 + 0x100; rte_write32(1, bar); + /* + * Make sure the channel doorbell ring command complete before @@ -32,7 +33,7 @@ + rte_io_mb(); /* Poll for the valid bit */ - for (i = 0; i < timeout; i++) { + for (i = 0; i < HWRM_CMD_TIMEOUT; i++) { -- 2.20.1