Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Meghana Malladi <m-malladi@ti.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <diogo.ivo@siemens.com>, <haokexin@gmail.com>,
	<vadim.fedorenko@linux.dev>, <devnexen@gmail.com>,
	<horms@kernel.org>, <jacob.e.keller@intel.com>, <sdf@fomichev.me>,
	<john.fastabend@gmail.com>, <hawk@kernel.org>,
	<daniel@iogearbox.net>, <ast@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <davem@davemloft.net>,
	<andrew+netdev@lunn.ch>, <bpf@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <srk@ti.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Roger Quadros <rogerq@kernel.org>, <danishanwar@ti.com>
Subject: Re: [PATCH net 4/4] net: ti: icssg: Fix XSK zero copy TX during application wakeup
Date: Wed, 17 Jun 2026 17:01:24 +0530	[thread overview]
Message-ID: <0c24f699-9deb-4fee-8d1e-4a70fa3d985f@ti.com> (raw)
In-Reply-To: <20260616081954.0d12aa13@kernel.org>

On 6/16/26 20:49, Jakub Kicinski wrote:
> On Tue, 16 Jun 2026 16:41:00 +0530 Meghana Malladi wrote:
>> On 6/16/26 04:51, Jakub Kicinski wrote:
>>> On Fri, 12 Jun 2026 00:27:44 +0530 Meghana Malladi wrote:
>>>> @@ -169,9 +169,6 @@ static int emac_xsk_xmit_zc(struct prueth_emac *emac,
>>>>    
>>>>    		num_tx++;
>>>>    	}
>>>> -
>>>> -	xsk_tx_release(tx_chn->xsk_pool);
>>>> -	return num_tx;
>>>
>>> Why are you deleting this?
>>>    
>>
>> xsk_sendmsg() also calls this without an rcu-lock when transmitting the
>> packets if the xmit was successful, so I was assuming it is not required
>> and I removed this.
> 
> I think you still need it. Besides, seems like a separate cleanup.
> 

Okay, I will add it back then.

>>>>    void prueth_xmit_free(struct prueth_tx_chn *tx_chn,
>>>> @@ -279,9 +276,6 @@ int emac_tx_complete_packets(struct prueth_emac *emac, int chn,
>>>>    		num_tx++;
>>>>    	}
>>>>    
>>>> -	if (!num_tx)
>>>> -		return 0;
>>>
>>> Does something prevent us from running all this code if budget is 0?
>>> If budget is 0 we can complete normal Tx with skbs but we must
>>> not touch any AF-XDP related state.
>>
>> Can you elaborate more, I couldn't interpret your comment here
> 
> netpoll may call napi from any context, including from IRQ.
> It uses budget of 0 to indicate that it's trying to only reap tx
> completions, without doing any Rx or XDP work. XDPs can't be called
> from IRQ context.
> 

Ah I wasn't aware of this, I will add a check to ensure AF_XDP runs only 
when budget > 0 then.

>>>>    	netif_txq = netdev_get_tx_queue(ndev, chn);
>>>>    	netdev_tx_completed_queue(netif_txq, num_tx, total_bytes);
>>>>    
>>>> @@ -306,7 +300,9 @@ int emac_tx_complete_packets(struct prueth_emac *emac, int chn,
>>>>    
>>>>    		netif_txq = netdev_get_tx_queue(ndev, chn);
>>>>    		txq_trans_cond_update(netif_txq);
>>>
>>> This looks misplaced, now we will hit it even if we didn't complete
>>> or submit any Tx.
>>
>> This code needs to be hit for packet transmission in zero copy mode.
>> emac_xsk_xmit_zc() submits the packets to the DMA in NAPI context,
>> when application wakes up the driver and triggers NAPI. Once DMA
>> transfer is done, irq gets triggered NAPI gets called which will handle
>> the tx packet completion + submit next Tx batch packets to the DMA.
>>
>> if (tx_chn->xsk_pool) -> check ensure this hits and runs for zero copy
>> only. Also above check (!num_tx) returns early during the application
>> wakeup (where budget is zero), hence it is removed.
> 
> I'm commenting on txq_trans_cond_update(), you're calling it
> effectively on every NAPI call when XSK is bound, whether
> Tx is making progress or not.

Ok got it, but I wonder if it will hurt in anyway to call this even when 
there are no Tx completions.
Nonetheless, I will move this inside xsk_frames_done check.


  reply	other threads:[~2026-06-17 11:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 18:57 [PATCH net 0/4] ICSSG XDP zero copy bug fixes Meghana Malladi
2026-06-11 18:57 ` [PATCH net 1/4] net: ti: icssg-prueth: Fix AF_XDP fill ring alloc and wakeup condition Meghana Malladi
2026-06-11 18:57 ` [PATCH net 2/4] net: ti: icssg: Use undirected TX tag for native XDP in HSR offload mode Meghana Malladi
2026-06-11 18:57 ` [PATCH net 3/4] net: ti: icssg: Use undirected TX tag for XDP zero copy " Meghana Malladi
2026-06-11 18:57 ` [PATCH net 4/4] net: ti: icssg: Fix XSK zero copy TX during application wakeup Meghana Malladi
2026-06-15 23:21   ` Jakub Kicinski
2026-06-16 11:11     ` Meghana Malladi
2026-06-16 15:19       ` Jakub Kicinski
2026-06-17 11:31         ` Meghana Malladi [this message]
2026-06-15 23:40 ` [PATCH net 0/4] ICSSG XDP zero copy bug fixes patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c24f699-9deb-4fee-8d1e-4a70fa3d985f@ti.com \
    --to=m-malladi@ti.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=devnexen@gmail.com \
    --cc=diogo.ivo@siemens.com \
    --cc=edumazet@google.com \
    --cc=haokexin@gmail.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rogerq@kernel.org \
    --cc=sdf@fomichev.me \
    --cc=srk@ti.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox