summaryrefslogtreecommitdiffstats
path: root/sys/ofed
Commit message (Collapse)AuthorAgeFilesLines
* MFC r289563,r291481,r292537,r292538,r292542,r292543,r292544 and r292834:hselasky2016-01-047-93/+260
| | | | | | | | | | | | | | | | | | | | Update the LinuxKPI: - Add more functions and types. - Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE(). - Implement sleepable RCU mechanism using shared exclusive locks. - Minor workqueue cleanup: - Make some functions global instead of inline to ease debugging. - Fix some minor style issues. - In the zero delay case in queue_delayed_work() use the return value from taskqueue_enqueue() instead of reading "ta_pending" unlocked and also ensure the callout is stopped before proceeding. - Implement drain_workqueue() function. - Reduce memory consumption when allocating kobject strings in the LinuxKPI. Compute string length before allocating memory instead of using fixed size allocations. Make kobject_set_name_vargs() global instead of inline to save some bytes when compiling. Sponsored by: Mellanox Technologies
* MFC r270212,r270332:ngie2015-12-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps reduce the diff in pci(4) between head and stable/10 to help pave the way for bringing in IOV/nv(9) more cleanly Differential Revision: https://reviews.freebsd.org/D4728 Relnotes: yes Reviewed by: hselasky (ofed piece), royger (overall change) Sponsored by: EMC / Isilon Storage Division r270212 (by royger): pci: make MSI(-X) enable and disable methods of the PCI bus 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. r270332 (by royger): pci: add a new pci_child_added newbus method. This is needed so when running under Xen the calls to pci_child_added can be intercepted and a custom Xen method can be used to register those devices with Xen. This should not include any functional change, since the Xen implementation will be added in a following patch and the native implementation is a noop. Sponsored by: Citrix Systems R&D Reviewed by: jhb dev/pci/pci.c: dev/pci/pci_if.m: dev/pci/pci_private.h: dev/pci/pcivar.h: - Add the pci_child_added newbus method.
* MFC r290003:hselasky2015-12-141-1/+18
| | | | | | | Add support for binding IRQs to CPUs in the LinuxKPI. The new function added is for BSD only and does not exist in Linux. Sponsored by: Mellanox Technologies
* MFC r291753:ngie2015-12-131-1/+7
| | | | | | | | | | | Fix scope of bridge_header and bridge_pcix_cap in mthca_reset(..) They're only used in the __linux__ case Differential Revision: https://reviews.freebsd.org/D4332 Reported by: cppcheck Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division
* Enable the mlx4en TSO limits.hselasky2015-12-111-2/+0
| | | | | | This is a direct commit to stable/10. Sponsored by: Mellanox Technologies
* MFC r290710, r291694, r291699 and r291793:hselasky2015-12-1116-2544/+1018
| | | | | | | | | | | | | | | | | | | - Fix print formatting compile warnings for Sparc64 and PowerPC platforms. - Updated the mlx4 and mlxen drivers to the latest version, v2.1.6: - Added support for dumping the SFP EEPROM content to dmesg. - Fixed handling of network interface capability IOCTLs. - Fixed race when loading and unloading the mlxen driver by applying appropriate locking. - Removed two unused C-files. - Convert the mlxen driver to use the BUSDMA(9) APIs instead of vtophys() when loading mbufs for transmission and reception. While at it all pointer arithmetic and cast qualifier issues were fixed, mostly related to transmission and reception. - Fix i386 build WITH_OFED=YES. Remove some redundant KASSERTs. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4283 Differential Revision: https://reviews.freebsd.org/D4284
* MFC r291693:hselasky2015-12-111-0/+19
| | | | | | | | Add some structures and defines which will be used when decoding small form factor, SFF, standards compliant ethernet EEPROMs. Obtained from: Linux Sponsored by: Mellanox Technologies
* MFC r291690:hselasky2015-12-111-4/+0
| | | | | | | Remove incorrect defines. The proper version of these macros is defined in linux/etherdevice.h. Sponsored by: Mellanox Technologies
* MFC r291047:ngie2015-11-231-0/+1
| | | | | | | | | Don't leak work if __mlx4_register_vlan(..) fails in mlx4_master_immediate_activate_vlan_qos(..) Differential Revision: https://reviews.freebsd.org/D4203 Submitted by: Miles Olrich <miles.olrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
* MFC 287440:jhb2015-09-112-25/+22
| | | | | | | | | | | | | | | Currently the Linux character device mmap handling only supports mmap operations that map a single page that has an associated vm_page_t. This does not permit mapping larger regions (such as a PCI memory BAR) and it does not permit mapping addresses beyond the top of RAM (such as a 64-bit BAR located above the top of RAM). Instead of using a single OBJT_DEVICE object and passing the physaddr via the offset as a hack, create a new sglist and OBJT_SG object for each mmap request. The requested memory attribute is applied to the object thus affecting all pages mapped by the request. Sponsored by: Chelsio
* MFC r286418:markj2015-08-271-2/+2
| | | | | ipv4_is_zeronet() and ipv4_is_loopback() expect an address in network order, but IN_ZERONET and IN_LOOPBACK expect it in host order.
* Merge r283612:glebius2015-08-173-0/+203
| | | | | | | | | | | | | | Add SIOCGI2C ioctl support to the driver. Would work only on ConnectX-3 with fresh firmware. The low level code is based on code provided by Mellanox. Thanks to Mellanox and their distributor Must (http://mustcompany.ru) for providing hardware. In collaboration with: Andre Melkoumian <andre mellanox.com> Reviewed by: hselasky Sponsored by: Netflix Sponsored by: Nginx, Inc.
* MFC r285088:hselasky2015-07-112-16/+19
| | | | | | | | | | Fix broken implementation of "kvasprintf()" function by adding missing kmalloc() call. Make function global instead of static inline to fix compiler warnings about passing variable argument lists to inline functions. Sponsored by: Mellanox Technologies Approved by: re, gjb
* MFC r277229:np2015-06-171-1/+1
| | | | | Use parentheses instead of close proximity to ensure layer + 1 is evaluated before the rest of the expression.
* MFC r282331:markj2015-05-293-11/+25
| | | | | | | | | | | | | | | Don't drop the idr lock before verifying that the newly-inserted element is present in the tree. MFC r282741: find_next_bit() and find_next_zero_bit(): if the caller-specified offset lies within the last block of the bit set and no bits are set beyond the offset, terminate the search immediately instead of continuing as though there are further blocks in the set and subsequently returning an incorrect result. MFC r282743: Ensure that msecs_to_jiffies(0) == 0.
* MFC r282817:hselasky2015-05-211-0/+4
| | | | | | | Apply proper locking when iterating the multicast addresses and add a missing check for NULL from a non-blocking "kzalloc()" function call. Sponsored by: Mellanox Technologies
* MFC r277396, r278681, r278865, r278924, r279205, r280208,hselasky2015-05-0520-178/+349
| | | | | | | | | | | | | | | | | | | | | r280210, r280764 and r280768: Update the Linux compatibility layer: - Add more functions. - Add some missing includes which are needed when the header files are not included in a particular order. - The kasprintf() function cannot be inlined due to using a variable number of arguments. Move it to a C-file. - Fix problems about 32-bit ticks wraparound and unsigned long conversion. Jiffies or ticks in FreeBSD have integer type and are not long. - Add missing "order_base_2()" macro. - Fix BUILD_BUG_ON() macro. - Declare a missing symbol which is needed when compiling without -O2 - Clean up header file inclusions in the linux/completion.h, linux/in.h and linux/fs.h header files. Sponsored by: Mellanox Technologies
* MFC r275358 r275483 r276982 - Removing M_FLOWID by hps@hiren2015-04-242-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r275358: Start process of removing the use of the deprecated "M_FLOWID" flag 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. r275483: Remove M_FLOWID from SCTP code. r276982: Remove no longer used "M_FLOWID" flag from mbuf.h and update the netisr manpage. Note: The FreeBSD version has been bumped. Reviewed by: hps, tuexen Sponsored by: Limelight Networks
* MFC r280211:hselasky2015-03-251-2/+2
| | | | | | Add missing void pointer argument to SYSINIT() functions. Sponsored by: Mellanox Technologies
* MFC r279865:hselasky2015-03-151-5/+8
| | | | | | | Ensure setting promiscious mode when a network interface is up, is always non-blocking by not locking a SX type of mutex. Sponsored by: Mellanox Technologies
* MFC r279587:hselasky2015-03-071-0/+2
| | | | | | | Define PTR_ALIGN() macro which will be needed coming Mellanox driver releases. Sponsored by: Mellanox Technologies
* MFC r278866:hselasky2015-03-071-0/+40
| | | | | | | Define standard formatting strings to print GIDs in a separate header file. Sponsored by: Mellanox Technologies
* MFC r279584:hselasky2015-03-0710-30/+74
| | | | | | | | | | | | | | | | | | | Updates for the Mellanox ethernet driver > List of fixes: * use correct format for GID printouts * double array indexing * spelling in printouts * void pointer arithmetic * allow more receive rings * correct maximum number of transmit rings * use "const" instead of "static" for constants * check for invalid VLAN tags * check for lack of IRQ resources > Added more hardware specific defines > Added more verbose printouts of firmware status codes Sponsored by: Mellanox Technologies
* MFC r278856:hselasky2015-02-191-1/+1
| | | | | | | The "frag_info" pointer is already pointing to an array index. Don't index twice. Sponsored by: Mellanox Technologies
* MFC r276749:hselasky2015-01-138-42/+90
| | | | | | | | | | | | | | | | | | | | Fixes and updates for the Linux compatibility layer: - 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
* MFC r276879:hselasky2015-01-131-1/+1
| | | | | | | Don't mask the IP-address when doing multicast IP over infiniband. PR: 196631 Sponsored by: Mellanox Technologies
* Merge r275599:rodrigc2015-01-062-0/+4
| | | | | | | | | | | | | Use CURVNET macros inside inet_get_local_port_range() function. 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
* MFC r275636:hselasky2014-12-121-2/+2
| | | | | | Move OFED init a bit earlier so that PXE boot works. Sponsored by: Mellanox Technologies
* MFC r271946 and r272595:hselasky2014-11-031-2/+2
| | | | | | | | | Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies
* MFC r273867:hselasky2014-10-311-3/+0
| | | | | | Fix compile warning by removing unused variable. Sponsored by: Mellanox Technologies
* MFC r273593:hselasky2014-10-311-1/+10
| | | | | | | Update the network interface baudrate integer according to the actual line rate. Sponsored by: Mellanox Technologies
* MFC r263710, r273377, r273378, r273423 and r273455:hselasky2014-10-271-4/+4
| | | | | | | - De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros. Sponsored by: Mellanox Technologies
* MFC r272683:hselasky2014-10-213-4/+1
| | | | | | | - Fix compile warning when compiling with GCC. - Add missed chunk in previous driver code MFC. Sponsored by: Mellanox Technologies
* MFC r273135:hselasky2014-10-1833-422/+261
| | | | | | | | | | | | | | | | | Update the OFED Linux compatibility layer and 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. Sponsored by: Mellanox Technologies
* MFC r272027:hselasky2014-10-0246-3387/+8966
| | | | | | | | | | | | | | | | | | | Hardware driver update from Mellanox Technologies, including: - improved performance - better stability - new features - bugfixes Supported HCAs: - ConnectX-2 - ConnectX-3 - ConnectX-3 Pro NOTE: - TSO feature needs r271946, which is not yet merged. Sponsored by: Mellanox Technologies Approved by: re, glebius
* MFC r270710 and r270821:hselasky2014-09-04145-494/+1348
| | | | | | | | | | | | | | | - Update the OFED Linux Emulation layer as a preparation for a 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. Sponsored by: Mellanox Technologies
* MFC r269859:hselasky2014-08-191-20/+64
| | | | | | Fix for memory leak. Sponsored by: Mellanox Technologies
* MFC r268316:hselasky2014-08-124-6/+11
| | | | | | | | | Fix OFED startup order: All SYSINIT()'s and modules should be loaded 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". Sponsored by: Mellanox Technologies
* MFC r268315:hselasky2014-08-121-1/+1
| | | | | | Fix compile warning. Sponsored by: Mellanox Technologies
* MFC r268314:hselasky2014-08-121-12/+12
| | | | | | Fix some compile warnings. Sponsored by: Mellanox Technologies
* MFC r267395:hselasky2014-06-151-5/+5
| | | | | - Fix out of range shifting bug in bitops.h. - Make code a bit easier to read by adding parenthesis.
* MFC r258779,r258780,r258787,r258822:eadler2014-02-044-13/+13
| | | | | | | | | | | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this shifts into the sign bit. Instead use (1U << 31) which gets the expected result. Similar to the (1 << 31) case it is not defined to do (2 << 30). This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD.
* MFC r260102:dim2014-01-092-2/+2
| | | | | | | | | | | | Similar to r260020, only use -fms-extensions with gcc, for all other 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 r260322: In addition to r260102, also define GCC_MS_EXTENSIONS in bsd.sys.mk, since kernel module builds do not use kern.pre.mk.
* Revert MFC of r260102 for now, until I can merge the required fix fromdim2014-01-052-2/+2
| | | | | head. This should fix building modules which require -fms-extensions to compile them with gcc.
* MFC r260020:dim2014-01-042-2/+2
| | | | | | | | | | | | | | For sys/dev/drm2/radeon, only use -fms-extensions with gcc. This flag is only to stop gcc complaining about anonymous unions, which clang does not do. For clang 3.4 however, -fms-extensions enables the Microsoft __wchar_t type, which clashes with our own types.h. MFC r260102: Similar to r260020, only use -fms-extensions with gcc, for all other 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.
* Defer start/stop port to workqueues.alfred2013-12-192-25/+75
| | | | MFC: 259411
* MFC: 258276alfred2013-11-171-0/+6
| | | | | | | | | Fix creating a vlan over lagg over mlxen crash. PR: 181931 Submitted by: Shahar Klein (shahark mellanox.com) Approved by: re
* MFC: 257542alfred2013-11-171-2/+2
| | | | | | | | | | Fix API mismatch exposed by lagg. When destroying a lagg the driver tries to restore the old mac and fails due to API mismatch. Submitted by: Shahar Klein (shahark at mellanox.com) Approved by: re
* MFC: r257862, r257863, r257864alfred2013-11-084-70/+53
| | | | | | | | | | | | | | | | | | | | | | | | r257862: Use explicit long cast to avoid overflow in bitopts. This was causing problems with the buddy allocator inside of ofed. r257863: Fix for bad performance when mtu is increased. Update the auto moderation behavior in the mlxen driver to match the new LINUX OFED code. r257864: Do not use a sleep lock when protecting the driver flags. This was causing a locking issue with lagg. Approved by: re
* Fix resource free.alfred2013-10-201-3/+3
| | | | | | | | | | The order of releasing resources in mlxen was wrong, which caused panic on reload of the module. MFC: 256682 Submitted by: Shahar Klein (shahark at mellanox.com) Approved by: re
OpenPOWER on IntegriCloud