Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/if_rge.c
RevisionDateAuthorComments
 1.34  04-Feb-2025  jmcneill rge(4): Add support for RTL8126

Patch from FUKAUMI Naoki in PR# 59044
 1.33  10-Nov-2024  mlelstv Add MBUFTRACE
 1.32  29-Jun-2024  riastradh if_stats(9): Add ifp argument to if_stat..._ref.

This will enable us to pass the ifp through to a dtrace probe inside.

No functional change intended in this change, but this is an API
change visible to modules so it shouldn't be pulled up.

PR kern/58377
 1.31  18-Jan-2024  msaitoh rge(4): Print HW revision.
 1.30  21-Dec-2023  skrll G/C sc_task and #include "opt_net_mpsafe.h"
 1.29  16-Dec-2023  mlelstv - handle stuck transmitter (descriptor still owned)
- restart send queue after transmit
- count output packets
- use deferred start

Should fix PR 57694
 1.28  19-Oct-2023  mrg rge: properly handle mbuf allocation failures in rx interrupts

several changes that should fix crashes seen after an mbuf
allocation failure:

- create RX ring dma maps with BUS_DMA_ALLOCNOW, so that any
future bus_dmamap_load*() call will succeed. this avoids one
error case in rge_newbuf(), that similar cases in eg wm(4)
actually call panic for now (i think this idea can be copied
into wm(4) as well.)

- extract the RX descriptor set into a common function that
both rge_newbuf() and rge_rxeof() can both use. it's almost
identical to the old rge_discard_rxbuf() except it also sets
the rge_addr (this is needed for the newbuf case.)

- move the bus_dmamap_unload() into rge_newbuf(), so that the
existing mbuf will remain mapped until a new mbuf is allocated.
(this part is what should fix crashes seen by wiz and Chavdar,
as the unload follow by sync is what triggers the assert in
x86 bus_dma. without the assert, it will would have shortly
triggered a page fault.) remove the assignment to NULL for
the rxq mbuf pointer, it is required for reload.

- add a couple of missing if_statinc() calls.


tested on amd64 and arm64.
 1.27  09-Oct-2023  riastradh rge(4): callout_stop can't be right here; just do callout_halt.

XXX pullup-10
 1.26  05-Oct-2023  mrg rge(4): check for all errors in rx buffer allocation

should fix a crash seen by by Chavdar Ivanov reported on current-users.

move the rx and tx list clean up into their own functions, and call the
rx clean up function from the init function if something fails. this
should fix a potential leak in this case, and generally frees up memory
that won't be used without a successful init phase again.

slight application of 'static', much more could be done.
 1.25  21-Dec-2022  nonaka Update the Rx descriptor based on the vendor driver for Linux.

This fixes a panic on RTL8125.
Patch from OpenBSD if_rge.c r1.20, if_rgereg.h r1.8.

Tested by msaitoh@n.o.
 1.24  24-Sep-2022  thorpej branches: 1.24.4;
Remove unnecessary include of <sys/malloc.h>.
 1.23  07-Jul-2022  skrll Trailing whitespace
 1.22  11-Oct-2021  msaitoh Avoid unaligned access in rge_get_macaddr(). Found by kUBSan.
 1.21  11-Oct-2021  msaitoh Use unsigned to avoid undefined behavior. Found by kUBSan.
 1.20  11-Oct-2021  msaitoh Add pmf_device_register().
 1.19  08-May-2021  thorpej Use pci_compatible_match().
 1.18  02-Mar-2021  knakahara branches: 1.18.4;
Fix build failure for options NET_MPSAFE.
 1.17  01-Mar-2021  jakllsch Update rge(4) from older OpenBSD, finish porting.

Should consider merging this all into re(4) and rgephy(4) someday.

Some cleanup tasks remain here.
 1.16  27-Jan-2021  jakllsch if_rge.c: avoid aprint_error*() abuse
 1.15  20-Jan-2021  jakllsch Sync with OpenBSD if_rge.c r1.4

"""
Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.
"""
 1.14  30-May-2020  sevan branches: 1.14.2;
Use device_xname() to access dv_xname
 1.13  30-May-2020  sevan Switch from printf to aprintf_error/normal
 1.12  30-May-2020  sevan Initialise sc->sc_dev, otherwise unnamed interfaces show up and things go
downhill from there.
 1.11  20-May-2020  sevan use device_private() instead of casting self as it doesn't work here.
Bump rcs tag which was missed in r1.9
 1.10  30-Apr-2020  sevan Sync with r1.3 from OpenBSD

