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 A04EAA04FF; Tue, 14 Jan 2020 14:49:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 702A61BFA2; Tue, 14 Jan 2020 14:49:22 +0100 (CET) Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by dpdk.org (Postfix) with ESMTP id 3D1D04C8B; Tue, 14 Jan 2020 14:49:20 +0100 (CET) Received: by mail-il1-f195.google.com with SMTP id v15so11567044iln.0; Tue, 14 Jan 2020 05:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=osZvlx5jxlB6yW2GcjDDY6FNaPtv8ITPNxX5lvdEIjE=; b=KreSpYkjWZHeMr73dHCEVaYA1zSU8cLOvv3DcWnaH8fW8fCJvcn97GFHE+6xH/F7z/ 9UuxZXLXiXtPhQAZxqFf8ZGrsMELUvwXH1rhGqSFAOyRycFx/wAkNdr+zzz5RVvELvKU e/j07nbJvhqzxYurzQpjvz7ECszbpRmRzoiIHUFCT+aQvX6KoeCL5XCoFDEeNL+oCkXv ghX8e1QXXE3yPTXTcbU3//vqXdOXgIuVjUqfuxGUe8EljUrxBe6xEnJJGA4wyMzEQa9c cvGAX0eolY9KgXFIA8ThqUC76gjttQ8bg5cd7+mit1euakepqE8ht+1fOZ7qijfY4LwN YVWA== 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=osZvlx5jxlB6yW2GcjDDY6FNaPtv8ITPNxX5lvdEIjE=; b=rWz1AJberh9Vp0pFO3GvfIP6hFU1sE9XfOUX8NYrnKWsQK7BW+s/wiK0JRvJ5kgwlP FjtfYpl6SOp6S7kHP4HWm6olV6rV9uTLNdch52i5owRM+jljojrQmvFgFMGyb+lDd4NK ewK3weo+CMb6JzN0yMzYN3DCDqiY0lygD2EUO+EYFV6c0xfRkN7zpgDf3JHCsGgFFJda phuVgHvGxjPPLqc2VEpa48/VLsa5l7IszDoXBA1ca9FKj1S/jMen+hrUES3roRGgmt3x nzRdj8YUJEIO7RdpnK593hLyD/+vxe3zDXBJrw5cWclqNY4iq8ji8zeXgzYhHJ9HvKWn 3XEA== X-Gm-Message-State: APjAAAUHPkubKP4swaDcpdriE98xSLi8rPIEKsOjbXcM3NPMZFxXs2sq axJUW5alUQYPBCAFDLNLv9PmEySYIye18NaE9rQ= X-Google-Smtp-Source: APXvYqwWqfD9txOuB4ws3T2UU0X/NBBH3iKwdpC6rB/JcKm1CRO4+HtXNG0R+plwz+zlBUnBD1ThxtJOkFR9XXlnG0k= X-Received: by 2002:a92:1906:: with SMTP id 6mr3607560ilz.130.1579009759480; Tue, 14 Jan 2020 05:49:19 -0800 (PST) MIME-Version: 1.0 References: <20200114003920.17705-1-rmody@marvell.com> In-Reply-To: <20200114003920.17705-1-rmody@marvell.com> From: Jerin Jacob Date: Tue, 14 Jan 2020 19:19:03 +0530 Message-ID: To: Rasesh Mody , Gavin Hu Cc: dpdk-dev , Jerin Jacob , Ferruh Yigit , GR-Everest-DPDK-Dev , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/3] net/bnx2x: fix to use required mem barriers in Rx path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" + Gavin On Tue, Jan 14, 2020 at 6:09 AM Rasesh Mody wrote: > > When handling RX completion queue PMD is not using required read/write > barriers before reading completion queue element (CQE) indices, > updating/writing hardware consumer and producer. > This patch adds appropriate read/write memory barriers in places which > are required by driver and adapter to read or update indices. > > Fixes: 540a211084a7 ("bnx2x: driver core") > Cc: stable@dpdk.org > > Signed-off-by: Rasesh Mody > --- > drivers/net/bnx2x/bnx2x.c | 5 +++++ > drivers/net/bnx2x/bnx2x_rxtx.c | 22 ++++++++++++++++++++++ > 2 files changed, 27 insertions(+) > > diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c > index ed31335ac..9c5e7995d 100644 > --- a/drivers/net/bnx2x/bnx2x.c > +++ b/drivers/net/bnx2x/bnx2x.c > @@ -1255,6 +1255,11 @@ static uint8_t bnx2x_rxeof(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp) > return 0; > } > > + /* Add memory barrier as status block fields can change. This memory > + * barrier will flush out all the read/write operations to status block > + * generated before the barrier. It will ensure stale data is not read > + */ > + mb(); # Do you need full barriers here? # Which architecture did you saw this issue? # rte_cio_* barriers are performance Friday, Have you checked rte_cio_* would suffice the requirements. See the discussion in http://patches.dpdk.org/patch/64038/ I assume 2/3 and 3/3 patches are for the slow path. if so, it is fine to use full barriers on those patches.