Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1783932pxp; Mon, 7 Mar 2022 02:13:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtzUfS2pBqMY0TMyCt0eoDWtQSjCkRKFnap6qVzfdFK+nRlME1OdqWkC1uTusWBskEu3/K X-Received: by 2002:aa7:c6d7:0:b0:415:a0fc:1dcd with SMTP id b23-20020aa7c6d7000000b00415a0fc1dcdmr10656757eds.266.1646647896992; Mon, 07 Mar 2022 02:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646647896; cv=none; d=google.com; s=arc-20160816; b=AYd+DbpyVri0RmwQ5JO/xXH+i89HgrMqY/Sx7HAnAMDEU+ciHr16hSOUTkX5HjT3eO /+aMnqs91sQuIYZpa3gnS+GfNL01Y2S0dNYuAH5CAolioRNlowSoT37sltKL/5/4vSwl aR8MK5Dzv/vGtao6gz6JwekpV5OQt6EV6hBsrv47giy9Rrw02RLjlYNOPS6bZDikRWwk cKAyXvmKDr6SRhIl6GXttQPa5ug1AKzmbhD3c7uaDpCSQph2uYkt2WhWvxwMOyfZ+PHd 3MMs8rp6f2qlHrIPs3mdUpioAQTGU8jN8DUS3vXwNw0ZEHtLwkxlOx3tuOZ9z5v9ed+D y41Q== 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=i/vzL0xs0f/WFYsR/9fiE9k+X/s1aHfcEL61NIor44M=; b=pk+U6rkn55miVaxUrFZdzILtVGO9MDdA+i+kJe2wghxI2eMKiYzy6bSuuY3203ZWRZ szb/Bj2IdjJQlSvup1kamIIF5RfbcQQiXLmQR3THDaCuHG0Q3OKzfYFxr9h3BE2hoZkL iUMaPXOUxmBe/G4FyYV8Spc2/D2bO1DJ57Gkqa21GKyVMFTB2Mug4UW4ORV+idpaaUDC sn/HccBjawlSfSfR8G7HLPNMIu7ty4X+qdpUbD3NhWwtfEeIH2/ty0uFWvq0oF5IbPjo Bu7nD6XxPFayzMU63mArGFlrHgq3WQ/2HvuaxykZK85dYb7it1QOKYHXedlSH9e3FpiW 9CEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WFowhp2i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b21-20020aa7df95000000b00415a0ffb17esi7602510edy.264.2022.03.07.02.11.15; Mon, 07 Mar 2022 02:11:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WFowhp2i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237725AbiCGJhk (ORCPT + 99 others); Mon, 7 Mar 2022 04:37:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238676AbiCGJ3f (ORCPT ); Mon, 7 Mar 2022 04:29:35 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E01E7593A6; Mon, 7 Mar 2022 01:27:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6B5B161119; Mon, 7 Mar 2022 09:27:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A047C340F3; Mon, 7 Mar 2022 09:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646645268; bh=LQXi6+tj6xNyWviwQ4Ff20ElLn5mPIjwO2ZEQlz1n+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WFowhp2izzVlgWjl1NqkwaWawnySJI2sc3VVzAQuHfaN1NqHNJKV6UFdRBsr2ZZVB 5hJrqNU3+0JAzvhz9JDk15oXcppHezD/P6afkFSzYB2Dm6aB5KYYNtq3vWPkLt6k3c cqyTXcnobF5qwGMi2xLlj1mEai/JvotQUd3UqLJ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maurice Baijens , Maciej Fijalkowski , Sandeep Penigalapati , Tony Nguyen , Jakub Kicinski Subject: [PATCH 5.4 39/64] ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() Date: Mon, 7 Mar 2022 10:19:12 +0100 Message-Id: <20220307091640.256636889@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091639.136830784@linuxfoundation.org> References: <20220307091639.136830784@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maciej Fijalkowski commit 6c7273a266759d9d36f7c862149f248bcdeddc0f upstream. Commit c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK") addressed the ring transient state when MEM_TYPE_XSK_BUFF_POOL was being configured which in turn caused the interface to through down/up. Maurice reported that when carrier is not ok and xsk_pool is present on ring pair, ksoftirqd will consume 100% CPU cycles due to the constant NAPI rescheduling as ixgbe_poll() states that there is still some work to be done. To fix this, do not set work_done to false for a !netif_carrier_ok(). Fixes: c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK") Reported-by: Maurice Baijens Tested-by: Maurice Baijens Signed-off-by: Maciej Fijalkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c @@ -583,12 +583,14 @@ static bool ixgbe_xmit_zc(struct ixgbe_r u32 cmd_type; while (budget-- > 0) { - if (unlikely(!ixgbe_desc_unused(xdp_ring)) || - !netif_carrier_ok(xdp_ring->netdev)) { + if (unlikely(!ixgbe_desc_unused(xdp_ring))) { work_done = false; break; } + if (!netif_carrier_ok(xdp_ring->netdev)) + break; + if (!xsk_umem_consume_tx(xdp_ring->xsk_umem, &desc)) break;