Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3231224imc; Wed, 13 Mar 2019 12:13:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAj2AKR0esfufTiAtoJQVQN03el9xcabGqpaLoogHrhMQwewlYYzmZgAhIt3Ry/q/65M9E X-Received: by 2002:a62:e216:: with SMTP id a22mr45133310pfi.20.1552504411824; Wed, 13 Mar 2019 12:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552504411; cv=none; d=google.com; s=arc-20160816; b=iOTANJJgV3S7plMmv1n++2DBQ9GFRu5L4i2E/pMa+Fy+Xik7DFmpRhQPtNnUh6X9/P zN4UbgMiJ/zxl0+8QJwd9mibK+wxBLFC42NTx5R8YpOJPy9HjG3leTf+A3g+XRCCcpAR XZ2OXiooTXY+x5Gowid2S7NeWnQqqD8uTMlmcWtqsNRmFkXB0luRZlhMwtADJ7q6ovlT sOiEOEmZ04XMPJq3G5YHXPrtvPh1RcXpF6fSesoh0ImuNlgHewm/VaSm6pc6NrGeIiCr 2uDRUcBGrs+4eAJVBRr9LjwTfas0PTzTfdaks7hYYR0IYs0wymEseHzGxfxIBywdc9sm B5bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UJjwwKtzuKGDezGAchA2iW50R3P3Wr69s9dMQNVtEdg=; b=WxH4ZZOBuaAzR4seq3mueoUw9aD4sQEeoGH9xySsbQiAaN4pXIzSQ10GcLDQfIxyao qWba1mFfNTUtF62ZS+g2H+DdUXKjEaSOvKX0KnjmcZs24tjK30z5iNY7DZDmmmHF7i6n seIFRrtVZ6fyBOi9A7XOzPpYPFnh7TQMslvUYleNHSNIioRgU/eKh+DBD/b6g649kcbb EVraGwj4MM8j6jj19ij1+SOzLXt8e/nQP8wOQ6s8Ee7f6ku6gPVDw9AnwyUE4R8r9AH6 0l3Ly6lvl9WWS7Des0zgSr+XNTQonMuoCLPc6dAJxWoHfXxBQJAuwKrfmW9LY/Sk+xQ0 WDjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IO9zPFFm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si9892560pls.34.2019.03.13.12.13.16; Wed, 13 Mar 2019 12:13:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IO9zPFFm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727430AbfCMTMR (ORCPT + 99 others); Wed, 13 Mar 2019 15:12:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbfCMTMP (ORCPT ); Wed, 13 Mar 2019 15:12:15 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0480C20693; Wed, 13 Mar 2019 19:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552504334; bh=WddH+or7KxxhUfkW8V+8x1zLcdH6jgiEi3Y72pPxG8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IO9zPFFm6sxvkCZ+DrgyFmWMyQIsQlUNG5Q7xUc8cvirM/mOm+xFyWBXNtgnY9shq LugGFSZ2XLIMbwJbI0TCZKcKZNQNsZKCdBX65QRSGKbMxP/eiD2oD3Suj2pj+oTSO4 7Xx4Pte+fDE5mXngoARr6jxzxPKzsxPyrXvLp75U= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jan Sokolowski , Jeff Kirsher , Sasha Levin , netdev@vger.kernel.org, xdp-newbies@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 47/60] ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK Date: Wed, 13 Mar 2019 15:10:08 -0400 Message-Id: <20190313191021.158171-47-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190313191021.158171-1-sashal@kernel.org> References: <20190313191021.158171-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Sokolowski [ Upstream commit c685c69fba71462c3f9f6a1fb6151cded6c74d42 ] An issue has been found while testing zero-copy XDP that causes a reset to be triggered. As it takes some time to turn the carrier on after setting zc, and we already start trying to transmit some packets, watchdog considers this as an erroneous state and triggers a reset. Don't do any work if netif carrier is not OK. Fixes: 8221c5eba8c13 (ixgbe: add AF_XDP zero-copy Tx support) Signed-off-by: Jan Sokolowski Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c index 654ae92342ea..36a8879536a4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c @@ -642,7 +642,8 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget) dma_addr_t dma; while (budget-- > 0) { - if (unlikely(!ixgbe_desc_unused(xdp_ring))) { + if (unlikely(!ixgbe_desc_unused(xdp_ring)) || + !netif_carrier_ok(xdp_ring->netdev)) { work_done = false; break; } -- 2.19.1