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 605A2A2EFC for ; Tue, 17 Sep 2019 03:56:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E3EB1BEF2; Tue, 17 Sep 2019 03:56:06 +0200 (CEST) Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by dpdk.org (Postfix) with ESMTP id 25F4B1BEC0 for ; Tue, 17 Sep 2019 03:56:03 +0200 (CEST) Received: by mail-oi1-f193.google.com with SMTP id i16so1488571oie.4 for ; Mon, 16 Sep 2019 18:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VPAyFUu3E/YcsYWIWfnCGBqZegTQ+gBq+3zIu2GxOwU=; b=DoEAoXz6np0qDN+fgbZ72Hurl/oKYy7zv6XxQeRpvcSK1TsdV5TJEY8sZz72Z2pSgM +UuEaFev14V/PUHjmvHTXTaBLb4W67NrloKLPD+XkTlKG7kUfn8A56EBh7H4tYHNxjA2 6pu3qsbQDGrP0kWzb19cTLhnD+wLpSl2FVSxU= 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=VPAyFUu3E/YcsYWIWfnCGBqZegTQ+gBq+3zIu2GxOwU=; b=qEAmeM5pEBcBFQcxVfNN2b/nqTKvrcS7vXm4GuDBYrW9j5cYy4quHjeHY+/ggBBy8e Ms/p/qK3NbJ0aAD5E2SLJSqkEJFnpKo8CF+vIoRpsMbfch8o8k5DUCuu7ukX4VRHUEIx vkjsVdYFQ3klIXOEve64stokOvxRICqp3p+JbB9fGVwZV2tPwvIWB4Ivmc3J9FlB/OY9 I/SL4er6kNmVFoPU95YFUFhx5rQPhgX0lzM8jrqcHHyVgyW4Pj2JqjyjlLqPGRnwuDOp 9fROo4ANA7jgL1TNAqa/50XGnQPb3SDnZ+Jfi7FkiZyxog6JZLXUIEqttgkO/6WqKH+F iLBA== X-Gm-Message-State: APjAAAUkYFdABNFM3FnUkeCAqHuOIif9nY15QLf/OzelvxYQXgzDss64 o5FTiabN8VxwIB9wGnOsDk8MCYGq/N8wyRPimszbCQ== X-Google-Smtp-Source: APXvYqyN7U68WxwOMGE+jBaVZB90HXvggahu4lgBFJofX+IgkBJdbxRZZpw/CSUW7FiE4p/lipMPg0Q/TBKR63M1ggM= X-Received: by 2002:aca:b654:: with SMTP id g81mr1752127oif.153.1568685361950; Mon, 16 Sep 2019 18:56:01 -0700 (PDT) MIME-Version: 1.0 References: <1567751873-15964-1-git-send-email-gavin.hu@arm.com> <1568633238-47888-1-git-send-email-gavin.hu@arm.com> <1568633238-47888-6-git-send-email-gavin.hu@arm.com> In-Reply-To: <1568633238-47888-6-git-send-email-gavin.hu@arm.com> From: Ajit Khaparde Date: Mon, 16 Sep 2019 18:55:45 -0700 Message-ID: To: Gavin Hu Cc: dev@dpdk.org, nd@arm.com, Thomas Monjalon , Bruce Richardson , yong.liu@intel.com, yinan.wang@intel.com, Somnath Kotur , Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com, steve.capper@arm.com, dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH v2 5/5] net/bnxt: enforce io barrier for doorbell command 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" On Mon, Sep 16, 2019 at 4:27 AM Gavin Hu wrote: > 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 > --- > 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 2d5dc00..7d192e3 100644 > --- a/drivers/net/bnxt/bnxt_hwrm.c > +++ b/drivers/net/bnxt/bnxt_hwrm.c > @@ -134,6 +134,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, > void *msg, > /* Ring channel doorbell */ > bar = (uint8_t *)bp->bar0 + mb_trigger_offset; > 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.7.4 > >