The NetBSD Project

CVS log for src/sys/dev/pci/if_rge.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / pci

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun Nov 10 11:45:48 2024 UTC (4 weeks, 4 days ago) by mlelstv
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -2 lines
Add MBUFTRACE

Revision 1.24.4.4: download - view: text, markup, annotated - select for diffs
Thu Aug 22 19:22:35 2024 UTC (3 months, 3 weeks ago) by martin
Branches: netbsd-10
Diff to: previous 1.24.4.3: preferred, colored; branchpoint 1.24: preferred, colored; next MAIN 1.25: preferred, colored
Changes since revision 1.24.4.3: +14 -21 lines
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

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat Jun 29 12:11:12 2024 UTC (5 months, 2 weeks ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +5 -5 lines
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

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Jan 18 03:47:26 2024 UTC (10 months, 3 weeks ago) by msaitoh
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +8 -2 lines
rge(4): Print HW revision.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Thu Dec 21 08:50:22 2023 UTC (11 months, 3 weeks ago) by skrll
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +10 -10 lines
G/C sc_task and #include "opt_net_mpsafe.h"

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat Dec 16 16:35:49 2023 UTC (11 months, 4 weeks ago) by mlelstv
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +14 -21 lines
- handle stuck transmitter (descriptor still owned)
- restart send queue after transmit
- count output packets
- use deferred start

Should fix PR 57694

Revision 1.24.4.3: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:25:32 2023 UTC (13 months, 3 weeks ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Diff to: previous 1.24.4.2: preferred, colored; branchpoint 1.24: preferred, colored
Changes since revision 1.24.4.2: +100 -84 lines
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.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Thu Oct 19 23:43:40 2023 UTC (13 months, 3 weeks ago) by mrg
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +50 -53 lines
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.

Revision 1.24.4.2: download - view: text, markup, annotated - select for diffs
Sat Oct 14 06:59:43 2023 UTC (14 months ago) by martin
Branches: netbsd-10
Diff to: previous 1.24.4.1: preferred, colored; branchpoint 1.24: preferred, colored
Changes since revision 1.24.4.1: +3 -6 lines
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.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Oct 9 11:55:22 2023 UTC (14 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -6 lines
rge(4): callout_stop can't be right here; just do callout_halt.

XXX pullup-10

Revision 1.26: download - view: text, markup, annotated - select for diffs
Thu Oct 5 21:43:02 2023 UTC (14 months, 1 week ago) by mrg
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +52 -33 lines
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.

Revision 1.24.4.1: download - view: text, markup, annotated - select for diffs
Wed Dec 21 09:36:42 2022 UTC (23 months, 3 weeks ago) by martin
Branches: netbsd-10
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +18 -24 lines
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.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Dec 21 05:19:15 2022 UTC (23 months, 3 weeks ago) by nonaka
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +18 -24 lines
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.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Sep 24 18:12:42 2022 UTC (2 years, 2 months ago) by thorpej
Branches: MAIN
CVS tags: netbsd-10-base, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -3 lines
Remove unnecessary include of <sys/malloc.h>.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Jul 7 06:11:08 2022 UTC (2 years, 5 months ago) by skrll
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +14 -14 lines
Trailing whitespace

Revision 1.22: download - view: text, markup, annotated - select for diffs
Mon Oct 11 15:11:49 2021 UTC (3 years, 2 months ago) by msaitoh
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +6 -4 lines
Avoid unaligned access in rge_get_macaddr(). Found by kUBSan.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon Oct 11 15:11:07 2021 UTC (3 years, 2 months ago) by msaitoh
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +5 -5 lines
Use unsigned to avoid undefined behavior. Found by kUBSan.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Mon Oct 11 15:10:19 2021 UTC (3 years, 2 months ago) by msaitoh
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +7 -2 lines
Add pmf_device_register().

Revision 1.18.4.1: download - view: text, markup, annotated - select for diffs
Thu May 13 00:47:31 2021 UTC (3 years, 7 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.18: preferred, colored; next MAIN 1.19: preferred, colored
Changes since revision 1.18: +8 -16 lines
Sync with HEAD.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sat May 8 00:27:02 2021 UTC (3 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +8 -16 lines
Use pci_compatible_match().

Revision 1.14.2.1: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:28:46 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14: +772 -350 lines
Sync with HEAD.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Mar 2 07:55:16 2021 UTC (3 years, 9 months ago) by knakahara
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs
Branch point for: thorpej-i2c-spi-conf
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -3 lines
Fix build failure for options NET_MPSAFE.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Mar 1 17:48:52 2021 UTC (3 years, 9 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +766 -344 lines
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.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Wed Jan 27 14:25:22 2021 UTC (3 years, 10 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +7 -7 lines
if_rge.c: avoid aprint_error*() abuse

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Jan 20 18:26:11 2021 UTC (3 years, 10 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +4 -4 lines
Sync with OpenBSD if_rge.c r1.4

"""
Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.
"""

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat May 30 22:39:40 2020 UTC (4 years, 6 months ago) by sevan
Branches: MAIN
Branch point for: thorpej-futex
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +6 -6 lines
Use device_xname() to access dv_xname

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat May 30 22:01:05 2020 UTC (4 years, 6 months ago) by sevan
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +29 -31 lines
Switch from printf to aprintf_error/normal

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat May 30 21:39:49 2020 UTC (4 years, 6 months ago) by sevan
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +4 -2 lines
Initialise sc->sc_dev, otherwise unnamed interfaces show up and things go
downhill from there.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed May 20 20:18:37 2020 UTC (4 years, 6 months ago) by sevan
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -4 lines
use device_private() instead of casting self as it doesn't work here.
Bump rcs tag which was missed in r1.9

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Apr 30 00:32:16 2020 UTC (4 years, 7 months ago) by sevan
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +4 -4 lines
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."

Revision 1.9.4.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:08:09 2020 UTC (4 years, 8 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.9.4.1: preferred, colored; branchpoint 1.9: preferred, colored; next MAIN 1.10: preferred, colored
Changes since revision 1.9.4.1: +2070 -0 lines
Merge changes from current as of 20200406

Revision 1.9.4.1
Sat Feb 29 21:27:19 2020 UTC (4 years, 9 months ago) by martin
Branches: phil-wifi
FILE REMOVED
Changes since revision 1.9: +0 -2070 lines
file if_rge.c was added on branch phil-wifi on 2020-04-08 14:08:09 +0000

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Feb 29 21:27:19 2020 UTC (4 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Branch point for: phil-wifi
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +7 -3 lines
Use the 64-bit PCI tag, if available.

Revision 1.3.2.3: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:19:10 2020 UTC (4 years, 9 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.3.2.2: preferred, colored; branchpoint 1.3: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.2.2: +38 -20 lines
Sync with head.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Thu Feb 27 23:15:34 2020 UTC (4 years, 9 months ago) by sevan
Branches: MAIN
CVS tags: ad-namecache-base3
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +4 -4 lines
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 *).

Revision 1.7: download - view: text, markup, annotated - select for diffs
Thu Feb 27 22:58:57 2020 UTC (4 years, 9 months ago) by sevan
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +21 -2 lines
Add an implementation of MCLGETI.
Borrowed from sys/dev/pci/if_bwfm_pci.c

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Feb 13 23:05:53 2020 UTC (4 years, 10 months ago) by sevan
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +2 -3 lines
redundant include

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue Feb 4 07:41:21 2020 UTC (4 years, 10 months ago) by skrll
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +13 -13 lines
Trailing whitespace

Revision 1.4: download - view: text, markup, annotated - select for diffs
Tue Feb 4 07:37:00 2020 UTC (4 years, 10 months ago) by skrll
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +6 -6 lines
Adopt <net/if_stats.h>

Revision 1.3.2.2: download - view: text, markup, annotated - select for diffs
Fri Jan 17 21:47:31 2020 UTC (4 years, 10 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.3.2.1: preferred, colored; branchpoint 1.3: preferred, colored
Changes since revision 1.3.2.1: +2048 -0 lines
Sync with head.

Revision 1.3.2.1
Sun Jan 12 23:22:12 2020 UTC (4 years, 11 months ago) by ad
Branches: ad-namecache
FILE REMOVED
Changes since revision 1.3: +0 -2048 lines
file if_rge.c was added on branch ad-namecache on 2020-01-17 21:47:31 +0000

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Jan 12 23:22:12 2020 UTC (4 years, 11 months ago) by sevan
Branches: MAIN
CVS tags: ad-namecache-base2, ad-namecache-base1
Branch point for: ad-namecache
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +20 -12 lines
Start to switch from OpenBSD timeout(9) API to callout(9) and workqueue(9)
Replace functions with NetBSD counterparts.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat Jan 11 21:05:45 2020 UTC (4 years, 11 months ago) by sevan
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +101 -67 lines
Start porting to NetBSD. (WIP, incomplete)

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Jan 11 20:56:51 2020 UTC (4 years, 11 months ago) by sevan
Branches: MAIN
Import rge(4) from OpenBSD for Realtek's RTL8125 based 2.5GbE network cards.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>