<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/mgb, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>Canonicalize the name of the FreeBSD Foundation</title>
<updated>2025-02-19T19:52:36+00:00</updated>
<author>
<name>Li-Wen Hsu</name>
<email>lwhsu@FreeBSD.org</email>
</author>
<published>2024-10-23T21:03:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fd3016b17efbfb351c62921e4ec1ac3812baffab'/>
<id>fd3016b17efbfb351c62921e4ec1ac3812baffab</id>
<content type='text'>
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dab59af3bcc7cb7ba01569d3044894b3e860ad56)
(cherry picked from commit ef3ed0726f2230e38df76a32a3b9ff145147af65)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dab59af3bcc7cb7ba01569d3044894b3e860ad56)
(cherry picked from commit ef3ed0726f2230e38df76a32a3b9ff145147af65)
</pre>
</div>
</content>
</entry>
<entry>
<title>iflib drivers: Constify PCI ID LUTs</title>
<updated>2024-01-05T22:48:03+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2023-08-16T16:49:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5153206df0f29d682cdcad97b67d182b00204ccd'/>
<id>5153206df0f29d682cdcad97b67d182b00204ccd</id>
<content type='text'>
Since d49e83eac3baf16a22b1c5d42e8438b68b17e6f9, iflib(9) is ready
for this change.
While at it, make isc_driver_version strings (static) const where
not apparently un-const on purpose, too.
This reduces the size of the amd64 GENERIC by about 10 KiB.

(cherry picked from commit 51e235148a4becba94e824a44bd69687644a7f56)

Conflicts (drivers missing in stable/13):
	sys/dev/enetc/if_enetc.c
	sys/dev/enic/if_enic.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since d49e83eac3baf16a22b1c5d42e8438b68b17e6f9, iflib(9) is ready
for this change.
While at it, make isc_driver_version strings (static) const where
not apparently un-const on purpose, too.
This reduces the size of the amd64 GENERIC by about 10 KiB.

(cherry picked from commit 51e235148a4becba94e824a44bd69687644a7f56)

Conflicts (drivers missing in stable/13):
	sys/dev/enetc/if_enetc.c
	sys/dev/enic/if_enic.c
</pre>
</div>
</content>
</entry>
<entry>
<title>iflib: invert default restart on VLAN changes</title>
<updated>2023-09-11T22:34:21+00:00</updated>
<author>
<name>Kevin Bowling</name>
<email>kbowling@FreeBSD.org</email>
</author>
<published>2023-08-24T20:42:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6cb4a544e00f834d3fa956aca61b0f71c04a4ad5'/>
<id>6cb4a544e00f834d3fa956aca61b0f71c04a4ad5</id>
<content type='text'>
In rS360398, a new iflib device method was added to opt out of VLAN
events needing an interface reset.

I am switching the default to not requiring a restart for:
* VLAN events
* unknown events

After fixing various bugs, I do not think this would be a common need
of hardware and it is undesirable from the user's perspective causing
link flaps and much slower VLAN configuration. Currently, there are no
other restart events besides VLAN events, and setting the
ifdi_needs_restart default to false will alleviate the need to churn
every driver if an odd event is added in the future for specific
hardware.

markj points out this could cause churn in the other direction; I will
solve that problem with an event registration system as he mentions in
the review should we need it in the future.

These drivers will opt into restart and need further inspection or work:
* ixv (needs code audit, 61a8231 fixed principal issue; re-init probably
not necessary)
* axgbe (needs code audit; re-init probably not necessary)
* iavf - (needs code audit; interaction with Malicious Driver Detection
mentioned in rS360398)
* mgb - no VLAN functions are currently implemented. Left a comment.

Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558

(cherry picked from commit 725e4008efef32dfbe57b3e21635fa80dde8ee38)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In rS360398, a new iflib device method was added to opt out of VLAN
events needing an interface reset.

I am switching the default to not requiring a restart for:
* VLAN events
* unknown events

After fixing various bugs, I do not think this would be a common need
of hardware and it is undesirable from the user's perspective causing
link flaps and much slower VLAN configuration. Currently, there are no
other restart events besides VLAN events, and setting the
ifdi_needs_restart default to false will alleviate the need to churn
every driver if an odd event is added in the future for specific
hardware.

markj points out this could cause churn in the other direction; I will
solve that problem with an event registration system as he mentions in
the review should we need it in the future.

These drivers will opt into restart and need further inspection or work:
* ixv (needs code audit, 61a8231 fixed principal issue; re-init probably
not necessary)
* axgbe (needs code audit; re-init probably not necessary)
* iavf - (needs code audit; interaction with Malicious Driver Detection
mentioned in rS360398)
* mgb - no VLAN functions are currently implemented. Left a comment.

Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558

