aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
Commit message (Collapse)AuthorAgeFilesLines
* Instead of individual conditional statements to look for each hypervisorStephen J. Kiernan2019-05-171-1/+2
| | | | | | | | | | | | | | | | | type, use a table to make it easier to add more in the future, if needed. Add VirtualBox detection to the table ("VBoxVBoxVBox" is the hypervisor vendor string to look for.) Also add VM_GUEST_VBOX to the VM_GUEST enumeration to indicate VirtualBox. Save the CPUID base for the hypervisor entry that we detected. Driver code may need to know about it in order to obtain additional CPUID features. Approved by: bryanv, jhb Differential Revision: https://reviews.freebsd.org/D16305 Notes: svn path=/head/; revision=347932
* FCP-101: Bump __FreeBSD_version for device removal.Brooks Davis2019-05-171-1/+1
| | | | | | | | | Bump accidentally omitted from r347924 due to a rebase accident. Differential Revision: https://reviews.freebsd.org/D20230 Notes: svn path=/head/; revision=347925
* FCP-101: Bump __FreeBSD_version for driver removal.Brooks Davis2019-05-171-3/+0
| | | | | | | | | Remove gone_by_fcp101_dev macro. Remove orphaned comment. Notes: svn path=/head/; revision=347924
* Allow loading the same DMA address multiple times without any priorTycho Nightingale2019-05-161-0/+4
| | | | | | | | | | | unload for the LinuxKPI. Reviewed by: kib, zeising Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20181 Notes: svn path=/head/; revision=347836
* LinuxKPI: Add prepare to pm_ops and bump FreeBSD version.Johannes Lundberg2019-05-141-1/+1
| | | | | | | | | | | This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Notes: svn path=/head/; revision=347601
* LinuxKPI: Add context member to ww_mutex and bump FreeBSD version.Johannes Lundberg2019-05-141-1/+1
| | | | | | | | | | This patch is part of https://reviews.freebsd.org/D19565. Reviewed by: hps Approved by: imp (mentor), hps Notes: svn path=/head/; revision=347596
* Add an UPDATING entry and bump __FreeBSD_version for r347532.Mark Johnston2019-05-131-1/+1
| | | | | | | Reported by: rgrimes, Oliver Pinter <oliver.pinter@hardenedbsd.org> Notes: svn path=/head/; revision=347543
* Provide separate accounting for user-wired pages.Mark Johnston2019-05-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically we have not distinguished between kernel wirings and user wirings for accounting purposes. User wirings (via mlock(2)) were subject to a global limit on the number of wired pages, so if large swaths of physical memory were wired by the kernel, as happens with the ZFS ARC among other things, the limit could be exceeded, causing user wirings to fail. The change adds a new counter, v_user_wire_count, which counts the number of virtual pages wired by user processes via mlock(2) and mlockall(2). Only user-wired pages are subject to the system-wide limit which helps provide some safety against deadlocks. In particular, while sources of kernel wirings typically support some backpressure mechanism, there is no way to reclaim user-wired pages shorting of killing the wiring process. The limit is exported as vm.max_user_wired, renamed from vm.max_wired, and changed from u_int to u_long. The choice to count virtual user-wired pages rather than physical pages was done for simplicity. There are mechanisms that can cause user-wired mappings to be destroyed while maintaining a wiring of the backing physical page; these make it difficult to accurately track user wirings at the physical page layer. The change also closes some holes which allowed user wirings to succeed even when they would cause the system limit to be exceeded. For instance, mmap() may now fail with ENOMEM in a process that has called mlockall(MCL_FUTURE) if the new mapping would cause the user wiring limit to be exceeded. Note that bhyve -S is subject to the user wiring limit, which defaults to 1/3 of physical RAM. Users that wish to exceed the limit must tune vm.max_user_wired. Reviewed by: kib, ngie (mlock() test changes) Tested by: pho (earlier version) MFC after: 45 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19908 Notes: svn path=/head/; revision=347532
* seqc: fix sed-introduced typos (seqcuence -> sequence)Mateusz Guzik2019-05-121-3/+3
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=347507
* A new parameter to blist_alloc specifies an upper bound on the size ofDoug Moore2019-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | the allocation request, so that the blocks allocated are from the next set of free blocks big enough to satisfy the minimum requirements of the request, and the number of blocks allocated are as many as possible, up to the specified maximum. The implementation of swp_pager_getswapspace uses this parameter to ask for a number of blocks between the new halved request size and the previous failed request size. Thus a request for 32 blocks may fail, but instead of getting only 16 blocks instead, the caller asks for 16 to 31 next, and might get 19 or 27, which is closer to what they originally wanted. I expect this to lead to bigger block allocations and less block fragmentation, at least in some cases. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20001 Notes: svn path=/head/; revision=347493
* A major change to subr_blist.c failed to update all the comments aboutDoug Moore2019-05-101-3/+3
| | | | | | | | | | changes to struct fields. Update those now. Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D20227 Notes: svn path=/head/; revision=347433
* Bind TCP HPTS (pacer) threads to NUMA domainsAndrew Gallatin2019-05-101-0/+2
| | | | | | | | | | | | | | | | | | | Bind the TCP pacer threads to NUMA domains and build per-domain pacer-thread lookup tables. These tables allow us to use the inpcb's NUMA domain information to match an inpcb with a pacer thread on the same domain. The motivation for this is to keep the TCP connection local to a NUMA domain as much as possible. Thanks to jhb for pre-reviewing an earlier version of the patch. Reviewed by: rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20134 Notes: svn path=/head/; revision=347430
* Mark inline functions with __unused; prevents compiler warningEdward Tomasz Napierala2019-05-081-3/+3
| | | | | | | | | | | | | when they end up being unused. Reviewed by: kib Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D20185 Notes: svn path=/head/; revision=347360
* Enable sys/disk.h consumers to avoid pulling in networking headers.Matt Macy2019-05-081-3/+5
| | | | | | | The networking headers break ZoF. Notes: svn path=/head/; revision=347357
* Reduce umtx-related work on exec and exitMateusz Guzik2019-05-081-0/+1
| | | | | | | | | | | | | | | | - there is no need to take the process lock to iterate the thread list after single-threading is enforced - typically there are no mutexes to clean up (testable without taking the global umtx lock) - typically there is no need to adjust the priority (testable without taking thread lock) Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20160 Notes: svn path=/head/; revision=347355
* Bump the Mellanox driver version numbers and the FreeBSD version number.Hans Petter Selasky2019-05-081-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347325
* make sysent after r347228Ed Maste2019-05-073-3/+3
| | | | | | | Regenerate to add @generated tag in generated files. Notes: svn path=/head/; revision=347230
* device_printf: Use sbuf for more coherent prints on SMPConrad Meyer2019-05-071-0/+1
| | | | | | | | | | | | | | | | | device_printf does multiple calls to printf allowing other console messages to be inserted between the device name, and the rest of the message. This change uses sbuf to compose to two into a single buffer, and prints it all at once. It exposes an sbuf drain function (drain-to-printf) for common use. Update documentation to match; some unit tests included. Submitted by: jmg Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16690 Notes: svn path=/head/; revision=347229
* List-ify kernel dump device configurationConrad Meyer2019-05-063-7/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow users to specify multiple dump configurations in a prioritized list. This enables fallback to secondary device(s) if primary dump fails. E.g., one might configure a preference for netdump, but fallback to disk dump as a second choice if netdump is unavailable. This change does not list-ify netdump configuration, which is tracked separately from ordinary disk dumps internally; only one netdump configuration can be made at a time, for now. It also does not implement IPv6 netdump. savecore(8) is already capable of scanning and iterating multiple devices from /etc/fstab or passed on the command line. This change doesn't update the rc or loader variables 'dumpdev' in any way; it can still be set to configure a single dump device, and rc.d/savecore still uses it as a single device. Only dumpon(8) is updated to be able to configure the more complicated configurations for now. As part of revving the ABI, unify netdump and disk dump configuration ioctl / structure, and leave room for ipv6 netdump as a future possibility. Backwards-compatibility ioctls are added to smooth ABI transition, especially for developers who may not keep kernel and userspace perfectly synced. Reviewed by: markj, scottl (earlier version) Relnotes: maybe Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19996 Notes: svn path=/head/; revision=347192
* Switch to use shared vnode locks for text files during image activation.Konstantin Belousov2019-05-052-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kern_execve() locks text vnode exclusive to be able to set and clear VV_TEXT flag. VV_TEXT is mutually exclusive with the v_writecount > 0 condition. The change removes VV_TEXT, replacing it with the condition v_writecount <= -1, and puts v_writecount under the vnode interlock. Each text reference decrements v_writecount. To clear the text reference when the segment is unmapped, it is recorded in the vm_map_entry backed by the text file as MAP_ENTRY_VN_TEXT flag, and v_writecount is incremented on the map entry removal The operations like VOP_ADD_WRITECOUNT() and VOP_SET_TEXT() check that v_writecount does not contradict the desired change. vn_writecheck() is now racy and its use was eliminated everywhere except access. Atomic check for writeability and increment of v_writecount is performed by the VOP. vn_truncate() now increments v_writecount around VOP_SETATTR() call, lack of which is arguably a bug on its own. nullfs bypasses v_writecount to the lower vnode always, so nullfs vnode has its own v_writecount correct, and lower vnode gets all references, since object->handle is always lower vnode. On the text vnode' vm object dealloc, the v_writecount value is reset to zero, and deadfs vop_unset_text short-circuit the operation. Reclamation of lowervp always reclaims all nullfs vnodes referencing lowervp first, so no stray references are left. Reviewed by: markj, trasz Tested by: mjg, pho Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D19923 Notes: svn path=/head/; revision=347151
* Fix regression issue after r346645 in the LinuxKPI.Hans Petter Selasky2019-05-041-1/+1
| | | | | | | | | | | | | | | | | The S/G list must be mapped AS-IS without any optimisations. This also implies that sg_dma_len() must be equal to sg->length. Many Linux drivers assume this and this fixes some DRM issues. Put the BUS DMA map pointer into the scatter-gather list to allow multiple mappings on the same physical memory address. The FreeBSD version has been bumped to force recompilation of external kernel modules. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347089
* Remove p_code from struct proc.John Baldwin2019-04-251-1/+0
| | | | | | | | | | | | | Contrary to the comments, it was never used by core dumps or debuggers. Instead, it used to hold the signal code of a pending signal, but that was replaced by the 'ksi_code' member of ksiginfo_t when signal information was reworked in 7.0. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D20047 Notes: svn path=/head/; revision=346695
* LinuxKPI should use bus_dma(9) to be compatible with an IOMMUTycho Nightingale2019-04-241-1/+1
| | | | | | | | | | Reviewed by: hselasky, kib Tested by: greg@unrelenting.technology Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19845 Notes: svn path=/head/; revision=346645
* This patch offers a workaround to buf_ring reorderingWojciech Macek2019-04-231-6/+15
| | | | | | | | | | | | visible on armv7 and armv8. Similar issue to rS302292. Obtained from: Semihalf Authored by: Michal Krawczyk <mk@semihalf.com> Approved by: wma Differential Revision: https://reviews.freebsd.org/D19932 Notes: svn path=/head/; revision=346593
* Revert r346410 and r346411Conrad Meyer2019-04-192-2/+1
| | | | | | | | libkern in .PATH has too many filename conflicts with libc and my -DNO_CLEAN tinderbox didn't catch that ahead of time. Mea culpa. Notes: svn path=/head/; revision=346420
* Bump __FreeBSD_version after r346410Conrad Meyer2019-04-191-1/+1
| | | | Notes: svn path=/head/; revision=346411
* libkern: Bring in arc4random_uniform(9) from libcConrad Meyer2019-04-191-0/+1
| | | | | | | | | | | | | | | | It is a useful arc4random wrapper in the kernel for much the same reasons as in userspace. Move the source to libkern (because kernel build is restricted to sys/, but userspace can include any file it likes) and build kernel and libc versions from the same source file. Copy the documentation from arc4random_uniform(3) to the section 9 page. While here, add missing arc4random_buf(9) symlink. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=346410
* random(4): Restore availability tradeoff prior to r346250Conrad Meyer2019-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in that commit message, it is a dangerous default. But the safe default causes enough pain on a variety of platforms that for now, restore the prior default. Some of this is self-induced pain we should/could do better about; for example, programmatic CI systems and VM managers should introduce entropy from the host for individual VM instances. This is considered a future work item. On modern x86 and Power9 systems, this may be wholly unnecessary after D19928 lands (even in the non-ideal case where early /boot/entropy is unavailable), because they have fast hardware random sources available early in boot. But D19928 is not yet landed and we have a host of architectures which do not provide fast random sources. This change adds several tunables and diagnostic sysctls, documented thoroughly in UPDATING and sys/dev/random/random_infra.c. PR: 230875 (reopens) Reported by: adrian, jhb, imp, and probably others Reviewed by: delphij, imp (earlier version), markm (earlier version) Discussed with: adrian Approved by: secteam(delphij) Relnotes: yeah Security: related Differential Revision: https://reviews.freebsd.org/D19944 Notes: svn path=/head/; revision=346358
* random(4): Add is_random_seeded(9) KPIConrad Meyer2019-04-162-1/+7
| | | | | | | | | | | | | | | The imagined use is for early boot consumers of random to be able to make decisions based on whether random is available yet or not. One such consumer seems to be __stack_chk_init(), which runs immediately after random is initialized. A follow-up patch will attempt to address that. Reported by: many Reviewed by: delphij (except man page) Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D19926 Notes: svn path=/head/; revision=346282
* Replace cosqos with numa_domain in mbuf pkthdrAndrew Gallatin2019-04-161-28/+2
| | | | | | | | | | | | | | | | | | | | The cosqos field was added nearly 6 years ago in r254804, and it is still unused by any in-tree consumers. I have a patchset that I'm working on which aligns many network resources by NUMA domain, including inps, inpcb lb group, tcp pacing, lagg output link selection, backing pages for sendfile, and more. It reduces cross-domain traffic by roughly 50% for a real web workload. This patchset relies on being able to store the numa domain in the mbuf, and grabbing the unused cosqos field for this purpose is the first step in starting to usptream it. Reviewed by: kib, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19862 Notes: svn path=/head/; revision=346281
* random(4): Block read_random(9) on initial seedingConrad Meyer2019-04-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read_random() is/was used, mostly without error checking, in a lot of very sensitive places in the kernel -- including seeding the widely used arc4random(9). Most uses, especially arc4random(9), should block until the device is seeded rather than proceeding with a bogus or empty seed. I did not spy any obvious kernel consumers where blocking would be inappropriate (in the sense that lack of entropy would be ok -- I did not investigate locking angle thoroughly). In many instances, arc4random_buf(9) or that family of APIs would be more appropriate anyway; that work was done in r345865. A minor cleanup was made to the implementation of the READ_RANDOM function: instead of using a variable-length array on the stack to temporarily store all full random blocks sufficient to satisfy the requested 'len', only store a single block on the stack. This has some benefit in terms of reducing stack usage, reducing memcpy overhead and reducing devrandom output leakage via the stack. Additionally, the stack block is now safely zeroed if it was used. One caveat of this change is that the kern.arandom sysctl no longer returns zero bytes immediately if the random device is not seeded. This means that FreeBSD-specific userspace applications which attempted to handle an unseeded random device may be broken by this change. If such behavior is needed, it can be replaced by the more portable getrandom(2) GRND_NONBLOCK option. On any typical FreeBSD system, entropy is persisted on read/write media and used to seed the random device very early in boot, and blocking is never a problem. This change primarily impacts the behavior of /dev/random on embedded systems with read-only media that do not configure "nodevice random". We toggle the default from 'charge on blindly with no entropy' to 'block indefinitely.' This default is safer, but may cause frustration. Embedded system designers using FreeBSD have several options. The most obvious is to plan to have a small writable NVRAM or NAND to persist entropy, like larger systems. Early entropy can be fed from any loader, or by writing directly to /dev/random during boot. Some embedded SoCs now provide a fast hardware entropy source; this would also work for quickly seeding Fortuna. A 3rd option would be creating an embedded-specific, more simplistic random module, like that designed by DJB in [1] (this design still requires a small rewritable media for forward secrecy). Finally, the least preferred option might be "nodevice random", although I plan to remove this in a subsequent revision. To help developers emulate the behavior of these embedded systems on ordinary workstations, the tunable kern.random.block_seeded_status was added. When set to 1, it blocks the random device. I attempted to document this change in random.4 and random.9 and ran into a bunch of out-of-date or irrelevant or inaccurate content and ended up rototilling those documents more than I intended to. Sorry. I think they're in a better state now. PR: 230875 Reviewed by: delphij, markm (earlier version) Approved by: secteam(delphij), devrandom(markm) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19744 Notes: svn path=/head/; revision=346250
* Fix the NFSv4 client to safely find processes.Rick Macklem2019-04-151-0/+3
| | | | | | | | | | | | | | | | | | r340744 broke the NFSv4 client, because it replaced pfind_locked() with a call to pfind(), since pfind() acquires the sx lock for the pid hash and the NFSv4 already holds a mutex when it does the call. The patch fixes the problem by recreating a pfind_any_locked() and adding the functions pidhash_slockall() and pidhash_sunlockall to acquire/release all of the pid hash locks. These functions are then used by the NFSv4 client instead of acquiring the allproc_lock and calling pfind(). Reviewed by: kib, mjg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19887 Notes: svn path=/head/; revision=346217
* Fix sbttons for values > 2sWarner Losh2019-04-131-1/+11
| | | | | | | | | | Add test against negative times. Add code to cope with larger values properly. Discussed with: bde@ (quite some time ago, for an earlier version) Notes: svn path=/head/; revision=346176
* Obvious comment correction.Gleb Smirnoff2019-04-091-1/+1
| | | | Notes: svn path=/head/; revision=346069
* Add vn_fsync_buf().Konstantin Belousov2019-04-091-0/+1
| | | | | | | | | | | Provide a convenience function to avoid the hack with filling fake struct vop_fsync_args and then calling vop_stdfsync(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=346065
* Bump FreeBSD version after r345982.Mariusz Zaborski2019-04-071-1/+1
| | | | | | | | Reported by: Shawn Webb <shawn.webb@hardenedbsd.org> Discussed with: imp, cy, rgrimes Notes: svn path=/head/; revision=346012
* kern/subr_pctrie: Convert old-style boolean_t to plain "bool"Conrad Meyer2019-04-061-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=345991
* Regen after r345982.Mariusz Zaborski2019-04-063-2/+12
| | | | Notes: svn path=/head/; revision=345983
* Introduce funlinkat syscall that always us to check if we are removingMariusz Zaborski2019-04-062-2/+12
| | | | | | | | | | | | the file associated with the given file descriptor. Reviewed by: kib, asomers Reviewed by: cem, jilles, brooks (they reviewed previous version) Discussed with: pjd, and many others Differential Revision: https://reviews.freebsd.org/D14567 Notes: svn path=/head/; revision=345982
* Add DEV_RESET /dev/devctl2 ioctl.Konstantin Belousov2019-04-051-0/+1
| | | | | | | | | | | | | It performs BUS_RESET_CHILD() on the parental bus and the specified device. Reviewed by: imp (previous version), jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19646 Notes: svn path=/head/; revision=345965
* Provide newbus infrastructure for initiating device reset.Konstantin Belousov2019-04-051-0/+6
| | | | | | | | | | | | | | | | | | | The methods BUS_RESET_PREPARE(), BUS_RESET(), and BUS_RESET_POST() should be implemented by bus which can provide reset to a device. The methods are described in inline doxygen comments. Code only provides BUS_RESET_PREPARE() and BUS_RESET_POST() helpers instead of default implementation, because actual bus needs to handle device state around reset, while helpers provide the other half of typical prepare/post code. Reviewed by: imp (previous version), jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19646 Notes: svn path=/head/; revision=345960
* Fix typos in r345849.Alexander Motin2019-04-031-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=345850
* List few more ATA commands.Alexander Motin2019-04-031-0/+11
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=345849
* Revert change accidentally committed along with r345625Ed Maste2019-03-281-2/+1
| | | | | | | Reported by: Oliver Pinter <oliver.pinter@hardenedbsd.org> Notes: svn path=/head/; revision=345638
* revert r341429 "disable BIND_NOW in libc, libthr, and rtld"Ed Maste2019-03-281-1/+2
| | | | | | | | | | | r345620 by kib@ fixed the rtld issue that caused a crash at startup during resolution of libc's ifuncs with BIND_NOW. PR: 233333 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=345625
* Change all kernel C-type macros into static inline functions.Hans Petter Selasky2019-03-251-13/+59
| | | | | | | | | | | | | | | | | | The current kernel C-type macros might obscurely hide the fact that the input argument might be used multiple times. This breaks code like: isalpha(*ptr++) Use static inline functions instead of macros to fix this. Reviewed by: kib @ Differential Revision: https://reviews.freebsd.org/D19694 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=345499
* Allow using TPM as entropy source.Marcin Wojtas2019-03-231-0/+1
| | | | | | | | | | | | | | | | | TPM has a built-in RNG, with its own entropy source. The driver was extended to harvest 16 random bytes from TPM every 10 seconds. A new build option "TPM_HARVEST" was introduced - for now, however, it is not enabled by default in the GENERIC config. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: markm, delphij Approved by: secteam Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D19620 Notes: svn path=/head/; revision=345438
* iflib: mark isc_driver_version as constantEric Joyner2019-03-191-0/+19
| | | | | | | | | | | | | | | | From Jake: The iflib core never modifies the isc_driver_version string. Allow drivers to safely assign pointers to constant buffers by marking this parameter const. Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: erj@, gallatin@, jhb@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19577 Notes: svn path=/head/; revision=345312
* iflib: expose the Rx mbuf buffer size to driversEric Joyner2019-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From Jake: iflib_fl_setup calculates a suitable buffer size for the Rx mbufs based on the isc_max_frame_size value that drivers setup. This calculation is repeated by drivers when programming their hardware with the size of each Rx buffer. This can lead to a mismatch where the iflib mbuf size is different from the expected size of the buffer as programmed by the hardware. This can lead to unexpected results. If iflib ever wants to support mbuf sizes larger than one page, every driver must be updated to account for the new possible buffer sizes. Fix this by calculating the mbuf size prior to calling IFDI_INIT, and adding the iflib_get_rx_mbuf_sz function which will expose this value to drivers, so that they do not repeat the same calculation. Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: shurd@, erj@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19489 Notes: svn path=/head/; revision=345305
* sys/stat.h: Improve timespec compatibility with other BSDsEd Maste2019-03-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | OpenBSD and NetBSD provide macros to directly reference the underlying struct timespec's tv_nsec member. While FreeBSD has such macros for tv_sec, the others are missing. Add the following macros: st->st_atimensec st->st_mtimensec st->st_ctimensec st->st_birthtimensec Adding these fields will provide programs which reference them better portability to FreeBSD. An example of such a program is makefs(8), which has unused support for subseconds that it has inherited from NetBSD. Submitted by: Mitchell Horne <mhorne063@gmail.com> Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D19626 Notes: svn path=/head/; revision=345280