From: Jakub Kicinski <kuba@kernel.org>
To: Meghana Malladi <m-malladi@ti.com>
Cc: <namcao@linutronix.de>, <jacob.e.keller@intel.com>,
<christian.koenig@amd.com>, <sumit.semwal@linaro.org>,
<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>, <linaro-mm-sig@lists.linaro.org>,
<dri-devel@lists.freedesktop.org>, <linux-media@vger.kernel.org>,
<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-next v2 1/6] net: ti: icssg-prueth: Add functions to create and destroy Rx/Tx queues
Date: Wed, 3 Sep 2025 17:48:47 -0700 [thread overview]
Message-ID: <20250903174847.5d8d1c9f@kernel.org> (raw)
In-Reply-To: <20250901100227.1150567-2-m-malladi@ti.com>
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);
next prev parent reply other threads:[~2025-09-04 0:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 10:02 [PATCH net-next v2 0/6] Add AF_XDP zero copy support Meghana Malladi
2025-09-01 10:02 ` [PATCH net-next v2 1/6] net: ti: icssg-prueth: Add functions to create and destroy Rx/Tx queues Meghana Malladi
2025-09-04 0:48 ` Jakub Kicinski [this message]
2025-09-01 10:02 ` [PATCH net-next v2 2/6] net: ti: icssg-prueth: Add XSK pool helpers Meghana Malladi
2025-09-01 10:02 ` [PATCH net-next v2 3/6] net: ti: icssg-prueth: Add AF_XDP zero copy for TX Meghana Malladi
2025-09-01 10:02 ` [PATCH net-next v2 4/6] net: ti: icssg-prueth: Make emac_run_xdp function independent of page Meghana Malladi
2025-09-01 10:02 ` [PATCH net-next v2 5/6] net: ti: icssg-prueth: Add AF_XDP zero copy for RX Meghana Malladi
2025-09-01 10:02 ` [PATCH net-next v2 6/6] net: ti: icssg-prueth: Enable zero copy in XDP features Meghana Malladi
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=20250903174847.5d8d1c9f@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=christian.koenig@amd.com \
--cc=daniel@iogearbox.net \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=john.fastabend@gmail.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m-malladi@ti.com \
--cc=namcao@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
--cc=sdf@fomichev.me \
--cc=srk@ti.com \
--cc=sumit.semwal@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).