Kyle Evans [Fri, 15 Mar 2024 01:19:18 +0000 (20:19 -0500)]
if_wg: use proper barriers around pkt->p_state
Without appropriate load-synchronization to pair with store barriers in
wg_encrypt() and wg_decrypt(), the compiler and hardware are often
allowed to reorder these loads in wg_deliver_out() and wg_deliver_in()
such that we end up with a garbage or intermediate mbuf that we try to
pass on. The issue is particularly prevalent with the weaker
memory models of !x86 platforms.
Switch from the big-hammer wmb() to more explicit acq/rel atomics to
both make it obvious what we're syncing up with, and to avoid somewhat
hefty fences on platforms that don't necessarily need this.
With this patch, my dual-iperf3 reproducer is dramatically more stable
than it is without on aarch64.
Rick Macklem [Fri, 15 Mar 2024 00:35:32 +0000 (17:35 -0700)]
vfs_vnops.c: Use va_bytes >= va_size hint to avoid SEEK_DATA/SEEKHOLE
vn_generic_copy_file_range() tries to maintain holes
in file ranges being copied, using SEEK_DATA/SEEK_HOLE
where possible,
Unfortunately SEEK_DATA/SEEK_HOLE operations can take
a long time under certain circumstances.
Although it is not currently possible to know if a file has
unallocated data regions, the case where va_bytes >= va_size
is a strong hint that there are no unallocated data regions.
This hint does not work well for file systems doing compression,
but since it is only a hint, it is still useful.
For the case of va_bytes >= va_size, avoid doing SEEK_DATA/SEEK_HOLE.
* boot-strap: tests can take a long time; use a cookie to
skip them if bmake has not been updated since tests last
ran successfully.
* Makefile: Cygwin handles MANTARGET man
* unit-tests/Makefile: set BROKEN_TESTS for Cygwin
2024-03-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240309
Merge with NetBSD make, pick up
o set .ERROR_EXIT to the exit status of .ERROR_TARGET
this allows a .ERROR target to ignore the case of
.ERROR_EXIT==6 which just means that the build actually
failed somewhere else.
* var.c: on IRIX we need both inttypes.h and stdint.h
2024-03-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240301
Merge with NetBSD make, pick up
o export variables with value from target scope
when appropriate.
2024-02-12 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240212
Merge with NetBSD make, pick up
o remove unneeded conditional-compilation toggles
INCLUDES, LIBRARIES, POSIX, SYSVINCLUDE, SYSVVARSUB,
GMAKEEXPORT NO_REGEX and SUNSHCMD
* configure.in: add check for regex.h
* var.c: replace use of NO_REGEX with HAVE_REGEX_H
2024-02-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240204
Merge with NetBSD make, pick up
o var.c: fix some lint (-dL) mode parsing issues
2024-02-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION: (_MAKE_VERSION): 20240202
Merge with NetBSD make, pick up
o make.1: note that arg to :D and :U can be empty
o var.c: $$ is not a parse error when .MAKE.SAVE_DOLLARS=no
* sys.dirdeps.mk, dirdeps-targets.mk, init.mk:
do not set .MAIN: dirdeps in sys.dirdeps.mk
dirdeps-targets.mk will do that for top-level builds
and init.mk will do it for others.
This allows a Makefile which has no need of 'dirdeps' to
set .MAIN for itself and "just work".
2024-02-18 Simon J Gerraty <sjg@beast.crufty.net>
* bsd.*.mk: for makefiles that get a bsd. symlink,
use _this in multiple inclusion tags since .PARSEFILE will not
DTRT when such a makefile is included directly by Makefile and
automatically (without bsd. prefix).
Since we cannot guarantee that our sys.mk will be used, we provide
a default _this in each makefile that gets a bsd. prefix such that
the value is the same regardless of bsd. prefix.
* subdir.mk: drop the !target guard on $SUBDIR_TARGETS
* SPDX-License-Identifier: BSD-2-Clause
Add SPDX-License-Identifier to inidicate that I consider
my copyright on any of these makefiles equivalent to BSD-2-Clause
* autoconf.mk: allow for configure.ac as currently recommended
* subdir.mk: support @auto
which is replaced with each subdir that
has a [Mm]akefile.
* subdir.mk: include local.subdir.mk if it exists.
* subdir.mk: rework to handle .WAIT
2024-02-11 Simon J Gerraty <sjg@beast.crufty.net>
* subdir.mk: _SUBDIRUSE report the target we are entering subdirs for.
2024-02-10 Simon J Gerraty <sjg@beast.crufty.net>
* prog.mk: treat empty SRCS the same as undefined
2024-02-02 Simon J Gerraty <sjg@beast.crufty.net>
* Avoid undefined errors in lint (-dL) mode
* man.mk (CMT2DOC_FLAGS): note that -mm does mdoc(7)
John Baldwin [Wed, 13 Mar 2024 22:05:54 +0000 (15:05 -0700)]
new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE
The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.
John Baldwin [Wed, 13 Mar 2024 22:05:54 +0000 (15:05 -0700)]
new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCE
The public bus_activate/deactivate_resource() API still accepts both
forms, but the internal kobj methods no longer pass the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.
John Baldwin [Wed, 13 Mar 2024 22:05:54 +0000 (15:05 -0700)]
new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCE
The public bus_map/unmap_resource() API still accepts both forms, but
the internal kobj methods no longer pass the argument.
Implementations which need the type now use rman_get_type() to fetch
the value from the allocated resource.
John Baldwin [Wed, 13 Mar 2024 22:05:54 +0000 (15:05 -0700)]
new-bus: Remove the 'type' argument from BUS_ADJUST_RESOURCE
The public bus_adjust_resource() API still accepts both forms, but the
internal kobj method no longer passes the argument. Implementations
which need the type now use rman_get_type() to fetch the value from
the allocated resource.
John Baldwin [Wed, 13 Mar 2024 22:05:53 +0000 (15:05 -0700)]
new-bus: Introduce a simpler bus API for managing resources
Remove the 'type' and 'rid' arguments from the wrapper bus API
functions (e.g. bus_release_resource) that accept a struct resource.
The "new" versions extract the 'type' and/or 'rid' from the passed in
resource object via rman_get_type and rman_get_rid.
This commit adds the new API as functions with a _new suffix. Wrapper
macros choose between the old and new functions based on the number of
arguments provided to the macro. This commit does not change the ABI
but can be safely MFCd to older branches so long as older kernels use
rman_set_type when allocating resources.
Future commits will push the removal of these extraneous arguments
through the bus implementation.
John Baldwin [Wed, 13 Mar 2024 22:05:53 +0000 (15:05 -0700)]
rman: Add rman_get/set_type
This permits associating a resource type (e.g. SYS_RES_MEMORY) with a
struct resource.
I considered adding a new field to struct rman to store the type and
only providing rman_get_type as an accessor. However, changing
'struct rman' is an ABI breakage. I might revisit this in main, but
the current approach is MFC'able.
ktls: deep copy tls_enable struct for in-kernel tcp consumers
Doing a deep copy of the keys early allows users of the
tls_enable structure to assume kernel memory.
This enables the socket options to be set by kernel threads.
Brooks Davis [Wed, 13 Mar 2024 20:34:46 +0000 (20:34 +0000)]
libc/softfloat: we don't export _fp[gs]et* symbols
Remove attempts to use NetBSD __weak_alias macros to export _-prefixed
versions of various fp[sg]et* symbols under softfloat. __weak_alias
isn't defined so we didn't export them and thus the Symbol.map entries
were wrong.
John Baldwin [Wed, 13 Mar 2024 20:19:10 +0000 (13:19 -0700)]
Revert "new-bus: Disable assertions for rman mismatches for activate/deactivate"
With recent fixes to the ACPI and pcib drivers to translate mapping
requests of child resources into mappings of sub-ranges of parent
resources these assertions should now be true.
Brooks Davis [Wed, 13 Mar 2024 17:42:01 +0000 (17:42 +0000)]
lib{c,sys}: return wrapped syscall APIs to libc
These provide standard APIs, but are implemented using another system
call (e.g., pipe implemented in terms of pipe2) or are interposed by the
threading library to support cancelation.
After discussion with kib (see D44111), I've concluded that it is
better to keep most public interfaces in libc with as little
as possible in libsys.
Brooks Davis [Wed, 13 Mar 2024 17:04:07 +0000 (17:04 +0000)]
libsys: don't expose sigwait wrapper
Long ago (e129c18a83ef) __sys_sigwait was wrapped to prevent sigwait()
from returning with EINTR. Through a series of changes this wrapper
become __libc_sigwait which was internal to libc and used solely in the
interposing table. To support a move of sigwait back to libc, move this
wrapper into libsys and rename it with an __libsys_ prefix.
Bjoern A. Zeeb [Mon, 4 Mar 2024 23:03:58 +0000 (23:03 +0000)]
LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM
In case of LKPI_80211_HW_CRYPTO we convert from LinuxKPI cipher_suites
to net80211 ic_cryptocaps fields. For WLAN_CIPHER_SUITE_CCMP we
accidentally returned the bit number instead of the shifted value
which leads to ieee80211_crypto_newkey() setting IEEE80211_KEY_SWCRYPT,
which in turned lead to us trying to decode the frame again despite
HW had already done it. This was found out of a discussion in D43634.
MFC after: 3 days
Reviewed by: cc, adrian
Differential Revision: https://reviews.freebsd.org/D44208
Bjoern A. Zeeb [Tue, 12 Mar 2024 21:22:36 +0000 (21:22 +0000)]
ath_hal/ar9300: allow JUPITER cards to read eeprom
Summary:
In ar9300_eeprom_read_word() also allow JUPITER cards read the eeprom
instead of returning an error. While this will not help all the
9462, 9485, 9565 OEM cards to work, it will make debugging of the
next steps a lot easier.
While here fix a typo in the error message if we do not get CAL.
PR: 255337
Tested by: John Nielsen (john jnielsen net)
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D44328
Brooks Davis [Tue, 12 Mar 2024 21:01:47 +0000 (21:01 +0000)]
libthr: restore _pthread_cond_timedwait
The function was renamed to _thr_cond_timedwait in commit 0ab1bfc7b28f
and for some reason did not get the same __weak_reference treatment as
other _pthread_cond symbols.
Gordon Bergling [Tue, 12 Mar 2024 14:44:48 +0000 (15:44 +0100)]
md5.1: Fix the GNU mode example when using a digest file
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead.
In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a digest file,
as created under the name digest for /boot/loader.conf in
the example above.
PR: 276560
Reviewed by: mhorne, des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44098
Randall Stewart [Tue, 12 Mar 2024 11:55:02 +0000 (07:55 -0400)]
Update to bring the rack stack with all its fixes in.
This brings the rack stack up to the current level used at NF. Many fixes
and improvements have been added. I also add in a fix to BBR to deal with
the changes that have been in hpts for a while i.e. only one call no matter
if mbuf queue or tcp_output.
It basically does little except BBlogs and is a placemark for future work on
doing path capacity measurements.
With a bit of a struggle with git I finally got rack_pcm.c into place (apologies
for not noticing this error). The LINT kernel is running on my box now .. sigh.
Reviewed by: tuexen, glebius
Sponsored by: Netflix Inc.
Differential Revision:https://reviews.freebsd.org/D43986
Sumit Saxena [Tue, 12 Mar 2024 06:51:09 +0000 (06:51 +0000)]
mrsas: don't reference the removed physical disk of RAID1 during IO submission
When a physical disk(PD) [belonging to a RAID1 Virtual disk(VD)] is
removed, driver may still use the reference to the removed PD while submitting
IO to the controller. Controller firmware faults upon receipt of such IO.
This patch fixes this issue by not using any reference to the removed PD.
Warner Losh [Tue, 12 Mar 2024 04:19:05 +0000 (22:19 -0600)]
timezone: Move to the XSI/POSIX definition for timezone.
The old timezone(3) function has long since been obsolete and has a
fatally flawed interface. Retain this function for compatibility
purposes, but shift to providing the offset from UTC in the timezone
variable, whether or not the timezone observes summer time in the
'daylight' variable. Document the tzname variable that's already been
set. Also make _tztab() static. It's not used in libc (or anywhere in
the tree) and it's not exported as a public dynamic symbol.
Warner Losh [Mon, 11 Mar 2024 20:15:44 +0000 (14:15 -0600)]
kboot: kbootfdt: fix error handling
If we are able to open /sys/firmware/fdt, but aren't able to read it,
fall back to /proc/device-tree. Remove comment that's not really true,
it turns out.
Warner Losh [Mon, 11 Mar 2024 20:15:34 +0000 (14:15 -0600)]
kboot: Print UEFI memory map
If we can read the UEFI memory map, go ahead and print the memory map.
While the kernel prints this with bootverbose, having it at this stage
is useful for debugging other problems.
Warner Losh [Mon, 11 Mar 2024 20:15:24 +0000 (14:15 -0600)]
kboot: hostfs -- check for llseek failure correctly
The host_* syscalls are all raw Linux system calls, not the POSIX
wrappers that glibc / musl create. So we have to ranage change the
return value of host_llseek correctly to use the negative value hack
that all Linux system calls use.
This fixes a false positive error detection when we do something like
lseek(fd, 0xf1234567, ...); This returns 0xf1234567, which is a negative
value which used to trigger the error path. Instead, we check using the
is_linux_error() and store the return value in a long. Translate that
errno to a host errno and set the global errno to that and return
-1. lseek can't otherwise return a negative number, since it's the
offset after seeking into the file, which by definition is positive.
This kept the 'read the UEFI memory map out of physical memory' from
working on aarch64 (whose boot loader falls back to reading it since
there are restrictive kernel options that can also prevent it), since
the physical address the memory map was at on my platform was like
0xfa008018.
Warner Losh [Mon, 11 Mar 2024 20:15:10 +0000 (14:15 -0600)]
kboot: Avoid UB in signed shift
offset is signed. Copy it to the unsigned res before shifting. This
avoids any possible undefined behavior for right shifting signed
numbers. No functional change intended (and the code generated is the
nearly same for aarch64).
Warner Losh [Mon, 11 Mar 2024 20:15:03 +0000 (14:15 -0600)]
kboot: Create function for error checking.
Linux has the convention of returning -ERRNO to flag errors from its
system calls. Sometimes other negative values are returned that are
success... However, only values -1 to -4096 (inclusive) are really
errors. The rest are either truncated values that only look negative (so
use long instead of int), or are things like addresses or legal unsigned
file offsets or similar that are successful returns. Filter out the
latter.
Randall Stewart [Mon, 11 Mar 2024 11:36:54 +0000 (07:36 -0400)]
Update to bring the rack stack with all its fixes in.
This brings the rack stack up to the current level used at NF. Many fixes
and improvements have been added. I also add in a fix to BBR to deal with
the changes that have been in hpts for a while i.e. only one call no matter
if mbuf queue or tcp_output.
Note there is a new file that I can't figure out how to get in rack_pcm.c
It basically does little except BBlogs and is a placemark for future work on
doing path capacity measurements.
Reviewed by: tuexen, glebius
Sponsored by: Netflix Inc.
Differential Revision:https://reviews.freebsd.org/D43986
unionfs: accommodate underlying FS calls that may re-lock
Since non-doomed unionfs vnodes always share their primary lock with
either the lower or upper vnode, any forwarded call to the base FS
which transiently drops that upper or lower vnode lock may result in
the unionfs vnode becoming completely unlocked during that transient
window. The unionfs vnode may then become doomed by a concurrent
forced unmount, which can lead to either or both of the following:
--Complete loss of the unionfs lock: in the process of being
doomed, the unionfs vnode switches back to the default vnode lock,
so even if the base FS VOP reacquires the upper/lower vnode lock,
that no longer translates into the unionfs vnode being relocked.
This will then violate that caller's locking assumptions as well
as various assertions that are enabled with DEBUG_VFS_LOCKS.
--Complete less of reference on the upper/lower vnode: the caller
normally holds a reference on the unionfs vnode, while the unionfs
vnode in turn holds references on the upper/lower vnodes. But in
the course of being doomed, the unionfs vnode will drop the latter
set of references, which can effectively lead to the base FS VOP
executing with no references at all on its vnode, violating the
assumption that vnodes can't be recycled during these calls and
(if lucky) violating various assertions in the base FS.
Fix this by adding two new functions, unionfs_forward_vop_start_pair()
and unionfs_forward_vop_finish_pair(), which are intended to bookend
any forwarded VOP which may transiently unlock the relevant vnode(s).
These functions are currently only applied to VOPs that modify file
state (and require vnode reference and lock state to be identical at
call entry and exit), as the common reason for transiently dropping
locks is to update filesystem metadata.
uipc_bindat(): Explicitly specify exclusive locking for the new vnode
When calling VOP_CREATE(), uipc_bindat() reuses the componentname
object from the preceding lookup operation, which is likely to specify
LK_SHARED. Furthermore, the VOP_CREATE() interface technically only
requires the newly-created vnode to be returned with a shared lock.
However, the socket layer requires the new vnode to be locked exclusive
and asserts to that effect.
In most cases, this is not a practical concern because most if not
all base-layer filesystems (certainly FFS, ZFS, and msdosfs at least)
always return the vnode locked exclusive regardless of the lock flags.
However, it is an issue for unionfs which uses cn_lkflags to determine
how the new unionfs wrapper vnode should be locked. While it would
be easy enough to work around this issue within unionfs itself, it
seems better for the socket layer to be explicit about its locking
requirements when issuing VOP_CREATE().
vn_lock_pair(): allow lkflags1/lkflags2 to be 0 if vp1/vp2 is NULL
It's a bit strange to require the caller to pass contrived lock flags
if the corresponding vnode is NULL, simply to appease the assertion
that exactly one of LK_SHARED or LK_EXCLUSIVE must be set. On the
other hand, we still want to catch cases in which completely bogus
or corrupt flags are passed even if the corresponding vnode is NULL.
Therefore, specifically allow empty flags for lkflags1/lkflags2 iff
the respective vp1/vp2 param is NULL.
Kyle Evans [Sat, 9 Mar 2024 02:01:17 +0000 (20:01 -0600)]
crunchgen: slap a dependency on the generated makefile for .lo
crunchgen generates a foo.lo for each binary it will end up crunching
into the final product. While they have a dependency on the libs that
are used to link them, nothing will force relinking if the set of libs
needed to link them is changed. Because of this, incremental builds may
not be possible if one builds a version of, e.g., rescue/ with a broken
set of libs specified for a project -- a subsequent fix won't be rolled
in cleanly, it will require purging the rescue/ objdir.
This is a bit crude, but the foo.mk we generate doesn't actually get
regenerated all that often in practice, so a spurious relink for the
vast majority of crunched objects won't actually happen all that often.
Brooks Davis [Fri, 8 Mar 2024 19:14:24 +0000 (19:14 +0000)]
lib{c,sys}: fix incremental builds
I removed lib/libsys/{aarch64,arm,riscv}/syscall.S in favor of an
idential generated version. We need to clean out the .ddepend files to
ensure the generated version is actually generated.
The guard here is technically too strict, but should be fine in practice
and I've verified both the breakage and fix on an armv7 build.
Mitchell Horne [Fri, 8 Mar 2024 14:09:17 +0000 (10:09 -0400)]
simple_mfd: don't attach children twice
Trying to probe+attach the child device at the point it is added comes
before the syscon handle is set up (if relevant). It will therefore be
unavailable to the attach method which is expecting it, and the first
attempt to attach the device will fail.
Just rely on the call to bus_generic_attach() at the end of the function
to perform probe+attach of dev's children.
Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44268
Mitchell Horne [Fri, 8 Mar 2024 14:09:08 +0000 (10:09 -0400)]
clkdom_dump(): improve output text
If the call to clknode_get_freq() returns an error (unlikely), report
this, rather than printing the error code as the clock frequency.
If the clock has no parent (e.g. a fixed reference clock), print "none"
rather than "(NULL)(-1)". This is a more human-legible presentation of the
same information.
Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44267
Wei Hu [Fri, 8 Mar 2024 10:00:25 +0000 (10:00 +0000)]
Hyper-V: vPCI: fix cpu id mis-mapping in vmbus_pcib_map_msi()
The msi address contains apic id. The code in vmbus_pcib_map_msi()
treats it as cpu id, which could cause mis-configuration of msix
IRQs, leading to missing interrupts for SRIOV devices. This happens
when apic id is not the same as cpu id on certain large VM sizes
with multiple numa domains in Azure. Fix this issue by correctly
mapping apic ids to cpu ids.
On vPCI version before 1.4, it only supports up to 64 vcpus
for msi/msix interrupt. This change also adds a check and returns
error if the vcpu_id is greater than 63.
Michael Tuexen [Fri, 8 Mar 2024 09:03:43 +0000 (10:03 +0100)]
TCP LRO: disable mbuf queuing when packet filter hooks are in place
When doing mbuf queueing, the packet filter hooks in ether_demux(),
ip_input(), and ip6_input() are by-passed. This means that the packet
filters don't process incoming packets, which might result in
connection failures. For example bypassing the TCP sequence number
validation will result in dropping valid packets.
Please note that this patch is only disabling mbuf queueing, not LRO.
Reported by: Herbert J. Skuhra
Reviewed by: glebius, rrs, rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D43769
Warner Losh [Fri, 8 Mar 2024 05:40:43 +0000 (22:40 -0700)]
awk: Fix the tests
I'd forgotten that we have to adjust the stderr tests from
upstream. Remove the OK files. Also remove system-status.*. These
restore the fixes I made in 517e52b6c21c which were lost when I imported
the last version of awk.
Also, force LANG to be C.UTF-8 when testing to ensure that stray lang
settings don't fail tests.
Brooks Davis [Thu, 7 Mar 2024 20:09:00 +0000 (20:09 +0000)]
libc/quad: narrow list of symbols exposed on i386
These symbols aren't present on i386 so don't try to expose them.
Given the structure of quad/Makefile.inc, it might make more sense to
have per-arch symbol maps here, but this is sufficent to build with
WITHOUT_UNDEFINED_VERSION on i386.
Brooks Davis [Thu, 7 Mar 2024 20:08:38 +0000 (20:08 +0000)]
libc/iconv: don't export nonexistant symbols
It's unclear to me that any of these symbols ever existed. The ones
I've spot checked are only mentioned in the initial Citrus iconv import
(commit ad30f8e79bd1) and this code hasn't changed much over time.
if_bnxt: Set 1G/10G baseT force speed as auto speeds
The firmware lacks support for manually setting 1G and 10G baseT speeds.
However, the driver can enable auto speed masks to achieve automatic configuration
at these speeds.
if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller
The newly added port extended hardware statistics are now accessible to
users through the sysctl interface. Also, Few obsolete stats are removed
and few stats are renamed.
if_bnxt: Fix media speed update issue in "ifconfig -m" during PHY hot plug
Currently, if a media type (e.g., DAC) is hot-plugged out and another type
(e.g., optical cable) is hot-plugged in, the new speed is not reflected in
ifconfig. This occurs when the driver fails to update speeds with unchanged
tx and rx flow control.
To fix, a phy_type check ensures update of phy speeds upon detecting the new
phy.