Re: [PATCH net-next] net: gianfar: use alloc_ethdev_mqs

From: Rosen Penev

Date: Tue Apr 28 2026 - 23:18:17 EST


On Tue, Apr 28, 2026 at 5:41 PM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> > > > + *pdev = alloc_etherdev_mqs(sizeof(*priv), num_tx_qs, num_rx_qs);
> > > > dev = *pdev;
> > > > if (NULL == dev)
> > > > return -ENOMEM;
> > > > @@ -679,10 +679,6 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
> > > >
> > > > priv->mode = mode;
> > > >
> > > > - priv->num_tx_queues = num_tx_qs;
> > > > - netif_set_real_num_rx_queues(dev, num_rx_qs);
> > > > - priv->num_rx_queues = num_rx_qs;
> > >
> > > Please add to the commit message an explanation of why these two
> > > assignments can be removed, because it is not obvious.
> > I didn't explain that _mqs sets them?
>
> How can alloc_etherdev_mqs() set them? priv is opaque to the core. All
> the core knows is the size of struct gfar_private, but nothing about
> its layout, where num_tx_queues and num_rx_queues are within priv.
I see what you mean. Will respin this.
>
> Andrew