Re: [PATCH net-next 3/6] net: bcmasp: Add support for ASP2.0 Ethernet controller

From: Florian Fainelli
Date: Wed Apr 19 2023 - 12:34:10 EST


On 4/18/23 23:35, Heiner Kallweit wrote:
On 19.04.2023 02:10, Justin Chen wrote:
Add support for the Broadcom ASP 2.0 Ethernet controller which is first
introduced with 72165. This controller features two distinct Ethernet
ports that can be independently operated.

This patch supports:
[snip]
+ intf->tx_spb_index = spb_index;
+ intf->tx_spb_dma_valid = valid;
+ bcmasp_intf_tx_write(intf, intf->tx_spb_dma_valid);
+
+ if (tx_spb_ring_full(intf, MAX_SKB_FRAGS + 1))
+ netif_stop_queue(dev);
+

Here it may be better to use the new macros from include/net/netdev_queues.h.
It seems your code (together with the related part in tx_poll) doesn't consider
the queue restart case.
In addition you should check whether using READ_ONCE()/WRITE_ONCE() is needed,
e.g. in ring_full().

Thanks Heiner. Can you trim the parts you are not quoting otherwise one has to scroll all the way down to where you responded. Thanks!
--
Florian