[PATCH v3 12/19] dlb2: add port enable/disable ioctls

2020-09-01 Thread Gage Eads
The ioctls can be used to dynamically enable or disable scheduling to a port. (By default, ports start with their scheduling enabled.) Doing so allows software to, for example, quickly add/remove cores to/from a worker pool. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc

[PATCH v3 07/19] dlb2: add queue create and queue-depth-get ioctls

2020-09-01 Thread Gage Eads
, and while a directed queue has a 1:1 mapping with a directed port, load-balanced queues can be configured with a set of load-balanced ports that software desires the queue's QEs to be scheduled to. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/dlb2_ioctl.

[PATCH v3 06/19] dlb2: add runtime power-management support

2020-09-01 Thread Gage Eads
dware to a known good state. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/dlb2_main.c | 72 + drivers/misc/dlb2/dlb2_main.h | 2 ++ drivers/misc/dlb2/dlb2_pf_ops.c | 30 + 3 files changed, 104 inser

[PATCH v3 19/19] dlb2: add ingress error handling

2020-09-01 Thread Gage Eads
interface. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation/ABI/testing/sysfs-driver-dlb2 | 15 ++ drivers/misc/dlb2/dlb2_hw_types.h | 17 ++ drivers/misc/dlb2/dlb2_main.h | 16 ++ drivers/misc/dlb2/dlb2_pf_ops.c | 177

[PATCH v3 15/19] dlb2: add sequence-number management ioctls

2020-09-01 Thread Gage Eads
ancy. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 86 +++ drivers/misc/dlb2/dlb2_main.h | 3 ++ drivers/misc/dlb2/dlb2_pf_ops.c | 21 ++ drivers/misc/dlb2/dlb2_resource.c | 67

[PATCH v3 13/19] dlb2: add CQ interrupt support

2020-09-01 Thread Gage Eads
o block on the wait queue. A CQ's interrupt is enabled when its port is configured, and interrupts are enabled/disabled when a port is enabled/disabled. If a port is disabled and a thread is blocked on the wait queue, the thread is woken and returned to user-space. Signed-off-by: Gage Ea

[PATCH v3 00/19] dlb2: introduce DLB 2.0 device driver

2020-09-01 Thread Gage Eads
and Kconfig help text and remove unnecessary (R)s - Remove unnecessary prints - Add a new entry in ioctl-number.rst - Convert the ioctl handler into a switch statement - Correct some instances of IOWR that should have been IOR - Align macro blocks - Don't break ioctl ABI when introducing new comm

[PATCH v3 10/19] dlb2: add start domain ioctl

2020-09-01 Thread Gage Eads
Once a scheduling domain and its resources have been configured, the start domain ioctl is called to enable its ports to begin enqueueing to the device. Once started, the domain's resources cannot be configured again until after the domain is reset. Signed-off-by: Gage Eads Reviewed-by:

[PATCH v3 04/19] dlb2: add device ioctl layer and first three ioctls

2020-09-01 Thread Gage Eads
a subsequent commit. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- Documentation/userspace-api/ioctl/ioctl-number.rst | 1 + drivers/misc/dlb2/Makefile | 1 + drivers/misc/dlb2/dlb2_bitmap.h| 63 drivers/misc/dlb2/dlb2_ioctl.c

[PATCH v3 17/19] dlb2: add device FLR support

2020-09-01 Thread Gage Eads
guaranteed the device is unconfigured and won't write to memory. 3. Reset software and hardware state. 4. Notify VFs that the FLR is complete. (Added in a later commit.) 5. Set reset_active to false. 6. Unlock the resource mutex. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation

[PATCH v3 16/19] dlb2: add cos bandwidth get/set ioctls

2020-09-01 Thread Gage Eads
em as needed. These allocations are controlled by the PF driver; virtual devices, when support for them is added, will not be able to adjust them. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 54 +++ drivers/misc

[PATCH v3 03/19] dlb2: add resource and device initialization

