Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1877986rwb; Wed, 26 Jul 2023 21:38:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGFoUDPvOnVJicHh3pUOoLhe3kh2QtOHUnb/pCoOLc2gzrKx+Wmsbnf2udicLy8ofIgd4EV X-Received: by 2002:a17:902:d487:b0:1b6:68bb:6ad0 with SMTP id c7-20020a170902d48700b001b668bb6ad0mr4741731plg.55.1690432716622; Wed, 26 Jul 2023 21:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690432716; cv=none; d=google.com; s=arc-20160816; b=uXo7D2oCgknmDKID/+3SGMcEIhiwmYGOtYAZXmk2J77tKOi9fUGVd29gKVfSaYuV0S dURkHjWpB67ClShgzGGAIC+9TMjJxMvCy23FrHBHPpJsG0t7NcjT59GpXI0rC+pUjoXt SfaValWr/HdV3Yb4HJK8qsJy/QUMuIjJ746Exxnxd+vAo8wMtGrPVocfoRvRFmpoVAnc 0nQ27Y9HLyXuEZSMOsRlZ5jh651KlZigzPpbDfxhUtFyrdqq76/oTAW+yDQqO22ZFoTL /+1o7yI4IDvh1j4nb6QIQSyKOEYgvN7RMnCtMprCQwjLj24QOeS7xEpljTXtqCgzPoaB ZNpg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=WQxB3SR4WKUYImYrTW9Pmr1zD85uZphz2hl23czPGDk=; fh=0PtwrrBxRSIW+ffljWppK2QXu9Vtyfybf8CpY9Vh+AE=; b=NevoTTt9EjJrBDGwq8uMTHhJt3myDDInotiSesksJYcXNo960zfuGEeYHVZBLeD4ur ePffKFw9oA+xzv3JoAQVYLydKxVddO0LkAI2j3nca3+KFBgmVdqQVSRLhLY5KkGxVG/J 09XryHhHMtM5/FvmhXtSio6KGLdTQqHGW5DpdctWtE2ek0h30OeOtp8oZm5da2PXzd2j VqH4mL136+SPkrqkBkRU6GVHhq14tn6Puctk46l/D0XSb6tvlaFOsDWyllY4qGxP1HMn H/g3MrVmBSfOR0qoeNol7lQkSs6q8mN3/ZATNfU/cKxWCHNoZ3gJ+1nFiL3h89DpmjJA Eb1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PzlXTbtf; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la11-20020a170902fa0b00b001b8b6089eeasi518572plb.326.2023.07.26.21.38.24; Wed, 26 Jul 2023 21:38:36 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=PzlXTbtf; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbjG0EO4 (ORCPT + 99 others); Thu, 27 Jul 2023 00:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjG0EOy (ORCPT ); Thu, 27 Jul 2023 00:14:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A53126B8 for ; Wed, 26 Jul 2023 21:14:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CF50861D18 for ; Thu, 27 Jul 2023 04:14:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A861BC433C8; Thu, 27 Jul 2023 04:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690431292; bh=n5IoGgevUqL40CMFdt7WgXl53BmR1iin6IDLbTGFxA4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PzlXTbtf73znm020yTLJQ+ESa5D7kpfpxRD1SSEsIajcmjvFJDyaEY6MUrLZC6jTT lW3TwUZYa8YI4t6Sc8CKQK6C6UX4DTUh8riGzQuza9kRsV+k7MuxKkoskZHYjdBrDu 2GaIc4oZG5n9EPhTqW+L4vaTnOaDm9ZMxT8NxT5H1WctgrG2WWqj0JkUtjshlQJOns ZOhi+5vRipzYv+x9/NFUYoJ7F5j8VaHmmtIOY53Dts/HzDa5eC0Lw9y2iI0TQS/5RZ mRlxMNX0I5JuQtLX/0shn+kGtIzWkb/eY3bzoT3werJ03+VTkIpnmi0KCUjstSg6pm hOqfv44pdnYaQ== Date: Wed, 26 Jul 2023 21:14:50 -0700 From: Jakub Kicinski To: Wei Fang Cc: Alexander Duyck , dl-linux-imx , "linux-kernel@vger.kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , Shenwei Wang , Clark Wang , "pabeni@redhat.com" , "netdev@vger.kernel.org" Subject: Re: [PATCH net] net: fec: tx processing does not call XDP APIs if budget is 0 Message-ID: <20230726211450.209efe35@kernel.org> In-Reply-To: References: <20230725074148.2936402-1-wei.fang@nxp.com> <70b71e7bb8a7dff2dacab99b0746e7bf2bee9344.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 On Thu, 27 Jul 2023 02:08:32 +0000 Wei Fang wrote: > > Actually after talking with Jakub a bit more there is an issue here, > > but not freeing the frames isn't the solution. We likely need to just > > fix the page pool code so that it doesn't attempt to recycle the > > frames if operating in IRQ context. > > > > The way this is dealt with for skbs is that we queue skbs if we are in > > IRQ context so that it can be deferred to be freed by the > > net_tx_action. We likely need to look at doing something similar for > > page_pool pages or XDP frames. > > > After reading your discussion with Jakub, I understand this issue a bit more. > But we are not sure when this issue will be fixed in page pool, currently we > can only tolerate a delay in sending of a netpoll message. So I think this patch > is necessary, and I will refine it in the future when the page pool has fixed the > issue. In addition, as you mentioned before, napi_consume_skb should be > used to instead of dev_kfree_skb_any, so I will improve this patch in version 2. I think so too, since the patch can only help, you already wrote it and it won't be extra backporting work since the code is only present in 6.5 - I think it's worth applying. And we can refine things as page pool limitations get listed (the napi_consume_skb() is net-next material, anyway).