[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68a37d33-6155-4ffc-a0ad-8c5a5b8fed25@lunn.ch>
Date: Tue, 9 Jul 2024 19:39:12 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: netdev@...r.kernel.org, nbd@....name, lorenzo.bianconi83@...il.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, conor@...nel.org,
linux-arm-kernel@...ts.infradead.org, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
devicetree@...r.kernel.org, catalin.marinas@....com,
will@...nel.org, upstream@...oha.com,
angelogioacchino.delregno@...labora.com,
benjamin.larsson@...exis.eu, rkannoth@...vell.com,
sgoutham@...vell.com, arnd@...db.de, horms@...nel.org
Subject: Re: [PATCH v6 net-next 2/2] net: airoha: Introduce ethernet support
for EN7581 SoC
> +static int airoha_qdma_init_rx_queue(struct airoha_eth *eth,
> + struct airoha_queue *q, int ndesc)
> +{
> + struct page_pool_params pp_params = {
> + .order = 0,
> + .pool_size = 256,
> + .flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV,
> + .dma_dir = DMA_FROM_DEVICE,
> + .max_len = PAGE_SIZE,
> + .nid = NUMA_NO_NODE,
> + .dev = eth->dev,
> + .napi = &q->napi,
> + };
I think you can make this const.
> +static int airoha_alloc_gdm_port(struct airoha_eth *eth, struct device_node *np)
> +{
> + port = netdev_priv(dev);
> + mutex_init(&port->stats.mutex);
> + port->dev = dev;
> + port->eth = eth;
> + port->id = id;
> +
> + err = register_netdev(dev);
> + if (err)
> + return err;
> +
> + eth->ports[index] = port;
eth->ports[index] appears to be used in
airoha_qdma_rx_process(). There is a small race condition here, since
the interface could be in use before register_netdev() returns,
e.g. NFS root. It would be better to do the assignment before
registering the interface.
These are quite minor, so please add to the next version:
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
---
pw-bot: cr
Powered by blists - more mailing lists