From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBC151772A; Thu, 20 Jul 2023 15:24:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D78D0C433C7; Thu, 20 Jul 2023 15:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689866672; bh=pjnKekjE71gAy7Zg6XstIv+bO3ieMLEzUP4PJ4z6uOE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=g/D6JRa9WygFmgZkTLCrBiBZQahul/3Farf9/Mx+xxESjqX4WZNkrFL4aUJpyCXVr xPOxRcDdSOTQ2mp89tl79bwSUCKq98cJVJbNZjfZ3eEcIkv7NI8o9Qph3Erjn0kMUZ bwd5p/mNXN0dCU7OPM4Ooo3c0Of+EqoRfmoUKmGEUguHvcGSaU3Ek5AEW5cdTTreTJ KYhJaxzvDd4adlLHthh9C6y26eCXH+s8CnAa8/lzBZ88t3Em36D7hovjmVySBovTmb gZMxkl+suYqa7X8ldNjGY7JCNCzmkx+U/sE/vdKlt8aZBukg7q82PU9PmEzplXY+db QHCm0tGXd4Qgw== Date: Thu, 20 Jul 2023 08:24:31 -0700 From: Jakub Kicinski To: Wei Fang Cc: "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "ast@kernel.org" , "daniel@iogearbox.net" , "hawk@kernel.org" , "john.fastabend@gmail.com" , Clark Wang , Shenwei Wang , "netdev@vger.kernel.org" , dl-linux-imx , "linux-kernel@vger.kernel.org" , "bpf@vger.kernel.org" Subject: Re: [PATCH net-next] net: fec: add XDP_TX feature support Message-ID: <20230720082431.5428050e@kernel.org> In-Reply-To: References: <20230717103709.2629372-1-wei.fang@nxp.com> <20230719204553.46856b29@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 20 Jul 2023 07:06:05 +0000 Wei Fang wrote: > > Are you taking budget into account? When NAPI is called with budget of 0 we > > are *not* in napi / softirq context. You can't be processing any XDP tx under > > such conditions (it may be a netpoll call from IRQ context). > > Actually, the fec driver never takes the budget into account for cleaning up tx BD > ring. The budget is only valid for rx. I know, that's what I'm complaining about. XDP can only run in normal NAPI context, i.e. when NAPI is called with budget != 0. That works out without any changes on Rx, if budget is zero drivers already don't process Rx. But similar change must be done on Tx when adding XDP support. You can still process all normal skb packets on Tx when budget is 0 (in fact you should), but you _can't_ process any XDP Tx frame.