summaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* Fix privilege escalation in cd(4) driver.Gordon Tetlow2019-07-032-21/+9
| | | | | | | | | | Approved by: so Approved by: re (implicit) Security: FreeBSD-SA-19:11.cd_ioctl Security: CVE-2019-5602 Notes: svn path=/releng/11.3/; revision=349625
* MFS r349163: ixl(4)/ixlv(4): Update Intel XL710 PF and VF drivers to ↵Eric Joyner2019-06-1937-1124/+2342
| | | | | | | | | | | | | | | | | | | | | | | | | | | ixl-1.11.9 and ixlv-1.5.8 Update the legacy (non-iflib) drivers in stable/11 with recent changes from the Intel out-of-tree version. Major changes: - Support for new BASE-T device with additional link speeds (2.5G and 5G) and EEE - Additional I2C access methods backported from ixl-iflib - FW LLDP Agent control with sysctl added for X722 devices (this already existed for 710 devices) - MAC/VLAN filters handling has been refactored - Building and loading if_ixlv as a KLD has been fixed This commit is not from CURRENT since the driver in 12/13 uses iflib, and the decision was made to not use iflib in FreeBSD 11 releases. Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com> Approved by: re@ (gjb@) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20290 Notes: svn path=/releng/11.3/; revision=349181
* MFC r348631:Hans Petter Selasky2019-06-101-4/+47
| | | | | | | | | | | | | | In usb(4) fix a lost completion event issue towards libusb(3). It may happen if a USB transfer is cancelled that we need to fake a completion event. Implement missing support in ugen_fs_copy_out() to handle this. This fixes issues with webcamd(8) and firefox. Approved by: re (gjb) Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=348855
* MFC r348604:Hans Petter Selasky2019-06-101-13/+13
| | | | | | | | | | | | In xhci(4) there is no stream ID in the completion TRB. Instead iterate all the stream IDs in stream mode to find the matching USB transfer. Approved by: re(kib) Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=348851
* MFC r348603:Hans Petter Selasky2019-06-091-0/+2
| | | | | | | | | | Make sure the DMA tags get freed in mlx5en(4). Approved by: re (gjb) Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=348830
* MFC r348065:Allan Jude2019-06-061-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | Correct the way remaining battery life is calculated Previously, if a system had multiple batteries, the remaining life percentage was calculated as the average of each battery's percent remaining. This results in rather incorrect values when you consider the case of the Thinkpad X270 that has a small 3 cell internally battery, and a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%, but battery 1 is at 10%, you do not infact have 55% of your capacity remaining. The new method calculates the percentage based on remaining capacity out of total capacity, giving a much more accurate reading. PR: 229818 Submitted by: Keegan Drake H.P. <kd-dev@pm.me> Sponsored by: Klara Systems Event: Waterloo Hackathon 2019 Approved by: re (gjb) Notes: svn path=/stable/11/; revision=348726
* MFC r348491:Navdeep Parhar2019-06-057-105/+37
| | | | | | | | | | | | | | | | | | | | cxgbe/t4_tom: adjust the hardware receive window to match changes to the receive sockbuf's high water mark. Calculate rx credits on the spot instead of tracking sbused/sb_cc and rx_credits in the toepcb. The previous method worked when the high water mark changed due to SB_AUTOSIZE but not when it was adjusted directly (for example, by the soreserve in nfsrvd_addsock). This fixes a connection hang while running iozone over an NFS mounted share where nfsd's TCP sockets are being handled by t4_tom. Sponsored by: Chelsio Communications Approved by: re@ (gjb@) Notes: svn path=/stable/11/; revision=348704
* MFC r348247:Kenneth D. Merry2019-05-312-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r348247 | ken | 2019-05-24 13:58:29 -0400 (Fri, 24 May 2019) | 57 lines Fix FC-Tape bugs caused in part by r345008. The point of r345008 was to reset the Command Reference Number (CRN) in some situations where a device stayed in the topology, but had changed somehow. This can include moving from a switch connection to a direct connection or vice versa, or a device that temporarily goes away and comes back. (e.g. moving to a different switch port) There were a couple of bugs in that change: - We were reporting that a device had not changed whenever the Establish Image Pair bit was not set. That is not quite correct. Instead, if the Establish Image Pair bit stays the same (set or not), the device hasn't changed in that way. - We weren't setting PRLI Word0 in the port database when a new device arrived, so comparisons with the old value for the Establish Image Pair bit weren't really possible. So, make sure PRLI Word0 is set in the port database for new devices. - We were resetting the CRN whenever the Establish Image Pair bit was set for a device, even when the device had stayed the same and the value of the bit hadn't changed. Now, only reset the CRN for devices that have changed, not devices that sayed the same. The result of all of this was that if we had a single FC device on an FC port and it went away and came back, we would wind up correctly resetting the CRN. But, if we had multiple devices connected via a switch, and there was any change in one or more of those devices, all of the devices that stayed the same would also have their CRN values reset. The result, from a user standpoint, is that the tape drives, etc. would all start to time out commands and the initiator would send aborts. sys/dev/isp/isp.c: In isp_pdb_add_update(), look at whether the Establish Image Pair bit has changed as part of the check to determine whether a device is still the same. This was causing erroneous change notifications. Also, when creating a new port database entry, initialize the PRLI Word 0 values. sys/dev/isp/isp_freebsd.c: In isp_async(), in the changed/stayed case, instead of looking at the Establish Image Pair bit to determine whether to reset the CRN, look at the command value. (Changed vs. Stayed.) Only reset the CRN for devices that have changed. ------------------------------------------------------------------------ Sponsored by: Spectra Logic Approved by: re (gjb) Notes: svn path=/stable/11/; revision=348483
* MFC r339703, r347365, r347703, r347940Brooks Davis2019-05-1816-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r339703: Deprecate a number of less used 10 and 10/100 Ethernet devices. The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe, pcn, sf, sn, tl, tx, txp, vx, wb, xe The list as refined as part of FCP-0101. Per the FCP, devices may be removed from the deprecation list if enough users are found or they are converted to iflib. FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md r347365: Update dme(4) to reflect that it will not be removed due to FCP-101. dme(4) is the built-in NIC on a couple non-expandable mips platforms and thus should remain. The FCP has been updated to reflect this fact. Discussed with: imp r347703: FCP-101: ae(4) is sufficently popular to be moved to the keep list. r347940: Remove the notice that ae(4) will be removed in FreeBSD 13. MFC requested by: rgrimes Approved by: re (kib) Notes: svn path=/stable/11/; revision=347962
* MFC r345008:Kenneth D. Merry2019-05-165-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r345008 | ken | 2019-03-11 10:21:14 -0400 (Mon, 11 Mar 2019) | 59 lines Fix CRN resets in the isp(4) driver in certain situations. The Command Reference Number (CRN) is part of the FC-Tape features that we enable when talking to tape drives. It starts at 1, and goes to 255 and wraps around to 1. There are a number of reset type conditions that result in the CRN getting reset to 1. These are detailed in section 4.10 (table 8) of the FCP-4r02b specification. One of the conditions is when a PRLI (Process Login) is sent by the initiator, and the Establish Image Pair bit is set in Word 0 of the PRLI. Previously, the isp(4) driver core sent a notification via isp_async() that the target had changed or stayed in place, but there was no indication of whether a PRLI was sent and whether the Establish Image Pair bit was set. The result of this was that in some situations, notably switching back and forth between a direct connection and a switch connection to a tape drive, the isp(4) driver would fail to reset the CRN in situations that require it according to the spec. When the CRN isn't reset in a situation that requires it, the tape drive then rejects every subsequent command that is sent to the drive. It is assuming that the commands are being sent out of order. So, modify the isp(4) driver to include Word 0 of the PRLI command when it sends isp_async() notifications of target changes. Look at the Establish Image Pair bit, and reset the CRN if that bit is set. With this change, I am able to switch a tape drive back and forth between a direct connection and a switch connection, and the isp(4) driver resets the CRN when it should. sys/dev/isp_stds.h: Add bit definitions for PRLI Word 0. sys/dev/ispmbox.h: Add PRLI Word 0 to the port database type, isp_pdb_t. sys/dev/ispvar.h Add PRLI Word 0 to fcportdb_t. sys/dev/isp.c: Populate the new prli_word0 parameter in the port database. In isp_pdb_add_update(), add a check to see if the Establish Image Pair bit is set in PRLI Word 0. If it is, then that is an additional reason to create a change notification. sys/dev/isp_freebsd.c: In isp_async(), if the device changed or stayed, look at PRLI Word 0 to see if the Establish Image Pair bit is set. If it is, reset the CRN if we haven't already. Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D19472 ------------------------------------------------------------------------ Notes: svn path=/stable/11/; revision=347894
* MFC r347325:Hans Petter Selasky2019-05-165-10/+10
| | | | | | | | | Bump the Mellanox driver version numbers and the FreeBSD version number. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347883
* MFC r347324:Hans Petter Selasky2019-05-163-34/+23
| | | | | | | | | | | | | Make command workqueue persistant in mlx5core. There is no reason to re-create the command workqueue during healthcare. This also fixes an issue where a previous work struct may refer to a destroyed workqueue. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347881
* MFC r347323:Hans Petter Selasky2019-05-163-64/+75
| | | | | | | | | | | | | | | | | | | | | | Fix race between driver unload and dumping firmware in mlx5core. Present code uses lock-less accesses to the dump data to prevent top level ioctls from blocking bottom-level call to dump. Unfortunately, this depends on the type stability of the dump data structure, which makes it non-functional during driver teardown. Switch to the mutex locking scheme where top levels use the mutex in the bound regions, while copyouts and drain for completion utilize condvars. The mutex lifetime is guaranteed to be strictly larger than the time interval where driver can initiate dump, and most of the control fields of the old struct mlx5_dump_data are directly embedded into struct mlx5_core_dev. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347880
* MFC r347322:Hans Petter Selasky2019-05-161-0/+3
| | | | | | | | | | Ensure the flowtable rules are not freed twice in mlx5en(4). This can happen when re-loading the driver. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347879
* MFC r347233:Michael Tuexen2019-05-162-11/+2
| | | | | | | | | | | | | | | | | | | | Remove non-functional SCTP checksum offload support for virtio. 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. Notes: svn path=/stable/11/; revision=347878
* MFC r347321:Hans Petter Selasky2019-05-161-4/+11
| | | | | | | | | | | Undo previous steps upon returning failure in mlx5en(4). Else flowtable resources may not be properly freed. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347877
* MFC r347320:Hans Petter Selasky2019-05-161-2/+2
| | | | | | | | | | Make sure the flow destination structure does not use values off the stack in mlx5en(4). Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347876
* MFC r347319:Hans Petter Selasky2019-05-162-2/+14
| | | | | | | | | | | | | Flush command workqueue when command completion is triggered in mlx5core. Avoid race for command completion when triggering a command completions event. Serialize operation by queueing all commands on the same work queue. This can happen when healthcare triggers. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347875
* MFC r347318:Hans Petter Selasky2019-05-161-1/+1
| | | | | | | | | | | | | | | | Make command timeout way shorter in mlx5core. The command timeout is terribly long, whole two hours. Make it 60s so if things do go wrong, the user gets feedback in relatively short time, so they can take corrective actions and/or investigate using tools and such. Linux commit: 6b6c07bdcdc97ccac2596063bfc32a5faddfe884 Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347874
* MFC r347317:Hans Petter Selasky2019-05-163-39/+5
| | | | | | | | | Remove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4). Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347873
* MFC r347316:Hans Petter Selasky2019-05-163-1/+6
| | | | | | | | | | | | Fix for compilation warning in mlx5en(4). Function 'mlx5e_alloc_rx_wqe' can never be inlined because it uses alloca (override using the always_inline attribute) Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347872
* MFC r347315:Hans Petter Selasky2019-05-163-16/+16
| | | | | | | | | | Rename functions from mlx5_fwdump to mlx5_ctl in mlx5core. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347871
* MFC r347313:Hans Petter Selasky2019-05-162-0/+30
| | | | | | | | | | Implement firmware reset from userspace in mlx5tool(8). Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347869
* MFC r347312:Hans Petter Selasky2019-05-165-0/+39
| | | | | | | | | | Add Firmware Reset Level, MFRL, register accessors in mlx5core. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347868
* MFC r347310:Hans Petter Selasky2019-05-162-0/+33
| | | | | | | | | Expose per-lane counters before correction mechanism in mlx5en(4). Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347866
* MFC r347309:Hans Petter Selasky2019-05-162-1/+204
| | | | | | | | | Add support for extended PCIe counters in mlx5en(4). Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347865
* MFC r347308:Hans Petter Selasky2019-05-161-195/+195
| | | | | | | | | | | | | | Extend the counters framework in mlx5en(4). Allow more macro arguments and split the variable type and name into separate arguments. This allows simple and powerful copy and extraction of values from IFC based structures into SYSCTLs with the use of a single macro. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347864
* MFC r347307:Hans Petter Selasky2019-05-162-39/+184
| | | | | | | | | Update performance counter bits in mlx5core. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347863
* MFC r347306:Hans Petter Selasky2019-05-166-8/+197
| | | | | | | | | | | | | | | | Implement reading PCI power status in mlx5core. Implement a watchdog as part of the healtcare subsystem which reads the PCI power status during startup and upon the PCI power status change event and store it into the core device structure. This value is then exported to user-space via a read-only SYSCTL. A dmesg print has been added to inform the admin about the PCI power status. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347862
* MFC r347305:Hans Petter Selasky2019-05-163-19/+16
| | | | | | | | | | | | Move workqueue from mlx5en(4) to mlx5core. This avoids creating more workqueues in mlx5core to do simple firmware command polling tasks. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347861
* MFC r347304:Hans Petter Selasky2019-05-161-0/+8
| | | | | | | | | | | | | | | | | | | Always return success for RoCE modify port in mlx5ib. CM layer calls ib_modify_port() regardless of the link layer. For the Ethernet ports, qkey violation and Port capabilities are meaningless. Therefore, always return success for ib_modify_port calls on the Ethernet ports. Linux Commit: ec2558796d25e6024071b6bcb8e11392538d57bf Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347860
* MFC r347303:Hans Petter Selasky2019-05-162-7/+69
| | | | | | | | | | Add support for new rates to mlx5ib. Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347859
* MFC r347300:Hans Petter Selasky2019-05-161-11/+0
| | | | | | | | | | | | | | Do not add IFM_10G_LR and IFM_40G_ER4 to supported media types by default in mlx5en(4). IFM_10G_LR and IFM_40G_ER4 media should be added only if the device has the needed capability bit set for it. Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347856
* MFC r347299:Hans Petter Selasky2019-05-166-105/+489
| | | | | | | | | | Add support for 200Gb ethernet speeds to mlx5core. Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347855
* MFC r347298:Hans Petter Selasky2019-05-161-30/+0
| | | | | | | | | | Remove unused speed enums in mlx5core. Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347854
* MFC r347297:Hans Petter Selasky2019-05-161-0/+7
| | | | | | | | | | Control automatic update of firmware on driver load with a tunable in mlx5core. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347853
* MFC r347295:Hans Petter Selasky2019-05-162-5/+1
| | | | | | | | | | | | Let rx_out_of_buffer be a 32-bit counter in mlx5en(4). This fixes counting issues when the firmware resets the counter during allocation of the counter set where the counter belongs. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347851
* MFC r347294:Hans Petter Selasky2019-05-164-2/+79
| | | | | | | | | Add vnic steering drop statistics in mlx5en(4). Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347850
* MFC r347293:Hans Petter Selasky2019-05-161-5/+6
| | | | | | | | | | | | | | Use software counters for rx_packets and rx_bytes in mlx5en(4). The physical- and virtual- port counters might not reflect the amount of data received after address filtering. Use the software counters instead for rx_packets and rx_bytes to know exactly how much data was received. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347849
* MFC r347292:Hans Petter Selasky2019-05-161-0/+20
| | | | | | | | | | | Add mlx5_firmware_update() in mlx5core. Add support for upgrading firmware on mlx5 module load. Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347847
* MFC r347290:Hans Petter Selasky2019-05-161-2/+0
| | | | | | | | | | | | | Fix for double bus master disable in mlx5core. mlx5_pci_disable_device is calling pci_disable_device which disables bus master. No need to explicitly call pci_clear_master. Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347845
* Fix minor compile issue after MFC r347288.Hans Petter Selasky2019-05-161-2/+2
| | | | | | | | | This is a direct commit. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347844
* MFC r347288:Hans Petter Selasky2019-05-162-0/+39
| | | | | | | | | | Implement userspace firmware update for ConnectX-4/5/6. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347841
* MFC r347287:Hans Petter Selasky2019-05-162-8/+8
| | | | | | | | | | Rename mlx5_fwdump_addr to more neutral mlx5_tool_addr in mlx5core. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347840
* MFC r347286:Hans Petter Selasky2019-05-163-2/+158
| | | | | | | | | | | | | | | | | | Add mlxfw callbacks in mlx5core. Add mlx5 implementation for the ones defined by the mlxfw shared module to be used while flashing the device firmware. The callbacks do their job through the MCQI, MCC and MCDA registers. Linux commit: 62bd22cf326dc4ac5be673c11cef4602dc1f5e47 Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347839
* MFC r347285 and r347327:Hans Petter Selasky2019-05-169-0/+1516
| | | | | | | | | | Initial version of Mellanox in-kernel firmware upgrade support. Submitted by: slavash@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347838
* MFC r347284:Hans Petter Selasky2019-05-161-12/+12
| | | | | | | | | Convert remaining module parameters into SYSCTLs in mlx5core. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347835
* MFC r347283:Hans Petter Selasky2019-05-161-1/+1
| | | | | | | | | Remove redundant line of code in mlx5core. Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347834
* MFC r347282:Hans Petter Selasky2019-05-161-1/+1
| | | | | | | | | | | Change implicit and probably erronous EPERM to EIO on command status error in mlx5core. Submitted by: kib@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347833
* MFC r347279:Hans Petter Selasky2019-05-161-26/+10
| | | | | | | | | | | | | | | | | | Fix netstat counters mapping in mlx5en(4). 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@ Sponsored by: Mellanox Technologies Notes: svn path=/stable/11/; revision=347830