Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existingpci device tables, and has no probe / attach code changes.Rev
Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existingpci device tables, and has no probe / attach code changes.Reviewed by: imp, chuckSubmitted by: Lakhan Shiva Kamireddy <[email protected]>Sponsored by: Google, Inc. (GSoC 2018)Approved by: re (glen)
show more ...
Move most of the contents of opt_compat.h to opt_global.h.opt_compat.h is mentioned in nearly 180 files. In-progress networkdriver compabibility improvements may add over 100 more so this isclose
Move most of the contents of opt_compat.h to opt_global.h.opt_compat.h is mentioned in nearly 180 files. In-progress networkdriver compabibility improvements may add over 100 more so this iscloser to "just about everywhere" than "only some files" per theguidance in sys/conf/options.Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset ofsys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.his created on all architectures.Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control theset of compiled files.Reviewed by: kib, cem, jhb, jtlSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D14941
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Fix intrhook release in MFI as well
Clean up MD pollution of bus_dma.h:--Remove special-case handling of sparc64 bus_dmamap* functions. Replace with a more generic mechanism that allows MD busdma implementations to generate inlin
Clean up MD pollution of bus_dma.h:--Remove special-case handling of sparc64 bus_dmamap* functions. Replace with a more generic mechanism that allows MD busdma implementations to generate inline mapping functions by defining WANT_INLINE_DMAMAP in <machine/bus_dma.h>. This is currently useful for sparc64, x86, and arm64, which all implement non-load dmamap operations as simple wrappers around map objects which may be bus- or device-specific.--Remove NULL-checked bus_dmamap macros. Implement the equivalent NULL checks in the inlined x86 implementation. For non-x86 platforms, these checks are a minor pessimization as those platforms do not currently allow NULL maps. NULL maps were originally allowed on arm64, which appears to have been the motivation behind adding arm[64]-specific barriers to bus_dma.h, but that support was removed in r299463.--Simplify the internal interface used by the bus_dmamap_load* variants and move it to bus_dma_internal.h--Fix some drivers that directly include sys/bus_dma.h despite the recommendations of bus_dma(9)Reviewed by: kib (previous revision), mariusDifferential Revision: https://reviews.freebsd.org/D10729
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq arefixed-length strings. AFAICT the only place they're read is insbin/c
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq arefixed-length strings. AFAICT the only place they're read is insbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.However, the kernel doesn't null-terminate them. A bunch of copy-pasted codeuses strncpy to write them, and doesn't guarantee null-termination. For atleast 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actuallyoverflows. You can see the result by doing "camcontrol negotiate da0 -v".This change null-terminates those fields everywhere they're set in thekernel. It also shortens a few strings to ensure they'll fit within the16-character field.PR: 215474Reported by: CoverityCID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187CID: 1010035 1010036 1010042 1010041 1010040 1010039Reviewed by: imp, sephe, slmMFC after: 4 weeksSponsored by: Spectra Logic CorpDifferential Revision: https://reviews.freebsd.org/D9037Differential Revision: https://reviews.freebsd.org/D9038
Add missing array subscript.This fixes a tautological pointer comparison warning, but would also areal bug for a platform where bus_dmamap_unload of a static allocationis not a no-op.
Remove NULL check after M_WAITOK allocations from mfi(4).MFC after: 1 monthSponsored by: The FreeBSD Foundation
sys/dev: minor spelling fixes.Most affect comments, very few have user-visible effects.
sys/dev: extend use of the howmany() macro when available.We have a howmany() macro in the <sys/param.h> header that isconvenient to re-use as it makes things easier to read.
Remove bare & 0x3; it encodes the values of BIO_READ andBIO_WRITE. It's also unnecessary since the only cases in this switchare those two.
Switch from make_dev_alias to make_dev_alias_p since make_dev_alias_p cangracefully fail if the /dev/megaraid_sas_ioctl_node symlink already exists.This can happen if mfi(4) and mrsas(4) are both a
Switch from make_dev_alias to make_dev_alias_p since make_dev_alias_p cangracefully fail if the /dev/megaraid_sas_ioctl_node symlink already exists.This can happen if mfi(4) and mrsas(4) are both attached to cards andproviding Linux emulation support. Let the first one win. An equivalentchange needs to be done to mrsas(4). Extra credit would be to pass theLinux emulation call to the other driver when appropriate. This willprobably be a rare case and the user can manually change where the symlinkpoints to.MFC after: 3 days
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and cle
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and clean up callout_init() callsto make them more consistent.Differential Revision: https://reviews.freebsd.org/D2613Reviewed by: jhbMFC after: 2 weeks
Pull in r267961 and r267973 again. Fix for issues reported will follow.
Revert r267961, r267973:These changes prevent sysctl(8) from returning proper output,such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1
Revert r267961, r267973:These changes prevent sysctl(8) from returning proper output,such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
Extend the meaning of the CTLFLAG_TUN flag to automatically check ifthere is an environment variable which shall initialize the SYSCTLduring early boot. This works for all SYSCTL types both statica
Extend the meaning of the CTLFLAG_TUN flag to automatically check ifthere is an environment variable which shall initialize the SYSCTLduring early boot. This works for all SYSCTL types both statically anddynamically created ones, except for the SYSCTL NODE type and SYSCTLswhich belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added tobe used in the case a tunable sysctl has a custom initialisationfunction allowing the sysctl to still be marked as a tunable. Thekernel SYSCTL API is mostly the same, with a few exceptions for somespecial operations like iterating childrens of a static/extern SYSCTLnode. This operation should probably be made into a factored outcommon macro, hence some device drivers use this. The reason forchanging the SYSCTL API was the need for a SYSCTL parent OID pointerand not only the SYSCTL parent OID list pointer in order to quicklygenerate the sysctl path. The motivation behind this patch is to avoidparameter loading cludges inside the OFED driver subsystem. Instead ofadding special code to the OFED driver subsystem to post-load tunablesinto dynamically created sysctls, we generalize this in the kernel.Other changes:- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"to "hw.pcic.intr_mask".- Removed redundant TUNABLE statements throughout the kernel.- Some minor code rewrites in connection to removing not neededTUNABLE statements.- Added a missing SYSCTL_DECL().- Wrapped two very long lines.- Avoid malloc()/free() inside sysctl string handling, in case it iscalled to initialize a sysctl from a tunable, hence malloc()/free() isnot ready when sysctls from the sysctl dataset are registered.- Bumped FreeBSD version to indicate SYSCTL API change.MFC after: 2 weeksSponsored by: Mellanox Technologies
Correct variable for loader tunable variable hw.mfi.mrsas_enable.Submitted by: Sascha Wildner (DragonFly)MFC after: 3 days
Add support for the unmapped i/o to mfi(4).Tested by: Nicholas Esborn <[email protected]>Sponsored by: The FreeBSD FoundationMFC after: 1 week
Update kernel inclusions of capability.h to use capsicum.h instead; somefurther refinement is required as some device drivers intended to beportable over FreeBSD versions rely on __FreeBSD_version
Update kernel inclusions of capability.h to use capsicum.h instead; somefurther refinement is required as some device drivers intended to beportable over FreeBSD versions rely on __FreeBSD_version to decide whetherto include capability.h.MFC after: 3 weeks
Add support for MegaRAID Fury cards. The main change needed to boot from a9341-4i controller was to ensure that scatter/gather lists are ended withan end-of-list marker. Both the mrsas and Linux me
Add support for MegaRAID Fury cards. The main change needed to boot from a9341-4i controller was to ensure that scatter/gather lists are ended withan end-of-list marker. Both the mrsas and Linux megaraid_sas drivers usethis marker with Invader cards as well, so we do the same thing, thoughit is apparently not strictly necessary.Reviewed by: ambriskoTested by: ambrisko (Invader card)MFC after: 3 weeksSponsored by: Sandvine Inc.
Add a tunable "hw.mfi.mrsas_enable" to allow mfi(4) to drop priority andallow mrsas(4) from LSI to attach to newer LSI cards that are support bymrsas(4). If mrsas(4) is not loaded into the system
Add a tunable "hw.mfi.mrsas_enable" to allow mfi(4) to drop priority andallow mrsas(4) from LSI to attach to newer LSI cards that are support bymrsas(4). If mrsas(4) is not loaded into the system at boot then mfi(4)will always attach. If a modified mrsas(4) is loaded in the system. Thatmodification is return "-30" in it's probe since that is betweenBUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY.This option is controller by a new probe flag "MFI_FLAGS_MRSAS" in mfi_identthat denotes cards that should work with mrsas(4). New entries that shouldhave this option.This is the first step to get mrsas(4) checked into FreeBSD and to avoidcollision with people that use mrsas(4) from LSI. Since mfi(4) takespriority, then mrsas(4) users need to rebuild GENERIC. Using the.disabled="1" method doesn't work since that blocks attaching and theprobe gave it to mfi(4).Discussed with: LSI (Kashyap Desai)
Remove not applicable PI_SDTR_ABLE and PI_WIDE_16 hba_inquiry flags tomake CAM to not try negotiate unsupported settings and suppress warnings.While there, enable command queuing on pass-through d
Remove not applicable PI_SDTR_ABLE and PI_WIDE_16 hba_inquiry flags tomake CAM to not try negotiate unsupported settings and suppress warnings.While there, enable command queuing on pass-through devices, announcedin hba_inquiry, but disabled. Even though queue size is very small, Itseems working well enough.Reviewed by: scottlMFC after: 2 weeks
Add PCI device ID for MegaRAID Invader cards. This was the onlychange needed to make it work on my card.Approved by: re (glebius)
Export two new DCMD enums. These allow set/get of the mfi_ctrl_propertiesstructure in the driver.Having these in 10.0 means that mfiutil can be modified to take adavantageof new updates without
Export two new DCMD enums. These allow set/get of the mfi_ctrl_propertiesstructure in the driver.Having these in 10.0 means that mfiutil can be modified to take adavantageof new updates without a kernel recompile.Approved by: re (gjb)MFC after: 2 weeks
Change the cap_rights_t type from uint64_t to a structure that we can extendin the future in a backward compatible (API and ABI) way.The cap_rights_t represents capability rights. We used to use o
Change the cap_rights_t type from uint64_t to a structure that we can extendin the future in a backward compatible (API and ABI) way.The cap_rights_t represents capability rights. We used to use one bit torepresent one right, but we are running out of spare bits. Currently the newstructure provides place for 114 rights (so 50 more than the previouscap_rights_t), but it is possible to grow the structure to hold at least 285rights, although we can make it even larger if 285 rights won't be enough.The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; };The initial CAP_RIGHTS_VERSION is 0.The top two bits in the first element of the cr_rights[] array contain totalnumber of elements in the array - 2. This means if those two bits are equal to0, we have 2 array elements.The top two bits in all remaining array elements should be 0.The next five bits in all array elements contain array index. Only one bit isused and bit position in this five-bits range defines array index. This meansthere can be at most five array elements in the future.To define new right the CAPRIGHT() macro must be used. The macro takes twoarguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL)We still support aliases that combine few rights, but the rights have to belongto the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP)There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);Capability rights to the cap_rights_init(), cap_rights_set(),cap_rights_clear() and cap_rights_is_set() functions are provided byseparating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);There is no need to terminate the list of rights, as those functions areactually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...);Thanks to using one bit as an array index we can assert in those functions thatthere are no two rights belonging to different array elements providedtogether. For example this is illegal and will be detected, because CAP_LOOKUPbelongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);Providing several rights that belongs to the same array's element this way iscorrect, but is not advised. It should only be used for aliases definition.This commit also breaks compatibility with some existing Capsicum system calls,but I see no other way to do that. This should be fine as Capsicum is stillexperimental and this change is not going to 9.x.Sponsored by: The FreeBSD Foundation
123456