aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Initial version of Mellanox in-kernel firmware upgrade support.Hans Petter Selasky2019-05-0813-0/+1546
| | | | | | | | | Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347285
* Convert remaining module parameters into SYSCTLs in mlx5core.Hans Petter Selasky2019-05-081-12/+12
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347284
* Remove redundant line of code in mlx5core.Hans Petter Selasky2019-05-081-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347283
* Change implicit and probably erronous EPERM to EIO on command status errorHans Petter Selasky2019-05-081-1/+1
| | | | | | | | | | | in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347282
* Fix netstat counters mapping in mlx5en(4).Hans Petter Selasky2019-05-081-26/+10
| | | | | | | | | | | | | | | | | The current mapping of driver counters to netstat counters is wrong. For example, a single jabber packet, will cause the Ierrs counter to count three times. The work for mapping the hardware and software counters to their right place in netstat counters were already done in Linux, take that as is to the FreeBSD driver. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347279
* Fix endless loop in ipoib_poll().Hans Petter Selasky2019-05-081-1/+1
| | | | | | | | | | | | | | ib_req_notify_cq may return negative value which will indicate a failure. In the case of uncorrectable error, we will end up in an endless loop. Fix that, by going to another loop with poll_more only if there is anything left to poll. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347278
* Avoid leaking send queue mbufs during error recovery in mlx5en(4).Hans Petter Selasky2019-05-082-2/+7
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347277
* Add helper functions to set/query MCC/MCDA/MCQI registers in mlx5core.Hans Petter Selasky2019-05-081-0/+114
| | | | | | | | | | | | | | To be used by the mlx5 callbacks exposed to the mlxfw module. Linux commit: d2ad488b0073bd1a2c3f5d2ea50a7eb632103e5d Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347276
* Enhance MCAM reg to allow query on access reg support in mlx5core.Hans Petter Selasky2019-05-082-0/+16
| | | | | | | | | | | | | | | Enhance MCAM to allow the driver to query which access regs are supported. For now, expose the regs needed for FW flashing. Linux commit: 0ab87743cc8c5bcd482daf71961ed5fc45349e01 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347275
* Add MCC (Management Component Control) register definitions in mlx5core.Hans Petter Selasky2019-05-082-0/+82
| | | | | | | | | | | | | | | | | | | | | MCC (Management Component Control) allows to control a firmware component update. MCDA (Management Component Data Access) allows to read and write a firmware component. MCQI (Management Component Query Information) allows to query information about firmware components. Linux commit: 4717628938423fcba0aa8fa889e9fed4eb6a655f Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347274
* Add reading the mcam_reg in mlx5core.Hans Petter Selasky2019-05-081-0/+6
| | | | | | | | | Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347273
* Query and cache PCAM, MCAM registers on initialization in mlx5core.Hans Petter Selasky2019-05-083-0/+22
| | | | | | | | | | | | | | | | On load_one, we now cache our capabilities registers internally, similar to QUERY_HCA_CAP. Capabilities can later be queried using macros introduced in this patch. Linux commit: 71862561f3a62015a11de16d1c306481e8415c08 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347272
* Implement PCAM, MCAM access register commands in mlx5core.Hans Petter Selasky2019-05-082-0/+28
| | | | | | | | | | | | | | | | | Introduced registers will expose capabilities of new registers and features related to port/management. Driver will query MCAM and PCAM in order to avoid failing on old firmwares with lack of support. Linux commit: c835ad64683bd3e2d1b31ed2cb1ff4366932edb1 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347271
* Expose PCAM, MCAM registers infrastructure in mlx5core.Hans Petter Selasky2019-05-083-1/+78
| | | | | | | | | | | | | | | | | | | | PCAM: Ports capabilities mask register. MCAM: Management capabilities mask register. PCAM and MCAM registers will provide information regarding firmware support for different features, in order to avoid cases where new driver combined with old firmware results in syndromes (for ex. PCIe counters before this patchset). Linux commit: cfdcbceaeffc669b70d904d80a2df9c86c232566 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347270
* Add sysctl(8) to control fast unload support in mlx5core.Hans Petter Selasky2019-05-081-1/+11
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347269
* Add Fast teardown support to mlx5core.Hans Petter Selasky2019-05-084-11/+71
| | | | | | | | | | | | | | | | | | | | | | | | | Today mlx5 devices support two teardown modes: 1- Regular teardown 2- Force teardown This change introduces the enhanced version of the "Force teardown" that allows SW to perform teardown in a faster way without the need to reclaim all the pages. Fast teardown provides the following advantages: 1- Fix a FW race condition that could cause command timeout 2- Avoid moving to polling mode 3- Close the vport to prevent PCI ACK to be sent without been scattered to memory Linux commit: fcd29ad17c6ff885dfae58f557e9323941e63ba2 MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347268
* Make sure the running variable is properly set for ratelimited SQs in mlx5en(4).Hans Petter Selasky2019-05-081-0/+2
| | | | | | | | | | | Else the SQs won't be properly released when closing rate-limited connections leading to wrong state transitions on the SQ. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347267
* Implement get and set nic state as global functions in mlx5core.Hans Petter Selasky2019-05-082-14/+28
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347266
* Ticks are integer type in FreeBSD.Hans Petter Selasky2019-05-081-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347265
* Configure firmware to use RX hash format in mini CQE in mlx5en(4).Hans Petter Selasky2019-05-082-5/+12
| | | | | | | | | | | | | | | | | | | | When using CQE zipping, one can choose between RX hash and Checksum. This will indicate the parameter on which a zipping session should be stopped. While porting the Linux code, Checksum was chosen. However, the value of Checksum is not being used anywhere. For the FreeBSD driver, we prefer to use the RX hash format which will guarantee the RX hash value for all the mini CQEs. While at it, make sure to initialize the Checksum value in the decompressed CQE. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347264
* Disable CQE zipping by default in mlx5en(4).Hans Petter Selasky2019-05-081-1/+6
| | | | | | | | | | | | | | After doing performance measurements, it seems like CQE zipping doesn't have any significant benefit. Moreover, we know that this feature is disabled by default on other operating systems (Linux for example). Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347263
* Split mlx5e_update_stats_work() in mlx5en(4).Hans Petter Selasky2019-05-081-73/+71
| | | | | | | | | | | | | | Split the function into the mlx5e_update_stats_locked() core and make mlx5e_update_stats_work() call the _locked helper, similar to many other places in the kernel. This improves the code structure, making the locking clean. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347262
* Implement fast close of RX channel in mlx5en(4).Hans Petter Selasky2019-05-081-10/+2
| | | | | | | | | | | | Instead of waiting for all jobs to be cancelled, simply close the completion queue to prevent more completion events and let mlx5e_destroy_rq() cleanup the remaining mbufs. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347261
* Correct number of elements for priority to traffic class mappings in mlx5en(4).Hans Petter Selasky2019-05-083-99/+100
| | | | | | | | | | | The number of priorities is always 8, while the number of traffic classes supported can vary. While at it convert the sysctl node into an array. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347260
* Remove unused module parameter in mlx5ib.Hans Petter Selasky2019-05-081-7/+0
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347259
* Make sure to error out when arming the CQ fails in mlx4ib and mlx5ib.Hans Petter Selasky2019-05-082-6/+17
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347258
* Make sure to error out when arming the CQ fails in ibcore.Hans Petter Selasky2019-05-081-3/+7
| | | | | | | | MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347257
* Destroy port stats debug context in correct order in mlx5en(4).Hans Petter Selasky2019-05-082-1/+5
| | | | | | | | | | Destroy children nodes before parent nodes. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347256
* Fix tx_jumbo_packets counter in mlx5en(4).Hans Petter Selasky2019-05-081-6/+6
| | | | | | | | | | | | | | | | Instead of reading Ethernet RFC 2819 pXtoYoctets counters from hardware which counts RX octets, count tx_stat_pXtoYoctets from Ethernet extended counters which counts TX octets. TX jumbo counters should be accumulated only after the PPCNT counters were fetched from hardware with their latest value. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347255
* Update Ethernet extended counters in mlx5en(4).Hans Petter Selasky2019-05-083-2/+96
| | | | | | | | | | | | | Expose all Ethernet extended counters those counters via debug_stats sysctl: dev.mce.X.debug_stats Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347254
* Protect from infinite sw-reset loop in mlx5core.Hans Petter Selasky2019-05-082-1/+35
| | | | | | | | | | | | | | | | | Avoid an infinite software firmware reset loop that may be caused by a hardware bug by limiting the maximum number of resets. The counter between resets is reset by request for reset, and not by a successful reset. The interval between two resets can be configured via sysctl: hw.mlx5.sw_reset_timeout which is global to all mlx5 devices in the system. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347253
* Disable all MSIX interrupts before shutdown in mlx5.Hans Petter Selasky2019-05-084-1/+26
| | | | | | | | | | | Make sure the interrupt handlers don't race with the fast unload one code in the shutdown handler. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347252
* Import Linux code to implement mlx5_ib_disassociate_ucontext() in mlx5ib.Hans Petter Selasky2019-05-081-0/+66
| | | | | | | | | Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347251
* Add temperature warning event to log in mlx5core.Hans Petter Selasky2019-05-083-1/+25
| | | | | | | | | | | | | | | | | Temperature warning event is sent by FW to indicate high temperature as detected by one of the sensors on the board. Add handling of this event by writing the numbers of the alert sensors to the kernel log. Linux commit: 1865ea9adbfaf341c5cd5d8f7d384f19948b2fe9 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347250
* Correctly define the interface state bits in mlx5en(4).Hans Petter Selasky2019-05-082-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | While at it remove unused interface state bits. This also fixes and issue during shutdown: There is an issue where the firmware fails during mlx5_load_one, the health_care timer detects the issue and schedules a health_care call. Then the mlx5_load_one detects the issue, cleans up and quits. Then the health_care starts and calls mlx5_unload_one to clean up the resources that no longer exist and causes kernel panic. The root cause is that the bit MLX5_INTERFACE_STATE_DOWN is not set after mlx5_load_one fails. The solution is removing the bit MLX5_INTERFACE_STATE_DOWN and quit mlx5_unload_one if the bit MLX5_INTERFACE_STATE_UP is not set. The bit MLX5_INTERFACE_STATE_DOWN is redundant and we can use MLX5_INTERFACE_STATE_UP instead. Linux commit: 10a8d00707082955b177164d4b4e758ffcbd4017 b3cb5388499c5e219324bfe7da2e46cbad82bfcf MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347249
* Enable FPGA and FPGA QP errors for EQ and call the handler in mlx5core.Hans Petter Selasky2019-05-081-0/+14
| | | | | | | | | Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347248
* Add MLX5_FPGA_RELOAD IOCTL(2) to mlx5fpga.Hans Petter Selasky2019-05-084-6/+61
| | | | | | | | | Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347247
* Add support for Dynamic Interrupt Moderation, DIM, in mlx5en(4).Hans Petter Selasky2019-05-088-11/+613
| | | | | | | | | | | | | | Add support for DIM based on Linux, with some minor adaptions specific to FreeBSD. Linux commit f97c3dc3c0e8d23a5c4357d182afeef4c67f5c33 MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=347246
* Allow to build without INET and INET6 again after r347221.Marius Strobl2019-05-081-0/+2
| | | | | | | Submitted by: cam Notes: svn path=/head/; revision=347245
* Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel.Xin LI2019-05-0845-0/+21807
| | | | | | | | | | | This is a prerequisite of unifying kernel zlib instances. Submitted by: Yoshihiro Ota <ota at j.email.ne.jp> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20191 Notes: svn path=/head/; revision=347244
* powerpc: hide innocuous printf behind bootverboseJustin Hibbits2019-05-081-1/+2
| | | | | | | | NUMA associativity, and OFW node existence, is completely optional, and shouldn't warn always. Notes: svn path=/head/; revision=347242
* tun/tap: merge and rename to `tuntap`Kyle Evans2019-05-0831-2387/+1786
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tun(4) and tap(4) share the same general management interface and have a lot in common. Bugs exist in tap(4) that have been fixed in tun(4), and vice-versa. Let's reduce the maintenance requirements by merging them together and using flags to differentiate between the three interface types (tun, tap, vmnet). This fixes a couple of tap(4)/vmnet(4) issues right out of the gate: - tap devices may no longer be destroyed while they're open [0] - VIMAGE issues already addressed in tun by kp [0] emaste had removed an easy-panic-button in r240938 due to devdrn blocking. A naive glance over this leads me to believe that this isn't quite complete -- destroy_devl will only block while executing d_* functions, but doesn't block the device from being destroyed while a process has it open. The latter is the intent of the condvar in tun, so this is "fixed" (for certain definitions of the word -- it wasn't really broken in tap, it just wasn't quite ideal). ifconfig(8) also grew the ability to map an interface name to a kld, so that `ifconfig {tun,tap}0` can continue to autoload the correct module, and `ifconfig vmnet0 create` will now autoload the correct module. This is a low overhead addition. (MFC commentary) This may get MFC'd if many bugs in tun(4)/tap(4) are discovered after this, and how critical they are. Changes after this are likely easily MFC'd without taking this merge, but the merge will be easier. I have no plans to do this MFC as of now. Reviewed by: bcr (manpages), tuexen (testing, syzkaller/packetdrill) Input also from: melifaro Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20044 Notes: svn path=/head/; revision=347241
* random: x86 driver: Prefer RDSEED over RDRAND when availableConrad Meyer2019-05-081-9/+39
| | | | | | | | | | | | | | | | | Per https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-rdrand-and-rdseed , RDRAND is a PRNG seeded from the same source as RDSEED. The source is more suitable as PRNG seed material, so prefer it when the RDSEED intrinsic is available (indicated in CPU feature bits). Reviewed by: delphij, jhb, imp (earlier version) Approved by: secteam(delphij) Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20192 Notes: svn path=/head/; revision=347239
* vmm(4): Pass through RDSEED feature bit to guestsConrad Meyer2019-05-081-0/+1
| | | | | | | | | | | Reviewed by: jhb Approved by: #bhyve (jhb) MFC after: 2 leapseconds Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20194 Notes: svn path=/head/; revision=347238
* Add missing newline to debug printf.Warner Losh2019-05-082-2/+2
| | | | Notes: svn path=/head/; revision=347237
* Remove non-functional SCTP checksum offload support for virtio.Michael Tuexen2019-05-072-11/+2
| | | | | | | | | | | | | | | | | | | | | | Checksum offloading for SCTP is not currently specified for virtio. If the hypervisor announces checksum offloading support, it means TCP and UDP checksum offload. If an SCTP packet is sent and the host announced checksum offload support, the hypervisor inserts the IP checksum (16-bit) at the correct offset, but this is not the right checksum, which is a CRC32c. This results in all outgoing packets having the wrong checksum and therefore breaking SCTP based communications. This patch removes SCTP checksum offloading support from the virtio network interface. Thanks to Felix Weinrank for making me aware of the issue. Reviewed by: bryanv@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20147 Notes: svn path=/head/; revision=347233
* Support PTRACE_GETREGSET w/ NT_PRSTATUS in Linux ptrace(2).Edward Tomasz Napierala2019-05-071-3/+128
| | | | | | | | | | | | | | While Linux strace(1) doesn't strictly require it - it has a fallback to PTRACE_GETREGS - it's a newer interface, so we better support it before the old one is deprecated. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20152 Notes: svn path=/head/; revision=347231
* make sysent after r347228Ed Maste2019-05-0731-31/+31
| | | | | | | Regenerate to add @generated tag in generated files. Notes: svn path=/head/; revision=347230
* device_printf: Use sbuf for more coherent prints on SMPConrad Meyer2019-05-074-10/+63
| | | | | | | | | | | | | | | | | device_printf does multiple calls to printf allowing other console messages to be inserted between the device name, and the rest of the message. This change uses sbuf to compose to two into a single buffer, and prints it all at once. It exposes an sbuf drain function (drain-to-printf) for common use. Update documentation to match; some unit tests included. Submitted by: jmg Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16690 Notes: svn path=/head/; revision=347229
* makesyscalls: use @generated tag in generated filesEd Maste2019-05-071-6/+9
| | | | | | | | | | | | | | | Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in generated files). Use the @generated tag in makesyscalls.sh as we've done for other generated files. Reviewed by: cem MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20183 Notes: svn path=/head/; revision=347228