Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2754389pxj; Mon, 31 May 2021 09:55:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5iOyJtwz4gRB37idYsN+7ZqG6zxqQPXwcj8HKKvPLt1VT1h7/fMLvM6J1af93mBlPeren X-Received: by 2002:a17:906:9143:: with SMTP id y3mr14853976ejw.465.1622480102718; Mon, 31 May 2021 09:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622480102; cv=none; d=google.com; s=arc-20160816; b=awAXjFQ2351nulpsbogkcAe4qrrs36U6b6TzwINUUbBTqyslwu4z55lH1+t1aHNKrW 1ADmzPAxt9X60gF0clGS8AQuRb5XoJsAOlkbMaDdh5C0rPP78p5klwx4I9gVo9KdHfZK wIT4DHTWitdVStmnbs45BTxKz1v/dryVWBWK1FLizlVG282MiICd8fxy2H8xhzUgjUdZ JRnr7f0LMOu2lKrrGS6B7+MVBk8HCzNOLDD1qYyPmS3yZtclg21fPab2jLJUwQaplFsW brqJDAGlCFPp+2OiKHOiKP9naI/oU11l5VVTcMLgpum5Q0wRq82B1d8Iug2o8MAqvXN6 7mAA== 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=ntVOfeSNCq3yPzYiMC6wNmFegR55ngpkPlOPYH+AO3g=; b=kjn/+c+dLQpYy+O9HY895BDwMsQ6703pKdGN5GFSOAaBFgiN/EN1fwc/ObfgzT5XUj zr6Ybt//DFSCAooocvtWRfqPDS7nTaigSJykn7IpvYtBrh8iIhDMb0a7h8uDNn85rrbh 5WqVoBTJohF67zgFkdVl1cG/0ERXCWefDH0j3STRmgnAh3122KQFwy+EJGkBDDw4jh4r swcmbK4zqFZGL/E8uwtaGZ69b9YxaDAQ8+cQNf4BNXhRcQJgcvxTD4cIVVxxJTZ9yh3e 9XCVSR7lvX874kwO2Nlrff6ReOzB1dRBXiHMPkSVQksYxGBzeOsalvqvxhxVE5RWvA1I a60Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F+XySutn; 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 b7si12271897edd.415.2021.05.31.09.54.40; Mon, 31 May 2021 09:55:02 -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=F+XySutn; 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 S234416AbhEaQyp (ORCPT + 99 others); Mon, 31 May 2021 12:54:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:50182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234367AbhEaO7V (ORCPT ); Mon, 31 May 2021 10:59:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2CA361CCE; Mon, 31 May 2021 14:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469678; bh=2/vnSKFmBiPWtK2QwcFs5JOW2fCY6BqT0zNO9pZ7rfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F+XySutns5ca3/SK0Mp3TD07jH9Umt+DRbJBuk+xI3Ekk/Y2OyYI1vyA9hwL2IEpL IOkyxGLfEwvF51c21xWyLjIUHSuH4ewpIJyOcSKqMF54czbgWf6wKFNB9mHGipvDWA 27RRlOL8TjQFith5zKWy4+e2LywG/fj8geFAxfpI= 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.12 254/296] gve: Upgrade memory barrier in poll routine Date: Mon, 31 May 2021 15:15:09 +0200 Message-Id: <20210531130712.295650193@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 21a5d058dab4..bbc423e93122 100644 --- a/drivers/net/ethernet/google/gve/gve_main.c +++ b/drivers/net/ethernet/google/gve/gve_main.c @@ -180,7 +180,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