[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251126164917.295b38ac@kernel.org>
Date: Wed, 26 Nov 2025 16:49:17 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, Wen Gu <guwen@...ux.alibaba.com>, Philo Lu
<lulie@...ux.alibaba.com>, Lorenzo Bianconi <lorenzo@...nel.org>, Vadim
Fedorenko <vadim.fedorenko@...ux.dev>, Dong Yibo <dong100@...se.com>, Lukas
Bulwahn <lukas.bulwahn@...hat.com>, Geert Uytterhoeven
<geert+renesas@...der.be>, Vivian Wang <wangruikang@...as.ac.cn>, MD Danish
Anwar <danishanwar@...com>, Dust Li <dust.li@...ux.alibaba.com>
Subject: Re: [PATCH net-next v16 4/5] eea: create/destroy rx,tx queues for
netdevice open and stop
On Mon, 24 Nov 2025 09:42:50 +0800 Xuan Zhuo wrote:
> +static void enet_bind_new_q_and_cfg(struct eea_net *enet,
> + struct eea_net_init_ctx *ctx)
> +{
> + struct eea_net_rx *rx;
> + struct eea_net_tx *tx;
> + int i;
> +
> + enet->cfg = ctx->cfg;
> +
> + enet->rx = ctx->rx;
> + enet->tx = ctx->tx;
> +
> + for (i = 0; i < ctx->cfg.rx_ring_num; i++) {
> + rx = ctx->rx[i];
> + tx = &ctx->tx[i];
> +
> + rx->enet = enet;
> + tx->enet = enet;
I think you need to move it up sooner? Or re-implement the cleanup
paths to handle partial initialization correctly.. Right now if
eea_alloc_rx_hdr() fails, eea_alloc_rx()->eea_free_rx()->eea_free_rx_hdr()
will dereference rx->enet before it's set
> +static void eea_free_meta(struct eea_net_tx *tx)
> +{
> + struct eea_sq_free_stats stats;
> + struct eea_tx_meta *meta;
> + int i;
> +
> + while ((meta = eea_tx_meta_get(tx)))
> + meta->skb = NULL;
> +
> + for (i = 0; i < tx->enet->cfg.tx_ring_num; i++) {
Similarly is it okay to use enet->cfg here? Could be that we're freeing
cfg before it's bound to a device.
Powered by blists - more mailing lists