aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed
Commit message (Collapse)AuthorAgeFilesLines
* Update the infiniband stack to Mellanox's OFED version 2.1.Hans Petter Selasky2015-02-1773-6814/+11239
| | | | | | | | | | | | | | | | Highlights: - Multiple verbs API updates - Support for RoCE, RDMA over ethernet All hardware drivers depending on the common infiniband stack has been updated aswell. Discussed with: np @ Sponsored by: Mellanox Technologies MFC after: 1 month Notes: svn path=/head/; revision=278886
* Define standard formatting strings to print GIDsHans Petter Selasky2015-02-161-0/+40
| | | | | | | | | | in a separate header file. Sponsored by: Mellanox Technologies MFC after: 3 days Notes: svn path=/head/; revision=278866
* The kasprintf() function cannot be inlined due to using a variableHans Petter Selasky2015-02-162-12/+15
| | | | | | | | | | | number of arguments. Move it to a C-file in the linuxapi module to make the function usable. Sponsored by: Mellanox Technologies MFC after: 3 days Notes: svn path=/head/; revision=278865
* The "frag_info" pointer is already pointing to an array index.Hans Petter Selasky2015-02-161-1/+1
| | | | | | | | | | Don't index twice. Sponsored by: Mellanox Technologies MFC after: 3 days Notes: svn path=/head/; revision=278856
* Add more functions to the Linux kernel compatibility layer. Add someHans Petter Selasky2015-02-134-0/+52
| | | | | | | | | | | missing includes which are needed when the header files are not included in a particular order. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=278681
* Fix bug in idr_pre_get where it doesn't handle 'need' correctly.Navdeep Parhar2015-02-021-1/+1
| | | | | | | Obtained from: Chelsio Communications' internal repository. Notes: svn path=/head/; revision=278117
* Revert for r277213:Hans Petter Selasky2015-01-221-2/+0
| | | | | | | | | | | | | | FreeBSD developers need more time to review patches in the surrounding areas like the TCP stack which are using MPSAFE callouts to restore distribution of callouts on multiple CPUs. Bump the __FreeBSD_version instead of reverting it. Suggested by: kmacy, adrian, glebius and kib Differential Revision: https://reviews.freebsd.org/D1438 Notes: svn path=/head/; revision=277528
* Add missing linuxapi module dependencies and always use the FreeBSDHans Petter Selasky2015-01-197-18/+11
| | | | | | | | | | | | "MODULE_VERSION" macro definition. Remove the redefinition of the "MODULE_VERSION" macro from the Linux kernel compatibility API. MFC after: 1 month Reported by: np@ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=277402
* Add more functions to the Linux kernel compatibility layer. Add someHans Petter Selasky2015-01-199-3/+52
| | | | | | | | | | | missing includes which are needed when the header files are not included in a particular order. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=277396
* Start importing the basic OFED linux compatibility layer changes madeHans Petter Selasky2015-01-179-146/+253
| | | | | | | | | | | | by dumbbell@ to be able to compile this layer as a dependency module. Clean up some Makefiles and remove the no longer used OFED define. Currently only i386 and amd64 targets are supported. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=277302
* Use parentheses instead of close proximity to ensure layer + 1 is evaluatedNavdeep Parhar2015-01-161-1/+1
| | | | | | | before the rest of the expression. Notes: svn path=/head/; revision=277229
* Major callout subsystem cleanup and rewrite:Hans Petter Selasky2015-01-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Close a migration race where callout_reset() failed to set the CALLOUT_ACTIVE flag. - Callout callback functions are now allowed to be protected by spinlocks. - Switching the callout CPU number cannot always be done on a per-callout basis. See the updated timeout(9) manual page for more information. - The timeout(9) manual page has been updated to reflect how all the functions inside the callout API are working. The manual page has been made function oriented to make it easier to deduce how each of the functions making up the callout API are working without having to first read the whole manual page. Group all functions into a handful of sections which should give a quick top-level overview when the different functions should be used. - The CALLOUT_SHAREDLOCK flag and its functionality has been removed to reduce the complexity in the callout code and to avoid problems about atomically stopping callouts via callout_stop(). If someone needs it, it can be re-added. From my quick grep there are no CALLOUT_SHAREDLOCK clients in the kernel. - A new callout API function named "callout_drain_async()" has been added. See the updated timeout(9) manual page for a complete description. - Update the callout clients in the "kern/" folder to use the callout API properly, like cv_timedwait(). Previously there was some custom sleepqueue code in the callout subsystem, which has been removed, because we now allow callouts to be protected by spinlocks. This allows us to tear down the callout like done with regular mutexes, and a "td_slpmutex" has been added to "struct thread" to atomically teardown the "td_slpcallout". Further the "TDF_TIMOFAIL" and "SWT_SLEEPQTIMO" states can now be completely removed. Currently they are marked as available and will be cleaned up in a follow up commit. - Bump the __FreeBSD_version to indicate kernel modules need recompilation. - There has been several reports that this patch "seems to squash a serious bug leading to a callout timeout and panic". Kernel build testing: all architectures were built MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D1438 Sponsored by: Mellanox Technologies Reviewed by: jhb, adrian, sbruno and emaste Notes: svn path=/head/; revision=277213
* Don't mask the IP-address when doing multicast IP over infiniband.Hans Petter Selasky2015-01-091-1/+1
| | | | | | | | | PR: 196631 MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=276879
* Use the M_SIZE() macro when possible.Hans Petter Selasky2015-01-082-4/+2
| | | | | | | | MFC after: 3 days Suggested by: rwatson@ Notes: svn path=/head/; revision=276824
* Fixes and updates for the Linux compatibility layer:Hans Petter Selasky2015-01-068-42/+90
| | | | | | | | | | | | | | | | | | | | | | - Remove unsupported "bus" field from "struct pci_dev". - Fix logic inside "pci_enable_msix()" when the number of allocated interrupts are less than the number of available interrupts. - Update header files included from "list.h". - Ensure that "idr_destroy()" removes all entries before destroying the IDR root node(s). - Set the "device->release" function so that we don't leak memory at device destruction. - Use FreeBSD's "log()" function for certain debug printouts. - Put parenthesis around arguments inside the min, max, min_t and max_t macros. - Make sure we don't leak file descriptors by dropping the extra file reference counts done by the FreeBSD kernel when calling falloc() and fget_unlocked(). MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=276749
* Make sure callbacks being freed are not pending when theHans Petter Selasky2014-12-111-1/+1
| | | | | | | | | | "mlx4_en_deactivate_cq()" function returns. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=275701
* Move OFED init a bit earlier so that PXE boot works.Hans Petter Selasky2014-12-091-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=275636
* Use CURVNET macros inside inet_get_local_port_range() function.Craig Rodrigues2014-12-082-0/+4
| | | | | | | | | | | | | | | Without this fix, a kernel with VIMAGE + Infiniband will panic on bootup. Certain necessary #include statements require LIST_HEAD. Add these includes to ofed/include/linux/list.h, because LIST_HEAD is specifically overridden in this file. PR: 191468 Differential Revision: D1279 Reviewed by: hselasky Notes: svn path=/head/; revision=275599
* Start process of removing the use of the deprecated "M_FLOWID" flagHans Petter Selasky2014-12-012-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. Additional notes: - The SCTP code changes will be committed as a separate patch. - Removal of the "M_FLOWID" flag will also be done separately. - The FreeBSD version has been bumped. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=275358
* Merge from projects/sendfile: extend protocols API to supportGleb Smirnoff2014-11-301-1/+1
| | | | | | | | | | | | sending not ready data: o Add new flag to pru_send() flags - PRUS_NOTREADY. o Add new protocol method pru_ready(). Sponsored by: Nginx, Inc. Sponsored by: Netflix Notes: svn path=/head/; revision=275329
* Do not return unlocked/unreferenced lle in arpresolve/nd6_storelladdr -Alexander V. Chernikov2014-11-272-8/+10
| | | | | | | | return lle flags IFF needed. Do not pass rte to arpresolve - pass is_gateway flag instead. Notes: svn path=/head/; revision=275196
* In preparation of merging projects/sendfile, transform bare access toGleb Smirnoff2014-11-122-14/+14
| | | | | | | | | | | | | | | sb_cc member of struct sockbuf to a couple of inline functions: sbavail() and sbused() Right now they are equal, but once notion of "not ready socket buffer data", will be checked in, they are going to be different. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=274421
* Fix compile warning by removing unused variable.Hans Petter Selasky2014-10-301-3/+0
| | | | | | | | MFC: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273867
* Update the network interface baudrate integer according to the actualHans Petter Selasky2014-10-241-1/+10
| | | | | | | | | | line rate. Submitted by: jhb @ MFC after: 1 week Notes: svn path=/head/; revision=273593
* Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky2014-10-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273377
* Update the OFED Linux compatibility layer andHans Petter Selasky2014-10-1534-425/+264
| | | | | | | | | | | | | | | | | | | | Mellanox hardware driver(s): - Properly name an inclusion guard - Fix compile warnings regarding unsigned enums - Add two new sysctl nodes - Remove all empty linux header files - Make an error printout more verbose - Use "mod_delayed_work()" instead of cancelling and starting a timeout. - Implement more Linux scatterlist functions. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273135
* Fix compile warning when compiling with GCC.Hans Petter Selasky2014-10-072-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=272683
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-274-22/+22
| | | | Notes: svn path=/head/; revision=272225
* Update code to use new network counter API.Hans Petter Selasky2014-09-245-17/+23
| | | | | | | | | | | Fix some minor compile warnings while at it. Sponsored by: Mellanox Technologies Suggested by: glebius@ MFC after: 1 week Notes: svn path=/head/; revision=272060
* Hardware driver update from Mellanox Technologies, including:Hans Petter Selasky2014-09-2348-3394/+8969
| | | | | | | | | | | | | | | | | | - improved performance - better stability - new features - bugfixes Supported HCAs: - ConnectX-2 - ConnectX-3 - ConnectX-3 Pro Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=272027
* Add a new fo_fill_kinfo fileops method to add type-specific information toJohn Baldwin2014-09-221-0/+9
| | | | | | | | | | | | | | | | | struct kinfo_file. - Move the various fill_*_info() methods out of kern_descrip.c and into the various file type implementations. - Rework the support for kinfo_ofile to generate a suitable kinfo_file object for each file and then convert that to a kinfo_ofile structure rather than keeping a second, different set of code that directly manipulates type-specific file information. - Remove the shm_path() and ksem_info() layering violations. Differential Revision: https://reviews.freebsd.org/D775 Reviewed by: kib, glebius (earlier version) Notes: svn path=/head/; revision=271976
* Improve transmit sending offload, TSO, algorithm in general.Hans Petter Selasky2014-09-221-0/+5
| | | | | | | | | | | | | | | | | | | | The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. Reviewed by: adrian, rmacklem Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=271946
* Revert r271504. A new patch to solve this issue will be made.Hans Petter Selasky2014-09-131-6/+0
| | | | | | | Suggested by: adrian @ Notes: svn path=/head/; revision=271551
* Improve transmit sending offload, TSO, algorithm in general.Hans Petter Selasky2014-09-131-0/+6
| | | | | | | | | | | | | | | | | | | The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=271504
* Fix various issues with invalid file operations:John Baldwin2014-09-121-1/+13
| | | | | | | | | | | | | | | | | | | | | - Add invfo_rdwr() (for read and write), invfo_ioctl(), invfo_poll(), and invfo_kqfilter() for use by file types that do not support the respective operations. Home-grown versions of invfo_poll() were universally broken (they returned an errno value, invfo_poll() uses poll_no_poll() to return an appropriate event mask). Home-grown ioctl routines also tended to return an incorrect errno (invfo_ioctl returns ENOTTY). - Use the invfo_*() functions instead of local versions for unsupported file operations. - Reorder fileops members to match the order in the structure definition to make it easier to spot missing members. - Add several missing methods to linuxfileops used by the OFED shim layer: fo_write(), fo_truncate(), fo_kqfilter(), and fo_stat(). Most of these used invfo_*(), but a dummy fo_stat() implementation was added. Notes: svn path=/head/; revision=271489
* Forward declare struct kiocb, which is only used for an unsued functionBjoern A. Zeeb2014-08-291-0/+1
| | | | | | | | | | | | | argument but not actually defined anywhere. This fixes the compile complaining about "declaration of 'struct kiocb' will not be visible outside of this function". MFC after: 2 weeks X-MFC with: whatever changed caused the breakage ;-) Notes: svn path=/head/; revision=270821
* - Update the OFED Linux Emulation layer as a preparation for aHans Petter Selasky2014-08-27144-494/+1347
| | | | | | | | | | | | | | | | | | hardware driver update from Mellanox Technologies. - Remove empty files from the OFED Linux Emulation layer. - Fix compile warnings related to printf() and the "%lld" and "%llx" format specifiers. - Add some missing 2-clause BSD copyrights. - Add "Mellanox Technologies, Ltd." to list of copyright holders. - Add some new compatibility files. - Fix order of uninit in the mlx4ib module to avoid crash at unload using the new module_exit_order() function. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=270710
* pci: make MSI(-X) enable and disable methods of the PCI busRoger Pau Monné2014-08-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the functions pci_disable_msi, pci_enable_msi and pci_enable_msix methods of the newbus PCI bus. This code should not include any functional change. Sponsored by: Citrix Systems R&D Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D354 dev/pci/pci.c: - Convert the mentioned functions to newbus methods. - Fix the callers of the converted functions. sys/dev/pci/pci_private.h: dev/pci/pci_if.m: - Declare the new methods. dev/pci/pcivar.h: - Add helpers to call the newbus methods. ofed/include/linux/pci.h: - Add define to prevent the ofed version of pci_enable_msix from clashing with the FreeBSD native version. Notes: svn path=/head/; revision=270212
* - Fix radix tree memory leakage when unloading modules using radixHans Petter Selasky2014-08-121-20/+64
| | | | | | | | | | | | | | | | | trees. This happens because the logic inserting items into the radix tree is allocating empty radix levels, when index zero does not contain any items. - Add proper error case handling, so that the radix tree does not end up in a bad state, if memory cannot be allocated during insertion of an item. - Add check for inserting NULL items into the radix tree. - Add check for radix tree getting too big. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=269859
* Fix OFED startup order: All SYSINIT()'s and modules should be loadedHans Petter Selasky2014-07-064-6/+11
| | | | | | | | | | | | prior to starting "/sbin/init" which will run all the "/etc/rc.d/xxx" scripts. Else there can be a race configuring the interfaces via "/etc/rc.conf". MFC after: 4 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=268316
* Fix compile warning.Hans Petter Selasky2014-07-061-1/+1
| | | | | | | | MFC after: 4 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=268315
* Fix some compile warnings.Hans Petter Selasky2014-07-061-12/+12
| | | | | | | | MFC after: 4 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=268314
* Compile fixes:Hans Petter Selasky2014-06-283-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Remove duplicate "debug_ktr.mask" sysctl definition. Remove now unused variable from "kern_ktr.c". This fixes build of "ktr" which was broken by r267961. Let the default value for "vm_kmem_size_scale" be zero. It is setup after that the sysctl has been initialized from "getenv()" in the "kmeminit()" function to equal the "VM_KMEM_SIZE_MAX" value, if zero. On Sparc64 the "VM_KMEM_SIZE_MAX" macro is not a constant. This fixes build of Sparc64 which was broken by r267961. Add a special macro to dynamically create SYSCTL root nodes, because root nodes have a special parent. This fixes build of existing OFED module and CANBUS module for pc98 which was broken by r267961. Add missing "sysctl.h" includes to get the needed sysctl header file declarations. This is needed after r267961. MFC after: 2 weeks Notes: svn path=/head/; revision=268005
* - Fix out of range shifting bug in bitops.h.Hans Petter Selasky2014-06-121-5/+5
| | | | | | | | | | - Make code a bit easier to read by adding parenthesis. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267395
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-062-2/+2
| | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* Rename global cnt to vm_cnt to avoid shadowing.Bryan Drewery2014-03-222-2/+2
| | | | | | | | | | | | | | | | | To reduce the diff struct pcu.cnt field was not renamed, so PCPU_OP(cnt.field) is still used. pc_cnt and pcpu are also used in kvm(3) and vmstat(8). The goal was to not affect externally used KPI. Bump __FreeBSD_version_ in case some out-of-tree module/code relies on the the global cnt variable. Exp-run revealed no ports using it directly. No objection from: arch@ Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=263620
* Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 GbitGleb Smirnoff2014-03-133-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface, in the r241616 a crutch was provided. It didn't work well, and finally we decided that it is time to break ABI and simply make if_baudrate a 64-bit value. Meanwhile, the entire struct if_data was reviewed. o Remove the if_baudrate_pf crutch. o Make all fields of struct if_data fixed machine independent size. The notion of data (packet counters, etc) are by no means MD. And it is a bug that on amd64 we've got a 64-bit counters, while on i386 32-bit, which at modern speeds overflow within a second. This also removes quite a lot of COMPAT_FREEBSD32 code. o Give 16 bit for the ifi_datalen field. This field was provided to make future changes to if_data less ABI breaking. Unfortunately the 8 bit size of it had effectively limited sizeof if_data to 256 bytes. o Give 32 bits to ifi_mtu and ifi_metric. o Give 64 bits to the rest of fields, since they are counters. __FreeBSD_version bumped. Discussed with: emax Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=263102
* Simplify filling sockaddr_dl structure for if_resolvemulti()Alexander V. Chernikov2014-01-181-16/+2
| | | | | | | | | | | | | | | | | callback providers. link_init_sdl() function can be used to fill most of the parameters. Use caller stack instead of allocation / freing memory for each request. Do not drop support for extra-long (probably non-existing) link-layer protocols by introducing link_alloc_sdl() (used by if_resolvemulti() callback) and link_free_sdl() (used by caller). Since this change breaks KBI, MFC requires slightly different approach (link_init_sdl() auto-allocating buffer if necessary to handle cases with unmodified if_resolvemulti() callers). MFC after: 2 weeks Notes: svn path=/head/; revision=260870
* Similar to r260020, only use -fms-extensions with gcc, for all otherDimitry Andric2013-12-302-2/+2
| | | | | | | | | | | modules which require this flag to compile. Use a GCC_MS_EXTENSIONS variable, defined in kern.pre.mk, which can be used to easily supply the flag (or not), depending on the compiler type. MFC after: 3 days Notes: svn path=/head/; revision=260102
* Defer start/stop port to workqueues.Alfred Perlstein2013-12-152-25/+75
| | | | | | | | | | | | We need to do this because the Linux compat layer uses sx(9) for mutex, however the lagg code uses rmlocks and calls into the mellanox driver. This causes deadlock due to sleeping while holding a rmlock. Submitted by: Shahar Klein (shahark mellanox.com) MFC After: 3 days. Notes: svn path=/head/; revision=259411