[PATCH net-next 3/6] net: bcmasp: Add support for ASP2.0 Ethernet controller
Justin Chen
justinpopo6 at gmail.com
Mon Apr 24 21:18:53 UTC 2023
On Wed, Apr 19, 2023 at 9:33 AM Florian Fainelli <f.fainelli at gmail.com> wrote:
>
> 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
>
Hello Heiner,
The implementation is a locked single queue xmit. Not sure how
netdev_queues.h fits into the picture here. I believe I am handling
the queue restart here.
+static int bcmasp_tx_poll(struct napi_struct *napi, int budget)
+{
[snip]
+ if (released)
+ netif_wake_queue(intf->ndev);
+
+ return 0;
+}
Let me know if I am misunderstanding the feedback here.
Thanks,
Justin
More information about the dri-devel
mailing list