2020-09-01 Thread Gage Eads
). This commit also introduces dlb2_bitmap_* functions, a thin convenience layer wrapping the Linux bitmap interfaces, used by the bitmaps in the dlb2 hardware types. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/Makefile| 7 +- drivers/misc/dlb2

[PATCH v3 08/19] dlb2: add ioctl to configure ports, query poll mode

2020-09-01 Thread Gage Eads
;poll mode". This (device-wide) mode is selected by the driver; to determine the mode at run time, the driver provides an ioctl for user-space software to query which mode the driver has configured. In this way, the policy of which mode to use is decoupled from user-space software. Signed-o

[PATCH v3 02/19] dlb2: initialize PF device

2020-09-01 Thread Gage Eads
The driver detects the device type (PF/VF) at probe time, and assigns the corresponding 'ops' callbacks from that. These callbacks include mapping and unmapping the PCI BAR space, creating/destroying the device, and adding/deleting a char device. Signed-off-by: Gage Eads Reviewed-

[PATCH v3 09/19] dlb2: add port mmap support

2020-09-01 Thread Gage Eads
yer uses a single inode that is shared with other kernel components -- calling unmap_mapping_range() on that shared inode would likely break the kernel. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/Makefile| 1 + drivers/misc/dlb2/dlb2_file.c

[PATCH v3 14/19] dlb2: add domain alert support

2020-09-01 Thread Gage Eads
. An application can read its domain alerts through the domain device file's read callback. Applications are expected to spawn a thread that performs a blocking read, and rarely (if ever) wakes and returns to user-space. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc

[PATCH v3 01/19] dlb2: add skeleton for DLB 2.0 driver

2020-09-01 Thread Gage Eads
This initial commit contains basic driver functionality (load, unload, probe, and remove callbacks) file_operations stubs, and device documentation as well. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- Documentation/misc-devices/dlb2.rst | 310

[PATCH v3 11/19] dlb2: add queue map and unmap ioctls

2020-09-01 Thread Gage Eads
his commit also adds a pending-port-unmaps ioctl, that user-space can call to query how many pending/outstanding unmap operations exist for a given port. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 9 + drivers/misc/dlb2/dlb2_main.h | 14 + d

[PATCH v3 18/19] dlb2: add basic PF sysfs interfaces

2020-09-01 Thread Gage Eads
These interfaces include files for reading the total and available device resources, getting and setting sequence number group allocations, and reading the device ID. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation/ABI/testing/sysfs-driver-dlb2 | 165 +++ drivers

[PATCH v2 13/19] dlb2: add CQ interrupt support

2020-08-11 Thread Gage Eads
o block on the wait queue. A CQ's interrupt is enabled when its port is configured, and interrupts are enabled/disabled when a port is enabled/disabled. If a port is disabled and a thread is blocked on the wait queue, the thread is woken and returned to user-space. Signed-off-by: Gage Ea

[PATCH v2 09/19] dlb2: add port mmap support

2020-08-11 Thread Gage Eads
yer uses a single inode that is shared with other kernel components -- calling unmap_mapping_range() on that shared inode would likely break the kernel. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/Makefile| 1 + drivers/misc/dlb2/dlb2_file.c

[PATCH v2 12/19] dlb2: add port enable/disable ioctls

2020-08-11 Thread Gage Eads
The ioctls can be used to dynamically enable or disable scheduling to a port. (By default, ports start with their scheduling enabled.) Doing so allows software to, for example, quickly add/remove cores to/from a worker pool. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc

[PATCH v2 11/19] dlb2: add queue map and unmap ioctls

2020-08-11 Thread Gage Eads
his commit also adds a pending-port-unmaps ioctl, that user-space can call to query how many pending/outstanding unmap operations exist for a given port. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 9 + drivers/misc/dlb2/dlb2_main.h | 14 + d

[PATCH v2 16/19] dlb2: add cos bandwidth get/set ioctls

