aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Don't repeat the the word 'the'Eitan Adler2016-05-173-3/+3
| | | | | | | | | | (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix) Notes: svn path=/head/; revision=300050
* ofed/drivers: minor spelling fixes.Pedro F. Giffuni2016-05-0610-14/+14
| | | | | | | | | No functional change. Reviewed by: hselasky Notes: svn path=/head/; revision=299179
* Fix NOIP kernels to compile.Bjoern A. Zeeb2016-04-241-0/+2
| | | | Notes: svn path=/head/; revision=298543
* More fixes for using IPv6 addresses with RDMA:Hans Petter Selasky2016-04-225-21/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added check that the SCOPE ID is only restored for IPv6 linklocal addresses. - Changes made by r237263 in the "cma_bind_addr()" function did not check if the socket address was of type IPv6 and used the IPv4 socket address for IPv6 addresses. This caused the function to fail. Fixed this. - In the "rdma_gid2ip()" function and some other places the "sin6_len" and "sin6_scope_id" fields were not set for IPv6 socket addresses. Fixed this. - The scope ID is not stored as part of the GID entries and must be passed as an argument to "rdma_gid2ip()". - Added new method to "struct ib_device" which returns a pointer to the network interface which belongs to the given infiniband device. This is needed to be able to get the scope ID for IPv6 addresses via the associated ethernet interface. - Added convenience function, "rdma_get_ipv6_scope_id()", to get the scope ID for IPv6 addresses. - Implemented new "get_netdev" method for mlx4ib. Other IB controller drivers which want to support IPv6 addresses needs to implement this aswell. - Bumped the FreeBSD version due to changing "struct ib_device". Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298486
* Add KASSERT() and set error code in dead code case to help static codeHans Petter Selasky2016-04-221-0/+2
| | | | | | | | | | | analysis tools. Suggested by: ngie@ Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298459
* Add missing set of the current VNET when inputting IP packets in IPoIB.Hans Petter Selasky2016-04-221-2/+7
| | | | | | | | | | | | This fixes a kernel panic when using IPoIB with VIMAGE and infiniband. PR: 208957 Sponsored by: Mellanox Technologies Tested by: Justin Clift <justin@postgresql.org> MFC after: 1 week Notes: svn path=/head/; revision=298458
* Fix for using IPv6 addresses with RDMA:Hans Petter Selasky2016-04-211-39/+108
| | | | | | | | | | | | | | | | | IPv6 addresses has a scope ID which sometimes is stored in the "sin6_scope_id" field of "struct sockaddr_in6" and sometimes as part of the IPv6 address itself depending on the context. If the scope ID is not in the expected location, the IPv6 address lookups in the so-called GID table will fail. Some code factoring has been made to achieve a clean exit of the "addr_resolve" function via a common "done" label. Sponsored by: Mellanox Technologies Submitted by: Shani Michaeli <shanim@mellanox.com> MFC after: 1 week Notes: svn path=/head/; revision=298419
* Fix for resolving mac address when the destination address is a gateway.Hans Petter Selasky2016-04-211-4/+5
| | | | | | | | | | Remove some dead code while at it. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298412
* Properly setup arguments for if_resolvemulti() callback.Hans Petter Selasky2016-04-211-1/+7
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298400
* Fix inverted priv check calls. Priv check returns zero on success andHans Petter Selasky2016-04-201-3/+3
| | | | | | | | | | an error code on failure. Refer to man 9 priv_check . Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=298342
* ofed: for pointers replace 0 with NULL.Pedro F. Giffuni2016-04-152-2/+2
| | | | | | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle. Reviewed by: hselasky Notes: svn path=/head/; revision=298046
* Remove some unused fields.Hans Petter Selasky2016-04-143-13/+0
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=297968
* Ensure the received IP header gets 32-bits aligned.Hans Petter Selasky2016-04-142-4/+12
| | | | | | | | | | | | The FreeBSD's TCP/IP stack assumes that the IP-header is 32-bits aligned when decoding it. Else unaligned 32-bit memory access can happen, which not all processor architectures support. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=297967
* Add missing port_up checks.Hans Petter Selasky2016-04-141-2/+17
| | | | | | | | | | | | When downing a mlxen network adapter we need to check the port_up variable to ensure we don't continue to transmit data or restart timers which can reside in freed memory. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=297966
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-103-3/+3
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* tcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplicationSepherosa Ziehau2016-04-011-7/+1
| | | | | | | | | | | | And factor out tcp_lro_rx_done, which deduplicates the same logic with netinet/tcp_lro.c Reviewed by: gallatin (1st version), hps, zbb, np, Dexuan Cui <decui microsoft com> Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5725 Notes: svn path=/head/; revision=297482
* Remove unnecessary dequeue_mutex (added in r294610) from the iWARPNavdeep Parhar2016-03-301-5/+0
| | | | | | | | | | | | connection manager. Examining so_comp without synchronization with iw_so_event_handler is a harmless race. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: Steve Wise @ Open Grid Computing Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=297406
* Add missing curly brackets in for loop.Hans Petter Selasky2016-03-171-2/+3
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=296987
* Use hardware computed Toeplitz hash for incoming flowidsHans Petter Selasky2016-03-152-2/+3
| | | | | | | | | | | | Use the Toeplitz hash value as source for the flowid. This makes the hash value more suitable for so-called hash bucket algorithms which are used in the FreeBSD's TCP/IP stack when RSS is enabled. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=296910
* Fix witness panic in the ipoib_ioctl() function when unloading theHans Petter Selasky2016-03-152-0/+7
| | | | | | | | | | | | | | | | ipoib module. The bpfdetach() function is trying to turn off promiscious mode on the network interface it is attached to while holding a mutex. The fix consists of ignoring any further calls to the ipoib_ioctl() function when the network interface is going to be detached. The ipoib_ioctl() function might sleep. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=296909
* Use SI_SUB_LAST instead of SI_SUB_SMP as the "catch-all" subsystem.John Baldwin2016-03-113-3/+3
| | | | | | | | | Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D5515 Notes: svn path=/head/; revision=296688
* Whitespace fixes.Hans Petter Selasky2016-03-0410-95/+95
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=296382
* LinuxKPI list updates:Hans Petter Selasky2016-01-261-2/+2
| | | | | | | | | | | | | | | | | | - Add some new hlist macros. - Update existing hlist macros removing the need for a temporary iteration variable. - Properly define the RCU hlist macros to be SMP safe with regard to RCU. - Safe list macro arguments by adding a pair of parentheses. - Prefix the _list_add() and _list_splice() functions with "linux" to reflect they are LinuxKPI internal functions. Obtained from: Linux MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=294837
* Fix for iWARP servers that listen on INADDR_ANY.Navdeep Parhar2016-01-222-6/+363
| | | | | | | | | | | | | | | | | | | The iWARP Connection Manager (CM) on FreeBSD creates a TCP socket to represent an iWARP endpoint when the connection is over TCP. For servers the current approach is to invoke create_listen callback for each iWARP RNIC registered with the CM. This doesn't work too well for INADDR_ANY because a listen on any TCP socket already notifies all hardware TOEs/RNICs of the new listener. This patch fixes the server side of things for FreeBSD. We've tried to keep all these modifications in the iWARP/TCP specific parts of the OFED infrastructure as much as possible. Submitted by: Krishnamraju Eraparaju @ Chelsio (with design inputs from Steve Wise) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D4801 Notes: svn path=/head/; revision=294610
* Finish r275196: do not dereference rtentry in if_output() routines.Alexander V. Chernikov2016-01-091-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only piece of information that is required is rt_flags subset. In particular, if_loop() requires RTF_REJECT and RTF_BLACKHOLE flags to check if this particular mbuf needs to be dropped (and what error should be returned). Note that if_loop() will always return EHOSTUNREACH for "reject" routes regardless of RTF_HOST flag existence. This is due to upcoming routing changes where RTF_HOST value won't be available as lookup result. All other functions require RTF_GATEWAY flag to check if they need to return EHOSTUNREACH instead of EHOSTDOWN error. There are 11 places where non-zero 'struct route' is passed to if_output(). For most of the callers (forwarding, bpf, arp) does not care about exact error value. In fact, the only place where this result is propagated is ip_output(). (ip6_output() passes NULL route to nd6_output_ifp()). Given that, add 3 new 'struct route' flags (RT_REJECT, RT_BLACKHOLE and RT_IS_GW) and inline function (rt_update_ro_flags()) to copy necessary rte flags to ro_flags. Call this function in ip_output() after looking up/ verifying rte. Reviewed by: ae Notes: svn path=/head/; revision=293544
* Make it possible for sbappend() to preserve M_NOTREADY on mbufs, just likeGleb Smirnoff2016-01-081-1/+1
| | | | | | | | | | | | | sbappendstream() does. Although, M_NOTREADY may appear only on SOCK_STREAM sockets, due to sendfile(2) supporting only the latter, there is a corner case of AF_UNIX/SOCK_STREAM socket, that still uses records for the sake of control data, albeit being stream socket. Provide private version of m_clrprotoflags(), which understands PRUS_NOTREADY, similar to m_demote(). Notes: svn path=/head/; revision=293432
* Implement interface link header precomputation API.Alexander V. Chernikov2015-12-311-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add if_requestencap() interface method which is capable of calculating various link headers for given interface. Right now there is support for INET/INET6/ARP llheader calculation (IFENCAP_LL type request). Other types are planned to support more complex calculation (L2 multipath lagg nexthops, tunnel encap nexthops, etc..). Reshape 'struct route' to be able to pass additional data (with is length) to prepend to mbuf. These two changes permits routing code to pass pre-calculated nexthop data (like L2 header for route w/gateway) down to the stack eliminating the need for other lookups. It also brings us closer to more complex scenarios like transparently handling MPLS nexthops and tunnel interfaces. Last, but not least, it removes layering violation introduced by flowtable code (ro_lle) and simplifies handling of existing if_output consumers. ARP/ND changes: Make arp/ndp stack pre-calculate link header upon installing/updating lle record. Interface link address change are handled by re-calculating headers for all lles based on if_lladdr event. After these changes, arpresolve()/nd6_resolve() returns full pre-calculated header for supported interfaces thus simplifying if_output(). Move these lookups to separate ether_resolve_addr() function which ether returs error or fully-prepared link header. Add <arp|nd6_>resolve_addr() compat versions to return link addresses instead of pre-calculated data. BPF changes: Raw bpf writes occupied _two_ cases: AF_UNSPEC and pseudo_AF_HDRCMPLT. Despite the naming, both of there have ther header "complete". The only difference is that interface source mac has to be filled by OS for AF_UNSPEC (controlled via BIOCGHDRCMPLT). This logic has to stay inside BPF and not pollute if_output() routines. Convert BPF to pass prepend data via new 'struct route' mechanism. Note that it does not change non-optimized if_output(): ro_prepend handling is purely optional. Side note: hackish pseudo_AF_HDRCMPLT is supported for ethernet and FDDI. It is not needed for ethernet anymore. The only remaining FDDI user is dev/pdq mostly untouched since 2007. FDDI support was eliminated from OpenBSD in 2013 (sys/net/if_fddisubr.c rev 1.65). Flowtable changes: Flowtable violates layering by saving (and not correctly managing) rtes/lles. Instead of passing lle pointer, pass pointer to pre-calculated header data from that lle. Differential Revision: https://reviews.freebsd.org/D4102 Notes: svn path=/head/; revision=292978
* Fix i386 build WITH_OFED=YES. Remove some redundant KASSERTs.Hans Petter Selasky2015-12-041-3/+0
| | | | | | | | | Suggested by: kib, ian Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=291793
* Fix scope of bridge_header and bridge_pcix_cap in mthca_reset(..)Enji Cooper2015-12-041-1/+7
| | | | | | | | | | | | | They're only used in the __linux__ case Differential Revision: https://reviews.freebsd.org/D4332 MFC after: 1 week Reported by: cppcheck Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291753
* Convert the mlxen driver to use the BUSDMA(9) APIs instead ofHans Petter Selasky2015-12-034-669/+625
| | | | | | | | | | | | | 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. MFC after: 1 week Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4284 Notes: svn path=/head/; revision=291699
* Updated the mlx4 and mlxen drivers to the latest version, v2.1.6:Hans Petter Selasky2015-12-0312-1885/+402
| | | | | | | | | | | | | | | | - 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. MFC after: 1 week Submitted by: Mark Bloch <markb@mellanox.com> Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4283 Notes: svn path=/head/; revision=291694
* Don't leak work if __mlx4_register_vlan(..) fails inEnji Cooper2015-11-191-0/+1
| | | | | | | | | | | | mlx4_master_immediate_activate_vlan_qos(..) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D4203 Submitted by: Miles Olrich <miles.olrich@isilon.com> Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291047
* Fix integer to pointer of different size conversion warnings whenHans Petter Selasky2015-11-122-4/+5
| | | | | | | | | | | using GCC for 32-bit platforms. The integer size in this case is hardcoded 64-bit while the pointer size is 32-bit. Sponsored by: Mellanox Technologies MFC after: 2 weeks Notes: svn path=/head/; revision=290711
* Fix print formatting compile warnings for Sparc64 and PowerPC platforms.Hans Petter Selasky2015-11-121-3/+3
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 2 weeks Notes: svn path=/head/; revision=290710
* Rename linuxapi[.ko] into linuxkpi[.ko], to reflect that it is aHans Petter Selasky2015-10-226-6/+6
| | | | | | | | | | | | | kernel programming interface module, KPI, to avoid confusion with the existing Linux userspace binary compatibility shims. Bump the FreeBSD_version number. Reviewed by: np @ Suggested by: dumbbell @ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289749
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-191-1/+1
| | | | | | | | | | | | - Define the kref structure identical to the one found in Linux. - Update clients referring inside the kref structure. - Implement kref_sub() for FreeBSD. Reviewed by: np @ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289578
* Merge LinuxKPI changes from DragonflyBSD:Hans Petter Selasky2015-10-193-6/+3
| | | | | | | | | | - Add more list related functions and macros. - Update the hlist_for_each_entry() macro to take one less argument. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289574
* Fix build broken by r287861.Alexander V. Chernikov2015-09-161-1/+1
| | | | | | | Spotted by: zb Notes: svn path=/head/; revision=287862
* Simplify the way of attaching IPv6 link-layer header.Alexander V. Chernikov2015-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem description: How do we currently perform layer 2 resolution and header imposition: For IPv4 we have the following chain: ip_output() -> (ether|atm|whatever)_output() -> arpresolve() Lookup is done in proper place (link-layer output routine) and it is possible to provide cached lle data. For IPv6 situation is more complex: ip6_output() -> nd6_output() -> nd6_output_ifp() -> (whatever)_output() -> nd6_storelladdr() We have ip6_ouput() which calls nd6_output() instead of link output routine. nd6_output() does the following: * checks if lle exists, creates it if needed (similar to arpresolve()) * performes lle state transitions (similar to arpresolve()) * calls nd6_output_ifp() which pushes packets to link output routine along with running SeND/MAC hooks regardless of lle state (e.g. works as run-hooks placeholder). After that, iface output routine like ether_output() calls nd6_storelladdr() which performs lle lookup once again. As a result, we perform lookup twice for each outgoing packet for most types of interfaces. We also need to maintain runtime-checked table of 'nd6-free' interfaces (see nd6_need_cache()). Fix this behavior by eliminating first ND lookup. To be more specific: * make all nd6_output() consumers use nd6_output_ifp() instead * rename nd6_output[_slow]() to nd6_resolve_[slow]() * convert nd6_resolve() and nd6_resolve_slow() to arpresolve() semantics, e.g. copy L2 address to buffer instead of pushing packet towards lower layers * Make all nd6_storelladdr() users use nd6_resolve() * eliminate nd6_storelladdr() The resulting callchain is the following: ip6_output() -> nd6_output_ifp() -> (whatever)_output() -> nd6_resolve() Error handling: Currently sending packet to non-existing la results in ip6_<output|forward> -> nd6_output() -> nd6_output _lle() which returns 0. In new scenario packet is propagated to <ether|whatever>_output() -> nd6_resolve() which will return EWOULDBLOCK, and that result will be converted to 0. (And EWOULDBLOCK is actually used by IB/TOE code). Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D1469 Notes: svn path=/head/; revision=287861
* Ensure that the MAD agent's delayed taskqueue is completely stoppedMark Johnston2015-09-151-1/+1
| | | | | | | | | | | | before proceeding. Otherwise, nothing prevents it from running after the MAD agent struct has been been freed, and this results in a use-after-free when the task's ta_pending count is incremented in the callout handler. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=287837
* Reinstate unify_tcp_port_space and associated code that was lost duringNavdeep Parhar2015-08-121-1/+49
| | | | | | | | | | | | | the last OFED update (r278886). iWARP on FreeBSD is properly integrated with the network stack and the iWARP drivers _never_ operate out of any private TCP port-space that is invisible to the kernel. Instead, an iWARP connection shows up as a TCP socket (which is what it is) fully visible to the kernel and standard tools like netstat, sockstat, etc. Notes: svn path=/head/; revision=286703
* Avoid calling into the random subsystem before it is initialized.Hans Petter Selasky2015-08-041-1/+5
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=286282
* ib mad: fix an incorrect use of list_for_each_entryMark Johnston2015-07-301-2/+5
| | | | | | | | | | | | | | | In tf_dequeue(), if we reach the end of the list without finding a non-cancelled element, "tmp" will be a pointer into the list head, so the tmp->canceled check is bogus. Use a flag instead. Submitted by: Tao Liu <Tao.Liu@isilon.com> Reviewed by: hselasky MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3244 Notes: svn path=/head/; revision=286087
* Implement lockless resource limits.Mateusz Guzik2015-06-102-2/+3
| | | | | | | | | | | | | Use the same scheme implemented to manage credentials. Code needing to look at process's credentials (as opposed to thred's) is provided with *_proc variants of relevant functions. Places which possibly had to take the proc lock anyway still use the proc pointer to access limits. Notes: svn path=/head/; revision=284215
* Add SIOCGI2C ioctl support to the driver. Would work only on ConnectX-3Gleb Smirnoff2015-05-272-0/+180
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=283612
* Apply proper locking when iterating the multicast addresses and add aHans Petter Selasky2015-05-121-0/+4
| | | | | | | | | | | missing check for NULL from a non-blocking "kzalloc()" function call. MFC after: 1 week Sponsored by: Mellanox Technologies Found by: glebius @ Notes: svn path=/head/; revision=282817
* Factor out mbuf hashing code from LAGG driver so that other networkHans Petter Selasky2015-03-113-237/+3
| | | | | | | | | | | | | | drivers can use it. This avoids some code duplication. Add missing default case to all switch statements while at it. Also move the hashing of the IPv6 flow field to layer 4 because the IPv6 flow field is constant on a per L4 connection basis and not on a per L3 network. Differential Revision: https://reviews.freebsd.org/D1987 Sponsored by: Mellanox Technologies MFC after: 1 month Notes: svn path=/head/; revision=279891
* Ensure setting promiscious mode when a network interface is up, isHans Petter Selasky2015-03-101-5/+8
| | | | | | | | | | always non-blocking by not locking a SX type of mutex. Sponsored by: Mellanox Technologies MFC after: 3 days Notes: svn path=/head/; revision=279865
* Updates for the Mellanox ethernet driverHans Petter Selasky2015-03-048-26/+57
| | | | | | | | | | | | | | | | | | | | | > 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 after: 3 days Notes: svn path=/head/; revision=279584
* Try to unbreak NOIP and NOINET6 LINT builds after r278886Bjoern A. Zeeb2015-02-191-0/+6
| | | | | | | | | by placing appropriate #ifdefs around otherwise unused variables or sections with functions called which are not available without IPv6 support in the kernel. Notes: svn path=/head/; revision=278995