(cherry picked from commit 725e4008efef32dfbe57b3e21635fa80dde8ee38)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-23T17:43:25+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:27+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3bc80996974a61a4223eae4c1ccd47b6ee32a48a'/>
<id>3bc80996974a61a4223eae4c1ccd47b6ee32a48a</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in current:
(cherry picked from commit 685dc743dc3b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in current:
(cherry picked from commit 685dc743dc3b)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-23T17:43:20+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f8167e0404dab9ffeaca95853dd237ab7c587f82'/>
<id>f8167e0404dab9ffeaca95853dd237ab7c587f82</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 95ee2897e98f)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 95ee2897e98f)
</pre>
</div>
</content>
</entry>
<entry>
<title>mgb: remove set but not used variables</title>
<updated>2022-02-09T21:22:20+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2021-11-23T01:32:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=51f69c0d533dc7b363a19b9b01cd1310979ee1fc'/>
<id>51f69c0d533dc7b363a19b9b01cd1310979ee1fc</id>
<content type='text'>
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c0aa5f6a321b8e7a921eda69ec0ab7373890c155)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c0aa5f6a321b8e7a921eda69ec0ab7373890c155)
</pre>
</div>
</content>
</entry>
<entry>
<title>mgb: sync with version in main</title>
<updated>2021-10-05T18:57:21+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2021-08-13T20:57:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9130e0ace0bb3e6cd1ad052b8a69ecbf37eb2b62'/>
<id>9130e0ace0bb3e6cd1ad052b8a69ecbf37eb2b62</id>
<content type='text'>
This is a combination of 7 commits.

mgb: update Microchip URLs

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6b25b4a73fbe56e15d094895b4c7acdb424ee80d)

mgb: enable multicast in mgb_init

Receive Filtering Engine (RFE) configuration is not yet implemented,
and mgb intended to enable all broadcast, multicast, and unicast.
However, MGB_RFE_ALLOW_MULTICAST was missed (MGB_RFE_ALLOW_UNICAST was
included twice).

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ecac5c2928eead57c05ee7d376ff58de0a575d49)

mgb: Do not KASSERT on error in mgb_init

There's not much we can do if mii_mediachg() fails, but KASSERT is not
appropriate.

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8b889b8953828fe22e5de68647a35610dd87ff8f)

mgb: Staticize devclass and iflib structs (as is typical)

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c83ae596f3c2ce8c4ef2bacfb63100aaf8d48bb7)

mgb: Apply some style(9)

Add parens around return values, rewrap lines

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 820da5820e60f538d3598d8cb226f51a01bdf01c)

mgb: Fix DEBUG (and LINT) build

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5f07d7fe408bbca5c2f6755c363128107916c08d)

mgb: Fix nop admin interrupt handling

Previously mgb_admin_intr printed a diagnostic message if no interrupt
status bits were set, but it's not valid to call device_printf() from a
filter.  Just drop the message as it has no user-facing value.

Also return FILTER_STRAY in this case - there is nothing further for
the driver to do.

Reviewed by:	kbowling
MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32231

(cherry picked from commit 1ad2d87778970582854082bcedd2df0394fd4933)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a combination of 7 commits.

mgb: update Microchip URLs

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6b25b4a73fbe56e15d094895b4c7acdb424ee80d)

mgb: enable multicast in mgb_init

Receive Filtering Engine (RFE) configuration is not yet implemented,
and mgb intended to enable all broadcast, multicast, and unicast.
However, MGB_RFE_ALLOW_MULTICAST was missed (MGB_RFE_ALLOW_UNICAST was
included twice).

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ecac5c2928eead57c05ee7d376ff58de0a575d49)

mgb: Do not KASSERT on error in mgb_init

There's not much we can do if mii_mediachg() fails, but KASSERT is not
appropriate.

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8b889b8953828fe22e5de68647a35610dd87ff8f)

mgb: Staticize devclass and iflib structs (as is typical)

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c83ae596f3c2ce8c4ef2bacfb63100aaf8d48bb7)

mgb: Apply some style(9)

Add parens around return values, rewrap lines

MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 820da5820e60f538d3598d8cb226f51a01bdf01c)

mgb: Fix DEBUG (and LINT) build

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5f07d7fe408bbca5c2f6755c363128107916c08d)

mgb: Fix nop admin interrupt handling

Previously mgb_admin_intr printed a diagnostic message if no interrupt
status bits were set, but it's not valid to call device_printf() from a
filter.  Just drop the message as it has no user-facing value.

Also return FILTER_STRAY in this case - there is nothing further for
the driver to do.

Reviewed by:	kbowling
MFC after:	1 week
Fixes:		8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32231

(cherry picked from commit 1ad2d87778970582854082bcedd2df0394fd4933)
</pre>
</div>
</content>
</entry>
<entry>
<title>iflib: ensure that tx interrupts enabled and cleanups</title>
<updated>2021-01-07T22:07:35+00:00</updated>
<author>
<name>Matt Macy</name>
<email>mmacy@FreeBSD.org</email>
</author>
<published>2020-12-19T01:08:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=81be655266fac2b333e25f386f32c9bcd17f523d'/>
<id>81be655266fac2b333e25f386f32c9bcd17f523d</id>
<content type='text'>
Doing a 'dd' over iscsi will reliably cause stalls. Tx
cleaning _should_ reliably happen as data is sent.
However, currently if the transmit queue fills it will
wait until the iflib timer (hz/2) runs.

