[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250903174847.5d8d1c9f@kernel.org>
Date: Wed, 3 Sep 2025 17:48:47 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Meghana Malladi <m-malladi@...com>
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>,
<linux-media@...r.kernel.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
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.
> + 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);
Powered by blists - more mailing lists