Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2711823pxj; Mon, 31 May 2021 08:51:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiB0/xD+PQGzqzvwxSBqxe5vJCxbH2aCclaT4Cwc1PYuGDsVSkxoT+SAJeS56POa/9nCsy X-Received: by 2002:a50:fc84:: with SMTP id f4mr6815579edq.252.1622476294854; Mon, 31 May 2021 08:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622476294; cv=none; d=google.com; s=arc-20160816; b=UOmb3UCAowhq0eXzWgElAQlJ3Vn4ZOnyyGBib3Hw1AL7yIuAk5+Gy1xUBtuhykR31B YwMTJkVwYdrMLqcJnXJxavFECgtbQi6hCWrYZxXPR+WoxrnmwPSUGMz4Zm3XKsyzwS1w SNcrmp90qWCPsdv3XcggYIN3XkHBkA/OpCkpffeG2CEufLbFhQFdjZqKxtgzeXAlL8EA 8yIY2FlCjCIkDDLyVxsa6lIGy5/oFoUBI4Ix5RgUvavPcQbdDnRV4Iju78MEu8yRWGik xcpcwZBBqKNCxmZ7HwuDlmxUx8xCl20N/mYyPX04aSrWvzkIWGORO8Z2balvOx1REjWc wntw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=112h+8jATOotSztcvP8P3L9atoUpjG8g180XBJq1wCE=; b=RSM6G2k7xab893xvp8c5DAgFtpd0JJngy78FpF9az2yQZUW65QZLMUmeCU/IkwXEaU aOexkJMl3J96eYbYZMLGlUTNiImNGp5482qQVLFkSn9DaGgD8S6D7E3zVBAGz9eobjQQ QXl+yLNwpbvI2P/rhGehAkCnhIXm5FnJS3UQ1hiaCDPeBqjZrId8oyFDN675yo0UtnKi hc7Q+dokJtmQ3R+hK2bue0fSPkcMrsBSLX9N0SlXmzj6Nr8ti3uQjq7HDROhhE5vudq6 m7NrmnuBZeT7xp6e6ggzoaGmKI/F2rPy1t4qBjAB1rYDLghHFVGU6a3yEBjrSE423C1q Myrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q0bON4G6; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si12047065edr.585.2021.05.31.08.51.12; Mon, 31 May 2021 08:51:34 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=q0bON4G6; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233861AbhEaPtZ (ORCPT + 99 others); Mon, 31 May 2021 11:49:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:56262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233828AbhEaO1c (ORCPT ); Mon, 31 May 2021 10:27:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 026EC6161E; Mon, 31 May 2021 13:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468861; bh=p2IRf5HxadbaaWHbQYjV3cAs2OANnCRPdefrgZYCLAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0bON4G65Uu+3qmXwkiX1CwmKwnTr1wc7yX7xZ7K1TqPGn2RofO4JVTLs7xb06Kp2 m8EH0Yet9lkNhb4uhv4pnbD0cPH5B6kf7IqswOdvp7fO1VbMdM6NhfWzUmDD28Z7Xv 6lytXTBcFOhW4wtvCwPumc3JYXC8JbOJtdnbENMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Catherine Sullivan , David Awogbemila , Willem de Brujin , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 155/177] gve: Upgrade memory barrier in poll routine Date: Mon, 31 May 2021 15:15:12 +0200 Message-Id: <20210531130653.278430907@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Catherine Sullivan [ Upstream commit f81781835f0adfae8d701545386030d223efcd6f ] As currently written, if the driver checks for more work (via gve_tx_poll or gve_rx_poll) before the device posts work and the irq doorbell is not unmasked (via iowrite32be(GVE_IRQ_ACK | GVE_IRQ_EVENT, ...)) before the device attempts to raise an interrupt, an interrupt is lost and this could potentially lead to the traffic being completely halted. For example, if a tx queue has already been stopped, the driver won't get the chance to complete work and egress will be halted. We need a full memory barrier in the poll routine to ensure that the irq doorbell is unmasked before the driver checks for more work. Fixes: f5cedc84a30d ("gve: Add transmit and receive support") Signed-off-by: Catherine Sullivan Signed-off-by: David Awogbemila Acked-by: Willem de Brujin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/google/gve/gve_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c index 77e79d2939ba..6ea0975d74a1 100644 --- a/drivers/net/ethernet/google/gve/gve_main.c +++ b/drivers/net/ethernet/google/gve/gve_main.c @@ -121,7 +121,7 @@ static int gve_napi_poll(struct napi_struct *napi, int budget) /* Double check we have no extra work. * Ensure unmask synchronizes with checking for work. */ - dma_rmb(); + mb(); if (block->tx) reschedule |= gve_tx_poll(block, -1); if (block->rx) -- 2.30.2