summaryrefslogtreecommitdiffstats
path: root/sys/ofed/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Use the M_SIZE() macro when possible.hselasky2015-01-082-4/+2
| | | | | MFC after: 3 days Suggested by: rwatson@
* Fixes and updates for the Linux compatibility layer:hselasky2015-01-062-6/+6
| | | | | | | | | | | | | | | | | | | - 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
* Make sure callbacks being freed are not pending when thehselasky2014-12-111-1/+1
| | | | | | | "mlx4_en_deactivate_cq()" function returns. MFC after: 1 week Sponsored by: Mellanox Technologies
* Start process of removing the use of the deprecated "M_FLOWID" flaghselasky2014-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
* Merge from projects/sendfile: extend protocols API to supportglebius2014-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
* Do not return unlocked/unreferenced lle in arpresolve/nd6_storelladdr -melifaro2014-11-272-8/+10
| | | | | return lle flags IFF needed. Do not pass rte to arpresolve - pass is_gateway flag instead.
* In preparation of merging projects/sendfile, transform bare access toglebius2014-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.
* Fix compile warning by removing unused variable.hselasky2014-10-301-3/+0
| | | | | MFC: 3 days Sponsored by: Mellanox Technologies
* Update the network interface baudrate integer according to the actualhselasky2014-10-241-1/+10
| | | | | | | line rate. Submitted by: jhb @ MFC after: 1 week
* Fix multiple incorrect SYSCTL arguments in the kernel:hselasky2014-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
* Update the OFED Linux compatibility layer andhselasky2014-10-1519-282/+25
| | | | | | | | | | | | | | | | | 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
* Fix compile warning when compiling with GCC.hselasky2014-10-071-0/+1
| | | | | MFC after: 3 days Sponsored by: Mellanox Technologies
* Mechanically convert to if_inc_counter().glebius2014-09-274-22/+22
|
* Update code to use new network counter API.hselasky2014-09-245-17/+23
| | | | | | | | Fix some minor compile warnings while at it. Sponsored by: Mellanox Technologies Suggested by: glebius@ MFC after: 1 week
* Hardware driver update from Mellanox Technologies, including:hselasky2014-09-2342-3312/+8600
| | | | | | | | | | | | | | | - improved performance - better stability - new features - bugfixes Supported HCAs: - ConnectX-2 - ConnectX-3 - ConnectX-3 Pro Sponsored by: Mellanox Technologies MFC after: 1 week
* Improve transmit sending offload, TSO, algorithm in general.hselasky2014-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
* Revert r271504. A new patch to solve this issue will be made.hselasky2014-09-131-6/+0
| | | | Suggested by: adrian @
* Improve transmit sending offload, TSO, algorithm in general.hselasky2014-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
* Forward declare struct kiocb, which is only used for an unsued functionbz2014-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 ;-)
* - Update the OFED Linux Emulation layer as a preparation for ahselasky2014-08-2740-58/+45
| | | | | | | | | | | | | | | 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
* Fix OFED startup order: All SYSINIT()'s and modules should be loadedhselasky2014-07-063-3/+3
| | | | | | | | | 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
* Fix compile warning.hselasky2014-07-061-1/+1
| | | | | MFC after: 4 weeks Sponsored by: Mellanox Technologies
* Fix some compile warnings.hselasky2014-07-061-12/+12
| | | | | MFC after: 4 weeks Sponsored by: Mellanox Technologies
* Compile fixes:hselasky2014-06-282-0/+2
| | | | | | | | | | | | | | | | | | | | | 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
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-062-2/+2
| | | | from the latter.
* Rename global cnt to vm_cnt to avoid shadowing.bdrewery2014-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
* Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbitglebius2014-03-132-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Simplify filling sockaddr_dl structure for if_resolvemulti()melifaro2014-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
* Similar to r260020, only use -fms-extensions with gcc, for all otherdim2013-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
* Defer start/stop port to workqueues.alfred2013-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.
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-11-304-13/+13
| | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. 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. Discussed with: -arch, rdivacky Reviewed by: cperciva
* Fix creating a vlan over lagg over mlxen crash.alfred2013-11-171-0/+6
| | | | | PR: 181931 Submitted by: Shahar Klein (shahark mellanox.com)
* Do not use a sleep lock when protecting the driver flags.alfred2013-11-082-2/+5
| | | | | | This was causing a locking issue with lagg Submitted by: odeds
* Fix for bad performance when mtu is increased.alfred2013-11-083-65/+45
| | | | | | | Update the auto moderation behavior in the mlxen driver to match the new LINUX OFED code. Submitted by: odeds
* Fix API mismatch exposed by lagg.alfred2013-11-021-2/+2
| | | | | When destroying a lagg the driver tries to restore the old mac and fails due to API mismatch
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-262-0/+2
| | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Fix resource free.alfred2013-10-171-3/+3
| | | | | | | | | | | | The order of releasing resources in mlxen was wrong, which caused panic on reload of the module. conf_ctx list should be released before stat_ctx list, otherwise the leafs in conf_ctx list won't be released because of the dependancy. The fix is to change the order of the releases. Submitted by: Shahar Klein (shahark at mellanox.com)
* Fix for When more than one NIC is present.alfred2013-10-101-34/+1
| | | | | | | | | | | | The device name was incorrect due to a specific function we ported from the Linux driver that is not FBSD compatible. This resulted with a false sysctl registration and some more problematic issues. The patch basically revokes it all together. Submitted by: Meny Yossefi (menyy mellanox.com) Approved by: re
* Remove redundant declaration of cmclass indim2013-10-091-3/+0
| | | | | | | sys/ofed/drivers/infiniband/core/ucm.c, to silence a gcc warning. Approved by: re (kib) X-MFC-With: r255932
* Fixed kernel crash when running devinfoalfred2013-10-011-0/+2
| | | | | | | | | | When calling to ib_uverbs_cleanup_ucontext, there is a call to mutex_lock of xrcd_table_mutex, which was not initialized. Added missing initialization for xrcd_table_mutex. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Enable ib_dev.mmap functionalfred2013-10-012-2/+45
| | | | | | | | | Removed the ifdef linux from this function. Added stub function for contiguous pages to avoid compilation errors. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Fixed 'Couldn't Create QP' issue when running rc_pingpong, uc_pingpong,alfred2013-10-011-0/+18
| | | | | | | | | | | | srq_pingpong IBverbs Removed refrences using 'ifdef __linux__' to qpg functions and related fields in struct ib_qp_init_attr. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Fixed kernel crash when removing IPOIB_CM option from configuration filealfred2013-10-012-2/+2
| | | | | | | Changed module init from module_init() to module_init_order() with SI_ORDER_MIDDLE flag Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re
* Update OFED to Linux 3.7 and update Mellanox drivers.alfred2013-09-2963-3277/+23023
| | | | | | | | | | | | | | | | | | | | | | | Update the OFED Infiniband core to the version supplied in Linux version 3.7. The update to OFED is nearly all additional defines and functions with the exception of the addition of additional parameters to ib_register_device() and the reg_user_mr callback. In addition the ibcore (Infiniband core) and ipoib (IP over Infiniband) have both been made into completely loadable modules to facilitate testing of the OFED stack in FreeBSD. Finally the Mellanox Infiniband drivers are now updated to the latest version shipping with Linux 3.7. Submitted by: Mellanox FreeBSD driver team: Oded Shanoon (odeds mellanox.com), Meny Yossefi (menyy mellanox.com), Orit Moskovich (oritm mellanox.com) Approved by: re
* Change m->pkthdr.header to m->pkthdr.PH_loc.ptr after r254804andre2013-08-251-2/+2
| | | | | | to transiently store pointers to packet headers. Sponsored by: The FreeBSD Foundation
* Stop an ipoib interface before detaching it.jhb2013-08-201-0/+2
| | | | | | | PR: kern/181225 Submitted by: Shahar Klein Obtained from: Mellanox MFC after: 1 week
* Add m_clrprotoflags() to clear protocol specific mbuf flags at up andandre2013-08-191-1/+1
| | | | | | | | downwards layer crossings. Consistently use it within IP, IPv6 and ethernet protocols. Discussed with: trociny, glebius
* Add a missing prototype.jhb2013-07-291-0/+1
| | | | Pointy hat: me
* Various fixes to the mlxen(4) driver:jhb2013-07-291-21/+31
| | | | | | | | | | | | | | - Remove an incorrect assertion that can trigger when downing an interface. - Stop the interface during detach to avoid panics when unloading the driver. - A few locking fixes to be more consistent with other FreeBSD drivers: - Protect if_drv_flags with the driver lock, not atomic ops - Hold the driver lock when adjusting multicast state. - Hold the driver lock while adjusting if_capenable. PR: kern/180791 [1,2] Submitted by: Shakar Klein @ Mellanox [1,2] MFC after: 3 days
* Avoid trashing IP fragments:jhb2013-07-251-2/+6
| | | | | | | | | - Only enable UDP/TCP hardware checksums if CSUM_UDP or CSUM_TCP is set. - Only enable IP hardware checksums if CSUM_IP is set. PR: kern/180430 Submitted by: Meny Yossefi <menyy@mellanox.com> MFC after: 1 week
OpenPOWER on IntegriCloud