History log of /netbsd-current/sys/dev/pci/if_mcx.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.27 11-Apr-2024 andvar

mcx(4): enforce full-duplex mark in mcx_media_status(), when link is up.

LACP protocol requires full-duplex to be enabled for lagg(4) to work,
however mcx(4) was not setting this capability making it to fail.

Fixes PR kern/58124. OK'd by msaitoh@


Revision tags: thorpej-ifq-base thorpej-altq-separation-base
# 1.26 26-Oct-2023 msaitoh

mcx(4): Add Mellanox ConnectX-6 Lx from OpenBSD.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.25 28-Aug-2022 skrll

branches: 1.25.4;
Empty if_watchdog functions are useless and now waste resources. Let's
remove them.


# 1.24 07-Jul-2022 skrll

Trailing whitespace


# 1.23 05-Nov-2021 andvar

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.


# 1.22 26-Sep-2021 jmcneill

Enable checksum offload features by default.


# 1.21 26-Sep-2021 jmcneill

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


# 1.20 25-Sep-2021 jmcneill

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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.26 26-Oct-2023 msaitoh

mcx(4): Add Mellanox ConnectX-6 Lx from OpenBSD.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.25 28-Aug-2022 skrll

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


# 1.24 07-Jul-2022 skrll

Trailing whitespace


# 1.23 05-Nov-2021 andvar

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.


# 1.22 26-Sep-2021 jmcneill

Enable checksum offload features by default.


# 1.21 26-Sep-2021 jmcneill

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


# 1.20 25-Sep-2021 jmcneill

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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.25 28-Aug-2022 skrll

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


# 1.24 07-Jul-2022 skrll

Trailing whitespace


# 1.23 05-Nov-2021 andvar

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.


# 1.22 26-Sep-2021 jmcneill

Enable checksum offload features by default.


# 1.21 26-Sep-2021 jmcneill

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


# 1.20 25-Sep-2021 jmcneill

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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.24 07-Jul-2022 skrll

Trailing whitespace


# 1.23 05-Nov-2021 andvar

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.


# 1.22 26-Sep-2021 jmcneill

Enable checksum offload features by default.


# 1.21 26-Sep-2021 jmcneill

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


# 1.20 25-Sep-2021 jmcneill

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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.23 05-Nov-2021 andvar

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.


# 1.22 26-Sep-2021 jmcneill

Enable checksum offload features by default.


# 1.21 26-Sep-2021 jmcneill

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


# 1.20 25-Sep-2021 jmcneill

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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.22 26-Sep-2021 jmcneill

Enable checksum offload features by default.


# 1.21 26-Sep-2021 jmcneill

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


# 1.20 25-Sep-2021 jmcneill

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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.20 25-Sep-2021 jmcneill

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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.19 20-Sep-2021 jmcneill

Use coherent DMA mappings when possible.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

branches: 1.17.4;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.18 24-Jul-2021 andvar

s/structres/structures + s/whenver/whenever


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.17 20-Feb-2021 jmcneill

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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


# 1.14 25-May-2020 jmcneill

branches: 1.14.2;
Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.17 20-Feb-2021 jmcneill

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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


Revision tags: thorpej-futex-base
# 1.14 25-May-2020 jmcneill

Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.16 05-Feb-2021 jmcneill

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


# 1.15 30-Jan-2021 jmcneill

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


Revision tags: thorpej-futex-base
# 1.14 25-May-2020 jmcneill

Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.15 30-Jan-2021 jmcneill

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


Revision tags: thorpej-futex-base
# 1.14 25-May-2020 jmcneill

Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.14 25-May-2020 jmcneill

Add __KERNEL_RCSID


Revision tags: bouyer-xenpvh-base2
# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.2; 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.13 24-Apr-2020 jmcneill

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 tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.12 15-Mar-2020 thorpej

branches: 1.12.4;
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 tags: is-mlppp-base ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.12 15-Mar-2020 thorpej

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 tags: ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


Revision tags: ad-namecache-base3
# 1.11 29-Feb-2020 thorpej

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


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

branches: 1.9.2;
Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.10 30-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.9 29-Nov-2019 msaitoh

Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.9 29-Nov-2019 msaitoh

Set if_baudrate.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.8 28-Nov-2019 msaitoh

- 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


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.7 26-Nov-2019 jmcneill

Fix IFF_ALLMULTI handling.


Revision tags: phil-wifi-20191119
# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.6 18-Nov-2019 nonaka

Fixed incorrect m_defrag return value check.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.5 17-Oct-2019 msaitoh

Use unsigned to avoid undefined behavior. Found by kUBSan.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.4 28-Sep-2019 tnn

len -> m_len


# 1.3 28-Sep-2019 tnn

mcx(4): fix rx mbuf DMA overrun

pullup-9


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.2 24-Sep-2019 msaitoh

Use IFM_50G_SR2.


# 1.1 21-Sep-2019 jmcneill

branches: 1.1.2;
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.


# 1.1 21-Sep-2019 jmcneill

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.