2020-08-11 Thread Gage Eads
em as needed. These allocations are controlled by the PF driver; virtual devices, when support for them is added, will not be able to adjust them. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 54 +++ drivers/misc

[PATCH v2 17/19] dlb2: add device FLR support

2020-08-11 Thread Gage Eads
guaranteed the device is unconfigured and won't write to memory. 3. Reset software and hardware state. 4. Notify VFs that the FLR is complete. (Added in a later commit.) 5. Set reset_active to false. 6. Unlock the resource mutex. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation

[PATCH v2 18/19] dlb2: add basic PF sysfs interfaces

2020-08-11 Thread Gage Eads
These interfaces include files for reading the total and available device resources, getting and setting sequence number group allocations, and reading the device ID. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation/ABI/testing/sysfs-driver-dlb2 | 165 +++ drivers

[PATCH v2 19/19] dlb2: add ingress error handling

2020-08-11 Thread Gage Eads
interface. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation/ABI/testing/sysfs-driver-dlb2 | 15 ++ drivers/misc/dlb2/dlb2_hw_types.h | 17 ++ drivers/misc/dlb2/dlb2_main.h | 16 ++ drivers/misc/dlb2/dlb2_pf_ops.c | 177

[PATCH v2 14/19] dlb2: add domain alert support

2020-08-11 Thread Gage Eads
. An application can read its domain alerts through the domain device file's read callback. Applications are expected to spawn a thread that performs a blocking read, and rarely (if ever) wakes and returns to user-space. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc

[PATCH v2 15/19] dlb2: add sequence-number management ioctls

2020-08-11 Thread Gage Eads
ancy. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 86 +++ drivers/misc/dlb2/dlb2_main.h | 3 ++ drivers/misc/dlb2/dlb2_pf_ops.c | 21 ++ drivers/misc/dlb2/dlb2_resource.c | 67

[PATCH v2 07/19] dlb2: add queue create and queue-depth-get ioctls

2020-08-11 Thread Gage Eads
, and while a directed queue has a 1:1 mapping with a directed port, load-balanced queues can be configured with a set of load-balanced ports that software desires the queue's QEs to be scheduled to. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/dlb2_ioctl.

[PATCH v2 08/19] dlb2: add ioctl to configure ports, query poll mode

2020-08-11 Thread Gage Eads
;poll mode". This (device-wide) mode is selected by the driver; to determine the mode at run time, the driver provides an ioctl for user-space software to query which mode the driver has configured. In this way, the policy of which mode to use is decoupled from user-space software. Signed-o

[PATCH v2 03/19] dlb2: add resource and device initialization

2020-08-11 Thread Gage Eads
). This commit also introduces dlb2_bitmap_* functions, a thin convenience layer wrapping the Linux bitmap interfaces, used by the bitmaps in the dlb2 hardware types. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/Makefile| 7 +- drivers/misc/dlb2

[PATCH v2 04/19] dlb2: add device ioctl layer and first three ioctls

2020-08-11 Thread Gage Eads
a subsequent commit. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- Documentation/userspace-api/ioctl/ioctl-number.rst | 1 + drivers/misc/dlb2/Makefile | 1 + drivers/misc/dlb2/dlb2_bitmap.h| 63 drivers/misc/dlb2/dlb2_ioctl.c

[PATCH v2 06/19] dlb2: add runtime power-management support

2020-08-11 Thread Gage Eads
dware to a known good state. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/dlb2_main.c | 72 + drivers/misc/dlb2/dlb2_main.h | 2 ++ drivers/misc/dlb2/dlb2_pf_ops.c | 30 + 3 files changed, 104 inser

[PATCH v2 00/19] dlb2: introduce DLB 2.0 device driver

2020-08-11 Thread Gage Eads
ry (R)s - Remove unnecessary prints - Add a new entry in ioctl-number.rst - Convert the ioctl handler into a switch statement - Correct some instances of IOWR that should have been IOR - Align macro blocks - Don't break ioctl ABI when introducing new commands - Remove indirect pointers from ioctl

