Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2678705pxj; Mon, 31 May 2021 08:05:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWnmaGyCFHJl0w7dOzb0Beaqd2+bFVMQGzUy7AfzO1Iw+l5nSdmEpMZZDmWR9JfTgKdAVn X-Received: by 2002:a6b:e817:: with SMTP id f23mr17117787ioh.183.1622473509526; Mon, 31 May 2021 08:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473509; cv=none; d=google.com; s=arc-20160816; b=Um3IHmpYHSp3DtoctmMQwsbUno4ayKYepZR3yI/LN463V7AbeXdDicxcR4Z7fMZyio 7mKS+di9JN6oF4Xqkqrd8OEophcpwwkl4fd3wc11UvfWLxv3zmmjPizwL4IM6Mh5OUYl LPPzon0BX6GFbuh3gL2De1E/qUPPWcjTAcwrKwR6hYPmLup4DcuO32uY8Ch8MqfLmO5e LfvcQhlgfbty+H6Y2DnIJss/jwvRWg4cSqgjdblCTpS1KM41pCrcwG0NE+pLghjeMO+3 hMHpE2tDx4V6qXU4o7jWiBT246aSbsn0Q3fRQJ72upIQwoDzHPZldu69X6aNu1VYEtLR 7OLw== 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=+iHEPcW+5ug8IZW8wvrBmob6uDLg7/m7xm26apZ4El4=; b=Y+gjzWsyKX46U0e5zvS6cUiSi9qwXfWCdPCrGGdkJVxgEu1BIQL16oaAzD1MS/vKlD zWvr5XorAu/xTQpvsnwRDzweejwI8MdbFT5h/HhQrD+G4y82wTj7pz/UhJaoxNk4N0Yx VepHZ0sUKXGehabI2BnOZSYTBcxityUfTd2vpJRYkAdBE+oNCi0HDcwtlr8BCyZVBx7g vkyWqMwJ03PnbT9AIj9mSDb+2ofH88mR9fggoavS+Q1WhJPxCqT8j9DBsna7feTt3Pdc Le4LJig9CP+lRCGXkqk3HGu0HfwFIFoAVhZtHlZr60IWeIHM62RlDUorlRiGswzjsCyf IdQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xi4nFtiN; 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 w17si12892586iot.47.2021.05.31.08.04.55; Mon, 31 May 2021 08:05:09 -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=Xi4nFtiN; 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 S233199AbhEaPGE (ORCPT + 99 others); Mon, 31 May 2021 11:06:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:40544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232726AbhEaOIB (ORCPT ); Mon, 31 May 2021 10:08:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A39F361455; Mon, 31 May 2021 13:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468378; bh=0rEjWKAlmJ30eRK65Wdy8KGlQ9zvTgZ9ZHF61gnUEJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xi4nFtiNe5opFVM2hF0OmEiCT7T0m8HCYdD0Qa1H4BnnfBkgg0jmov7EnnNDLfNVW NXAyCyaMmr3ZNjeiEHmhLVDHDWsVsLx0tiDbSdaMfwRMsyfDdVBHHWeJHkXaCYj0D6 GR4kj5Y+JJv8kcUxF0Xuq0PcOr6ntxKF/QUVTH54= 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.10 219/252] gve: Upgrade memory barrier in poll routine Date: Mon, 31 May 2021 15:14:44 +0200 Message-Id: <20210531130705.448694163@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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 839102ea6aa1..d6e35421d8f7 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