]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
23 months agolibpmc: add armv8 pmu-event aliases
Mitchell Horne [Wed, 6 Jul 2022 17:30:03 +0000 (14:30 -0300)]
libpmc: add armv8 pmu-event aliases

These are all "standard microarchitectural events", which in theory are
supported by every ARMv8 processor. In practice, it depends on the
pmu-event definitions being complete and accurate, which they are not
for every processor. Still, these aliases should be functional on the
majority of systems.

PR: 254532
Reported by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35550

23 months agolibpmc: import updated pmu-events for arm64
Mitchell Horne [Wed, 6 Jul 2022 17:29:55 +0000 (14:29 -0300)]
libpmc: import updated pmu-events for arm64

Thanks to the recently updated import of the jevents utility by mav@, we
can now compile the latest version of these event definitions. This
should support a wider set of common ARMv8 processors, for example, the
Cortex-A72 in the Raspberry Pi 4.

This brings this folder in sync with Linux commit 62e6eb8d5454.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35549

23 months agoena: Update driver version to v2.6.1
Michal Krawczyk [Mon, 4 Jul 2022 07:12:57 +0000 (09:12 +0200)]
ena: Update driver version to v2.6.1

Minor version update which improves styling of a printouts, fixes
the KASAN and KMSAN kernel builds and LLQ reconfiguration after the
device reset.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

23 months agoena: Fix LLQ descriptor reconfiguration
Michal Krawczyk [Tue, 5 Jul 2022 10:59:25 +0000 (12:59 +0200)]
ena: Fix LLQ descriptor reconfiguration

After the device reset, the LLQ configuration descriptor wasn't passed
to the hardware. On a 6-generation AWS instances (like C6gn), it is
required to pass the LLQ descriptor after the device reset, otherwise
the hardware will be missing the LLQ configuration resulting in
performance degradation.

This patch reconfigures the LLQ each time the ena_device_init() is
called. This means that the LLQ descriptor will be passed during the
initial configuration and after a reset.

The ena_map_llq_mem_bar() function call was moved before the
ena_device_init() call, to make sure that the mem bar is available.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

23 months agoena: Align req_id and qid print order
Michal Krawczyk [Mon, 4 Jul 2022 07:03:54 +0000 (09:03 +0200)]
ena: Align req_id and qid print order

In most places, the req_id is printed first, and the qid is printed as a
second. To align the driver, one printout was reworked and the print
order of those variables was changed.

Suggested by: rpokala
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

