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