aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed/drivers/infiniband/core/ib_sysfs.c
Commit message (Collapse)AuthorAgeFilesLines
* ofed: jiffies is unsigned longKonstantin Belousov2025-04-291-1/+1
| | | | | Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D48878
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* ibcore: Fix sysfs registration error flowHans Petter Selasky2022-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel commit cited below restructured ib device management so that the device kobject is initialized in ib_alloc_device. As part of the restructuring, the kobject is now initialized in procedure ib_alloc_device, and is later added to the device hierarchy in the ib_register_device call stack, in procedure ib_device_register_sysfs (which calls device_add). However, in the ib_device_register_sysfs error flow, if an error occurs following the call to device_add, the cleanup procedure device_unregister is called. This call results in the device object being deleted -- which results in various use-after-free crashes. The correct cleanup call is device_del -- which undoes device_add without deleting the device object. The device object will then (correctly) be deleted in the ib_register_device caller's error cleanup flow, when the caller invokes ib_dealloc_device. Linux commit: b312be3d87e4c80872cbea869e569175c5eb0f9a PR: 264472 MFC after: 3 days Sponsored by: NVIDIA Networking
* ibcore: Add support for NDR link speed.Hans Petter Selasky2022-02-211-0/+4
| | | | | | | | | | Add new IBTA speed NDR, supporting signaling rate of 100Gb. Linux commit: c7adf7717301558e8852949d8e3dc3748d1a4a97 MFC after: 1 week Sponsored by: NVIDIA Networking
* ibcore: Protect against concurrent access to hardware stats.Hans Petter Selasky2021-07-121-6/+28
| | | | | | | | | | | | | | Currently access to hardware stats buffer isn't protected, this can result in multiple writes and reads at the same time to the same memory location. This can lead to providing an incorrect value to the user. Add a mutex to protect against it. Linux commit: e945130b52bea65d15f9bdf54949d4cb7a88db7f MFC after: 1 week Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking
* ibcore: Do not expose unsupported counters.Hans Petter Selasky2021-07-121-7/+12
| | | | | | | | | | | | | | If the provider driver (such as rdma_rxe) doesn't support PMA counters, avoid exposing its directory similar to optional hw_counters directory. If core fails to read the PMA counter, return an error so that user can retry later if needed. Linux commit: 0f6ef65d1c6ec8deb5d0f11f86631ec4cfe8f22e MFC after: 1 week Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking
* ibcore: Introduce ib_port_phys_state enum.Hans Petter Selasky2021-07-121-10/+20
| | | | | | | | | | | | In order to improve readability, add ib_port_phys_state enum to replace the use of magic numbers. Linux commit: 72a7720fca37fec0daf295923f17ac5d88a613e1 MFC after: 1 week Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking
* ibcore: Fix unable to change lifespan entry for hw_counters.Hans Petter Selasky2021-07-121-1/+15
| | | | | | | | | | | | | | | | | | | | | This patch fixes the case where 'lifespan' entry of the hw_counters is not writable. Currently write callback is not exposed for for the hw_counters sysfs operation. Due to this, modifying lifespan value results into permission denied error in below example. echo 10 > /sys/class/infiniband/mlx5_0/ports/1/hw_counters/lifespan -bash: /sys/class/infiniband/mlx5_0/ports/1/hw_counters/lifespan: Permission denied This patch adds the hook to modify any attribute which implements store() operation. Linux commit: 79c4d80b43b8e43684894574a508a871f0c196bf MFC after: 1 week Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking
* ibcore: Move debug counters to be under relevant IB deviceHans Petter Selasky2021-07-121-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sysfs layout is created by CM incorrectly presented RDMA devices with InfiniBand link layer. Layout of such devices represents device tree of connections. By moving CM statistics to be under relevant port of IB device, we will fix the following issues: * Symlink name - It used device name instead of specific identifier. * Target location - It was supposed to point to PCI-ID/infiniband_cm/ instead of PCI-ID/infiniband/ * Target name - It created extra device file under already existing device folder, e.g. mlx5_0/mlx5_0 * Crash during boot with RDMA persistent naming patches. sysfs: cannot create duplicate filename '/class/infiniband_cm/mlx5_0' CPU: 29 PID: 433 Comm: modprobe Not tainted 5.0.0-rc5+ #178 Call Trace: dump_stack+0xcc/0x180 sysfs_warn_dup.cold.3+0x17/0x2d sysfs_do_create_link_sd.isra.2+0xd0/0xf0 device_add+0x7cb/0x1450 device_create_groups_vargs+0x1ae/0x220 device_create+0x93/0xc0 cm_add_one+0x38f/0xf60 [ib_cm] add_client_context+0x167/0x210 [ib_core] enable_device_and_get+0x230/0x3f0 [ib_core] ib_register_device+0x823/0xbf0 [ib_core] __mlx5_ib_add+0x45/0x150 [mlx5_ib] mlx5_ib_add+0x1b3/0x5e0 [mlx5_ib] mlx5_add_device+0x130/0x3a0 [mlx5_core] mlx5_register_interface+0x1a9/0x270 [mlx5_core] do_one_initcall+0x14f/0x5de do_init_module+0x247/0x7c0 load_module+0x4c2f/0x60d0 entry_SYSCALL_64_after_hwframe+0x49/0xbe After this change: [leonro@server ~]$ ls -al /sys/class/infiniband/ibp0s12f0/ports/1/ drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_rx_duplicates drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_rx_msgs drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_tx_msgs drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_tx_retries Linux commit: c87e65cfb97c7f325132a68288ed76ba7bdcd2c6 MFC after: 1 week Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking
* OFED: migrate LinuxKPI net_device/ifnet macros into ofedBjoern A. Zeeb2021-05-271-0/+1
| | | | | | | | | | | | The LinuxKPI net_device actually is an ifnet; in order to further clean that up so we can extend "net_device" migrate the few macros left into ofed and make sure the header is included in all files which need access to the macros. Sponsored by: The FreeBSD Foundation MFC after: 12 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D30477
* ibcore: Add support for IB_SPEED_HDR in sysfs rate printout.Slava Shwartsman2018-12-051-0/+5
| | | | | | | | | | Submitted by: hselasky@ Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341524
* Use __FBSDID() for RCS tags in ibcore.Hans Petter Selasky2018-07-171-2/+3
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=336391
* Add missing FreeBSD tags and SVN properties to ibcore.Hans Petter Selasky2018-03-051-1/+5
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=330490
* Initial RoCE/infiniband kernel update to Linux v4.9.Hans Petter Selasky2017-06-151-0/+1327
This patch currently supports: - ibcore as a kernel module only - krping as a kernel module only - ipoib as a kernel module only Sponsored by: Mellanox Technologies Notes: svn path=/projects/bsd_rdma_4_9/; revision=319974