Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1790541pxp; Mon, 7 Mar 2022 02:23:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0P4Ox3iWz8+Wnmxj1nqwMGvZWWCkceLeXp18CcPwcCbfJ4qp0MteZurt0C5BK+yuQlm3j X-Received: by 2002:a17:90b:1c83:b0:1b9:caa:8230 with SMTP id oo3-20020a17090b1c8300b001b90caa8230mr24235860pjb.26.1646648608158; Mon, 07 Mar 2022 02:23:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646648608; cv=none; d=google.com; s=arc-20160816; b=tKuAmn1QeoFvenpTz21VbmQTWvI87awm93DUifRSgCP55cFFsuzjALdeWxt/xoth2h OLUNctw21gUdLsR3SMJs/6JXWjb3oviKu+IooPkJwAQfGn0TqV6BEL8B4O5cE5rbvRjN +syys0iYpaAlzewIt36HEoIVukb8+2XmnMSKvWyn+v4Ja921nkulvEQwdjixry7NTbk4 +6pJ/l/VZ6+Z2/qRBQr/C4Eo/AjF4ONlczNKHP9YxeYRghjfbeNIsscm/XXE/+FJxa02 rnIgQfNl6L8G+82Cq2m0OYoOxdhNMsgXVUYvDqZC5AWUKruyaIsyBX1s9lZAMYC4jHSd bnNg== 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=PeUr5EUdnPMDUDaf8Lsn8rlgUWmQ0uplTzVY8S/d+gM=; b=meA7Slz8snSC15efSfNyetf/p9SBA8Y0f0Jr5NTAxbs0cPS9DGTjWxpidU4iG7hOit v+SQTmarQuxqX/AtbKjoxkvKww2gBxyWY1pN18bwJQLtKrY6yYe51aB1j+A2FgwZAqfd vAp8b7UjZ/jEBmP8GWtmepttErg/Zn8fSsD0419FjR+mxnXSkWJMewi9boYodv9zYqCg KgbIFCbbbLUpcCDAieK5COZUAgJjQ5JVhmTZ+hZZj2TNtuliKvS/qXTFdHMQ5rS3S3iZ QaB9zKFxS0BwgWZay8NM83uituG11FRKjFBhZyy3JNlAjTYHLQbWv7naTUnGoc8C5A3p yPew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wXPn/1GF"; 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 i8-20020a17090332c800b00151c6f1b299si8018540plr.374.2022.03.07.02.23.13; Mon, 07 Mar 2022 02:23:28 -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="wXPn/1GF"; 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 S238641AbiCGJ5i (ORCPT + 99 others); Mon, 7 Mar 2022 04:57:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239261AbiCGJjd (ORCPT ); Mon, 7 Mar 2022 04:39:33 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B849970CD7; Mon, 7 Mar 2022 01:35:15 -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 sin.source.kernel.org (Postfix) with ESMTPS id 68DEECE0B91; Mon, 7 Mar 2022 09:34:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CFCEC340E9; Mon, 7 Mar 2022 09:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646645663; bh=6crrs/elwQ8b0hU87CPZNpOETc1cgMCnScdjzdtuKdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wXPn/1GFjd8dI/jAkTirUWu2IxnYl8k3jk46VTlI51An4B1kE9pz82y9dwr3gv9AC sX4QgVZlkWAPTGLgY2lG3nzD9yu4XAz4dgCNKq5f6jhxbl2JK1t1OO34on0DK4OeoG pfaP1NdSPgp+KS3WSxEnkYaayQUJefLpovaHI7KQ= 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.10 067/105] ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() Date: Mon, 7 Mar 2022 10:19:10 +0100 Message-Id: <20220307091646.062759142@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091644.179885033@linuxfoundation.org> References: <20220307091644.179885033@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 @@ -391,12 +391,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_tx_peek_desc(pool, &desc)) break;