test/bonding: fix RSS test when disable RSS
[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_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.
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 };
502
503 /*
504  * DLB2_DOMAIN_CMD_START_DOMAIN: Mark the end of the domain configuration. This
505  *      must be called before passing QEs into the device, and no configuration
506  *      ioctls can be issued once the domain has started. Sending QEs into the
507  *      device before calling this ioctl will result in undefined behavior.
508  * Input parameters:
509  * - (None)
510  *
511  * Output parameters:
512  * - response.status: Detailed error code. In certain cases, such as if the
513  *      ioctl request arg is invalid, the driver won't set status.
514  */
515 struct dlb2_start_domain_args {
516         /* Output parameters */
517         struct dlb2_cmd_response response;
518 };
519
520 /*
521  * DLB2_DOMAIN_CMD_MAP_QID: Map a load-balanced queue to a load-balanced port.
522  * Input parameters:
523  * - port_id: Load-balanced port ID.
524  * - qid: Load-balanced queue ID.
525  * - priority: Queue->port service priority.
526  * - padding0: Reserved for future use.
527  *
528  * Output parameters:
529  * - response.status: Detailed error code. In certain cases, such as if the
530  *      ioctl request arg is invalid, the driver won't set status.
531  */
532 struct dlb2_map_qid_args {
533         /* Output parameters */
534         struct dlb2_cmd_response response;
535         /* Input parameters */
536         __u32 port_id;
537         __u32 qid;
538         __u32 priority;
539         __u32 padding0;
540 };
541
542 /*
543  * DLB2_DOMAIN_CMD_UNMAP_QID: Unmap a load-balanced queue to a load-balanced
544  *      port.
545  * Input parameters:
546  * - port_id: Load-balanced port ID.
547  * - qid: Load-balanced queue ID.
548  *
549  * Output parameters:
550  * - response.status: Detailed error code. In certain cases, such as if the
551  *      ioctl request arg is invalid, the driver won't set status.
552  */
553 struct dlb2_unmap_qid_args {
554         /* Output parameters */
555         struct dlb2_cmd_response response;
556         /* Input parameters */
557         __u32 port_id;
558         __u32 qid;
559 };
560
561 /*
562  * DLB2_DOMAIN_CMD_ENABLE_LDB_PORT: Enable scheduling to a load-balanced port.
563  * Input parameters:
564  * - port_id: Load-balanced port ID.
565  * - padding0: Reserved for future use.
566  *
567  * Output parameters:
568  * - response.status: Detailed error code. In certain cases, such as if the
569  *      ioctl request arg is invalid, the driver won't set status.
570  */
571 struct dlb2_enable_ldb_port_args {
572         /* Output parameters */
573         struct dlb2_cmd_response response;
574         /* Input parameters */
575         __u32 port_id;
576         __u32 padding0;
577 };
578
579 /*
580  * DLB2_DOMAIN_CMD_ENABLE_DIR_PORT: Enable scheduling to a directed port.
581  * Input parameters:
582  * - port_id: Directed port ID.
583  * - padding0: Reserved for future use.
584  *
585  * Output parameters:
586  * - response.status: Detailed error code. In certain cases, such as if the
587  *      ioctl request arg is invalid, the driver won't set status.
588  */
589 struct dlb2_enable_dir_port_args {
590         /* Output parameters */
591         struct dlb2_cmd_response response;
592         /* Input parameters */
593         __u32 port_id;
594 };
595
596 /*
597  * DLB2_DOMAIN_CMD_DISABLE_LDB_PORT: Disable scheduling to a load-balanced
598  *      port.
599  * Input parameters:
600  * - port_id: Load-balanced port ID.
601  * - padding0: Reserved for future use.
602  *
603  * Output parameters:
604  * - response.status: Detailed error code. In certain cases, such as if the
605  *      ioctl request arg is invalid, the driver won't set status.
606  */
607 struct dlb2_disable_ldb_port_args {
608         /* Output parameters */
609         struct dlb2_cmd_response response;
610         /* Input parameters */
611         __u32 port_id;
612         __u32 padding0;
613 };
614
615 /*
616  * DLB2_DOMAIN_CMD_DISABLE_DIR_PORT: Disable scheduling to a directed port.
617  * Input parameters:
618  * - port_id: Directed port ID.
619  * - padding0: Reserved for future use.
620  *
621  * Output parameters:
622  * - response.status: Detailed error code. In certain cases, such as if the
623  *      ioctl request arg is invalid, the driver won't set status.
624  */
625 struct dlb2_disable_dir_port_args {
626         /* Output parameters */
627         struct dlb2_cmd_response response;
628         /* Input parameters */
629         __u32 port_id;
630         __u32 padding0;
631 };
632
633 /*
634  * DLB2_DOMAIN_CMD_GET_LDB_QUEUE_DEPTH: Get a load-balanced queue's depth.
635  * Input parameters:
636  * - queue_id: The load-balanced queue ID.
637  * - padding0: Reserved for future use.
638  *
639  * Output parameters:
640  * - response.status: Detailed error code. In certain cases, such as if the
641  *      ioctl request arg is invalid, the driver won't set status.
642  * - response.id: queue depth.
643  */
644 struct dlb2_get_ldb_queue_depth_args {
645         /* Output parameters */
646         struct dlb2_cmd_response response;
647         /* Input parameters */
648         __u32 queue_id;
649         __u32 padding0;
650 };
651
652 /*
653  * DLB2_DOMAIN_CMD_DIR_QUEUE_DEPTH: Get a directed queue's depth.
654  * Input parameters:
655  * - queue_id: The directed queue ID.
656  * - padding0: Reserved for future use.
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: queue depth.
662  */
663 struct dlb2_get_dir_queue_depth_args {
664         /* Output parameters */
665         struct dlb2_cmd_response response;
666         /* Input parameters */
667         __u32 queue_id;
668         __u32 padding0;
669 };
670
671 /*
672  * DLB2_DOMAIN_CMD_PENDING_PORT_UNMAPS: Get number of queue unmap operations in
673  *      progress for a load-balanced port.
674  *
675  *      Note: This is a snapshot; the number of unmap operations in progress
676  *      is subject to change at any time.
677  *
678  * Input parameters:
679  * - port_id: Load-balanced port ID.
680  *
681  * Output parameters:
682  * - response.status: Detailed error code. In certain cases, such as if the
683  *      ioctl request arg is invalid, the driver won't set status.
684  * - response.id: number of unmaps in progress.
685  */
686 struct dlb2_pending_port_unmaps_args {
687         /* Output parameters */
688         struct dlb2_cmd_response response;
689         /* Input parameters */
690         __u32 port_id;
691         __u32 padding0;
692 };
693
694 /*
695  * DLB2_DOMAIN_CMD_ENABLE_CQ_WEIGHT: Enable QE-weight based scheduling on a
696  *      load-balanced port's CQ and configures the CQ's weight limit.
697  *
698  *      This must be called after creating the port but before starting the
699  *      domain. The QE weight limit must be non-zero and cannot exceed the
700  *      CQ's depth.
701  *
702  * Input parameters:
703  * - port_id: Load-balanced port ID.
704  * - limit: QE weight limit.
705  *
706  * Output parameters:
707  * - response.status: Detailed error code. In certain cases, such as if the
708  *      ioctl request arg is invalid, the driver won't set status.
709  * - response.id: number of unmaps in progress.
710  */
711 struct dlb2_enable_cq_weight_args {
712         /* Output parameters */
713         struct dlb2_cmd_response response;
714         /* Input parameters */
715         __u32 port_id;
716         __u32 limit;
717 };
718
719 /*
720  * Mapping sizes for memory mapping the consumer queue (CQ) memory space, and
721  * producer port (PP) MMIO space.
722  */
723 #define DLB2_CQ_SIZE 65536
724 #define DLB2_PP_SIZE 4096
725
726
727 #endif /* __DLB2_USER_H */