[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53cbd465-6925-4003-a13b-11fa1034819d@ti.com>
Date: Tue, 7 Oct 2025 00:24:53 +0530
From: "Malladi, Meghana" <m-malladi@...com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <namcao@...utronix.de>, <jacob.e.keller@...el.com>,
<christian.koenig@....com>, <sumit.semwal@...aro.org>,
<sdf@...ichev.me>, <john.fastabend@...il.com>, <hawk@...nel.org>,
<daniel@...earbox.net>, <ast@...nel.org>, <pabeni@...hat.com>,
<edumazet@...gle.com>, <davem@...emloft.net>, <andrew+netdev@...n.ch>,
<linaro-mm-sig@...ts.linaro.org>, <dri-devel@...ts.freedesktop.org>,
<bpf@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<srk@...com>, Vignesh Raghavendra <vigneshr@...com>,
Roger Quadros
<rogerq@...nel.org>, <danishanwar@...com>
Subject: Re: [PATCH net-next v2 1/6] net: ti: icssg-prueth: Add functions to
create and destroy Rx/Tx queues
Hi Jakub,
On 9/4/2025 6:18 AM, Jakub Kicinski wrote:
> On Mon, 1 Sep 2025 15:32:22 +0530 Meghana Malladi wrote:
>> if (!emac->xdpi.prog && !prog)
>> return 0;
>>
>> - WRITE_ONCE(emac->xdp_prog, prog);
>> + if (netif_running(emac->ndev)) {
>> + prueth_destroy_txq(emac);
>> + prueth_destroy_rxq(emac);
>> + }
>> +
>> + old_prog = xchg(&emac->xdp_prog, prog);
>> + if (old_prog)
>> + bpf_prog_put(old_prog);
>> +
>> + if (netif_running(emac->ndev)) {
>> + ret = prueth_create_rxq(emac);
>
> shutting the device down and freeing all rx memory for reconfig is not
> okay. If the system is low on memory the Rx buffer allocations may fail
> and system may drop off the network. You must either pre-allocate or
> avoid freeing the memory, and just restart the queues.
So I have been working on trying to address this comment and maintain
parity with the existing support provided by this series but looks like
I might be missing something which is causing some regressions.
I am facing an issue with zero copy Rx, where there is some active
traffic being received by the DUT (running in copy mode - default state)
and I switch to zero copy mode using AF-XDP_example [1], I am not able
to receive any packets because I observe that the napi_rx_poll is not
getting scheduled for whatever reason, ending up draining the rx
descriptors and leading to memory leak. But if I first switch from copy
to zero copy mode and then try sending traffic I am able to receive
traffic on long runs without any failure or crash. I am not able to
figure out why is this happening, so sharing my changes [2] on top of
this series, which I made to address your comment. I am wondering if you
could have a look and give me some pointers here. Thank you.
[1] https://github.com/xdp-project/bpf-examples/tree/main/AF_XDP-example
[2]
https://gist.github.com/MeghanaMalladiTI/4c1cb106aee5bef4489ab372938d62d9
>
>> + if (ret) {
>> + netdev_err(emac->ndev, "Failed to create RX queue: %d\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = prueth_create_txq(emac);
>> + if (ret) {
>> + netdev_err(emac->ndev, "Failed to create TX queue: %d\n", ret);
>> + prueth_destroy_rxq(emac);
>> + emac->xdp_prog = NULL;
>> + return ret;
>> + }
>> + }
>>
>> xdp_attachment_setup(&emac->xdpi, bpf);
--
Thanks,
Meghana Malladi
Powered by blists - more mailing lists