"Use correct bit mask to promptly exit rge_set_phy_power() and
rge_exit_oob() timeout loops.

Spotted by CID 1491296 and 1491309."
 1.9  29-Feb-2020  thorpej branches: 1.9.4;
Use the 64-bit PCI tag, if available.
 1.8  27-Feb-2020  sevan Cast to make up for the difference in type between our bus_dma_map(9) and
theirs. Where we expect kvap to be of void **, they expect caddr_t (typedef char *).
 1.7  27-Feb-2020  sevan Add an implementation of MCLGETI.
Borrowed from sys/dev/pci/if_bwfm_pci.c
 1.6  13-Feb-2020  sevan redundant include
 1.5  04-Feb-2020  skrll Trailing whitespace
 1.4  04-Feb-2020  skrll Adopt <net/if_stats.h>
 1.3  12-Jan-2020  sevan branches: 1.3.2;
Start to switch from OpenBSD timeout(9) API to callout(9) and workqueue(9)
Replace functions with NetBSD counterparts.
 1.2  11-Jan-2020  sevan Start porting to NetBSD. (WIP, incomplete)
 1.1  11-Jan-2020  sevan Import rge(4) from OpenBSD for Realtek's RTL8125 based 2.5GbE network cards.
 1.3.2.3  29-Feb-2020  ad Sync with head.
 1.3.2.2  17-Jan-2020  ad Sync with head.
 1.3.2.1  12-Jan-2020  ad file if_rge.c was added on branch ad-namecache on 2020-01-17 21:47:31 +0000
 1.9.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.9.4.1  29-Feb-2020  martin file if_rge.c was added on branch phil-wifi on 2020-04-08 14:08:09 +0000
 1.14.2.1  03-Apr-2021  thorpej Sync with HEAD.
 1.18.4.1  13-May-2021  thorpej Sync with HEAD.
 1.24.4.4  22-Aug-2024  martin Pull up following revision(s) (requested by mrg in ticket #782):

sys/dev/pci/if_rge.c: revision 1.29

- handle stuck transmitter (descriptor still owned)
- restart send queue after transmit
- count output packets
- use deferred start

Should fix PR 57694
 1.24.4.3  22-Oct-2023  martin Pull up following revision(s) (requested by mrg in ticket #434):

sys/dev/pci/if_rge.c: revision 1.26
sys/dev/pci/if_rge.c: revision 1.28

rge(4): check for all errors in rx buffer allocation
should fix a crash seen by by Chavdar Ivanov reported on current-users.
move the rx and tx list clean up into their own functions, and call the
rx clean up function from the init function if something fails. this
should fix a potential leak in this case, and generally frees up memory
that won't be used without a successful init phase again.
slight application of 'static', much more could be done.

rge: properly handle mbuf allocation failures in rx interrupts
several changes that should fix crashes seen after an mbuf
allocation failure:
- create RX ring dma maps with BUS_DMA_ALLOCNOW, so that any
future bus_dmamap_load*() call will succeed. this avoids one
error case in rge_newbuf(), that similar cases in eg wm(4)
actually call panic for now (i think this idea can be copied
into wm(4) as well.)
- extract the RX descriptor set into a common function that
both rge_newbuf() and rge_rxeof() can both use. it's almost
identical to the old rge_discard_rxbuf() except it also sets
the rge_addr (this is needed for the newbuf case.)
- move the bus_dmamap_unload() into rge_newbuf(), so that the
existing mbuf will remain mapped until a new mbuf is allocated.
(this part is what should fix crashes seen by wiz and Chavdar,
as the unload follow by sync is what triggers the assert in
x86 bus_dma. without the assert, it will would have shortly
triggered a page fault.) remove the assignment to NULL for
the rxq mbuf pointer, it is required for reload.
- add a couple of missing if_statinc() calls.

tested on amd64 and arm64.
 1.24.4.2  14-Oct-2023  martin Pull up following revision(s) (requested by riastradh in ticket #414):

sys/dev/pci/if_rge.c: revision 1.27

rge(4): callout_stop can't be right here; just do callout_halt.
 1.24.4.1  21-Dec-2022  martin Pull up following revision(s) (requested by nonaka in ticket #14):

sys/dev/pci/if_rge.c: revision 1.25
sys/dev/pci/if_rgereg.h: revision 1.7

Update the Rx descriptor based on the vendor driver for Linux.

This fixes a panic on RTL8125.

Patch from OpenBSD if_rge.c r1.20, if_rgereg.h r1.8.

Tested by msaitoh@n.o.

RSS XML Feed