xref: /dpdk/drivers/event/dlb2/dlb2_user.h (revision e3191f1078492c40cbd0da51cca9eaa10a116b94)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016-2020 Intel Corporation
3  */
4 
5 #ifndef __DLB2_USER_H
6 #define __DLB2_USER_H
7 
8 #define DLB2_MAX_NAME_LEN 64
9 
10 #include <linux/types.h>
11 
12 enum dlb2_error {
13 	DLB2_ST_SUCCESS = 0,
14 	DLB2_ST_NAME_EXISTS,
15 	DLB2_ST_DOMAIN_UNAVAILABLE,
16 	DLB2_ST_LDB_PORTS_UNAVAILABLE,
17 	DLB2_ST_DIR_PORTS_UNAVAILABLE,
18 	DLB2_ST_LDB_QUEUES_UNAVAILABLE,
19 	DLB2_ST_LDB_CREDITS_UNAVAILABLE,
20 	DLB2_ST_DIR_CREDITS_UNAVAILABLE,
21 	DLB2_ST_CREDITS_UNAVAILABLE,
22 	DLB2_ST_SEQUENCE_NUMBERS_UNAVAILABLE,
23 	DLB2_ST_INVALID_DOMAIN_ID,
24 	DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION,
25 	DLB2_ST_ATOMIC_INFLIGHTS_UNAVAILABLE,
26 	DLB2_ST_HIST_LIST_ENTRIES_UNAVAILABLE,
27 	DLB2_ST_INVALID_LDB_QUEUE_ID,
28 	DLB2_ST_INVALID_CQ_DEPTH,
29 	DLB2_ST_INVALID_CQ_VIRT_ADDR,
30 	DLB2_ST_INVALID_PORT_ID,
31 	DLB2_ST_INVALID_QID,
32 	DLB2_ST_INVALID_PRIORITY,
33 	DLB2_ST_NO_QID_SLOTS_AVAILABLE,
34 	DLB2_ST_INVALID_DIR_QUEUE_ID,
35 	DLB2_ST_DIR_QUEUES_UNAVAILABLE,
36 	DLB2_ST_DOMAIN_NOT_CONFIGURED,
37 	DLB2_ST_INTERNAL_ERROR,
38 	DLB2_ST_DOMAIN_IN_USE,
39 	DLB2_ST_DOMAIN_NOT_FOUND,
40 	DLB2_ST_QUEUE_NOT_FOUND,
41 	DLB2_ST_DOMAIN_STARTED,
42 	DLB2_ST_DOMAIN_NOT_STARTED,
43 	DLB2_ST_LDB_PORT_REQUIRED_FOR_LDB_QUEUES,
44 	DLB2_ST_DOMAIN_RESET_FAILED,
45 	DLB2_ST_MBOX_ERROR,
46 	DLB2_ST_INVALID_HIST_LIST_DEPTH,
47 	DLB2_ST_NO_MEMORY,
48 	DLB2_ST_INVALID_LOCK_ID_COMP_LEVEL,
49 	DLB2_ST_INVALID_COS_ID,
50 	DLB2_ST_INVALID_CQ_WEIGHT_LIMIT,
51 	DLB2_ST_FEATURE_UNAVAILABLE,
52 };
53 
54 static const char dlb2_error_strings[][128] = {
55 	"DLB2_ST_SUCCESS",
56 	"DLB2_ST_NAME_EXISTS",
57 	"DLB2_ST_DOMAIN_UNAVAILABLE",
58 	"DLB2_ST_LDB_PORTS_UNAVAILABLE",
59 	"DLB2_ST_DIR_PORTS_UNAVAILABLE",
60 	"DLB2_ST_LDB_QUEUES_UNAVAILABLE",
61 	"DLB2_ST_LDB_CREDITS_UNAVAILABLE",
62 	"DLB2_ST_DIR_CREDITS_UNAVAILABLE",
63 	"DLB2_ST_CREDITS_UNAVAILABLE",
64 	"DLB2_ST_SEQUENCE_NUMBERS_UNAVAILABLE",
65 	"DLB2_ST_INVALID_DOMAIN_ID",
66 	"DLB2_ST_INVALID_QID_INFLIGHT_ALLOCATION",
67 	"DLB2_ST_ATOMIC_INFLIGHTS_UNAVAILABLE",
68 	"DLB2_ST_HIST_LIST_ENTRIES_UNAVAILABLE",
69 	"DLB2_ST_INVALID_LDB_QUEUE_ID",
70 	"DLB2_ST_INVALID_CQ_DEPTH",
71 	"DLB2_ST_INVALID_CQ_VIRT_ADDR",
72 	"DLB2_ST_INVALID_PORT_ID",
73 	"DLB2_ST_INVALID_QID",
74 	"DLB2_ST_INVALID_PRIORITY",
75 	"DLB2_ST_NO_QID_SLOTS_AVAILABLE",
76 	"DLB2_ST_INVALID_DIR_QUEUE_ID",
77 	"DLB2_ST_DIR_QUEUES_UNAVAILABLE",
78 	"DLB2_ST_DOMAIN_NOT_CONFIGURED",
79 	"DLB2_ST_INTERNAL_ERROR",
80 	"DLB2_ST_DOMAIN_IN_USE",
81 	"DLB2_ST_DOMAIN_NOT_FOUND",
82 	"DLB2_ST_QUEUE_NOT_FOUND",
83 	"DLB2_ST_DOMAIN_STARTED",
84 	"DLB2_ST_DOMAIN_NOT_STARTED",
85 	"DLB2_ST_LDB_PORT_REQUIRED_FOR_LDB_QUEUES",
86 	"DLB2_ST_DOMAIN_RESET_FAILED",
87 	"DLB2_ST_MBOX_ERROR",
88 	"DLB2_ST_INVALID_HIST_LIST_DEPTH",
89 	"DLB2_ST_NO_MEMORY",
90 	"DLB2_ST_INVALID_LOCK_ID_COMP_LEVEL",
91 	"DLB2_ST_INVALID_COS_ID",
92 	"DLB2_ST_INVALID_CQ_WEIGHT_LIMIT",
93 	"DLB2_ST_FEATURE_UNAVAILABLE",
94 };
95 
96 struct dlb2_cmd_response {
97 	__u32 status; /* Interpret using enum dlb2_error */
98 	__u32 id;
99 };
100 
101 /*******************/
102 /* 'dlb2' commands */
103 /*******************/
104 
105 #define DLB2_DEVICE_VERSION(x) (((x) >> 8) & 0xFF)
106 #define DLB2_DEVICE_REVISION(x) ((x) & 0xFF)
107 
108 enum dlb2_revisions {
109 	DLB2_REV_A0 = 0,
110 };
111 
112 /*
113  * DLB2_CMD_GET_DEVICE_VERSION: Query the DLB device version.
114  *
115  *	This ioctl interface is the same in all driver versions and is always
116  *	the first ioctl.
117  *
118  * Output parameters:
119  * - response.status: Detailed error code. In certain cases, such as if the
120  *	ioctl request arg is invalid, the driver won't set status.
121  * - response.id[7:0]: Device revision.
122  * - response.id[15:8]: Device version.
123  */
124 
125 struct dlb2_get_device_version_args {
126 	/* Output parameters */
127 	struct dlb2_cmd_response response;
128 };
129 
130 /*
131  * DLB2_CMD_CREATE_SCHED_DOMAIN: Create a DLB 2.0 scheduling domain and reserve
132  *	its hardware resources. This command returns the newly created domain
133  *	ID and a file descriptor for accessing the domain.
134  *
135  * Input parameters:
136  * - num_ldb_queues: Number of load-balanced queues.
137  * - num_ldb_ports: Number of load-balanced ports that can be allocated from
138  *	any class-of-service with available ports.
139  * - num_cos_ldb_ports[4]: Number of load-balanced ports from
140  *	classes-of-service 0-3.
141  * - num_dir_ports: Number of directed ports. A directed port has one directed
142  *	queue, so no num_dir_queues argument is necessary.
143  * - num_atomic_inflights: This specifies the amount of temporary atomic QE
144  *	storage for the domain. This storage is divided among the domain's
145  *	load-balanced queues that are configured for atomic scheduling.
146  * - num_hist_list_entries: Amount of history list storage. This is divided
147  *	among the domain's CQs.
148  * - num_ldb_credits: Amount of load-balanced QE storage (QED). QEs occupy this
149  *	space until they are scheduled to a load-balanced CQ. One credit
150  *	represents the storage for one QE.
151  * - num_dir_credits: Amount of directed QE storage (DQED). QEs occupy this
152  *	space until they are scheduled to a directed CQ. One credit represents
153  *	the storage for one QE.
154  * - cos_strict: If set, return an error if there are insufficient ports in
155  *	class-of-service N to satisfy the num_ldb_ports_cosN argument. If
156  *	unset, attempt to fulfill num_ldb_ports_cosN arguments from other
157  *	classes-of-service if class N does not contain enough free ports.
158  * - padding1: Reserved for future use.
159  *
160  * Output parameters:
161  * - response.status: Detailed error code. In certain cases, such as if the
162  *	ioctl request arg is invalid, the driver won't set status.
163  * - response.id: domain ID.
164  * - domain_fd: file descriptor for performing the domain's ioctl operations
165  * - padding0: Reserved for future use.
166  */
167 struct dlb2_create_sched_domain_args {
168 	/* Output parameters */
169 	struct dlb2_cmd_response response;
170 	__u32 domain_fd;
171 	__u32 padding0;
172 	/* Input parameters */
173 	__u32 num_ldb_queues;
174 	__u32 num_ldb_ports;
175 	__u32 num_cos_ldb_ports[4];
176 	__u32 num_dir_ports;
177 	__u32 num_atomic_inflights;
178 	__u32 num_hist_list_entries;
179 	union {
180 		struct {
181 			__u32 num_ldb_credits;
182 			__u32 num_dir_credits;
183 		};
184 		struct {
185 			__u32 num_credits;
186 		};
187 	};
188 	__u8 cos_strict;
189 	__u8 padding1[3];
190 };
191 
192 /*
193  * DLB2_CMD_GET_NUM_RESOURCES: Return the number of available resources
194  *	(queues, ports, etc.) that this device owns.
195  *
196  * Output parameters:
197  * - num_domains: Number of available scheduling domains.
198  * - num_ldb_queues: Number of available load-balanced queues.
199  * - num_ldb_ports: Total number of available load-balanced ports.
200  * - num_cos_ldb_ports[4]: Number of available load-balanced ports from
201  *	classes-of-service 0-3.
202  * - num_dir_ports: Number of available directed ports. There is one directed
203  *	queue for every directed port.
204  * - num_atomic_inflights: Amount of available temporary atomic QE storage.
205  * - num_hist_list_entries: Amount of history list storage.
206  * - max_contiguous_hist_list_entries: History list storage is allocated in
207  *	a contiguous chunk, and this return value is the longest available
208  *	contiguous range of history list entries.
209  * - num_ldb_credits: Amount of available load-balanced QE storage.
210  * - num_dir_credits: Amount of available directed QE storage.
211  * - response.status: Detailed error code. In certain cases, such as if the
212  *	ioctl request arg is invalid, the driver won't set status.
213  */
214 struct dlb2_get_num_resources_args {
215 	/* Output parameters */
216 	struct dlb2_cmd_response response;
217 	__u32 num_sched_domains;
218 	__u32 num_ldb_queues;
219 	__u32 num_ldb_ports;
220 	__u32 num_cos_ldb_ports[4];
221 	__u32 num_dir_ports;
222 	__u32 num_atomic_inflights;
223 	__u32 num_hist_list_entries;
224 	__u32 max_contiguous_hist_list_entries;
225 	union {
226 		struct {
227 			__u32 num_ldb_credits;
228 			__u32 num_dir_credits;
229 		};
230 		struct {
231 			__u32 num_credits;
232 		};
233 	};
234 };
235 
236 /*
237  * DLB2_CMD_SET_SN_ALLOCATION: Configure a sequence number group (PF only)
238  *
239  * Input parameters:
240  * - group: Sequence number group ID.
241  * - num: Number of sequence numbers per queue.
242  *
243  * Output parameters:
244  * - response.status: Detailed error code. In certain cases, such as if the
245  *	ioctl request arg is invalid, the driver won't set status.
246  */
247 struct dlb2_set_sn_allocation_args {
248 	/* Output parameters */
249 	struct dlb2_cmd_response response;
250 	/* Input parameters */
251 	__u32 group;
252 	__u32 num;
253 };
254 
255 /*
256  * DLB2_CMD_GET_SN_ALLOCATION: Get a sequence number group's configuration
257  *
258  * Input parameters:
259  * - group: Sequence number group ID.
260  * - padding0: Reserved for future use.
261  *
262  * Output parameters:
263  * - response.status: Detailed error code. In certain cases, such as if the
264  *	ioctl request arg is invalid, the driver won't set status.
265  * - response.id: Specified group's number of sequence numbers per queue.
266  */
267 struct dlb2_get_sn_allocation_args {
268 	/* Output parameters */
269 	struct dlb2_cmd_response response;
270 	/* Input parameters */
271 	__u32 group;
272 	__u32 padding0;
273 };
274 
275 /*
276  * DLB2_CMD_SET_COS_BW: Set a bandwidth allocation percentage for a
277  *	load-balanced port class-of-service (PF only).
278  *
279  * Input parameters:
280  * - cos_id: class-of-service ID, between 0 and 3 (inclusive).
281  * - bandwidth: class-of-service bandwidth percentage. Total bandwidth
282  *		percentages across all 4 classes cannot exceed 100%.
283  *
284  * Output parameters:
285  * - response.status: Detailed error code. In certain cases, such as if the
286  *	ioctl request arg is invalid, the driver won't set status.
287  */
288 struct dlb2_set_cos_bw_args {
289 	/* Output parameters */
290 	struct dlb2_cmd_response response;
291 	/* Input parameters */
292 	__u32 cos_id;
293 	__u32 bandwidth;
294 };
295 
296 /*
297  * DLB2_CMD_GET_COS_BW: Get the bandwidth allocation percentage for a
298  *	load-balanced port class-of-service.
299  *
300  * Input parameters:
301  * - cos_id: class-of-service ID, between 0 and 3 (inclusive).
302  * - padding0: Reserved for future use.
303  *
304  * Output parameters:
305  * - response.status: Detailed error code. In certain cases, such as if the
306  *	ioctl request arg is invalid, the driver won't set status.
307  * - response.id: Specified class's bandwidth percentage.
308  */
309 struct dlb2_get_cos_bw_args {
310 	/* Output parameters */
311 	struct dlb2_cmd_response response;
312 	/* Input parameters */
313 	__u32 cos_id;
314 	__u32 padding0;
315 };
316 
317 /*
318  * DLB2_CMD_GET_SN_OCCUPANCY: Get a sequence number group's occupancy
319  *
320  * Each sequence number group has one or more slots, depending on its
321  * configuration. I.e.:
322  * - If configured for 1024 sequence numbers per queue, the group has 1 slot
323  * - If configured for 512 sequence numbers per queue, the group has 2 slots
324  *   ...
325  * - If configured for 32 sequence numbers per queue, the group has 32 slots
326  *
327  * This ioctl returns the group's number of in-use slots. If its occupancy is
328  * 0, the group's sequence number allocation can be reconfigured.
329  *
330  * Input parameters:
331  * - group: Sequence number group ID.
332  * - padding0: Reserved for future use.
333  *
334  * Output parameters:
335  * - response.status: Detailed error code. In certain cases, such as if the
336  *	ioctl request arg is invalid, the driver won't set status.
337  * - response.id: Specified group's number of used slots.
338  */
339 struct dlb2_get_sn_occupancy_args {
340 	/* Output parameters */
341 	struct dlb2_cmd_response response;
342 	/* Input parameters */
343 	__u32 group;
344 	__u32 padding0;
345 };
346 
347 enum dlb2_cq_poll_modes {
348 	DLB2_CQ_POLL_MODE_STD,
349 	DLB2_CQ_POLL_MODE_SPARSE,
350 
351 	/* NUM_DLB2_CQ_POLL_MODE must be last */
352 	NUM_DLB2_CQ_POLL_MODE,
353 };
354 
355 /*
356  * DLB2_CMD_QUERY_CQ_POLL_MODE: Query the CQ poll mode setting
357  *
358  * Output parameters:
359  * - response.status: Detailed error code. In certain cases, such as if the
360  *	ioctl request arg is invalid, the driver won't set status.
361  * - response.id: CQ poll mode (see enum dlb2_cq_poll_modes).
362  */
363 struct dlb2_query_cq_poll_mode_args {
364 	/* Output parameters */
365 	struct dlb2_cmd_response response;
366 };
367 
368 /********************************/
369 /* 'scheduling domain' commands */
370 /********************************/
371 
372 /*
373  * DLB2_DOMAIN_CMD_CREATE_LDB_QUEUE: Configure a load-balanced queue.
374  * Input parameters:
375  * - num_atomic_inflights: This specifies the amount of temporary atomic QE
376  *	storage for this queue. If zero, the queue will not support atomic
377  *	scheduling.
378  * - num_sequence_numbers: This specifies the number of sequence numbers used
379  *	by this queue. If zero, the queue will not support ordered scheduling.
380  *	If non-zero, the queue will not support unordered scheduling.
381  * - num_qid_inflights: The maximum number of QEs that can be inflight
382  *	(scheduled to a CQ but not completed) at any time. If
383  *	num_sequence_numbers is non-zero, num_qid_inflights must be set equal
384  *	to num_sequence_numbers.
385  * - lock_id_comp_level: Lock ID compression level. Specifies the number of
386  *	unique lock IDs the queue should compress down to. Valid compression
387  *	levels: 0, 64, 128, 256, 512, 1k, 2k, 4k, 64k. If lock_id_comp_level is
388  *	0, the queue won't compress its lock IDs.
389  * - depth_threshold: DLB sets two bits in the received QE to indicate the
390  *	depth of the queue relative to the threshold before scheduling the
391  *	QE to a CQ:
392  *	- 2’b11: depth > threshold
393  *	- 2’b10: threshold >= depth > 0.75 * threshold
394  *	- 2’b01: 0.75 * threshold >= depth > 0.5 * threshold
395  *	- 2’b00: depth <= 0.5 * threshold
396  * - padding0: Reserved for future use.
397  *
398  * Output parameters:
399  * - response.status: Detailed error code. In certain cases, such as if the
400  *	ioctl request arg is invalid, the driver won't set status.
401  * - response.id: Queue ID.
402  */
403 struct dlb2_create_ldb_queue_args {
404 	/* Output parameters */
405 	struct dlb2_cmd_response response;
406 	/* Input parameters */
407 	__u32 num_sequence_numbers;
408 	__u32 num_qid_inflights;
409 	__u32 num_atomic_inflights;
410 	__u32 lock_id_comp_level;
411 	__u32 depth_threshold;
412 	__u32 padding0;
413 };
414 
415 /*
416  * DLB2_DOMAIN_CMD_CREATE_DIR_QUEUE: Configure a directed queue.
417  * Input parameters:
418  * - port_id: Port ID. If the corresponding directed port is already created,
419  *	specify its ID here. Else this argument must be 0xFFFFFFFF to indicate
420  *	that the queue is being created before the port.
421  * - depth_threshold: DLB sets two bits in the received QE to indicate the
422  *	depth of the queue relative to the threshold before scheduling the
423  *	QE to a CQ:
424  *	- 2’b11: depth > threshold
425  *	- 2’b10: threshold >= depth > 0.75 * threshold
426  *	- 2’b01: 0.75 * threshold >= depth > 0.5 * threshold
427  *	- 2’b00: depth <= 0.5 * threshold
428  *
429  * Output parameters:
430  * - response.status: Detailed error code. In certain cases, such as if the
431  *	ioctl request arg is invalid, the driver won't set status.
432  * - response.id: Queue ID.
433  */
434 struct dlb2_create_dir_queue_args {
435 	/* Output parameters */
436 	struct dlb2_cmd_response response;
437 	/* Input parameters */
438 	__s32 port_id;
439 	__u32 depth_threshold;
440 };
441 
442 /*
443  * DLB2_DOMAIN_CMD_CREATE_LDB_PORT: Configure a load-balanced port.
444  * Input parameters:
445  * - cq_depth: Depth of the port's CQ. Must be a power-of-two between 8 and
446  *	1024, inclusive.
447  * - cq_depth_threshold: CQ depth interrupt threshold. A value of N means that
448  *	the CQ interrupt won't fire until there are N or more outstanding CQ
449  *	tokens.
450  * - num_hist_list_entries: Number of history list entries. This must be
451  *	greater than or equal cq_depth.
452  * - cos_id: class-of-service to allocate this port from. Must be between 0 and
453  *	3, inclusive. Should be 255 if default.
454  * - cos_strict: If set, return an error if there are no available ports in the
455  *	requested class-of-service. Else, allocate the port from a different
456  *	class-of-service if the requested class has no available ports.
457  *
458  * - padding0: Reserved for future use.
459  *
460  * Output parameters:
461  * - response.status: Detailed error code. In certain cases, such as if the
462  *	ioctl request arg is invalid, the driver won't set status.
463  * - response.id: port ID.
464  */
465 
466 struct dlb2_create_ldb_port_args {
467 	/* Output parameters */
468 	struct dlb2_cmd_response response;
469 	/* Input parameters */
470 	__u16 cq_depth;
471 	__u16 cq_depth_threshold;
472 	__u16 cq_history_list_size;
473 	__u8 cos_id;
474 	__u8 cos_strict;
475 };
476 
477 /*
478  * DLB2_DOMAIN_CMD_CREATE_DIR_PORT: Configure a directed port.
479  * Input parameters:
480  * - cq_depth: Depth of the port's CQ. Must be a power-of-two between 8 and
481  *	1024, inclusive.
482  * - cq_depth_threshold: CQ depth interrupt threshold. A value of N means that
483  *	the CQ interrupt won't fire until there are N or more outstanding CQ
484  *	tokens.
485  * - qid: Queue ID. If the corresponding directed queue is already created,
486  *	specify its ID here. Else this argument must be 0xFFFFFFFF to indicate
487  *	that the port is being created before the queue.
488  *
489  * Output parameters:
490  * - response.status: Detailed error code. In certain cases, such as if the
491  *	ioctl request arg is invalid, the driver won't set status.
492  * - response.id: Port ID.
493  */
494 struct dlb2_create_dir_port_args {
495 	/* Output parameters */
496 	struct dlb2_cmd_response response;
497 	/* Input parameters */
498 	__u16 cq_depth;
499 	__u16 cq_depth_threshold;
500 	__s32 queue_id;
501 	__u8 is_producer;
502 };
503 
504 /*
505  * DLB2_DOMAIN_CMD_START_DOMAIN: Mark the end of the domain configuration. This
506  *	must be called before passing QEs into the device, and no configuration
507  *	ioctls can be issued once the domain has started. Sending QEs into the
508  *	device before calling this ioctl will result in undefined behavior.
509  * Input parameters:
510  * - (None)
511  *
512  * Output parameters:
513  * - response.status: Detailed error code. In certain cases, such as if the
514  *	ioctl request arg is invalid, the driver won't set status.
515  */
516 struct dlb2_start_domain_args {
517 	/* Output parameters */
518 	struct dlb2_cmd_response response;
519 };
520 
521 /*
522  * DLB2_DOMAIN_CMD_MAP_QID: Map a load-balanced queue to a load-balanced port.
523  * Input parameters:
524  * - port_id: Load-balanced port ID.
525  * - qid: Load-balanced queue ID.
526  * - priority: Queue->port service priority.
527  * - padding0: Reserved for future use.
528  *
529  * Output parameters:
530  * - response.status: Detailed error code. In certain cases, such as if the
531  *	ioctl request arg is invalid, the driver won't set status.
532  */
533 struct dlb2_map_qid_args {
534 	/* Output parameters */
535 	struct dlb2_cmd_response response;
536 	/* Input parameters */
537 	__u32 port_id;
538 	__u32 qid;
539 	__u32 priority;
540 	__u32 padding0;
541 };
542 
543 /*
544  * DLB2_DOMAIN_CMD_UNMAP_QID: Unmap a load-balanced queue to a load-balanced
545  *	port.
546  * Input parameters:
547  * - port_id: Load-balanced port ID.
548  * - qid: Load-balanced queue ID.
549  *
550  * Output parameters:
551  * - response.status: Detailed error code. In certain cases, such as if the
552  *	ioctl request arg is invalid, the driver won't set status.
553  */
554 struct dlb2_unmap_qid_args {
555 	/* Output parameters */
556 	struct dlb2_cmd_response response;
557 	/* Input parameters */
558 	__u32 port_id;
559 	__u32 qid;
560 };
561 
562 /*
563  * DLB2_DOMAIN_CMD_ENABLE_LDB_PORT: Enable scheduling to a load-balanced port.
564  * Input parameters:
565  * - port_id: Load-balanced port ID.
566  * - padding0: Reserved for future use.
567  *
568  * Output parameters:
569  * - response.status: Detailed error code. In certain cases, such as if the
570  *	ioctl request arg is invalid, the driver won't set status.
571  */
572 struct dlb2_enable_ldb_port_args {
573 	/* Output parameters */
574 	struct dlb2_cmd_response response;
575 	/* Input parameters */
576 	__u32 port_id;
577 	__u32 padding0;
578 };
579 
580 /*
581  * DLB2_DOMAIN_CMD_ENABLE_DIR_PORT: Enable scheduling to a directed port.
582  * Input parameters:
583  * - port_id: Directed port ID.
584  * - padding0: Reserved for future use.
585  *
586  * Output parameters:
587  * - response.status: Detailed error code. In certain cases, such as if the
588  *	ioctl request arg is invalid, the driver won't set status.
589  */
590 struct dlb2_enable_dir_port_args {
591 	/* Output parameters */
592 	struct dlb2_cmd_response response;
593 	/* Input parameters */
594 	__u32 port_id;
595 };
596 
597 /*
598  * DLB2_DOMAIN_CMD_DISABLE_LDB_PORT: Disable scheduling to a load-balanced
599  *	port.
600  * Input parameters:
601  * - port_id: Load-balanced port ID.
602  * - padding0: Reserved for future use.
603  *
604  * Output parameters:
605  * - response.status: Detailed error code. In certain cases, such as if the
606  *	ioctl request arg is invalid, the driver won't set status.
607  */
608 struct dlb2_disable_ldb_port_args {
609 	/* Output parameters */
610 	struct dlb2_cmd_response response;
611 	/* Input parameters */
612 	__u32 port_id;
613 	__u32 padding0;
614 };
615 
616 /*
617  * DLB2_DOMAIN_CMD_DISABLE_DIR_PORT: Disable scheduling to a directed port.
618  * Input parameters:
619  * - port_id: Directed port ID.
620  * - padding0: Reserved for future use.
621  *
622  * Output parameters:
623  * - response.status: Detailed error code. In certain cases, such as if the
624  *	ioctl request arg is invalid, the driver won't set status.
625  */
626 struct dlb2_disable_dir_port_args {
627 	/* Output parameters */
628 	struct dlb2_cmd_response response;
629 	/* Input parameters */
630 	__u32 port_id;
631 	__u32 padding0;
632 };
633 
634 /*
635  * DLB2_DOMAIN_CMD_GET_LDB_QUEUE_DEPTH: Get a load-balanced queue's depth.
636  * Input parameters:
637  * - queue_id: The load-balanced queue ID.
638  * - padding0: Reserved for future use.
639  *
640  * Output parameters:
641  * - response.status: Detailed error code. In certain cases, such as if the
642  *	ioctl request arg is invalid, the driver won't set status.
643  * - response.id: queue depth.
644  */
645 struct dlb2_get_ldb_queue_depth_args {
646 	/* Output parameters */
647 	struct dlb2_cmd_response response;
648 	/* Input parameters */
649 	__u32 queue_id;
650 	__u32 padding0;
651 };
652 
653 /*
654  * DLB2_DOMAIN_CMD_DIR_QUEUE_DEPTH: Get a directed queue's depth.
655  * Input parameters:
656  * - queue_id: The directed queue ID.
657  * - padding0: Reserved for future use.
658  *
659  * Output parameters:
660  * - response.status: Detailed error code. In certain cases, such as if the
661  *	ioctl request arg is invalid, the driver won't set status.
662  * - response.id: queue depth.
663  */
664 struct dlb2_get_dir_queue_depth_args {
665 	/* Output parameters */
666 	struct dlb2_cmd_response response;
667 	/* Input parameters */
668 	__u32 queue_id;
669 	__u32 padding0;
670 };
671 
672 /*
673  * DLB2_DOMAIN_CMD_PENDING_PORT_UNMAPS: Get number of queue unmap operations in
674  *	progress for a load-balanced port.
675  *
676  *	Note: This is a snapshot; the number of unmap operations in progress
677  *	is subject to change at any time.
678  *
679  * Input parameters:
680  * - port_id: Load-balanced port ID.
681  *
682  * Output parameters:
683  * - response.status: Detailed error code. In certain cases, such as if the
684  *	ioctl request arg is invalid, the driver won't set status.
685  * - response.id: number of unmaps in progress.
686  */
687 struct dlb2_pending_port_unmaps_args {
688 	/* Output parameters */
689 	struct dlb2_cmd_response response;
690 	/* Input parameters */
691 	__u32 port_id;
692 	__u32 padding0;
693 };
694 
695 /*
696  * DLB2_DOMAIN_CMD_ENABLE_CQ_WEIGHT: Enable QE-weight based scheduling on a
697  *      load-balanced port's CQ and configures the CQ's weight limit.
698  *
699  *      This must be called after creating the port but before starting the
700  *      domain. The QE weight limit must be non-zero and cannot exceed the
701  *      CQ's depth.
702  *
703  * Input parameters:
704  * - port_id: Load-balanced port ID.
705  * - limit: QE weight limit.
706  *
707  * Output parameters:
708  * - response.status: Detailed error code. In certain cases, such as if the
709  *      ioctl request arg is invalid, the driver won't set status.
710  * - response.id: number of unmaps in progress.
711  */
712 struct dlb2_enable_cq_weight_args {
713 	/* Output parameters */
714 	struct dlb2_cmd_response response;
715 	/* Input parameters */
716 	__u32 port_id;
717 	__u32 limit;
718 };
719 
720 /*
721  * Mapping sizes for memory mapping the consumer queue (CQ) memory space, and
722  * producer port (PP) MMIO space.
723  */
724 #define DLB2_CQ_SIZE 65536
725 #define DLB2_PP_SIZE 4096
726 
727 
728 #endif /* __DLB2_USER_H */
729