The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.25 / (download) - annotate - [select for diffs], Sun Aug 28 07:54:03 2022 UTC (5 months ago) by skrll
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.24: +2 -8 lines
Diff to previous 1.24 (colored)

Empty if_watchdog functions are useless and now waste resources. Let's
remove them.

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

Trailing whitespace

Revision 1.23 / (download) - annotate - [select for diffs], Fri Nov 5 23:39:47 2021 UTC (14 months, 3 weeks ago) by andvar
Branch: MAIN
Changes since 1.22: +5 -2 lines
Diff to previous 1.22 (colored)

mcx(4): ensure that RQT size is always a power of two.
Fixes PR kern/56484.
Thanks riastradh for the power of two patch :). OK: mrg, jmcneill, riastradh.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Sep 26 20:14:07 2021 UTC (16 months ago) by jmcneill
Branch: MAIN
Changes since 1.21: +9 -2 lines
Diff to previous 1.21 (colored)

Enable checksum offload features by default.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Sep 26 15:01:55 2021 UTC (16 months ago) by jmcneill
Branch: MAIN
Changes since 1.20: +10 -3 lines
Diff to previous 1.20 (colored)

We are not mapping registers prefetchable so no need for explicit bs
barriers.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Sep 25 15:16:36 2021 UTC (16 months ago) by jmcneill
Branch: MAIN
Changes since 1.19: +7 -7 lines
Diff to previous 1.19 (colored)

Sync with OpenBSD r1.101:

When processing a received packet, only sync the amount of bytes
mcx(4) told us has arrived.  The DMA map's mapsize on RX packets
is the length of the allocated buffer.  For mcx(4), this can be
more than around 9000 bytes, as each buffer will be at least as
big as the maximum supported MTU.  There's no need to sync the
whole buffer, if it's only a small packet.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Sep 20 11:47:26 2021 UTC (16 months, 1 week ago) by jmcneill
Branch: MAIN
Changes since 1.18: +4 -3 lines
Diff to previous 1.18 (colored)

Use coherent DMA mappings when possible.

