Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3120697pxu; Tue, 8 Dec 2020 04:14:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLwKhEx8KPwyly125J8DYSHJbpb5+JvbZQWL7syoHl557DHAs+UhaUvF8VNONUPOeo/HK1 X-Received: by 2002:a17:907:b09:: with SMTP id h9mr23289805ejl.155.1607429695002; Tue, 08 Dec 2020 04:14:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607429694; cv=none; d=google.com; s=arc-20160816; b=SetbQveE6uxOb9xLVRERIBQcftiF3bM4Rm982dPv2UpwODOy+m1pw7HH0xu3Pb7jQG VFtnypXSxcYqQJjJ6nTrXYG24ecsJqMWHhseO5JLf8H1jwMe4YRWrdZOcc1XpqIQYC53 1CgtxOeeoNtYFOVck7rL5t3P9CsLanDdUswQblMbBlAKWJVT5IqUNCNl4nDTpIqbHiOZ AT3EH/b19xOzIbkks6PAoTcFSIysZrAx0qjK7MLdkkAnvgtAyjKUCvKDHTXFpd8odCe3 pGYZ3q6rN7mHQFQLrWeN7ynHusZk3/QiXx/5DewKcQLRHvK4ZvSAZWBmRCqYOWjfLQUZ RTeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dFsq2xs9sTUYZhZViaCLtjhb30g1fDD4Z2bfmBzr46M=; b=UX3THNGBBWSVbhS8KEOKmD+HXTYhXOVMHoFm/j9ixnbl1JXb4uOVac8t27rOIs98tM +h8RCGjL7zJUZT9zo1vcpO1KB/8y3H//ZH1urQFrhFhrqd2iFoZrqnKsBf58cHrp6oTA 1K6MCt00jqCxo1g+6z8wSvXRrf0iL1sqHZFtXlzJclzhVmlAPFwwOIPQ2QsdTqCGrv99 GegNOascfqbbDhNs4/yIok+glTnn2rzIfsEmRyoNxiB8iV0ySfigdE6n0qddXDGJ3yx/ ZcXISI7S9T7oSZ2L5qiZBQzj+FV9Yn7RdX+a+h7yTp0hRUNOl1HnS+rtxN/6L/npnBRg fRkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Km45oX1n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck15si9766005edb.37.2020.12.08.04.14.32; Tue, 08 Dec 2020 04:14:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Km45oX1n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgLHJPq (ORCPT + 99 others); Tue, 8 Dec 2020 04:15:46 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:1520 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbgLHJPq (ORCPT ); Tue, 8 Dec 2020 04:15:46 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 08 Dec 2020 01:15:06 -0800 Received: from mtl-vdi-166.wap.labs.mlnx (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 8 Dec 2020 09:15:04 +0000 Date: Tue, 8 Dec 2020 11:15:00 +0200 From: Eli Cohen To: Jason Wang CC: , , , , Subject: Re: [PATCH] vdpa/mlx5: Use write memory barrier after updating CQ index Message-ID: <20201208091500.GA17763@mtl-vdi-166.wap.labs.mlnx> References: <20201206105719.123753-1-elic@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.9.5 (bf161cf53efb) (2018-04-13) X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1607418906; bh=dFsq2xs9sTUYZhZViaCLtjhb30g1fDD4Z2bfmBzr46M=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To:User-Agent:X-Originating-IP:X-ClientProxiedBy; b=Km45oX1nrydEXr3wGp1VEdrwnc4vCj0VFQJQ395jSO4K1aQpvyNEOJdolklVW3hk/ OGecy/daM70W2QmfW3FmzyNDGC7T8vQfJdA5PB7GJdtisIRkkIRmaocdNmjUCFEgOD +T6NGWPUFq2Q5Hh4ml2f9ZOBMTzMiwjqwQayvYhY6WwjKMHebrY7vYqeyeEW7rtTz9 Hw6B9LM4oJ5sZvIP38I7sfZCMEWZKJM4Wobsvu20DsbGUlQRi29zRDQdKektUvw9QW AeCxDp58u9kcP0XNlWpTEb0UtWR0Dszbk7ATf49RlGlqmgHI7MwaPqoZlfzHeXppWs V/fJUcaZxO00A== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 10:51:44AM +0800, Jason Wang wrote: >=20 > On 2020/12/6 =E4=B8=8B=E5=8D=886:57, Eli Cohen wrote: > > Make sure to put write memory barrier after updating CQ consumer index > > so the hardware knows that there are available CQE slots in the queue. > >=20 > > Failure to do this can cause the update of the RX doorbell record to ge= t > > updated before the CQ consumer index resulting in CQ overrun. > >=20 > > Change-Id: Ib0ae4c118cce524c9f492b32569179f3c1f04cc1 Michael, I left this gerrit ID by mistake. Can you remove it before merging? > > Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 dev= ices") > > Signed-off-by: Eli Cohen > > --- > > drivers/vdpa/mlx5/net/mlx5_vnet.c | 5 +++++ > > 1 file changed, 5 insertions(+) > >=20 > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/= mlx5_vnet.c > > index 1f4089c6f9d7..295f46eea2a5 100644 > > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > > @@ -478,6 +478,11 @@ static int mlx5_vdpa_poll_one(struct mlx5_vdpa_cq = *vcq) > > static void mlx5_vdpa_handle_completions(struct mlx5_vdpa_virtqueue *= mvq, int num) > > { > > mlx5_cq_set_ci(&mvq->cq.mcq); > > + > > + /* make sure CQ cosumer update is visible to the hardware before upda= ting > > + * RX doorbell record. > > + */ > > + wmb(); > > rx_post(&mvq->vqqp, num); > > if (mvq->event_cb.callback) > > mvq->event_cb.callback(mvq->event_cb.private); >=20 >=20 > Acked-by: Jason Wang >=20 >=20