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


Default branch: MAIN


Revision 1.31 / (download) - annotate - [select for diffs], Thu Jan 18 03:47:26 2024 UTC (6 weeks, 5 days ago) by msaitoh
Branch: MAIN
CVS Tags: triaxx-drm, HEAD
Changes since 1.30: +8 -2 lines
Diff to previous 1.30 (colored)

rge(4): Print HW revision.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Dec 21 08:50:22 2023 UTC (2 months, 2 weeks ago) by skrll
Branch: MAIN
Changes since 1.29: +10 -10 lines
Diff to previous 1.29 (colored)

G/C sc_task and #include "opt_net_mpsafe.h"

Revision 1.29 / (download) - annotate - [select for diffs], Sat Dec 16 16:35:49 2023 UTC (2 months, 2 weeks ago) by mlelstv
Branch: MAIN
Changes since 1.28: +14 -21 lines
Diff to previous 1.28 (colored)

- 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) - annotate - [select for diffs], Sun Oct 22 06:25:32 2023 UTC (4 months, 1 week ago) by martin
Branch: netbsd-10
CVS Tags: netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Changes since 1.24.4.2: +100 -84 lines
Diff to previous 1.24.4.2 (colored) to branchpoint 1.24 (colored) next main 1.25 (colored)

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) - annotate - [select for diffs], Thu Oct 19 23:43:40 2023 UTC (4 months, 2 weeks ago) by mrg
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Changes since 1.27: +50 -53 lines
Diff to previous 1.27 (colored)

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) - annotate - [select for diffs], Sat Oct 14 06:59:43 2023 UTC (4 months, 3 weeks ago) by martin
Branch: netbsd-10
Changes since 1.24.4.1: +3 -6 lines
Diff to previous 1.24.4.1 (colored) to branchpoint 1.24 (colored)

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) - annotate - [select for diffs], Mon Oct 9 11:55:22 2023 UTC (4 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.26: +3 -6 lines
Diff to previous 1.26 (colored)

rge(4): callout_stop can't be right here; just do callout_halt.

XXX pullup-10

Revision 1.26 / (download) - annotate - [select for diffs], Thu Oct 5 21:43:02 2023 UTC (4 months, 4 weeks ago) by mrg
Branch: MAIN
Changes since 1.25: +52 -33 lines
Diff to previous 1.25 (colored)

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) - annotate - [select for diffs], Wed Dec 21 09:36:42 2022 UTC (14 months, 2 weeks ago) by martin
Branch: netbsd-10
Changes since 1.24: +18 -24 lines
Diff to previous 1.24 (colored)

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) - annotate - [select for diffs], Wed Dec 21 05:19:15 2022 UTC (14 months, 2 weeks ago) by nonaka
Branch: MAIN
Changes since 1.24: +18 -24 lines
Diff to previous 1.24 (colored)

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) - annotate - [select for diffs], Sat Sep 24 18:12:42 2022 UTC (17 months, 1 week ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-10-base, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Changes since 1.23: +2 -3 lines
Diff to previous 1.23 (colored)

Remove unnecessary include of <sys/malloc.h>.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jul 7 06:11:08 2022 UTC (19 months, 4 weeks ago) by skrll
Branch: MAIN
Changes since 1.22: +14 -14 lines
Diff to previous 1.22 (colored)

Trailing whitespace

Revision 1.22 / (download) - annotate - [select for diffs], Mon Oct 11 15:11:49 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.21: +6 -4 lines
Diff to previous 1.21 (colored)

Avoid unaligned access in rge_get_macaddr(). Found by kUBSan.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Oct 11 15:11:07 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.20: +5 -5 lines
Diff to previous 1.20 (colored)

Use unsigned to avoid undefined behavior. Found by kUBSan.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Oct 11 15:10:19 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.19: +7 -2 lines
Diff to previous 1.19 (colored)

Add pmf_device_register().

Revision 1.18.4.1 / (download) - annotate - [select for diffs], Thu May 13 00:47:31 2021 UTC (2 years, 9 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.18: +8 -16 lines
Diff to previous 1.18 (colored) next main 1.19 (colored)

Sync with HEAD.

Revision 1.19 / (download) - annotate - [select for diffs], Sat May 8 00:27:02 2021 UTC (2 years, 9 months ago) by thorpej
Branch: 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
Changes since 1.18: +8 -16 lines
Diff to previous 1.18 (colored)

Use pci_compatible_match().

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:46 2021 UTC (2 years, 11 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.14: +772 -350 lines
Diff to previous 1.14 (colored) next main 1.15 (colored)

Sync with HEAD.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Mar 2 07:55:16 2021 UTC (3 years ago) by knakahara
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs
Branch point for: thorpej-i2c-spi-conf
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Fix build failure for options NET_MPSAFE.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Mar 1 17:48:52 2021 UTC (3 years ago) by jakllsch
Branch: MAIN
Changes since 1.16: +766 -344 lines
Diff to previous 1.16 (colored)

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) - annotate - [select for diffs], Wed Jan 27 14:25:22 2021 UTC (3 years, 1 month ago) by jakllsch
Branch: MAIN
Changes since 1.15: +7 -7 lines
Diff to previous 1.15 (colored)

if_rge.c: avoid aprint_error*() abuse

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jan 20 18:26:11 2021 UTC (3 years, 1 month ago) by jakllsch
Branch: MAIN
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (colored)

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) - annotate - [select for diffs], Sat May 30 22:39:40 2020 UTC (3 years, 9 months ago) by sevan
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.13: +6 -6 lines
Diff to previous 1.13 (colored)

Use device_xname() to access dv_xname

Revision 1.13 / (download) - annotate - [select for diffs], Sat May 30 22:01:05 2020 UTC (3 years, 9 months ago) by sevan
Branch: MAIN
Changes since 1.12: +29 -31 lines
Diff to previous 1.12 (colored)

Switch from printf to aprintf_error/normal

Revision 1.12 / (download) - annotate - [select for diffs], Sat May 30 21:39:49 2020 UTC (3 years, 9 months ago) by sevan
Branch: MAIN
Changes since 1.11: +4 -2 lines
Diff to previous 1.11 (colored)

Initialise sc->sc_dev, otherwise unnamed interfaces show up and things go
downhill from there.

Revision 1.11 / (download) - annotate - [select for diffs], Wed May 20 20:18:37 2020 UTC (3 years, 9 months ago) by sevan
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

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) - annotate - [select for diffs], Thu Apr 30 00:32:16 2020 UTC (3 years, 10 months ago) by sevan
Branch: MAIN
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

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) - annotate - [select for diffs], Wed Apr 8 14:08:09 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.9.4.1: +2070 -0 lines
Diff to previous 1.9.4.1 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