Revision 1.17.4.1 / (download) - annotate - [select for diffs], Sun Aug 1 22:42:25 2021 UTC (17 months, 4 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

Sync with HEAD.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jul 24 22:30:59 2021 UTC (18 months, 1 week ago) by andvar
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
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

s/structres/structures + s/whenver/whenever

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

Sync with HEAD.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Feb 20 13:31:35 2021 UTC (23 months, 1 week ago) by jmcneill
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Changes since 1.16: +7 -6 lines
Diff to previous 1.16 (colored)

Sync with OpenBSD r1.99:

   move the rearming of the cq after the refill of the rq.

   this is the only real diff we have left outstanding on a box that
   experienced rx lockups. since adding this change it's been happy
   for the last 4 weeks and counting so far.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Feb 5 22:23:30 2021 UTC (23 months, 3 weeks ago) by jmcneill
Branch: MAIN
Changes since 1.15: +79 -6 lines
Diff to previous 1.15 (colored)

mcx: Add if_transmit callback to enable more than one tx queue

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jan 30 21:26:32 2021 UTC (23 months, 4 weeks ago) by jmcneill
Branch: MAIN
Changes since 1.14: +2811 -825 lines
Diff to previous 1.14 (colored)

Sync with OpenBSD r1.98. Lots of improvements including checksum offload,
hardware vlan tagging, and support for multiple receive queues.

Revision 1.14 / (download) - annotate - [select for diffs], Mon May 25 10:35:17 2020 UTC (2 years, 8 months ago) by jmcneill
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.13: +4 -1 lines
Diff to previous 1.13 (colored)

Add __KERNEL_RCSID

Revision 1.1.2.10 / (download) - annotate - [select for diffs], Tue Apr 28 15:44:06 2020 UTC (2 years, 9 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.1.2.9: +165 -116 lines
Diff to previous 1.1.2.9 (colored) next main 1.2 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #858):

	sys/dev/pci/if_mcx.c: revision 1.13

mcx: sync with OpenBSD sys/dev/pci/if_mcx.c r1.44

1.44:
Fix typo which could lead into a double free

1.43:
Commands that create objects return a 24 bit object ID, so mask off the
high 8 bits of the value we extract, in case the firmware leaves junk there.
Hrvoje Popovski has seen this with newer firmware on a ConnectX 5 card,
which now works properly.

1.42:
Increase the completion queue size to prevent overflow.  Under reasonably
unlikely circumstances - lots of single-fragment packets being sent, a
significant number of packets being received, while the interrupt handler
was unable to process the completion queue - the completion queue could
overflow, which would result in the interface locking up.

1.41:
Check if we've reached the end of the current mailbox before writing past
the end of it, rather than after.  Now we can actually allocate queues
big enough to need multiple mailboxes.

1.40:
Don't call mcx_intr() from mcx_cmdq_poll(); this was a leftover from early
development that I forgot about, but turns out to be a potential race with
the actual interrupt handler.

1.39:
fix previous: use the correct offset for sq/rq creation, and don't
reset the mbox counter to 0 after calculating it.

1.38:
Add a helper function for writing physical addresses for queues into
command queue mailboxes, and use this for all queue setup commands.
Previously we just assumed the addresses would fit in the first mailbox,
which is currently true but may not be for much longer.

1.37:
(skipped)

1.36:
The event queue consumer counter also needs to be unsigned like the others.

1.35:
try to make if_baudrate look plausible.
this updates the eth proto capability map so it records the baudrate
against the different link types and their media, and then reads
it when the link state changes.

1.34:
(skipped)

Revision 1.12.2.1 / (download) - annotate - [select for diffs], Sat Apr 25 11:23:59 2020 UTC (2 years, 9 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.12: +165 -116 lines
Diff to previous 1.12 (colored) next main 1.13 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.13 / (download) - annotate - [select for diffs], Fri Apr 24 12:58:42 2020 UTC (2 years, 9 months ago) by jmcneill
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.12: +165 -116 lines
Diff to previous 1.12 (colored)

mcx: sync with OpenBSD sys/dev/pci/if_mcx.c r1.44

1.44:
Fix typo which could lead into a double free

1.43:
Commands that create objects return a 24 bit object ID, so mask off the
high 8 bits of the value we extract, in case the firmware leaves junk there.
Hrvoje Popovski has seen this with newer firmware on a ConnectX 5 card,
which now works properly.

1.42:
Increase the completion queue size to prevent overflow.  Under reasonably
unlikely circumstances - lots of single-fragment packets being sent, a
significant number of packets being received, while the interrupt handler
was unable to process the completion queue - the completion queue could
overflow, which would result in the interface locking up.

1.41:
Check if we've reached the end of the current mailbox before writing past
the end of it, rather than after.  Now we can actually allocate queues
big enough to need multiple mailboxes.

1.40:
Don't call mcx_intr() from mcx_cmdq_poll(); this was a leftover from early
development that I forgot about, but turns out to be a potential race with
the actual interrupt handler.

1.39:
fix previous: use the correct offset for sq/rq creation, and don't
reset the mbox counter to 0 after calculating it.

1.38:
Add a helper function for writing physical addresses for queues into
command queue mailboxes, and use this for all queue setup commands.
Previously we just assumed the addresses would fit in the first mailbox,
which is currently true but may not be for much longer.

1.37:
(skipped)

1.36:
The event queue consumer counter also needs to be unsigned like the others.

1.35:
try to make if_baudrate look plausible.
this updates the eth proto capability map so it records the baudrate
against the different link types and their media, and then reads
it when the link state changes.

1.34:
(skipped)

Revision 1.12.4.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:26 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.12.4.1: +6845 -0 lines
Diff to previous 1.12.4.1 (colored) to branchpoint 1.12 (colored) next main 1.13 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.12.4.1, Sun Mar 15 23:04:50 2020 UTC (2 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.12: +0 -6845 lines
FILE REMOVED

file if_mcx.c was added on branch phil-wifi on 2020-04-13 08:04:26 +0000

Revision 1.12 / (download) - annotate - [select for diffs], Sun Mar 15 23:04:50 2020 UTC (2 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base1, bouyer-xenpvh-base
Branch point for: phil-wifi, bouyer-xenpvh
Changes since 1.11: +12 -8 lines
Diff to previous 1.11 (colored)

Define and implement a locking protocol for the ifmedia / mii layers:
- MP-safe drivers provide a mutex to ifmedia that is used to serialize
  access to media-related structures / hardware regsiters.  Converted
  drivers use the new ifmedia_init_with_lock() function for this.  The
  new name is provided to ease the transition.
- Un-converted drivers continue to call ifmedia_init(), which will supply
  a compatibility lock to be used instead.  Several media-related entry
  points must be aware of this compatibility lock, and are able to acquire
  it recursively a limited number of times, if needed.  This is a SPIN
  mutex with priority IPL_NET.
- This same lock is used to serialize access to PHY registers and other
  MII-related data structures.

The PHY drivers are modified to acquire and release the lock, as needed,
and assert the lock is held as a diagnostic aid.

The "usbnet" framework has had an overhaul of its internal locking
protocols to fit in with the media / mii changes, and the drivers adapted.

USB wifi drivers have been changed to provide their own adaptive mutex
to the ifmedia later via a new ieee80211_media_init_with_lock() function.
This is required because the USB drivers need an adaptive mutex.

Besised "usbnet", a few other drivers are converted: vmx, wm, ixgbe / ixv.

mcx also now calls ifmedia_init_with_lock() because it needs to also use
an adaptive mutex.  The mcx driver still needs to be fully converted to
NET_MPSAFE.

Revision 1.1.2.9 / (download) - annotate - [select for diffs], Sun Mar 1 12:47:10 2020 UTC (2 years, 11 months ago) by martin
Branch: netbsd-9
Changes since 1.1.2.8: +5 -2 lines
Diff to previous 1.1.2.8 (colored)

Pull up following revision(s) (requested by thorpej in ticket #747):

	sys/dev/pci/if_mcx.c: revision 1.11

Use the 64-bit PCI DMA tag if available.  Otherwise, we are needlessly
allocating (and using) bounce buffers on sytems with >4GB of RAM.

XXX pullup-9

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:10 2020 UTC (2 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.9: +6 -3 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Sync with head.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Feb 29 18:07:57 2020 UTC (2 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.10: +5 -2 lines
Diff to previous 1.10 (colored)

Use the 64-bit PCI DMA tag if available.  Otherwise, we are needlessly
allocating (and using) bounce buffers on sytems with >4GB of RAM.

XXX pullup-9

Revision 1.1.2.8 / (download) - annotate - [select for diffs], Fri Jan 31 11:14:50 2020 UTC (3 years ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.1.2.7: +6 -6 lines
Diff to previous 1.1.2.7 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #671):

	sys/dev/pci/if_bce.c: revision 1.53
	sys/dev/pci/pccbbreg.h: revision 1.16
	sys/dev/ic/rt2860.c: revision 1.34
	sys/dev/pci/if_alc.c: revision 1.45
	sys/dev/pci/if_mcx.c: revision 1.5
	sys/dev/pci/if_pcn.c: revision 1.72
	sys/dev/pci/if_ale.c: revision 1.37
	sys/dev/pci/if_age.c: revision 1.65
	sys/dev/ieee1394/fwohcireg.h: revision 1.20
	sys/dev/ieee1394/fwohci.c: revision 1.143
	sys/dev/ieee1394/firewire.c: revision 1.49
	sys/dev/ic/am79900reg.h: revision 1.10

 Use unsigned to avoid undefined behavior. Found by kUBSan.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jan 30 14:02:14 2020 UTC (3 years ago) by thorpej
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Adopt <net/if_stats.h>.

Revision 1.1.2.7 / (download) - annotate - [select for diffs], Sun Jan 26 11:17:11 2020 UTC (3 years ago) by martin
Branch: netbsd-9
Changes since 1.1.2.6: +17 -8 lines
Diff to previous 1.1.2.6 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #651):

	sys/dev/pci/if_mcx.c: revision 1.8
	sys/dev/pci/if_mcx.c: revision 1.9

- Change IFM_10G_T(10GBase-T) entry to IFM_10G_CR1(10GBASE-CR1)
- Add the following entries:
	20GBASE-KR2
	56GBASE-R4
	100GBASE-LR4
	100BaseTX
	1000baseT
	10GBase-T
Set if_baudrate.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Nov 29 15:17:14 2019 UTC (3 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.8: +4 -1 lines
Diff to previous 1.8 (colored)

Set if_baudrate.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Nov 28 16:02:07 2019 UTC (3 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.7: +14 -8 lines
Diff to previous 1.7 (colored)

- Change IFM_10G_T(10GBase-T) entry to IFM_10G_CR1(10GBASE-CR1)
- Add the following entries:

	20GBASE-KR2
	56GBASE-R4
	100GBASE-LR4
	100BaseTX
	1000baseT
	10GBase-T

Revision 1.1.2.6 / (download) - annotate - [select for diffs], Tue Nov 26 18:30:57 2019 UTC (3 years, 2 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RC1
Changes since 1.1.2.5: +29 -9 lines
Diff to previous 1.1.2.5 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #486):

	sys/dev/pci/if_mcx.c: revision 1.7

Fix IFF_ALLMULTI handling.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Nov 26 10:33:19 2019 UTC (3 years, 2 months ago) by jmcneill
Branch: MAIN
Changes since 1.6: +29 -9 lines
Diff to previous 1.6 (colored)

Fix IFF_ALLMULTI handling.

Revision 1.1.2.5 / (download) - annotate - [select for diffs], Mon Nov 18 19:46:33 2019 UTC (3 years, 2 months ago) by martin
Branch: netbsd-9
Changes since 1.1.2.4: +2 -2 lines
Diff to previous 1.1.2.4 (colored)

Pull up following revision(s) (requested by nonaka in ticket #441):

	sys/dev/hyperv/if_hvn.c: revision 1.7
	sys/dev/pci/if_mcx.c: revision 1.6

Fixed incorrect m_defrag return value check.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Nov 18 04:40:05 2019 UTC (3 years, 2 months ago) by nonaka
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Fixed incorrect m_defrag return value check.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Oct 17 15:57:56 2019 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.4: +6 -6 lines
Diff to previous 1.4 (colored)

 Use unsigned to avoid undefined behavior. Found by kUBSan.

Revision 1.1.2.4 / (download) - annotate - [select for diffs], Sun Sep 29 07:26:23 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-9
Changes since 1.1.2.3: +4 -3 lines
Diff to previous 1.1.2.3 (colored)

Pull up following revision(s) (requested by tnn in ticket #266):

	sys/dev/pci/if_mcx.c: revision 1.3
	sys/dev/pci/if_mcx.c: revision 1.4

mcx(4): fix rx mbuf DMA overrun
pullup-9

 -

len -> m_len

Revision 1.4 / (download) - annotate - [select for diffs], Sat Sep 28 16:22:45 2019 UTC (3 years, 4 months ago) by tnn
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

len -> m_len

Revision 1.3 / (download) - annotate - [select for diffs], Sat Sep 28 16:20:43 2019 UTC (3 years, 4 months ago) by tnn
Branch: MAIN
Changes since 1.2: +4 -3 lines
Diff to previous 1.2 (colored)

mcx(4): fix rx mbuf DMA overrun

pullup-9

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Thu Sep 26 19:09:57 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-9
Changes since 1.1.2.2: +2 -2 lines
Diff to previous 1.1.2.2 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #247):

	sys/dev/pci/if_mcx.c: revision 1.2

Use IFM_50G_SR2.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Sep 24 14:39:38 2019 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

 Use IFM_50G_SR2.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Mon Sep 23 07:04:40 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-9
Changes since 1.1.2.1: +6808 -0 lines
Diff to previous 1.1.2.1 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #230):

	sys/dev/pci/files.pci: revision 1.415
	distrib/sets/lists/man/mi: revision 1.1655
	sys/dev/pci/if_mcx.c: revision 1.1
	share/man/man4/Makefile: revision 1.683
	share/man/man4/mcx.4: revision 1.1
	sys/arch/evbarm/conf/GENERIC64: revision 1.107
	sys/dev/pci/files.pci: revision 1.414

Add support for Mellanox 5th generation ethernet devices. This driver
supports the ConnectX-4 Lx EN, ConnectX-4 EN, ConnectX-5 EN, and
ConnectX-6 EN adapters.

Driver ported from OpenBSD.

add mcx attachment.

Correct mcx comment, drop mii dependency

Revision 1.1.2.1, Sat Sep 21 14:04:12 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-9
Changes since 1.1: +0 -6808 lines
FILE REMOVED

file if_mcx.c was added on branch netbsd-9 on 2019-09-23 07:04:40 +0000

Revision 1.1 / (download) - annotate - [select for diffs], Sat Sep 21 14:04:12 2019 UTC (3 years, 4 months ago) by jmcneill
Branch: MAIN
Branch point for: netbsd-9

Add support for Mellanox 5th generation ethernet devices. This driver
supports the ConnectX-4 Lx EN, ConnectX-4 EN, ConnectX-5 EN, and
ConnectX-6 EN adapters.

Driver ported from OpenBSD.

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>