This change causes the the tx taskq thread to be run
if there are completed descriptors.

While here:

- make timer interrupt delay a sysctl

- simplify txd_db_check handling

- comment on INTR types

Background on the change:

Initially doorbell updates were minimized by only writing to the register
on every fourth packet. If txq_drain would return without writing to the
doorbell it scheduled a callout on the next tick to do the doorbell write
to ensure that the write otherwise happened "soon". At that time a sysctl
was added for users to avoid the potential added latency by simply writing
to the doorbell register on every packet. This worked perfectly well for
e1000 and ixgbe ... and appeared to work well on ixl. However, as it
turned out there was a race to this approach that would lockup the ixl MAC.
It was possible for a lower producer index to be written after a higher one.
On e1000 and ixgbe this was harmless - on ixl it was fatal. My initial
response was to add a lock around doorbell writes - fixing the problem but
adding an unacceptable amount of lock contention.

The next iteration was to use transmit interrupts to drive delayed doorbell
writes. If there were no packets in the queue all doorbell writes would be
immediate as the queue started to fill up we could delay doorbell writes
further and further. At the start of drain if we've cleaned any packets we
know we've moved the state machine along and we write the doorbell (an
obvious missing optimization was to skip that doorbell write if db_pending
is zero). This change required that tx interrupts be scheduled periodically
as opposed to just when the hardware txq was full. However, that just leads
to our next problem.

Initially dedicated msix vectors were used for both tx and rx. However, it
was often possible to use up all available vectors before we set up all the
queues we wanted. By having rx and tx share a vector for a given queue we
could halve the number of vectors used by a given configuration. The problem
here is that with this change only e1000 passed the necessary value to have
the fast interrupt drive tx when appropriate.

Reported by: mav@
Tested by: mav@
Reviewed by:    gallatin@
MFC after:      1 month
Sponsored by:   iXsystems
Differential Revision:  https://reviews.freebsd.org/D27683
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Doing a 'dd' over iscsi will reliably cause stalls. Tx
cleaning _should_ reliably happen as data is sent.
However, currently if the transmit queue fills it will
wait until the iflib timer (hz/2) runs.

This change causes the the tx taskq thread to be run
if there are completed descriptors.

While here:

- make timer interrupt delay a sysctl

- simplify txd_db_check handling

- comment on INTR types

Background on the change:

Initially doorbell updates were minimized by only writing to the register
on every fourth packet. If txq_drain would return without writing to the
doorbell it scheduled a callout on the next tick to do the doorbell write
to ensure that the write otherwise happened "soon". At that time a sysctl
was added for users to avoid the potential added latency by simply writing
to the doorbell register on every packet. This worked perfectly well for
e1000 and ixgbe ... and appeared to work well on ixl. However, as it
turned out there was a race to this approach that would lockup the ixl MAC.
It was possible for a lower producer index to be written after a higher one.
On e1000 and ixgbe this was harmless - on ixl it was fatal. My initial
response was to add a lock around doorbell writes - fixing the problem but
adding an unacceptable amount of lock contention.

The next iteration was to use transmit interrupts to drive delayed doorbell
writes. If there were no packets in the queue all doorbell writes would be
immediate as the queue started to fill up we could delay doorbell writes
further and further. At the start of drain if we've cleaned any packets we
know we've moved the state machine along and we write the doorbell (an
obvious missing optimization was to skip that doorbell write if db_pending
is zero). This change required that tx interrupts be scheduled periodically
as opposed to just when the hardware txq was full. However, that just leads
to our next problem.

Initially dedicated msix vectors were used for both tx and rx. However, it
was often possible to use up all available vectors before we set up all the
queues we wanted. By having rx and tx share a vector for a given queue we
could halve the number of vectors used by a given configuration. The problem
here is that with this change only e1000 passed the necessary value to have
the fast interrupt drive tx when appropriate.

Reported by: mav@
Tested by: mav@
Reviewed by:    gallatin@
MFC after:      1 month
Sponsored by:   iXsystems
Differential Revision:  https://reviews.freebsd.org/D27683
</pre>
</div>
</content>
</entry>
<entry>
<title>mgb: correct macro argument name</title>
<updated>2020-09-03T02:17:55+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2020-09-03T02:17:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=49492b213fbd94348911f276b7bc771ecadb7c7a'/>
<id>49492b213fbd94348911f276b7bc771ecadb7c7a</id>
<content type='text'>
mgb had a longstanding typo in function-like macro MGB_NEXT_RING_IDX's
argument, but the macro had no consumers.  r365061 introduced a use of
the macro, after which mgb failed to build.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mgb had a longstanding typo in function-like macro MGB_NEXT_RING_IDX's
argument, but the macro had no consumers.  r365061 introduced a use of
the macro, after which mgb failed to build.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
</pre>
</div>
</content>
</entry>
<entry>
<title>mgb: clean up empty lines in .c and .h files</title>
<updated>2020-09-01T22:08:14+00:00</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-09-01T22:08:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fc32241fc8a8d46a481bf05252fb3d260f0955de'/>
<id>fc32241fc8a8d46a481bf05252fb3d260f0955de</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