Merge changes from current as of 20200406

Revision 1.9.4.1, Sat Feb 29 21:27:19 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.9: +0 -2070 lines
FILE REMOVED

file if_rge.c was added on branch phil-wifi on 2020-04-08 14:08:09 +0000

Revision 1.9 / (download) - annotate - [select for diffs], Sat Feb 29 21:27:19 2020 UTC (4 years ago) by thorpej
Branch: 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
Changes since 1.8: +7 -3 lines
Diff to previous 1.8 (colored)

Use the 64-bit PCI tag, if available.

Revision 1.3.2.3 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:10 2020 UTC (4 years ago) by ad
Branch: ad-namecache
Changes since 1.3.2.2: +38 -20 lines
Diff to previous 1.3.2.2 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Sync with head.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Feb 27 23:15:34 2020 UTC (4 years ago) by sevan
Branch: MAIN
CVS Tags: ad-namecache-base3
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored)

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) - annotate - [select for diffs], Thu Feb 27 22:58:57 2020 UTC (4 years ago) by sevan
Branch: MAIN
Changes since 1.6: +21 -2 lines
Diff to previous 1.6 (colored)

Add an implementation of MCLGETI.
Borrowed from sys/dev/pci/if_bwfm_pci.c

Revision 1.6 / (download) - annotate - [select for diffs], Thu Feb 13 23:05:53 2020 UTC (4 years ago) by sevan
Branch: MAIN
Changes since 1.5: +2 -3 lines
Diff to previous 1.5 (colored)

redundant include

Revision 1.5 / (download) - annotate - [select for diffs], Tue Feb 4 07:41:21 2020 UTC (4 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.4: +13 -13 lines
Diff to previous 1.4 (colored)

Trailing whitespace

Revision 1.4 / (download) - annotate - [select for diffs], Tue Feb 4 07:37:00 2020 UTC (4 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.3: +6 -6 lines
Diff to previous 1.3 (colored)

Adopt <net/if_stats.h>

Revision 1.3.2.2 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:31 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.3.2.1: +2048 -0 lines
Diff to previous 1.3.2.1 (colored) to branchpoint 1.3 (colored)

Sync with head.

Revision 1.3.2.1, Sun Jan 12 23:22:12 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.3: +0 -2048 lines
FILE REMOVED

file if_rge.c was added on branch ad-namecache on 2020-01-17 21:47:31 +0000

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 12 23:22:12 2020 UTC (4 years, 1 month ago) by sevan
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1
Branch point for: ad-namecache
Changes since 1.2: +20 -12 lines
Diff to previous 1.2 (colored)

Start to switch from OpenBSD timeout(9) API to callout(9) and workqueue(9)
Replace functions with NetBSD counterparts.

Revision 1.2 / (download) - annotate - [select for diffs], Sat Jan 11 21:05:45 2020 UTC (4 years, 1 month ago) by sevan
Branch: MAIN
Changes since 1.1: +101 -67 lines
Diff to previous 1.1 (colored)

Start porting to NetBSD. (WIP, incomplete)

Revision 1.1 / (download) - annotate - [select for diffs], Sat Jan 11 20:56:51 2020 UTC (4 years, 1 month ago) by sevan
Branch: MAIN

Import rge(4) from OpenBSD for Realtek's RTL8125 based 2.5GbE network cards.

This form allows you to request diff's 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.




CVSweb <webmaster@jp.NetBSD.org>