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