When changing driver tunables that use strings with kenv, they fail with error 14. For example Intel drivers rx/tx descriptor tunables fail with: Setting sysctl dev.ixl.0.iflib.override_ntxds failed: 14 Setting sysctl dev.ixl.0.iflib.override_nrxds failed: 14 More than likely this is caused by https://reviews.freebsd.org/D23378. This patch has made changes to the sysctl_handle_string() function. The copyin() function is now used to copy bytes from user space to kernel space. The problem is that the tunables are already located in the kernel space (kenv). It turns out that changing string parameters using sysctl works well, but if you set string parameters from kenv, the copyin() function fails with error 14.
Associated commit: base r357614
Review with a proposed fix: https://reviews.freebsd.org/D24429
A commit references this bug: Author: kaktus Date: Wed Apr 15 16:33:55 UTC 2020 New revision: 359975 URL: https://svnweb.freebsd.org/changeset/base/359975 Log: sysctl(9): fix handling string tunables. r357614 changed internals of handling string sysctls, and inadvertently broke setting string tunables. Take them into account. PR: 245463 Reported by: jhb, np Reviewed by: imp, jhb, kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D24429 Changes: head/sys/kern/kern_sysctl.c