[PATCH v2 01/19] dlb2: add skeleton for DLB 2.0 driver

2020-08-11 Thread Gage Eads
This initial commit contains basic driver functionality (load, unload, probe, and remove callbacks) file_operations stubs, and device documentation as well. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- Documentation/misc-devices/dlb2.rst | 310

[PATCH v2 10/19] dlb2: add start domain ioctl

2020-08-11 Thread Gage Eads
Once a scheduling domain and its resources have been configured, the start domain ioctl is called to enable its ports to begin enqueueing to the device. Once started, the domain's resources cannot be configured again until after the domain is reset. Signed-off-by: Gage Eads Reviewed-by:

[PATCH v2 02/19] dlb2: initialize PF device

2020-08-11 Thread Gage Eads
The driver detects the device type (PF/VF) at probe time, and assigns the corresponding 'ops' callbacks from that. These callbacks include mapping and unmapping the PCI BAR space, creating/destroying the device, and adding/deleting a char device. Signed-off-by: Gage Eads Reviewed-

[PATCH 09/20] dlb2: add ioctl to configure ports, query poll mode

2020-07-12 Thread Gage Eads
;poll mode". This (device-wide) mode is selected by the driver; to determine the mode at run time, the driver provides an ioctl for user-space software to query which mode the driver has configured. In this way, the policy of which mode to use is decoupled from user-space software. Signed-o

[PATCH 12/20] dlb2: add queue map and unmap ioctls

2020-07-12 Thread Gage Eads
his commit also adds a pending-port-unmaps ioctl, that user-space can call to query how many pending/outstanding unmap operations exist for a given port. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 6 + drivers/misc/dlb2/dlb2_main.h | 14 + d

[PATCH 19/20] dlb2: add basic PF sysfs interfaces

2020-07-12 Thread Gage Eads
These interfaces include files for reading the total and available device resources, getting and setting sequence number group allocations, and reading the device ID. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation/ABI/testing/sysfs-driver-dlb2 | 165 +++ drivers

[PATCH 08/20] dlb2: add queue create and queue-depth-get ioctls

2020-07-12 Thread Gage Eads
, and while a directed queue has a 1:1 mapping with a directed port, load-balanced queues can be configured with a set of load-balanced ports that software desires the queue's QEs to be scheduled to. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/dlb2_ioctl.

[PATCH 18/20] dlb2: add device FLR support

2020-07-12 Thread Gage Eads
guaranteed the device is unconfigured and won't write to memory. 3. Reset software and hardware state. 4. Notify VFs that the FLR is complete. (Added in a later commit.) 5. Set reset_active to false. 6. Unlock the resource mutex. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation

[PATCH 20/20] dlb2: add ingress error handling

2020-07-12 Thread Gage Eads
interface. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- Documentation/ABI/testing/sysfs-driver-dlb2 | 15 ++ drivers/misc/dlb2/dlb2_hw_types.h | 17 ++ drivers/misc/dlb2/dlb2_main.h | 16 ++ drivers/misc/dlb2/dlb2_pf_ops.c | 177

[PATCH 13/20] dlb2: add port enable/disable ioctls

2020-07-12 Thread Gage Eads
The ioctls can be used to dynamically enable or disable scheduling to a port. (By default, ports start with their scheduling enabled.) Doing so allows software to, for example, quickly add/remove cores to/from a worker pool. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc

[PATCH 14/20] dlb2: add CQ interrupt support

2020-07-12 Thread Gage Eads
o block on the wait queue. A CQ's interrupt is enabled when its port is configured, and interrupts are enabled/disabled when a port is enabled/disabled. If a port is disabled and a thread is blocked on the wait queue, the thread is woken and returned to user-space. Signed-off-by: Gage Ea

[PATCH 16/20] dlb2: add sequence-number management ioctls

2020-07-12 Thread Gage Eads
ancy. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 116 ++ drivers/misc/dlb2/dlb2_main.h | 3 + drivers/misc/dlb2/dlb2_pf_ops.c | 21 +++ drivers/misc/dlb2/dlb2_resource.c | 67 +

