1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
3 * Copyright 2013-2016 Freescale Semiconductor Inc.
4 * Copyright 2016-2019 NXP
11 #include <fsl_dpopr.h>
16 * Data Path Network Interface API
17 * Contains initialization APIs and runtime control APIs for DPNI
20 /** General DPNI macros */
23 * Maximum number of traffic classes
27 * Maximum number of buffer pools per DPNI
29 #define DPNI_MAX_DPBP 8
31 * Maximum number of storage-profiles per DPNI
36 * All traffic classes considered; see dpni_set_queue()
38 #define DPNI_ALL_TCS (uint8_t)(-1)
40 * All flows within traffic class considered; see dpni_set_queue()
42 #define DPNI_ALL_TC_FLOWS (uint16_t)(-1)
45 * Tx traffic is always released to a buffer pool on transmit, there are no
46 * resources allocated to have the frames confirmed back to the source after
49 #define DPNI_OPT_TX_FRM_RELEASE 0x000001
51 * Disables support for MAC address filtering for addresses other than primary
52 * MAC address. This affects both unicast and multicast. Promiscuous mode can
53 * still be enabled/disabled for both unicast and multicast. If promiscuous mode
54 * is disabled, only traffic matching the primary MAC address will be accepted.
56 #define DPNI_OPT_NO_MAC_FILTER 0x000002
58 * Allocate policers for this DPNI. They can be used to rate-limit traffic per
59 * traffic class (TC) basis.
61 #define DPNI_OPT_HAS_POLICING 0x000004
63 * Congestion can be managed in several ways, allowing the buffer pool to
64 * deplete on ingress, taildrop on each queue or use congestion groups for sets
65 * of queues. If set, it configures a single congestion groups across all TCs.
66 * If reset, a congestion group is allocated for each TC. Only relevant if the
67 * DPNI has multiple traffic classes.
69 #define DPNI_OPT_SHARED_CONGESTION 0x000008
71 * Enables TCAM for Flow Steering and QoS look-ups. If not specified, all
72 * look-ups are exact match. Note that TCAM is not available on LS1088 and its
73 * variants. Setting this bit on these SoCs will trigger an error.
75 #define DPNI_OPT_HAS_KEY_MASKING 0x000010
77 * Disables the flow steering table.
79 #define DPNI_OPT_NO_FS 0x000020
82 * Enable the Order Restoration support
84 #define DPNI_OPT_HAS_OPR 0x000040
87 * Order Point Records are shared for the entire TC
89 #define DPNI_OPT_OPR_PER_TC 0x000080
91 * All Tx traffic classes will use a single sender (ignore num_queueus for tx)
93 #define DPNI_OPT_SINGLE_SENDER 0x000100
95 * Define a custom number of congestion groups
97 #define DPNI_OPT_CUSTOM_CG 0x000200
101 * Software sequence maximum layout size
103 #define DPNI_SW_SEQUENCE_LAYOUT_SIZE 33
105 int dpni_open(struct fsl_mc_io *mc_io,
110 int dpni_close(struct fsl_mc_io *mc_io,
115 * struct dpni_cfg - Structure representing DPNI configuration
116 * @options: Any combination of the following options:
117 * DPNI_OPT_TX_FRM_RELEASE
118 * DPNI_OPT_NO_MAC_FILTER
119 * DPNI_OPT_HAS_POLICING
120 * DPNI_OPT_SHARED_CONGESTION
121 * DPNI_OPT_HAS_KEY_MASKING
123 * DPNI_OPT_SINGLE_SENDER
124 * @fs_entries: Number of entries in the flow steering table.
125 * This table is used to select the ingress queue for
126 * ingress traffic, targeting a GPP core or another.
127 * In addition it can be used to discard traffic that
128 * matches the set rule. It is either an exact match table
129 * or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING
130 * bit in OPTIONS field. This field is ignored if
131 * DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise,
132 * value 0 defaults to 64. Maximum supported value is 1024.
133 * Note that the total number of entries is limited on the
134 * SoC to as low as 512 entries if TCAM is used.
135 * @vlan_filter_entries: Number of entries in the VLAN address filtering
136 * table. This is an exact match table used to filter
137 * ingress traffic based on VLAN IDs. Value 0 disables VLAN
138 * filtering. Maximum supported value is 16.
139 * @mac_filter_entries: Number of entries in the MAC address filtering
140 * table. This is an exact match table and allows both
141 * unicast and multicast entries. The primary MAC address
142 * of the network interface is not part of this table,
143 * this contains only entries in addition to it. This
144 * field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in
145 * OPTIONS field. Otherwise, value 0 defaults to 80.
146 * Maximum supported value is 80.
147 * @num_queues: Number of Tx and Rx queues used for traffic
148 * distribution. This is orthogonal to QoS and is only
149 * used to distribute traffic to multiple GPP cores.
150 * This configuration affects the number of Tx queues
151 * (logical FQs, all associated with a single CEETM queue),
152 * Rx queues and Tx confirmation queues, if applicable.
153 * Value 0 defaults to one queue. Maximum supported value
155 * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI.
156 * TCs can have different priority levels for the purpose
157 * of Tx scheduling (see DPNI_SET_TX_PRIORITIES), different
158 * BPs (DPNI_ SET_POOLS), policers. There are dedicated QM
159 * queues for traffic classes (including class queues on
160 * Tx). Value 0 defaults to one TC. Maximum supported value
161 * is 16. There are maximum 16 TCs for Tx and 8 TCs for Rx.
162 * When num_tcs>8 Tx will use this value but Rx will have
163 * only 8 traffic classes.
164 * @num_rx_tcs: if set to other value than zero represents number
165 * of TCs used for Rx. Maximum value is 8. If set to zero the
166 * number of Rx TCs will be initialized with the value provided
167 * in num_tcs parameter.
168 * @qos_entries: Number of entries in the QoS classification table. This
169 * table is used to select the TC for ingress traffic. It
170 * is either an exact match or a TCAM table, depending on
171 * DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This
172 * field is ignored if the DPNI has a single TC. Otherwise,
173 * a value of 0 defaults to 64. Maximum supported value
179 uint8_t vlan_filter_entries;
180 uint8_t mac_filter_entries;
188 int dpni_create(struct fsl_mc_io *mc_io,
191 const struct dpni_cfg *cfg,
194 int dpni_destroy(struct fsl_mc_io *mc_io,
200 * struct dpni_pools_cfg - Structure representing buffer pools configuration
201 * @num_dpbp: Number of DPBPs
202 * @pool_options: Buffer assignment options
203 * This field is a combination of DPNI_POOL_ASSOC_flags
204 * @pools: Array of buffer pools parameters; The number of valid entries
205 * must match 'num_dpbp' value
206 * @pools.dpbp_id: DPBP object ID
207 * @pools.priority: Priority mask that indicates TC's used with this buffer.
208 * I set to 0x00 MC will assume value 0xff.
209 * @pools.buffer_size: Buffer size
210 * @pools.backup_pool: Backup pool
213 #define DPNI_POOL_ASSOC_QPRI 0
214 #define DPNI_POOL_ASSOC_QDBIN 1
216 struct dpni_pools_cfg {
218 uint8_t pool_options;
221 uint8_t priority_mask;
222 uint16_t buffer_size;
224 } pools[DPNI_MAX_DPBP];
227 int dpni_set_pools(struct fsl_mc_io *mc_io,
230 const struct dpni_pools_cfg *cfg);
232 int dpni_enable(struct fsl_mc_io *mc_io,
236 int dpni_disable(struct fsl_mc_io *mc_io,
240 int dpni_is_enabled(struct fsl_mc_io *mc_io,
245 int dpni_reset(struct fsl_mc_io *mc_io,
250 * DPNI IRQ Index and Events
256 #define DPNI_IRQ_INDEX 0
258 * IRQ event - indicates a change in link state
260 #define DPNI_IRQ_EVENT_LINK_CHANGED 0x00000001
262 int dpni_set_irq_enable(struct fsl_mc_io *mc_io,
268 int dpni_get_irq_enable(struct fsl_mc_io *mc_io,
274 int dpni_set_irq_mask(struct fsl_mc_io *mc_io,
280 int dpni_get_irq_mask(struct fsl_mc_io *mc_io,
286 int dpni_get_irq_status(struct fsl_mc_io *mc_io,
292 int dpni_clear_irq_status(struct fsl_mc_io *mc_io,
299 * struct dpni_attr - Structure representing DPNI attributes
300 * @options: Any combination of the following options:
301 * DPNI_OPT_TX_FRM_RELEASE
302 * DPNI_OPT_NO_MAC_FILTER
303 * DPNI_OPT_HAS_POLICING
304 * DPNI_OPT_SHARED_CONGESTION
305 * DPNI_OPT_HAS_KEY_MASKING
307 * @num_queues: Number of Tx and Rx queues used for traffic distribution.
308 * @num_rx_tcs: Number of RX traffic classes (TCs), reserved for the DPNI.
309 * @num_tx_tcs: Number of TX traffic classes (TCs), reserved for the DPNI.
310 * @mac_filter_entries: Number of entries in the MAC address filtering
312 * @vlan_filter_entries: Number of entries in the VLAN address filtering
314 * @qos_entries: Number of entries in the QoS classification table.
315 * @fs_entries: Number of entries in the flow steering table.
316 * @qos_key_size: Size, in bytes, of the QoS look-up key. Defining a key larger
317 * than this when adding QoS entries will result
319 * @fs_key_size: Size, in bytes, of the flow steering look-up key. Defining a
320 * key larger than this when composing the hash + FS key
321 * will result in an error.
322 * @wriop_version: Version of WRIOP HW block.
323 * The 3 version values are stored on 6, 5, 5 bits
326 * - 0x400 - WRIOP version 1.0.0, used on LS2080 and
328 * - 0x421 - WRIOP version 1.1.1, used on LS2088 and
330 * - 0x422 - WRIOP version 1.1.2, used on LS1088 and
332 * - 0xC00 - WRIOP version 3.0.0, used on LX2160 and
340 uint8_t mac_filter_entries;
341 uint8_t vlan_filter_entries;
344 uint8_t qos_key_size;
346 uint16_t wriop_version;
350 int dpni_get_attributes(struct fsl_mc_io *mc_io,
353 struct dpni_attr *attr);
360 * Discard error. When set all discarded frames in wriop will be enqueued to
361 * error queue. To be used in dpni_set_errors_behavior() only if error_action
362 * parameter is set to DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE.
364 #define DPNI_ERROR_DISC 0x80000000
367 * Extract out of frame header error
369 #define DPNI_ERROR_EOFHE 0x00020000
373 #define DPNI_ERROR_FLE 0x00002000
375 * Frame physical error
377 #define DPNI_ERROR_FPE 0x00001000
379 * Parsing header error
381 #define DPNI_ERROR_PHE 0x00000020
383 * Parser L3 checksum error
385 #define DPNI_ERROR_L3CE 0x00000004
387 * Parser L3 checksum error
389 #define DPNI_ERROR_L4CE 0x00000001
392 * enum dpni_error_action - Defines DPNI behavior for errors
393 * @DPNI_ERROR_ACTION_DISCARD: Discard the frame
394 * @DPNI_ERROR_ACTION_CONTINUE: Continue with the normal flow
395 * @DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE: Send the frame to the error queue
397 enum dpni_error_action {
398 DPNI_ERROR_ACTION_DISCARD = 0,
399 DPNI_ERROR_ACTION_CONTINUE = 1,
400 DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE = 2
404 * struct dpni_error_cfg - Structure representing DPNI errors treatment
405 * @errors: Errors mask; use 'DPNI_ERROR__<X>
406 * @error_action: The desired action for the errors mask
407 * @set_frame_annotation: Set to '1' to mark the errors in frame
408 * annotation status (FAS); relevant only
409 * for the non-discard action
411 struct dpni_error_cfg {
413 enum dpni_error_action error_action;
414 int set_frame_annotation;
417 int dpni_set_errors_behavior(struct fsl_mc_io *mc_io,
420 struct dpni_error_cfg *cfg);
423 * DPNI buffer layout modification options
427 * Select to modify the time-stamp setting
429 #define DPNI_BUF_LAYOUT_OPT_TIMESTAMP 0x00000001
431 * Select to modify the parser-result setting; not applicable for Tx
433 #define DPNI_BUF_LAYOUT_OPT_PARSER_RESULT 0x00000002
435 * Select to modify the frame-status setting
437 #define DPNI_BUF_LAYOUT_OPT_FRAME_STATUS 0x00000004
439 * Select to modify the private-data-size setting
441 #define DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE 0x00000008
443 * Select to modify the data-alignment setting
445 #define DPNI_BUF_LAYOUT_OPT_DATA_ALIGN 0x00000010
447 * Select to modify the data-head-room setting
449 #define DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM 0x00000020
451 * Select to modify the data-tail-room setting
453 #define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM 0x00000040
455 * Select to modify the sw-opaque value setting
457 #define DPNI_BUF_LAYOUT_OPT_SW_OPAQUE 0x00000080
460 * struct dpni_buffer_layout - Structure representing DPNI buffer layout
461 * @options: Flags representing the suggested modifications to the
463 * Use any combination of 'DPNI_BUF_LAYOUT_OPT_<X>' flags
464 * @pass_timestamp: Pass timestamp value
465 * @pass_parser_result: Pass parser results
466 * @pass_frame_status: Pass frame status
467 * @private_data_size: Size kept for private data (in bytes)
468 * @data_align: Data alignment
469 * @data_head_room: Data head room
470 * @data_tail_room: Data tail room
472 struct dpni_buffer_layout {
475 int pass_parser_result;
476 int pass_frame_status;
478 uint16_t private_data_size;
480 uint16_t data_head_room;
481 uint16_t data_tail_room;
485 * enum dpni_queue_type - Identifies a type of queue targeted by the command
486 * @DPNI_QUEUE_RX: Rx queue
487 * @DPNI_QUEUE_TX: Tx queue
488 * @DPNI_QUEUE_TX_CONFIRM: Tx confirmation queue
489 * @DPNI_QUEUE_RX_ERR: Rx error queue
491 enum dpni_queue_type {
494 DPNI_QUEUE_TX_CONFIRM,
498 int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,
501 enum dpni_queue_type qtype,
502 struct dpni_buffer_layout *layout);
504 int dpni_set_buffer_layout(struct fsl_mc_io *mc_io,
507 enum dpni_queue_type qtype,
508 const struct dpni_buffer_layout *layout);
511 * enum dpni_offload - Identifies a type of offload targeted by the command
512 * @DPNI_OFF_RX_L3_CSUM: Rx L3 checksum validation
513 * @DPNI_OFF_RX_L4_CSUM: Rx L4 checksum validation
514 * @DPNI_OFF_TX_L3_CSUM: Tx L3 checksum generation
515 * @DPNI_OFF_TX_L4_CSUM: Tx L4 checksum generation
516 * @DPNI_OPT_FLCTYPE_HASH: flow context will be generated by WRIOP for AIOP or
527 int dpni_set_offload(struct fsl_mc_io *mc_io,
530 enum dpni_offload type,
533 int dpni_get_offload(struct fsl_mc_io *mc_io,
536 enum dpni_offload type,
539 int dpni_get_qdid(struct fsl_mc_io *mc_io,
542 enum dpni_queue_type qtype,
545 int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,
548 uint16_t *data_offset);
550 #define DPNI_STATISTICS_CNT 7
553 * union dpni_statistics - Union describing the DPNI statistics
554 * @page_0: Page_0 statistics structure
555 * @page_0.ingress_all_frames: Ingress frame count
556 * @page_0.ingress_all_bytes: Ingress byte count
557 * @page_0.ingress_multicast_frames: Ingress multicast frame count
558 * @page_0.ingress_multicast_bytes: Ingress multicast byte count
559 * @page_0.ingress_broadcast_frames: Ingress broadcast frame count
560 * @page_0.ingress_broadcast_bytes: Ingress broadcast byte count
561 * @page_1: Page_1 statistics structure
562 * @page_1.egress_all_frames: Egress frame count
563 * @page_1.egress_all_bytes: Egress byte count
564 * @page_1.egress_multicast_frames: Egress multicast frame count
565 * @page_1.egress_multicast_bytes: Egress multicast byte count
566 * @page_1.egress_broadcast_frames: Egress broadcast frame count
567 * @page_1.egress_broadcast_bytes: Egress broadcast byte count
568 * @page_2: Page_2 statistics structure
569 * @page_2.ingress_filtered_frames: Ingress filtered frame count
570 * @page_2.ingress_discarded_frames: Ingress discarded frame count
571 * @page_2.ingress_nobuffer_discards: Ingress discarded frame count due to
573 * @page_2.egress_discarded_frames: Egress discarded frame count
574 * @page_2.egress_confirmed_frames: Egress confirmed frame count
575 * @page_3: Page_3 statistics structure with values for the selected TC
576 * @page_3.ceetm_dequeue_bytes: Cumulative count of the number of bytes dequeued
577 * @page_3.ceetm_dequeue_frames: Cumulative count of the number of frames
579 * @page_3.ceetm_reject_bytes: Cumulative count of the number of bytes in all
580 * frames whose enqueue was rejected
581 * @page_3.ceetm_reject_frames: Cumulative count of all frame enqueues rejected
582 * @page_4: congestion point drops for seleted TC
583 * @page_4.cgr_reject_frames: number of rejected frames due to congestion point
584 * @page_4.cgr_reject_bytes: number of rejected bytes due to congestion point
585 * @page_5: policer statistics per TC
586 * @page_5.policer_cnt_red: NUmber of red colored frames
587 * @page_5.policer_cnt_yellow: number of yellow colored frames
588 * @page_5.policer_cnt_green: number of green colored frames
589 * @page_5.policer_cnt_re_red: number of recolored red frames
590 * @page_5.policer_cnt_re_yellow: number of recolored yellow frames
591 * @page_6.tx_pending_frames_cnt: total number of frames pending in Tx queues
592 * @raw: raw statistics structure, used to index counters
594 union dpni_statistics {
596 uint64_t ingress_all_frames;
597 uint64_t ingress_all_bytes;
598 uint64_t ingress_multicast_frames;
599 uint64_t ingress_multicast_bytes;
600 uint64_t ingress_broadcast_frames;
601 uint64_t ingress_broadcast_bytes;
604 uint64_t egress_all_frames;
605 uint64_t egress_all_bytes;
606 uint64_t egress_multicast_frames;
607 uint64_t egress_multicast_bytes;
608 uint64_t egress_broadcast_frames;
609 uint64_t egress_broadcast_bytes;
612 uint64_t ingress_filtered_frames;
613 uint64_t ingress_discarded_frames;
614 uint64_t ingress_nobuffer_discards;
615 uint64_t egress_discarded_frames;
616 uint64_t egress_confirmed_frames;
619 uint64_t ceetm_dequeue_bytes;
620 uint64_t ceetm_dequeue_frames;
621 uint64_t ceetm_reject_bytes;
622 uint64_t ceetm_reject_frames;
625 uint64_t cgr_reject_frames;
626 uint64_t cgr_reject_bytes;
629 uint64_t policer_cnt_red;
630 uint64_t policer_cnt_yellow;
631 uint64_t policer_cnt_green;
632 uint64_t policer_cnt_re_red;
633 uint64_t policer_cnt_re_yellow;
636 uint64_t tx_pending_frames_cnt;
639 uint64_t counter[DPNI_STATISTICS_CNT];
644 * Enable auto-negotiation
646 #define DPNI_LINK_OPT_AUTONEG 0x0000000000000001ULL
648 * Enable half-duplex mode
650 #define DPNI_LINK_OPT_HALF_DUPLEX 0x0000000000000002ULL
652 * Enable pause frames
654 #define DPNI_LINK_OPT_PAUSE 0x0000000000000004ULL
656 * Enable a-symmetric pause frames
658 #define DPNI_LINK_OPT_ASYM_PAUSE 0x0000000000000008ULL
660 * Enable priority flow control pause frames
662 #define DPNI_LINK_OPT_PFC_PAUSE 0x0000000000000010ULL
665 * Advertise 10MB full duplex
667 #define DPNI_ADVERTISED_10BASET_FULL 0x0000000000000001ULL
669 * Advertise 100MB full duplex
671 #define DPNI_ADVERTISED_100BASET_FULL 0x0000000000000002ULL
673 * Advertise 1GB full duplex
675 #define DPNI_ADVERTISED_1000BASET_FULL 0x0000000000000004ULL
677 * Advertise auto-negotiation enable
679 #define DPNI_ADVERTISED_AUTONEG 0x0000000000000008ULL
681 * Advertise 10GB full duplex
683 #define DPNI_ADVERTISED_10000BASET_FULL 0x0000000000000010ULL
685 * Advertise 2.5GB full duplex
687 #define DPNI_ADVERTISED_2500BASEX_FULL 0x0000000000000020ULL
689 * Advertise 5GB full duplex
691 #define DPNI_ADVERTISED_5000BASET_FULL 0x0000000000000040ULL
695 * struct - Structure representing DPNI link configuration
697 * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values
698 * @advertising: Speeds that are advertised for autoneg (bitmap)
700 struct dpni_link_cfg {
703 uint64_t advertising;
706 int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
709 const struct dpni_link_cfg *cfg);
712 * struct dpni_link_state - Structure representing DPNI link state
714 * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values
715 * @up: Link state; '0' for down, '1' for up
716 * @state_valid: Ignore/Update the state of the link
717 * @supported: Speeds capability of the phy (bitmap)
718 * @advertising: Speeds that are advertised for autoneg (bitmap)
720 struct dpni_link_state {
726 uint64_t advertising;
729 int dpni_get_link_state(struct fsl_mc_io *mc_io,
732 struct dpni_link_state *state);
734 int dpni_set_max_frame_length(struct fsl_mc_io *mc_io,
737 uint16_t max_frame_length);
739 int dpni_get_max_frame_length(struct fsl_mc_io *mc_io,
742 uint16_t *max_frame_length);
744 int dpni_set_mtu(struct fsl_mc_io *mc_io,
749 int dpni_get_mtu(struct fsl_mc_io *mc_io,
754 int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io,
759 int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io,
764 int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io,
769 int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io,
774 int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,
777 const uint8_t mac_addr[6]);
779 int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,
782 uint8_t mac_addr[6]);
784 int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
787 const uint8_t mac_addr[6],
792 int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,
795 const uint8_t mac_addr[6]);
797 int dpni_clear_mac_filters(struct fsl_mc_io *mc_io,
803 int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io,
806 uint8_t mac_addr[6]);
808 int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io,
814 * Set vlan filter queue action
816 #define DPNI_VLAN_SET_QUEUE_ACTION 1
818 int dpni_add_vlan_id(struct fsl_mc_io *mc_io,
826 int dpni_remove_vlan_id(struct fsl_mc_io *mc_io,
831 int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io,
836 * enum dpni_dist_mode - DPNI distribution mode
837 * @DPNI_DIST_MODE_NONE: No distribution
838 * @DPNI_DIST_MODE_HASH: Use hash distribution; only relevant if
839 * the 'DPNI_OPT_DIST_HASH' option was set at DPNI creation
840 * @DPNI_DIST_MODE_FS: Use explicit flow steering; only relevant if
841 * the 'DPNI_OPT_DIST_FS' option was set at DPNI creation
843 enum dpni_dist_mode {
844 DPNI_DIST_MODE_NONE = 0,
845 DPNI_DIST_MODE_HASH = 1,
846 DPNI_DIST_MODE_FS = 2
850 * enum dpni_fs_miss_action - DPNI Flow Steering miss action
851 * @DPNI_FS_MISS_DROP: In case of no-match, drop the frame
852 * @DPNI_FS_MISS_EXPLICIT_FLOWID: In case of no-match, use explicit flow-id
853 * @DPNI_FS_MISS_HASH: In case of no-match, distribute using hash
855 enum dpni_fs_miss_action {
856 DPNI_FS_MISS_DROP = 0,
857 DPNI_FS_MISS_EXPLICIT_FLOWID = 1,
858 DPNI_FS_MISS_HASH = 2
862 * struct dpni_fs_tbl_cfg - Flow Steering table configuration
863 * @miss_action: Miss action selection
864 * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID'
865 * @keep_hash_key: used only when miss_action is set to DPNI_FS_MISS_HASH. When
866 * set to one unclassified frames will be distributed according to previous
867 * used hash key. If set to zero hash key will be replaced with the key
868 * provided for flow steering.
869 * @keep_entries: if set to one command will not delete the entries that already
870 * exist into FS table. Use this option with caution: if the table
871 * entries are not compatible with the distribution key the packets
872 * will not be classified properly.
874 struct dpni_fs_tbl_cfg {
875 enum dpni_fs_miss_action miss_action;
876 uint16_t default_flow_id;
878 uint8_t keep_entries;
882 * struct dpni_rx_tc_dist_cfg - Rx traffic class distribution configuration
883 * @dist_size: Set the distribution size;
884 * supported values: 1,2,3,4,6,7,8,12,14,16,24,28,32,48,56,64,96,
885 * 112,128,192,224,256,384,448,512,768,896,1024
886 * @dist_mode: Distribution mode
887 * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with
888 * the extractions to be used for the distribution key by calling
889 * dpkg_prepare_key_cfg() relevant only when
890 * 'dist_mode != DPNI_DIST_MODE_NONE', otherwise it can be '0'
891 * @fs_cfg: Flow Steering table configuration; only relevant if
892 * 'dist_mode = DPNI_DIST_MODE_FS'
894 struct dpni_rx_tc_dist_cfg {
896 enum dpni_dist_mode dist_mode;
897 uint64_t key_cfg_iova;
898 struct dpni_fs_tbl_cfg fs_cfg;
901 int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,
905 const struct dpni_rx_tc_dist_cfg *cfg);
908 * enum dpni_congestion_unit - DPNI congestion units
909 * @DPNI_CONGESTION_UNIT_BYTES: bytes units
910 * @DPNI_CONGESTION_UNIT_FRAMES: frames units
912 enum dpni_congestion_unit {
913 DPNI_CONGESTION_UNIT_BYTES = 0,
914 DPNI_CONGESTION_UNIT_FRAMES
918 * enum dpni_dest - DPNI destination types
919 * @DPNI_DEST_NONE: Unassigned destination; The queue is set in parked mode and
920 * does not generate FQDAN notifications; user is expected to
921 * dequeue from the queue based on polling or other user-defined
923 * @DPNI_DEST_DPIO: The queue is set in schedule mode and generates FQDAN
924 * notifications to the specified DPIO; user is expected to dequeue
925 * from the queue only after notification is received
926 * @DPNI_DEST_DPCON: The queue is set in schedule mode and does not generate
927 * FQDAN notifications, but is connected to the specified DPCON
928 * object; user is expected to dequeue from the DPCON channel
937 * struct dpni_dest_cfg - Structure representing DPNI destination parameters
938 * @dest_type: Destination type
939 * @dest_id: Either DPIO ID or DPCON ID, depending on the destination type
940 * @priority: Priority selection within the DPIO or DPCON channel; valid values
941 * are 0-1 or 0-7, depending on the number of priorities in that
942 * channel; not relevant for 'DPNI_DEST_NONE' option
944 struct dpni_dest_cfg {
945 enum dpni_dest dest_type;
950 /* DPNI congestion options */
953 * CSCN message is written to message_iova once entering a
954 * congestion state (see 'threshold_entry')
956 #define DPNI_CONG_OPT_WRITE_MEM_ON_ENTER 0x00000001
958 * CSCN message is written to message_iova once exiting a
959 * congestion state (see 'threshold_exit')
961 #define DPNI_CONG_OPT_WRITE_MEM_ON_EXIT 0x00000002
963 * CSCN write will attempt to allocate into a cache (coherent write);
964 * valid only if 'DPNI_CONG_OPT_WRITE_MEM_<X>' is selected
966 #define DPNI_CONG_OPT_COHERENT_WRITE 0x00000004
968 * if 'dest_cfg.dest_type != DPNI_DEST_NONE' CSCN message is sent to
969 * DPIO/DPCON's WQ channel once entering a congestion state
970 * (see 'threshold_entry')
972 #define DPNI_CONG_OPT_NOTIFY_DEST_ON_ENTER 0x00000008
974 * if 'dest_cfg.dest_type != DPNI_DEST_NONE' CSCN message is sent to
975 * DPIO/DPCON's WQ channel once exiting a congestion state
976 * (see 'threshold_exit')
978 #define DPNI_CONG_OPT_NOTIFY_DEST_ON_EXIT 0x00000010
980 * if 'dest_cfg.dest_type != DPNI_DEST_NONE' when the CSCN is written to the
981 * sw-portal's DQRR, the DQRI interrupt is asserted immediately (if enabled)
983 #define DPNI_CONG_OPT_INTR_COALESCING_DISABLED 0x00000020
985 * This congestion will trigger flow control or priority flow control. This
986 * will have effect only if flow control is enabled with dpni_set_link_cfg()
988 #define DPNI_CONG_OPT_FLOW_CONTROL 0x00000040
991 * enum dpni_congestion_point - Structure representing congestion point
992 * @DPNI_CP_QUEUE: Set congestion per queue, identified by QUEUE_TYPE, TC
994 * @DPNI_CP_GROUP: Set congestion per queue group. Depending on options
995 * used to define the DPNI this can be either per
996 * TC (default) or per interface
997 * (DPNI_OPT_SHARED_CONGESTION set at DPNI create).
998 * QUEUE_INDEX is ignored if this type is used.
999 * @DPNI_CP_CONGESTION_GROUP: Set per congestion group id. This will work
1000 * only if the DPNI is created with DPNI_OPT_CUSTOM_CG option
1003 enum dpni_congestion_point {
1006 DPNI_CP_CONGESTION_GROUP,
1010 * struct dpni_congestion_notification_cfg - congestion notification
1012 * @units: units type
1013 * @threshold_entry: above this threshold we enter a congestion state.
1014 * set it to '0' to disable it
1015 * @threshold_exit: below this threshold we exit the congestion state.
1016 * @message_ctx: The context that will be part of the CSCN message
1017 * @message_iova: I/O virtual address (must be in DMA-able memory),
1018 * must be 16B aligned; valid only if 'DPNI_CONG_OPT_WRITE_MEM_<X>' is
1019 * contained in 'options'
1020 * @dest_cfg: CSCN can be send to either DPIO or DPCON WQ channel
1021 * @notification_mode: Mask of available options; use 'DPNI_CONG_OPT_<X>' values
1022 * @cg_point: Congestion point settings
1023 * @cgid: id of the congestion group. The index is relative to dpni.
1026 struct dpni_congestion_notification_cfg {
1027 enum dpni_congestion_unit units;
1028 uint32_t threshold_entry;
1029 uint32_t threshold_exit;
1030 uint64_t message_ctx;
1031 uint64_t message_iova;
1032 struct dpni_dest_cfg dest_cfg;
1033 uint16_t notification_mode;
1034 enum dpni_congestion_point cg_point;
1038 int dpni_set_congestion_notification(struct fsl_mc_io *mc_io,
1041 enum dpni_queue_type qtype,
1043 const struct dpni_congestion_notification_cfg *cfg);
1045 int dpni_get_congestion_notification(struct fsl_mc_io *mc_io,
1048 enum dpni_queue_type qtype,
1050 struct dpni_congestion_notification_cfg *cfg);
1052 /* DPNI FLC stash options */
1055 * stashes the whole annotation area (up to 192 bytes)
1057 #define DPNI_FLC_STASH_FRAME_ANNOTATION 0x00000001
1060 * struct dpni_queue - Queue structure
1061 * @destination - Destination structure
1062 * @destination.id: ID of the destination, only relevant if DEST_TYPE is > 0.
1063 * Identifies either a DPIO or a DPCON object.
1064 * Not relevant for Tx queues.
1065 * @destination.type: May be one of the following:
1066 * 0 - No destination, queue can be manually
1067 * queried, but will not push traffic or
1068 * notifications to a DPIO;
1069 * 1 - The destination is a DPIO. When traffic
1070 * becomes available in the queue a FQDAN
1071 * (FQ data available notification) will be
1072 * generated to selected DPIO;
1073 * 2 - The destination is a DPCON. The queue is
1074 * associated with a DPCON object for the
1075 * purpose of scheduling between multiple
1076 * queues. The DPCON may be independently
1077 * configured to generate notifications.
1078 * Not relevant for Tx queues.
1079 * @destination.hold_active: Hold active, maintains a queue scheduled for longer
1080 * in a DPIO during dequeue to reduce spread of traffic.
1081 * Only relevant if queues are
1082 * not affined to a single DPIO.
1083 * @user_context: User data, presented to the user along with any frames
1084 * from this queue. Not relevant for Tx queues.
1085 * @flc: FD FLow Context structure
1086 * @flc.value: Default FLC value for traffic dequeued from
1087 * this queue. Please check description of FD
1088 * structure for more information.
1089 * Note that FLC values set using dpni_add_fs_entry,
1090 * if any, take precedence over values per queue.
1091 * @flc.stash_control: Boolean, indicates whether the 6 lowest
1092 * - significant bits are used for stash control.
1093 * significant bits are used for stash control. If set, the 6
1094 * least significant bits in value are interpreted as follows:
1095 * - bits 0-1: indicates the number of 64 byte units of context
1096 * that are stashed. FLC value is interpreted as a memory address
1097 * in this case, excluding the 6 LS bits.
1098 * - bits 2-3: indicates the number of 64 byte units of frame
1099 * annotation to be stashed. Annotation is placed at FD[ADDR].
1100 * - bits 4-5: indicates the number of 64 byte units of frame
1101 * data to be stashed. Frame data is placed at FD[ADDR] +
1103 * For more details check the Frame Descriptor section in the
1104 * hardware documentation.
1105 *@cgid :indicate the cgid to set relative to dpni
1110 enum dpni_dest type;
1114 uint64_t user_context;
1123 * struct dpni_queue_id - Queue identification, used for enqueue commands
1125 * @fqid: FQID used for enqueueing to and/or configuration of this
1127 * @qdbin: Queueing bin, used to enqueue using QDID, DQBIN, QPRI.
1128 * Only relevant for Tx queues.
1130 struct dpni_queue_id {
1136 * enum dpni_confirmation_mode - Defines DPNI options supported for Tx
1138 * @DPNI_CONF_AFFINE: For each Tx queue set associated with a sender there is
1139 * an affine Tx Confirmation queue
1140 * @DPNI_CONF_SINGLE: All Tx queues are associated with a single Tx
1141 * confirmation queue
1142 * @DPNI_CONF_DISABLE: Tx frames are not confirmed. This must be associated
1143 * with proper FD set-up to have buffers release to a Buffer Pool, otherwise
1144 * buffers will be leaked
1146 enum dpni_confirmation_mode {
1152 int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io,
1155 enum dpni_confirmation_mode mode);
1157 int dpni_get_tx_confirmation_mode(struct fsl_mc_io *mc_io,
1160 enum dpni_confirmation_mode *mode);
1163 * struct dpni_qos_tbl_cfg - Structure representing QOS table configuration
1164 * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with
1165 * key extractions to be used as the QoS criteria by calling
1166 * dpkg_prepare_key_cfg()
1167 * @discard_on_miss: Set to '1' to discard frames in case of no match (miss);
1168 * '0' to use the 'default_tc' in such cases
1169 * @keep_entries: if set to one will not delele existing table entries. This
1170 * option will work properly only for dpni objects created with
1171 * DPNI_OPT_HAS_KEY_MASKING option. All previous QoS entries must
1172 * be compatible with new key composition rule.
1173 * It is the caller's job to delete incompatible entries before
1174 * executing this function.
1175 * @default_tc: Used in case of no-match and 'discard_on_miss'= 0
1177 struct dpni_qos_tbl_cfg {
1178 uint64_t key_cfg_iova;
1179 int discard_on_miss;
1184 int dpni_set_qos_table(struct fsl_mc_io *mc_io,
1187 const struct dpni_qos_tbl_cfg *cfg);
1190 * struct dpni_rule_cfg - Rule configuration for table lookup
1191 * @key_iova: I/O virtual address of the key (must be in DMA-able memory)
1192 * @mask_iova: I/O virtual address of the mask (must be in DMA-able memory)
1193 * @key_size: key and mask size (in bytes)
1195 struct dpni_rule_cfg {
1201 int dpni_add_qos_entry(struct fsl_mc_io *mc_io,
1204 const struct dpni_rule_cfg *cfg,
1210 int dpni_remove_qos_entry(struct fsl_mc_io *mc_io,
1213 const struct dpni_rule_cfg *cfg);
1215 int dpni_clear_qos_table(struct fsl_mc_io *mc_io,
1220 * Discard matching traffic. If set, this takes precedence over any other
1221 * configuration and matching traffic is always discarded.
1223 #define DPNI_FS_OPT_DISCARD 0x1
1226 * Set FLC value. If set, flc member of truct dpni_fs_action_cfg is used to
1227 * override the FLC value set per queue.
1228 * For more details check the Frame Descriptor section in the hardware
1231 #define DPNI_FS_OPT_SET_FLC 0x2
1234 * Indicates whether the 6 lowest significant bits of FLC are used for stash
1235 * control. If set, the 6 least significant bits in value are interpreted as
1237 * - bits 0-1: indicates the number of 64 byte units of context that are
1238 * stashed. FLC value is interpreted as a memory address in this case,
1239 * excluding the 6 LS bits.
1240 * - bits 2-3: indicates the number of 64 byte units of frame annotation
1241 * to be stashed. Annotation is placed at FD[ADDR].
1242 * - bits 4-5: indicates the number of 64 byte units of frame data to be
1243 * stashed. Frame data is placed at FD[ADDR] + FD[OFFSET].
1244 * This flag is ignored if DPNI_FS_OPT_SET_FLC is not specified.
1246 #define DPNI_FS_OPT_SET_STASH_CONTROL 0x4
1249 * struct dpni_fs_action_cfg - Action configuration for table look-up
1250 * @flc: FLC value for traffic matching this rule. Please check the Frame
1251 * Descriptor section in the hardware documentation for more information.
1252 * @flow_id: Identifies the Rx queue used for matching traffic. Supported
1253 * values are in range 0 to num_queue-1.
1254 * @options: Any combination of DPNI_FS_OPT_ values.
1256 struct dpni_fs_action_cfg {
1262 int dpni_add_fs_entry(struct fsl_mc_io *mc_io,
1267 const struct dpni_rule_cfg *cfg,
1268 const struct dpni_fs_action_cfg *action);
1270 int dpni_remove_fs_entry(struct fsl_mc_io *mc_io,
1274 const struct dpni_rule_cfg *cfg);
1276 int dpni_clear_fs_entries(struct fsl_mc_io *mc_io,
1281 int dpni_get_api_version(struct fsl_mc_io *mc_io,
1283 uint16_t *major_ver,
1284 uint16_t *minor_ver);
1289 #define DPNI_QUEUE_OPT_USER_CTX 0x00000001
1292 * Set queue destination configuration
1294 #define DPNI_QUEUE_OPT_DEST 0x00000002
1297 * Set FD[FLC] configuration for traffic on this queue. Note that FLC values
1298 * set with dpni_add_fs_entry, if any, take precedence over values per queue.
1300 #define DPNI_QUEUE_OPT_FLC 0x00000004
1303 * Set the queue to hold active mode. This prevents the queue from being
1304 * rescheduled between DPIOs while it carries traffic and is active on one
1305 * DPNI. Can help reduce reordering when servicing one queue on multiple
1306 * CPUs, but the queue is also less likely to push data to multiple CPUs
1307 * especially when congested.
1309 #define DPNI_QUEUE_OPT_HOLD_ACTIVE 0x00000008
1311 #define DPNI_QUEUE_OPT_SET_CGID 0x00000040
1312 #define DPNI_QUEUE_OPT_CLEAR_CGID 0x00000080
1314 int dpni_set_queue(struct fsl_mc_io *mc_io,
1317 enum dpni_queue_type qtype,
1321 const struct dpni_queue *queue);
1323 int dpni_get_queue(struct fsl_mc_io *mc_io,
1326 enum dpni_queue_type qtype,
1329 struct dpni_queue *queue,
1330 struct dpni_queue_id *qid);
1332 int dpni_get_statistics(struct fsl_mc_io *mc_io,
1337 union dpni_statistics *stat);
1339 int dpni_reset_statistics(struct fsl_mc_io *mc_io,
1344 * struct dpni_taildrop - Structure representing the taildrop
1345 * @enable: Indicates whether the taildrop is active or not.
1346 * @units: Indicates the unit of THRESHOLD. Queue taildrop only
1347 * supports byte units, this field is ignored and
1348 * assumed = 0 if CONGESTION_POINT is 0.
1349 * @threshold: Threshold value, in units identified by UNITS field. Value 0
1350 * cannot be used as a valid taildrop threshold,
1351 * THRESHOLD must be > 0 if the taildrop is
1353 * @oal : Overhead Accounting Length, a 12-bit, 2's complement value
1354 * with range (-2048 to +2047) representing a fixed per-frame
1355 * overhead to be added to the actual length of a frame when
1356 * performing WRED and tail drop calculations and threshold
1359 struct dpni_taildrop {
1361 enum dpni_congestion_unit units;
1366 int dpni_set_taildrop(struct fsl_mc_io *mc_io,
1369 enum dpni_congestion_point cg_point,
1370 enum dpni_queue_type q_type,
1373 struct dpni_taildrop *taildrop);
1375 int dpni_get_taildrop(struct fsl_mc_io *mc_io,
1378 enum dpni_congestion_point cg_point,
1379 enum dpni_queue_type q_type,
1382 struct dpni_taildrop *taildrop);
1384 int dpni_set_opr(struct fsl_mc_io *mc_io,
1390 struct opr_cfg *cfg);
1392 int dpni_get_opr(struct fsl_mc_io *mc_io,
1397 struct opr_cfg *cfg,
1398 struct opr_qry *qry);
1401 * When used for queue_idx in function dpni_set_rx_dist_default_queue will
1402 * signal to dpni to drop all unclassified frames
1404 #define DPNI_FS_MISS_DROP ((uint16_t)-1)
1407 * struct dpni_rx_dist_cfg - distribution configuration
1408 * @dist_size: distribution size; supported values: 1,2,3,4,6,7,8,
1409 * 12,14,16,24,28,32,48,56,64,96,112,128,192,224,256,384,448,
1411 * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with
1412 * the extractions to be used for the distribution key by calling
1413 * dpkg_prepare_key_cfg() relevant only when enable!=0 otherwise
1415 * @enable: enable/disable the distribution.
1416 * @tc: TC id for which distribution is set
1417 * @fs_miss_flow_id: when packet misses all rules from flow steering table and
1418 * hash is disabled it will be put into this queue id; use
1419 * DPNI_FS_MISS_DROP to drop frames. The value of this field is
1420 * used only when flow steering distribution is enabled and hash
1421 * distribution is disabled
1423 struct dpni_rx_dist_cfg {
1425 uint64_t key_cfg_iova;
1428 uint16_t fs_miss_flow_id;
1431 int dpni_set_rx_fs_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
1432 uint16_t token, const struct dpni_rx_dist_cfg *cfg);
1434 int dpni_set_rx_hash_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
1435 uint16_t token, const struct dpni_rx_dist_cfg *cfg);
1437 int dpni_add_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
1438 uint16_t token, uint16_t tpid);
1440 int dpni_remove_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
1441 uint16_t token, uint16_t tpid);
1444 * struct dpni_custom_tpid_cfg - custom TPID configuration. Contains custom TPID
1445 * values used in current dpni object to detect 802.1q frames.
1446 * @tpid1: first tag. Not used if zero.
1447 * @tpid2: second tag. Not used if zero.
1449 struct dpni_custom_tpid_cfg {
1454 int dpni_get_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
1455 uint16_t token, struct dpni_custom_tpid_cfg *tpid);
1458 * enum dpni_soft_sequence_dest - Enumeration of WRIOP software sequence
1460 * @DPNI_SS_INGRESS: Ingress parser
1461 * @DPNI_SS_EGRESS: Egress parser
1463 enum dpni_soft_sequence_dest {
1464 DPNI_SS_INGRESS = 0,
1469 * struct dpni_load_ss_cfg - Structure for Software Sequence load configuration
1470 * @dest: Destination of the Software Sequence: ingress or egress parser
1471 * @ss_size: Size of the Software Sequence
1472 * @ss_offset: The offset where to load the Software Sequence (0x20-0x7FD)
1473 * @ss_iova: I/O virtual address of the Software Sequence
1475 struct dpni_load_ss_cfg {
1476 enum dpni_soft_sequence_dest dest;
1483 * struct dpni_enable_ss_cfg - Structure for software sequence enable
1485 * @dest: Destination of the Software Sequence: ingress or egress parser
1486 * @hxs: HXS to attach the software sequence to
1487 * @set_start: If the Software Sequence or HDR it is attached to is set as
1489 * If hxs=DUMMY_LAST_HXS the ss_offset is set directly as parser
1490 * start else the hdr index code is set as parser start
1491 * @ss_offset: The offset of the Software Sequence to enable or set as parse
1493 * @param_size: Size of the software sequence parameters
1494 * @param_offset: Offset in the parameter zone for the software sequence
1496 * @param_iova: I/O virtual address of the parameters
1498 struct dpni_enable_ss_cfg {
1499 enum dpni_soft_sequence_dest dest;
1504 uint8_t param_offset;
1505 uint64_t param_iova;
1509 * dpni_load_sw_sequence() - Loads a software sequence in parser memory.
1510 * @mc_io: Pointer to MC portal's I/O object
1511 * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
1512 * @token: Token of DPNI object
1513 * @cfg: Software sequence load configuration
1514 * Return: '0' on Success; Error code otherwise.
1516 int dpni_load_sw_sequence(struct fsl_mc_io *mc_io,
1519 struct dpni_load_ss_cfg *cfg);
1522 * dpni_eanble_sw_sequence() - Enables a software sequence in the parser
1524 * corresponding to the ingress or egress of the DPNI.
1525 * @mc_io: Pointer to MC portal's I/O object
1526 * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
1527 * @token: Token of DPNI object
1528 * @cfg: Software sequence enable configuration
1529 * Return: '0' on Success; Error code otherwise.
1531 int dpni_enable_sw_sequence(struct fsl_mc_io *mc_io,
1534 struct dpni_enable_ss_cfg *cfg);
1537 * struct dpni_sw_sequence_layout - Structure for software sequence enable
1539 * @num_ss: Number of software sequences returned
1540 * @ss: Array of software sequence entries. The number of valid entries
1541 * must match 'num_ss' value
1543 struct dpni_sw_sequence_layout {
1548 uint8_t param_offset;
1550 } ss[DPNI_SW_SEQUENCE_LAYOUT_SIZE];
1554 * dpni_get_sw_sequence_layout() - Get the soft sequence layout
1555 * @mc_io: Pointer to MC portal's I/O object
1556 * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
1557 * @token: Token of DPNI object
1558 * @src: Source of the layout (WRIOP Rx or Tx)
1559 * @ss_layout_iova: I/O virtual address of 264 bytes DMA-able memory
1561 * warning: After calling this function, call dpni_extract_sw_sequence_layout()
1564 * Return: '0' on Success; error code otherwise.
1566 int dpni_get_sw_sequence_layout(struct fsl_mc_io *mc_io,
1569 enum dpni_soft_sequence_dest src,
1570 uint64_t ss_layout_iova);
1573 * dpni_extract_sw_sequence_layout() - extract the software sequence layout
1574 * @layout: software sequence layout
1575 * @sw_sequence_layout_buf: Zeroed 264 bytes of memory before mapping it
1578 * This function has to be called after dpni_get_sw_sequence_layout
1581 void dpni_extract_sw_sequence_layout(struct dpni_sw_sequence_layout *layout,
1582 const uint8_t *sw_sequence_layout_buf);
1584 #endif /* __FSL_DPNI_H */