Rework the tx path to use the consumer and producer positions to work out
authorjmatthew <jmatthew@openbsd.org>
Mon, 20 Dec 2021 04:21:32 +0000 (04:21 +0000)
committerjmatthew <jmatthew@openbsd.org>
Mon, 20 Dec 2021 04:21:32 +0000 (04:21 +0000)
commit26d66e1bd77e7d4b305094759a35fe6d841fec4f
tree39e86b0e9c537c0ae9d9a733c8a78ff99bdbebab
parent04b7ede1d84e0e6e8b173d4628a8d7eaf81a21b4
Rework the tx path to use the consumer and producer positions to work out
the number of slots available, and to put packets on the ring until fewer
than DWGE_NTXSEGS slots are left, making dwge_start() and dwge_txeof()
work independently.  While here, only write to GMAC_TX_POLL_DEMAND once
per call to dwge_start() rather than once per packet.

Adjust the rx interrupt path to check the number of slots in use and
return slots once per interrupt.

Add interrupt and ifq barriers before taking the interface down.
With all of this done, we can mark dwge(4) mpsafe.

ok dlg@ patrick@
sys/dev/fdt/if_dwge.c