[PATCH 17/20] dlb2: add cos bandwidth get/set ioctls

2020-07-12 Thread Gage Eads
em as needed. These allocations are controlled by the PF driver; virtual devices, when support for them is added, will not be able to adjust them. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc/dlb2/dlb2_ioctl.c| 76 +++ drivers/misc

[PATCH 10/20] dlb2: add port mmap support

2020-07-12 Thread Gage Eads
yer uses a single inode that is shared with other kernel components -- calling unmap_mapping_range() on that shared inode would likely break the kernel. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/Makefile| 1 + drivers/misc/dlb2/dlb2_file.c

[PATCH 15/20] dlb2: add domain alert support

2020-07-12 Thread Gage Eads
. An application can read its domain alerts through the domain device file's read callback. Applications are expected to spawn a thread that performs a blocking read, and rarely (if ever) wakes and returns to user-space. Signed-off-by: Gage Eads Reviewed-by: Björn Töpel --- drivers/misc

[PATCH 04/20] dlb2: add device ioctl layer and first 4 ioctls

2020-07-12 Thread Gage Eads
creation will be added in a subsequent commit. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/Makefile| 1 + drivers/misc/dlb2/dlb2_bitmap.h | 63 ++ drivers/misc/dlb2/dlb2_ioctl.c| 186 ++ drivers/misc/dlb2

[PATCH 11/20] dlb2: add start domain ioctl

2020-07-12 Thread Gage Eads
Once a scheduling domain and its resources have been configured, the start domain ioctl is called to enable its ports to begin enqueueing to the device. Once started, the domain's resources cannot be configured again until after the domain is reset. Signed-off-by: Gage Eads Reviewed-by:

[PATCH 06/20] dlb2: add ioctl to get sched domain fd

2020-07-12 Thread Gage Eads
ultiple virtual functions -- and thus multiple /dev/dlb nodes -- each using unique file permissions. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/dlb2_ioctl.c | 68 ++ include/uapi/linux/dlb2_user.h | 30 +++

[PATCH 03/20] dlb2: add resource and device initialization

2020-07-12 Thread Gage Eads
). This commit also introduces dlb2_bitmap_* functions, a thin convenience layer wrapping the Linux bitmap interfaces, used by the bitmaps in the dlb2 hardware types. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/Makefile| 7 +- drivers/misc/dlb2

[PATCH 07/20] dlb2: add runtime power-management support

2020-07-12 Thread Gage Eads
dware to a known good state. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- drivers/misc/dlb2/dlb2_ioctl.c | 2 ++ drivers/misc/dlb2/dlb2_main.c | 79 + drivers/misc/dlb2/dlb2_main.h | 2 ++ drivers/misc/dlb2/dlb2_pf_ops.c

[PATCH 02/20] dlb2: initialize PF device

2020-07-12 Thread Gage Eads
The driver detects the device type (PF/VF) at probe time, and assigns the corresponding 'ops' callbacks from that. These callbacks include mapping and unmapping the PCI BAR space, creating/destroying the device, and adding/deleting a char device. Signed-off-by: Gage Eads Reviewed-

[PATCH 01/20] dlb2: add skeleton for DLB 2.0 driver

2020-07-12 Thread Gage Eads
This initial commit contains basic driver functionality (load, unload, probe, and remove callbacks) file_operations stubs, and device documentation as well. Signed-off-by: Gage Eads Reviewed-by: Magnus Karlsson --- Documentation/misc-devices/dlb2.rst | 313

[PATCH 00/20] dlb2: introduce DLB 2.0 device driver

2020-07-12 Thread Gage Eads
yle corrections (multi-line comments, header order, etc.) - Add device and software documentation (dlb2.rst) - Use dyndbg for debug messages - Refactor mmap and device file architecture - Use ida library for ID management - Fill data structure holes - Add missing static keyword for various fu