23 months agocddl/*: add a WITH(OUT)_DTRACE option
Brooks Davis [Wed, 6 Jul 2022 13:03:48 +0000 (14:03 +0100)]
cddl/*: add a WITH(OUT)_DTRACE option

Add an option to enable/disable DTrace without disabling ZFS.  New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE.  WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_<FOO>}+= form rather than using intermediate
variables.

Reviewed by: markj
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D35718

23 months agoufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp
Konstantin Belousov [Mon, 4 Jul 2022 10:28:49 +0000 (13:28 +0300)]
ufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoufs_rename(): do not treat ERELOOKUP specially
Konstantin Belousov [Sat, 2 Jul 2022 13:15:57 +0000 (16:15 +0300)]
ufs_rename(): do not treat ERELOOKUP specially

Delegate handling of it to the top VFS layer, as it is done everywhere.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agonetstat -i: do not truncate interface names
Mike Karels [Sat, 2 Jul 2022 16:03:36 +0000 (11:03 -0500)]
netstat -i: do not truncate interface names

The field for interface names for netstat -i was 5 characters by
default, which is no longer sufficient with names like "vlan1234"
and "vtnet0".  netstat -iW computed the necessary field width, but
also enlarged the address field by a lot (especially with IPv6 enabled).
Make netstat -i compute the field width for interface names with or
without -W.  Note that the existing default output does not fit in
80 columns in any case.  Update the man page accordingly, documenting
the remaining effect of -W with -i.  Also add -W to the list of
General Options, as there are numerous pointers to this.

Reported by: Chris Ross
Reviewed by: melifaro, rgrimes, cy
Differential Revision: https://reviews.freebsd.org/D35703
MFC after: 1 week

23 months agodwc3: add ACPI attachment
Bjoern A. Zeeb [Tue, 5 Jul 2022 01:07:07 +0000 (01:07 +0000)]
dwc3: add ACPI attachment

Split the current FDT-only implementation up into an FDT and an
ACPI part reusing and sharing as much code as possible (thanks mw!).

This makes the Synopsis XHCI root hubs attach correctly on SolidRun's
HoenyComb instead of just the generic XHCI root and this means we
are also doing proper chip setup and applying the quirk needed there [1].

There is one problem with ACPI attachment in that it uses the generic
XHCI PNP ID.  So we need to do extra checks in order to not claim
all xhci, which means we check for a known quirk to be present
in acpi_probe.  Long term this isn't scaling and this was discussed
in SolidRun's Discord Channel in 2021 with the intend that "jnettlet"
will take this to a steering committee.  Since then ACPI has kind-of
become a technology non grata (due to not getting changes into Linux
timely) so it is unclear if this will ever happen.  If there will be
further hardware with dwc3/ACPI we should go and make sure this problem
gets solved.

[1] https://github.com/SolidRun/edk2-platforms/blob/24698f90b79facfbbfc4067b39a4ddf8c7fdfa88/Silicon/NXP/LX2160A/AcpiTables/Dsdt/Usb.asl

Reviewed by: manu, mw
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D32256

23 months agodevinfo: xref devctl
Warner Losh [Tue, 5 Jul 2022 21:15:08 +0000 (15:15 -0600)]
devinfo: xref devctl

devctl has ways to get the different locator's paths to devices, while
devinfo does not. xref devctl in devinfo(8) as a hint.

Sponsored by: Netflix

23 months agoif_ovpn: deal with short packets
Kristof Provost [Tue, 5 Jul 2022 17:27:00 +0000 (19:27 +0200)]
if_ovpn: deal with short packets

If we receive a UDP packet (directed towards an active OpenVPN socket)
which is too short to contain an OpenVPN header ('struct
ovpn_wire_header') we wound up making m_copydata() read outside the
mbuf, and panicking the machine.

Explicitly check that the packet is long enough to copy the data we're
interested in. If it's not we will pass the packet to userspace, just
like we'd do for an unknown peer.

Extend a test case to provoke this situation.

Sponsored by: Rubicon Communications, LLC ("Netgate")

23 months agodummynet: fix ip_dn_vnet_init() / dummynet_task() race
Kristof Provost [Mon, 4 Jul 2022 20:36:43 +0000 (22:36 +0200)]
dummynet: fix ip_dn_vnet_init() / dummynet_task() race

If dummynet_task() is run on a vnet where dummynet is still initialising
(i.e. still running ip_dn_vnet_init()) we can attempt to use an
uninitialised mutex.

We can use the existing init_done field to check if the per-vnet
V_dn_cfg is fully set up, if we ensure that it's only set to 1 when
we've done all of the init work.

Reported by: Alfredo Dal'Ava Júnior <alfredo@freebsd.org>
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35716

23 months agoOpenSSL: Regen assembly file for OpenSSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 16:06:50 +0000 (12:06 -0400)]
OpenSSL: Regen assembly file for OpenSSSL 1.1.1q

23 months agoOpenSSL: Regen manual pages for OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 16:01:07 +0000 (12:01 -0400)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1q

23 months agoOpenSSL: Merge OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 15:47:01 +0000 (11:47 -0400)]
OpenSSL: Merge OpenSSL 1.1.1q

Merge commit 'f874e59ffcd8b5ecd018ad8311d78e866340f3e9'

23 months agoImport OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 15:27:51 +0000 (11:27 -0400)]
Import OpenSSL 1.1.1q

23 months agoxargs: fix description of strnsubst return value
Tom Jones [Tue, 5 Jul 2022 15:27:15 +0000 (16:27 +0100)]
xargs: fix description of strnsubst return value

Reported by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574

23 months agoxargs: terminate if line replacement cannot be constructed
Tom Jones [Tue, 5 Jul 2022 15:03:51 +0000 (16:03 +0100)]
xargs: terminate if line replacement cannot be constructed

If the line with replacement cannot be constructed xargs should
terminate as documented in the man page

We encounter this error, but gnu/xargs doesn't because they have a much
larger limit for created outputs (~10000 lines).

Reviewed by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574

23 months agoDB_COMMAND(9): fix a typo
Mitchell Horne [Tue, 5 Jul 2022 15:14:44 +0000 (12:14 -0300)]
DB_COMMAND(9): fix a typo

Fixes: b83d53cb687e

23 months agoDB_COMMAND(9): update to mention additional macros
Mitchell Horne [Tue, 5 Jul 2022 14:55:18 +0000 (11:55 -0300)]
DB_COMMAND(9): update to mention additional macros

Document the existing alias definitions, and augment the example with
one of these. Also, describe the purpose of the newly added _FLAGS
variations of these command definitions.

Make some small style improvements to appease mandoc -Tlint.

Reviewed by: markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35664

23 months agoddb: use _FLAGS command macros where appropriate
Mitchell Horne [Tue, 5 Jul 2022 14:47:55 +0000 (11:47 -0300)]
ddb: use _FLAGS command macros where appropriate

Some command definitions were forced to use DB_FUNC in order to specify
their required flags, CS_OWN or CS_MORE. Use the new macros to simplify
these.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35582

23 months agoddb: add _FLAGS command variants
Mitchell Horne [Thu, 30 Jun 2022 15:58:22 +0000 (12:58 -0300)]
ddb: add _FLAGS command variants

Provide _FLAGS variants of the various command definition macros, in
anticipation of adding a new flag. This can also be used for some
existing commands which require special flag values.

Reviewed by: markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35581

23 months agodb_command.c: use designated initializers
Mitchell Horne [Tue, 5 Jul 2022 14:45:47 +0000 (11:45 -0300)]
db_command.c: use designated initializers

Provide separate helper macros for regular commands and next-level table
commands as they are mutually exclusive. This ensures proper
initialization of each element and allows us to exclude some redundant
fields, such as specifying .more = NULL for every regular command.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35580

23 months agodb_command.c: style
Mitchell Horne [Tue, 5 Jul 2022 14:44:36 +0000 (11:44 -0300)]
db_command.c: style

Reviewed by: jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35368

23 months agoriscv: implement db_show_mdpcpu()
Mitchell Horne [Mon, 4 Oct 2021 20:47:49 +0000 (17:47 -0300)]
riscv: implement db_show_mdpcpu()

This prints the machine-dependent members of struct pcpu when executing
the 'show pcpu' or 'show all pcpu' ddb(4) commands.

MFC after: 3 days

23 months agosesutil.8: Polish
Mateusz Piotrowski [Tue, 5 Jul 2022 14:37:18 +0000 (16:37 +0200)]
sesutil.8: Polish

- Use right mdoc macros
- Fix synopsis. Some of the optional command modifiers were not optional
  after all.
- Sort options

MFC after: 1 week

23 months agorc.8: Reference the article about rc scripting
Mateusz Piotrowski [Mon, 4 Jul 2022 10:54:57 +0000 (12:54 +0200)]
rc.8: Reference the article about rc scripting

MFC after: 3 days

23 months agonetinet6: perform out-of-bounds check for loX multicast statistics
Alexander V. Chernikov [Mon, 4 Jul 2022 20:03:06 +0000 (20:03 +0000)]
netinet6: perform out-of-bounds check for loX multicast statistics

Currently, some per-mbuf multicast statistics is stored in
 the per-interface ip6stat.ip6s_m2m[] array of size 32 (IP6S_M2MMAX).
Check that loopback ifindex falls within 0.. IP6S_M2MMAX-1 range to
 avoid silent data corruption. The latter cat happen with large
 number of VNETs.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D35715
MFC after: 2 weeks

23 months agodiff3: make the eflag logic easier to follow
Tom Jones [Tue, 5 Jul 2022 11:33:55 +0000 (12:33 +0100)]
diff3: make the eflag logic easier to follow

Discussed with: dim
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35324

23 months agoarp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)
KUROSAWA Takahiro [Tue, 5 Jul 2022 03:56:29 +0000 (20:56 -0700)]
arp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)

The original code had used a fixed-size buffer for ioctl(SIOCGIFCONF),
that might cause the target ifreq spilled from the buffer.  Use the handy
getifaddrs(3) to fix the problem.

Reviewed by: glebius
Differential revision: https://reviews.freebsd.org/D35536

23 months agodwc3: fix from not working
Bjoern A. Zeeb [Tue, 5 Jul 2022 00:53:42 +0000 (00:53 +0000)]
dwc3: fix from not working

During the review of 09cdf4878c621be4cd229fa88cdccdcdc8c101f7 we
switched from cached registers to reading them as needed.
One read of the two reads was moved after the softreset got triggered
and as a result returned 0 rather than the proper register value.
Moving the read before the softreset gets initiated seems to make
things work again and xhci.c no longer complains about
"Controller does not support 4K page size.".

MFC after: 10 days
X-MFC with: 09cdf4878c621be4cd229fa88cdccdcdc8c101f7
Pointy hat to: bz

23 months agolinux(4): Use saved cpu feature bits
Dmitry Chagin [Mon, 4 Jul 2022 20:42:07 +0000 (23:42 +0300)]
linux(4): Use saved cpu feature bits

MFC after: 3 days

23 months agolinux(4): Implement __vdso_time
Dmitry Chagin [Mon, 4 Jul 2022 20:41:32 +0000 (23:41 +0300)]
linux(4): Implement __vdso_time

PR: 240769
MFC after: 3 days

2 years agosockets: use only soref()/sorele() as socket reference count
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
sockets: use only soref()/sorele() as socket reference count

o Retire SS_FDREF as it is basically a debug flag on top of already
  existing soref()/sorele().
o Convert SS_PROTOREF into soref()/sorele().
o Change reference model for the listen queues, see below.
o Make sofree() private.  The correct KPI to use is only sorele().
o Make soabort() respect the model and sorele() instead of sofree().

Note on listening queues.  Until now the sockets on a queue had zero
reference count.  And the reference were given only upon accept(2).  The
assumption was that there is no way to see the queued socket from anywhere
except its head.  This is not true, since queued sockets already have pcbs,
which are linked at least into the global pcb lists.  With this change we
put the reference right in the sonewconn() and on accept(2) path we just
hand the existing reference to the file descriptor.

Differential revision: https://reviews.freebsd.org/D35679

2 years agosockets: use positive flag for file descriptor socket reference
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
sockets: use positive flag for file descriptor socket reference

Rename SS_NOFDREF to SS_FDREF and flip all bitwise operations.
Mark sockets created by socreate() with SS_FDREF.

This change is mostly illustrative. With it we see that SS_FDREF
is a debugging flag, since:
* socreate() takes a reference with soref().
* on accept path solisten_dequeue() takes a reference
  with soref() and then soaccept() sets SS_FDREF.
* soclose() checks SS_FDREF, removes it and does sorele().

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35678

2 years agotcp: use a TCP flag to check if connection has been close(2)d
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
tcp: use a TCP flag to check if connection has been close(2)d

The flag SS_NOFDREF is a private flag of the socket layer.  It also
is supposed to be read with SOCK_LOCK(), which we don't own here.

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D35663

2 years agopca954x: harmonize pca9547 and pca954x and add pca9540 support
Bjoern A. Zeeb [Sat, 2 Jul 2022 23:33:32 +0000 (23:33 +0000)]
pca954x: harmonize pca9547 and pca954x and add pca9540 support

The two implementations for the pca9548 switch and the pca9547 mux
seemed close enough so we can put them together and with a bit more
abstraction add pca9540 support.

While here apply a bit of consistency in variable and driver naming and
use device_has_property instead of the FDT-only OF_ variant.

This disconnects pca9547 from the build but does not yet delete it.

MFC after: 2 weeks
Reviewed by: mmel (earlier version), avg
Differential Revision: https://reviews.freebsd.org/D35701

2 years agorb_tree: fine-tune rebalancing code
Doug Moore [Mon, 4 Jul 2022 17:28:35 +0000 (12:28 -0500)]
rb_tree: fine-tune rebalancing code

Change parts of RB_INSERT_COLOR and RB_REMOVE_COLOR to reduce the
number of operations, by, in some cases, flipping two color bits at a
time instead of flipping each individually, in separate operations,
and by using a switch statement to replace a sequence of if-elses.
Rewrite RB_SET_PARENT to generate fewer instructions.  These changes
reduce the code size by over 100 bytes on some architectures.

Also, allow RB users to define a preprocessor symbol to generate
RB_REMOVE_COLOR code that matches the implementation described in the
original weak-AVL paper in one particular case, instead of the still
correct, but slightly more efficient implementation of that case
currently implemented.

Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35524

2 years agopmcstat: fix log analysis
Andrew Gallatin [Mon, 4 Jul 2022 16:40:35 +0000 (12:40 -0400)]
pmcstat: fix log analysis

pmcstat has been broken for analyzing logs since D35342 / b6e28991bf3aadb.

This is because the pmc for the first CPU is not added when reading logs
because unlike its clones, its event id is not invalid. That causes us
to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
when encountering samples from cpu0.

Fix this by removing the check that the PMC is invalid

Reviewed by: tsoome
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35709

2 years agoAdd Rockchip PCIe cleanup on attach faulure
Andrew Turner [Thu, 30 Jun 2022 18:16:34 +0000 (19:16 +0100)]
Add Rockchip PCIe cleanup on attach faulure

We should clean up on failure as it may panic the kernel later, e.g.
if we crate the rman, but fail to destroy it on attach faulure.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35682

2 years agoFix ofw pcib when it rman_init fails
Andrew Turner [Thu, 30 Jun 2022 18:12:46 +0000 (19:12 +0100)]
Fix ofw pcib when it rman_init fails

rman_fini assumes rman_init has been called successfully. Clean up
init faulure by only calling rman_fini when rman_init has succeeded.

While here add ofw_pcib_fini that can be used by a sub-class to clean
up.

Reviewed by: bz, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35681

2 years agoSupport decoding mem32 memory in the rk pcie driver
Andrew Turner [Thu, 30 Jun 2022 18:08:32 +0000 (19:08 +0100)]
Support decoding mem32 memory in the rk pcie driver

This is needed with some dtb files.

While here use a switch statement as the two options are mutually
exclusive in any iteration of the loop.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35680

2 years agoe6000sw: Fix direct register write logic
Kornel Dulęba [Mon, 4 Jul 2022 06:53:41 +0000 (08:53 +0200)]
e6000sw: Fix direct register write logic

When accessing a register directly from etherswitchcfg one must specify
a register group(e.g. registers of portN) and the register offset within
the group. The latter is passed as the 5 least significant bits.
Extract the former by dividing the register address by 32, not by 5.

Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35672

2 years agolockstat: Fix construction of comparision predicates
Kornel Dulęba [Mon, 4 Jul 2022 06:48:52 +0000 (08:48 +0200)]
lockstat: Fix construction of comparision predicates

Passing "0x%p" to sprintf results in double "0x" being printed.
This causes a dtrace script compilation failure when "-d" flag
is specified.
Fix that by removing the extraneous "0x".

Reviewed by: markj
Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Alstom
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35690

2 years agomountd startup: enable NFSv4 if needed on restart
Mike Karels [Sun, 3 Jul 2022 23:04:41 +0000 (18:04 -0500)]
mountd startup: enable NFSv4 if needed on restart

The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly
when it is run at system startup, relying on the kernel default.
However, if NFSv4 was enabled in /etc/rc.conf later, and the script
was re-run to restart mountd, the sysctl was still set to 3.
Set the sysctl to the right value in all cases.

Reviewed by: rmacklem
MFC after: 1 week

2 years agorouting: hide notify_add and notify_del behind ROUTE_MPATH
Mateusz Guzik [Mon, 4 Jul 2022 08:38:13 +0000 (08:38 +0000)]
routing: hide notify_add and notify_del behind ROUTE_MPATH

Fixes a warn about unused routines without the option.

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoipmi: do not omit lun in BMC addresses
Yuri [Mon, 4 Jul 2022 06:29:52 +0000 (14:29 +0800)]
ipmi: do not omit lun in BMC addresses

Some systems put sensors on non-0 lun, so we should not omit it.  This
was the only difference with the Linux driver, where DIMM sensors could
be queried, but not on FreeBSD.

See this report[1] on the FreeBSD forums:
https://forums.freebsd.org/threads/freebsd-cannot-get-dimm-temperature-sensor-value.85166/

Reviewed by: philip
Tested by: Andrey Lanin[1]
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35612

2 years agoipmi: correctly handle ipmb requests
Yuri [Mon, 4 Jul 2022 04:55:18 +0000 (12:55 +0800)]
ipmi: correctly handle ipmb requests

Handle IPMB requests using SEND_MSG (sent as driver request as we do not
need to return anything back to userland for this) and GET_MSG (sent as
usual request so we can return the data for RECEIVE_MSG ioctl) pair.

This fixes fetching complete sensor data from boards (e.g. HP ProLiant
DL380 Gen10).

Reviewed by: philip
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35605

2 years agofile: upgrade to 5.42.
Xin LI [Mon, 4 Jul 2022 00:07:28 +0000 (17:07 -0700)]
file: upgrade to 5.42.

MFC after: 2 weeks

2 years agoVendor import of file 5.42.
Xin LI [Mon, 4 Jul 2022 00:05:11 +0000 (17:05 -0700)]
Vendor import of file 5.42.

2 years agodwc3: improve debugging
Bjoern A. Zeeb [Sat, 2 Jul 2022 21:10:00 +0000 (21:10 +0000)]
dwc3: improve debugging

Rather than hiding behind #if 0, hide the debugging behind DWC3_DEBUG
so it can be turned on with a single define.  Require bootverbose
to print anything so we can still avoid spamming the console if DWC3_DEBUG
is on.
Harmonize the format string in snsp_dwc3_dump_regs() to always print the
full register and also print the XHCI quirks.
Call snsp_dwc3_dump_regs() twice, before and after generic XHCI attachment
and initialisation as this may have an effect on the confirgumation state.

Obtained from: an old debug patch
MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35700

2 years agodwc3: add more quirks and checks
Bjoern A. Zeeb [Sat, 2 Jul 2022 20:56:07 +0000 (20:56 +0000)]
dwc3: add more quirks and checks

Rather than just printing the Global SNPS ID Register store it as well
so we can do a version check later.
In addition, for debugging purposes, read the Global Hardware Parameters
Registers and print them.

Based on the snpsid disable an XHCI feature using a quirk prepared
in 447c418da03454a2a00bc115a69c62055a6d5272.
Add the "snps,dis_u3_susphy_quirk" quirk and handle Suspend USB3.0 SS PHY
after power-on-reset/during core initialization (suggested to be cleared)
based on the DWC3_GHWPARAMS0 register.

MFC after: 2 weeks
Obtained from: an old debugging patch
Reviewed by: mw (earlier version), mmel
Differential Revision: https://reviews.freebsd.org/D35699

2 years agodwc3: uncondinationally enable Host IN Auto Retry
Bjoern A. Zeeb [Sat, 2 Jul 2022 19:14:39 +0000 (19:14 +0000)]
dwc3: uncondinationally enable Host IN Auto Retry

Enable dwc3's auto retry feature. For IN transfers with crc errors
or internal overruns this will make the host reply with a
non-terminating retry ACK.  I believe the hope was to improve
reliability after seeing occasional hiccups.

Obtained from: an old debugging patch
MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35698

2 years agodwc3: fix snps,dis-del-phy-power-chg-quirk
Bjoern A. Zeeb [Sat, 2 Jul 2022 18:17:13 +0000 (18:17 +0000)]
dwc3: fix snps,dis-del-phy-power-chg-quirk

If snps,dis-del-phy-power-chg-quirk is set, the register bit should be
cleared not ored on (it's the "dis" version).

MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35697

2 years agotca6416: add support for tca9539
Bjoern A. Zeeb [Sun, 3 Jul 2022 00:51:13 +0000 (00:51 +0000)]
tca6416: add support for tca9539

Programming-wise tca6416 and tca9539 seem identical so all we have to
do is add the extra ofw_compat_data line.

MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35702

2 years agowpa_supplicant: Resolve secondary VAP association issue
J.R. Oldroyd [Sat, 2 Jul 2022 18:15:31 +0000 (11:15 -0700)]
wpa_supplicant: Resolve secondary VAP association issue

Association will fail on a secondary open unprotected VAP when the
primary VAP is configured for WPA. Examples of secondary VAPs are,
hotels, universities, and commodity routers' guest networks.

A broadly similar bug was discussed on Red Hat's bugzilla affecting
association to a D-Link DIR-842.

This suggests that as IEs were added to the 802.11 protocol the old code
was increasingly inadaquate to handle the additional IEs, not only a
secondary VAP.

PR: 264238
Reported by: Jaskie <jiangjun12321@gmail.com>
"J.R. Oldroyd" <fbsd@opal.com>
Submitted by: "J.R. Oldroyd" <fbsd@opal.com>
MFC after: 3 days

2 years agowpa: Enable WEP by default
Cy Schubert [Sun, 3 Jul 2022 18:41:00 +0000 (11:41 -0700)]
wpa: Enable WEP by default

As of hostap 2.10, WEP is disabled by default. This of course is not a
bad thing but requires some planning and an announcment to remove WEP
support by default. A possible src.conf knob or letting users know they
should use the port instead might different options.

MFC after: 3 days

2 years agomount_nfs.8: Update BUGS section for NFSv4.1/4.2
Rick Macklem [Sun, 3 Jul 2022 20:37:23 +0000 (13:37 -0700)]
mount_nfs.8: Update BUGS section for NFSv4.1/4.2

If the "intr" and/or "soft" mount options are used for
NFSv4 mounts, the protocol can be broken when the
operation returns without waiting for the RPC reply.
The likelyhood of failure increases for NFSv4.1/4.2
mounts, since the session slot will be broken when
an RPC reply is not processed.

This is mentioned in the BUGS section of "man mount_nfs",
but there was no specific mention of the session slot
problem.  This patch adds a sentence for this case.

PR: 260011
Reviewed by: gbe
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35693

2 years agoApply clang fix for assertion building llvm with libc++ 15
Dimitry Andric [Sun, 3 Jul 2022 19:33:22 +0000 (21:33 +0200)]
Apply clang fix for assertion building llvm with libc++ 15

Merge commit f1b0a4fc540f from llvm git (by Richard Smith):

  An expression should only contain an unexpanded parameter pack if it
  lexically contains a mention of the pack.

  Systematically distinguish between syntactic and semantic references to
  packs, especially when propagating dependence from a type into an
  expression. We should consult the type-as-written when computing
  syntactic dependence and should consult the semantic type when computing
  semantic dependence.

  Fixes #54402.

MFC after: 3 days

2 years agosockatmark(3): Add references to 4.4BSD IPC tutorials
Gordon Bergling [Sun, 3 Jul 2022 13:56:42 +0000 (15:56 +0200)]
sockatmark(3): Add references to 4.4BSD IPC tutorials

Obtained from: NetBSD
MFC after: 3 days

2 years agoif_clone: Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 13:13:32 +0000 (15:13 +0200)]
if_clone: Fix a typo in a source code comment

- s/fucntions/functions/

MFC ater: 3 days

2 years agojme(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 13:13:01 +0000 (15:13 +0200)]
jme(4): Fix a typo in a source code comment

- s/fuctions/functions/

MFC after: 3 days

2 years agoata(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 13:12:26 +0000 (15:12 +0200)]
ata(4): Fix a typo in a source code comment

- s/fuctions/functions/

MFC after: 3 days

2 years agosnmp_hostres(3): Fix a typo in a debug message
Gordon Bergling [Sun, 3 Jul 2022 12:57:12 +0000 (14:57 +0200)]
snmp_hostres(3): Fix a typo in a debug message

- s/atempt/attempt/

MFC after: 3 days

2 years agoaic7xxx: Fix a few common typo in source code comments
Gordon Bergling [Sun, 3 Jul 2022 12:10:30 +0000 (14:10 +0200)]
aic7xxx: Fix a few common typo in source code comments

- s/irrespecitve/irrespective/

Obtained from: NetBSD
MFC after: 3 days

2 years agoaic7xxx: Fix a few common typos in source code comments
Gordon Bergling [Sun, 3 Jul 2022 12:06:48 +0000 (14:06 +0200)]
aic7xxx: Fix a few common typos in source code comments

- s/ingnore/ignore/
- s/ingnored/ignored/

MFC after: 3 days

2 years agofreescale: Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 11:55:40 +0000 (13:55 +0200)]
freescale: Fix a typo in a source code comment

- s/transistions/transitions/

MFC after: 3 days

2 years agopmc(3): Fix a common typo in a description
Gordon Bergling [Sun, 3 Jul 2022 11:53:01 +0000 (13:53 +0200)]
pmc(3): Fix a common typo in a description

- s/transistioned/transitioned/

MFC after: 3 days

2 years agopci(4): Fix a common typo in source code comments
Gordon Bergling [Sun, 3 Jul 2022 11:43:44 +0000 (13:43 +0200)]
pci(4): Fix a common typo in source code comments

- s/transistions/transitions/

MFC after: 3 days

2 years agopselect(2): Document what a null pointer for the signalmask means
Warner Losh [Sat, 2 Jul 2022 19:39:24 +0000 (13:39 -0600)]
pselect(2): Document what a null pointer for the signalmask means

When pselect is passed a null pointer for the signal mask, the standard
says it shall behave like select (except for the different timeout
arg). Make a note of that here.

Sponsored by: Netflix

2 years agoacpi: add sys/kernel.h
Warner Losh [Sat, 2 Jul 2022 16:35:04 +0000 (10:35 -0600)]
acpi: add sys/kernel.h

sys/kernel.h is needed for tunable fetching.

Sponsored by: Netflix

2 years agoarm64: NXP add LS1088a clockgen support
Bjoern A. Zeeb [Tue, 28 Jun 2022 00:02:17 +0000 (00:02 +0000)]
arm64: NXP add LS1088a clockgen support

Add a driver for NXP LS1088a clockgen support which passes
configuration information to QorIQ clockgen class.
The implementaiton started off as copy of ls1028 support and was
adjusted accordingly.

Reviewed by: dgr_semihalf.com (earlier), mmel
MFC after: 1 week
Sponsored by: Traverse Technologies (providing Ten64 HW for testing)
Differential Revision: https://reviews.freebsd.org/D35617

2 years agoamd64/efi: Remove setting hints for rsdp
Warner Losh [Sat, 2 Jul 2022 14:01:09 +0000 (08:01 -0600)]
amd64/efi: Remove setting hints for rsdp

Given that hints set this way don't work when a static kenv is compiled
into the kernel. acpi.rsdp has been set for this for the past 6 years,
and all kernels in that time have used it in preference to the hints. As
such, we no longer hints.*, so remove them.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35634

2 years agoamd64/efi: Stop falling back to hints for RSDP
Warner Losh [Sat, 2 Jul 2022 14:01:02 +0000 (08:01 -0600)]
amd64/efi: Stop falling back to hints for RSDP

All boot loaders for the last 6 years set acpi.rsdp in addition to the
hints. This was planned for removal ~5 years ago. Belatedly remove it
from here.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35633

2 years agoloader: Set preferred kenv for acpi.rsdp on arm64
Warner Losh [Sat, 2 Jul 2022 14:00:40 +0000 (08:00 -0600)]
loader: Set preferred kenv for acpi.rsdp on arm64

Several years ago, x86 moved from using hints to communicate this
information to using the simpler acpi.rsdp variables. If one compiles
static hints into the kernel, then these hints are ignored. We can
remove this when we branch FreeBSD 15. Thought about BURN_BRIDGES
here, but it's too messy.

Sponsored by: Netflix
Reviewed by: andrew, jhb
Differential Revision: https://reviews.freebsd.org/D35632

2 years agoarm64: Grab the RSDP from acpi.rsdp like x86
Warner Losh [Sat, 2 Jul 2022 14:00:27 +0000 (08:00 -0600)]
arm64: Grab the RSDP from acpi.rsdp like x86

arm64 wasn't updated to grab this from acpi.rsdp when x86 was
update. belatedly update the kernel to grab this information from the
preferred kenv.

Sponsored by: Netflix
Reviewed by: andrew, jhb
Differential Revision: https://reviews.freebsd.org/D35631

2 years agotty: Default to printing kernel stack traceback only on INVARIANT kernels
Warner Losh [Wed, 29 Jun 2022 14:26:58 +0000 (08:26 -0600)]
tty: Default to printing kernel stack traceback only on INVARIANT kernels

Change the default from printing a breif kernel thread stack informaton
back to omitting it for non-invariant kernels in response to
SIGINFO/^T. Full and brief stack support can be selected with the
kern.tty_info_kstacks sysctl.

MFC After: 2 weeks
Sponsored by: Netflix
Reviewed by: grembo, jhb
Differential Revision: https://reviews.freebsd.org/D35576

2 years agoApply llvm fix for assertion/crash building archivers/c-blosc2
Dimitry Andric [Fri, 1 Jul 2022 23:13:46 +0000 (01:13 +0200)]
Apply llvm fix for assertion/crash building archivers/c-blosc2

Merge commit 88ce403c6aab from llvm git (by Florian Hahn):

  [LV] Add new block to place recurrence splice, if needed.

  In some cases, a recurrence splice instructions needs to be inserted
  between to regions, for example if the regions get re-arranged during
  sinking.

  Fixes #56146.

PR: 264979
Reported by: Robert Clausecker <fuz@fuz.su>
MFC after: 3 days

2 years agomount_nfs: Warn that intr, soft are not safe for NFSv4
Rick Macklem [Fri, 1 Jul 2022 21:43:17 +0000 (14:43 -0700)]
mount_nfs: Warn that intr, soft are not safe for NFSv4

If the "intr" and/or "soft" mount options are used for
NFSv4 mounts, the protocol can be broken when the
operation returns without waiting for the RPC reply.
The likelyhood of failure increases for NFSv4.1/4.2
mounts, since the session slot will be broken when
an RPC reply is not processed.

This is mentioned in the BUGS section of "man mount_nfs",
but more needs to be done.  This patch adds code that
generates a warning message when the mount is done.

PR: 260011
Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35407

2 years agoMIMIMAL: add uart
Warner Losh [Fri, 1 Jul 2022 17:22:38 +0000 (11:22 -0600)]
MIMIMAL: add uart

While uart could be detected completely through plug and play means, add
it here for two reasons. First, we don't do that from the loader, so
it's not available as a console. Second, even if we did do it from the
loader, there's a limitation in the system today that console drivers
must be compiled into the kernel because the console is selected before
external modules are linked into the kernel. Adding it only increases
the kernel size by ~14k as well.

Sponsored by: Netflix
Idea liked by: des, rpokala, brooks, jhb

2 years agocrypto: Validate return values from CRYPTODEV_PROCESS()
Mark Johnston [Fri, 1 Jul 2022 15:09:39 +0000 (11:09 -0400)]
crypto: Validate return values from CRYPTODEV_PROCESS()

Errors are always handled by the completion callback, so we should check
that they're not also passed back to the caller.

No functional change intended.

Reviewed by: kp, mav, jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35382

2 years agocrypto: Fix the NULL_HMAC finalizer
Mark Johnston [Fri, 1 Jul 2022 15:04:15 +0000 (11:04 -0400)]
crypto: Fix the NULL_HMAC finalizer

The current implementation leaves the digest buffer partially
uninitialized.

Reported by: syzkaller
Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35547

2 years agoena: Make first_interrupt a uint8_t
Mark Johnston [Thu, 30 Jun 2022 18:49:46 +0000 (14:49 -0400)]
ena: Make first_interrupt a uint8_t

We do not have atomic(9) routines for bools, and it is not guaranteed
that sizeof(bool) is 1.

This fixes the KASAN and KMSAN kernel builds, which fail because the
compiler refuses to silently cast a _Bool * to a uint8_t * when calling
the atomic(9) sanitizer interceptors.

Reviewed by: Dawid Górecki <dgr@semihalf.com>
MFC after: 2 weeks
Fixes: 0ac122c388d9 ("ena: Use atomic_load/store functions for first_interrupt variable")
Differential Revision: https://reviews.freebsd.org/D35683

2 years agoRevert "rtw88: split driver up into a core and pci part"
Bjoern A. Zeeb [Fri, 1 Jul 2022 13:06:31 +0000 (13:06 +0000)]
Revert "rtw88: split driver up into a core and pci part"

After some discussion, for now, simply revert the change to split
the driver up into if_rtw88_core.ko and if_rtw88_pci.ko as we do
not have an if_rtw88.ko anymore.  We do have code trying to
auto-load modules, e.g. ifconfig, based on if_xxx.ko.

We could, based on Makefile magic or further code, generate a
if_rtw88.ko module with proper dependencies and keep this but for
simplicity stay with the one slightly larger module for now.
Should code appear to do this "properly" we can revisit this once
USB support has landed.

Slightly update the module Makefile to keep the separation of files
between core and pci bits visible and maintainable for the future.

This reverts commit 0f7b9777f8f39fbc230b3e1de2f844d9f839adea.

2 years agoloader: fix powerpc* ofw loader
Alfredo Dal'Ava Junior [Fri, 1 Jul 2022 15:54:01 +0000 (12:54 -0300)]
loader: fix powerpc* ofw loader

With the introduction of llvm14, the powerpc* loader used on ofw/pseries
for 32 and 64 bit architectures puts the .data.rel.ro section after
.data section. This caused a crash kernel didn't boot. Bisect pointed to
change https://reviews.llvm.org/D111717 but problem could be fixed by
adding a section description to make it appear in the expected order.

This patch is based on discussion at:
        https://github.com/llvm/llvm-project/issues/56306

MFC after: 1 day
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)

2 years agopf: handle dummynet for non-IP packets
Kristof Provost [Fri, 1 Jul 2022 11:13:20 +0000 (13:13 +0200)]
pf: handle dummynet for non-IP packets

Do not panic if we try to dummynet an Ethernet packet that's not IPv4 or
IPv6. Simply give it to dummynet.

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoCatch up with 2004 and improve markup.
Dag-Erling Smørgrav [Thu, 30 Jun 2022 13:36:05 +0000 (13:36 +0000)]
Catch up with 2004 and improve markup.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35676

2 years agostand/uboot: setup archsw before probing devices
Albert Jakiela [Tue, 28 Jun 2022 15:28:35 +0000 (17:28 +0200)]
stand/uboot: setup archsw before probing devices

In some cases ubldr would try to mount a disk device before
the archsw struct was filled with functions pointers.
This would result in a NULL pointer derefrence of the arch_getdev field.
Fix that filling the archsw functions earlier.
Note that this matches the EFI behavoiur.

Reviewed by: imp, mw
Sponsored by: Stormshield
Obtained from: Semihalf
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35670

2 years agotslog.4: Document what TSLOG excels at
Mateusz Piotrowski [Fri, 1 Jul 2022 09:17:12 +0000 (11:17 +0200)]
tslog.4: Document what TSLOG excels at

Based on an email mhorne@ sent to arch@.

Reviewed by: debdrup, pauamma_gundo.com
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34565

2 years agoboottrace.4: Document that boottrace is good at tracing one-shot events
Mateusz Piotrowski [Fri, 1 Jul 2022 09:09:46 +0000 (11:09 +0200)]
boottrace.4: Document that boottrace is good at tracing one-shot events

Based on an email mhorne@ sent to arch@.

Reviewed by: debdrup
Differential Revision: https://reviews.freebsd.org/D34566

2 years agoifconfig.8: Polish
Zhenlei Huang [Fri, 1 Jul 2022 08:59:11 +0000 (10:59 +0200)]
ifconfig.8: Polish

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D35686

2 years agoif_ovpn: handle m_pullup() failure
Kristof Provost [Thu, 30 Jun 2022 18:11:52 +0000 (20:11 +0200)]
if_ovpn: handle m_pullup() failure

Ensure we correctly handle m_pullup() failing in ovpn_finish_rx().

Reported by: Coverity (CID 1490340)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoif_ovpn tests: IPv4-mapped IPv6 address test
Kristof Provost [Thu, 30 Jun 2022 15:47:58 +0000 (17:47 +0200)]
if_ovpn tests: IPv4-mapped IPv6 address test

OpenVPN uses IPv4-mapped IPv6 addresses by default (if we don't specify
'proto udp4', or an IPv4 address to bind to). Test that this works.

Sponsored by:   Rubicon Communications, LLC ("Netgate")

2 years agoif_ovpn: deal with v4 mapped IPv6 addresses
Kristof Provost [Thu, 30 Jun 2022 15:28:15 +0000 (17:28 +0200)]
if_ovpn: deal with v4 mapped IPv6 addresses

Openvpn defaults to binding to IPv6 sockets (with
setsockopt(IPV6_V6ONLY=0)), which we didn't deal with.
That resulted in us trying to in6_selectsrc_addr() on a v4 mapped v6
address, which does not work.

Instead we translate the mapped address to v4 and treat it as an IPv4
address.

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agodtrace: Remove local mips support
Brooks Davis [Fri, 1 Jul 2022 07:33:17 +0000 (08:33 +0100)]
dtrace: Remove local mips support

Remove the stub pid probe and all the build glue.

Reviewed by: imp, jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D35541

2 years agolibcompat: Use WORLDTMP sysroot
Brooks Davis [Fri, 1 Jul 2022 07:33:16 +0000 (08:33 +0100)]
libcompat: Use WORLDTMP sysroot

Now that -m32 is fixed, just install libs in ${WORLDTMP}/lib/lib32
and use the installed headers.

Reviewed by: imp, jhb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D34697

2 years agoinstallworld: improve portability of ldd use
Brooks Davis [Fri, 1 Jul 2022 07:33:16 +0000 (08:33 +0100)]
installworld: improve portability of ldd use

b3b462229f97 added a case statement to ignore lines containing strings
in square brackets such as "[vdso]" and "[preloaded]". On MacOS
Monterey where /bin/sh may be zsh, this fails with:

/bin/sh: -c: line 0: syntax error near unexpected token `;;'

Invoke grep in the pipeline to remove such lines instead.

Reviewed by: emaste
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D35618

2 years agoigc: Change default duplex setting
Kornel Dulęba [Thu, 30 Jun 2022 11:57:58 +0000 (13:57 +0200)]
igc: Change default duplex setting

During media selection through ifconfig one might not specify
the duplex setting through the mediaopt flag.
In that case the igc driver would default to full-duplex.
The problem with this approach is that e1000(em/igb) driver
defaults to half-duplex.
Because of that if one connects both NICs and sets media to
e.g. 100baseTX on both of them no link will be found.
Fix that by matching igc behaviour with what e1000 does.

Reviewed by: grehan
Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35673

2 years agoAdd myself(kd) as src commiter and mw/emaste as my co-mentors
Kornel Dulęba [Wed, 29 Jun 2022 14:44:20 +0000 (16:44 +0200)]
Add myself(kd) as src commiter and mw/emaste as my co-mentors

Approved by: mw(mentor)
Differential Revision: https://reviews.freebsd.org/D35658