1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Marvell International Ltd.
3 * Copyright(c) 2017 Semihalf.
10 #include <rte_common.h>
12 #include "mrvl_ethdev.h"
14 /** Code Points per Traffic Class. Equals max(DSCP, PCP). */
15 #define MRVL_CP_PER_TC (64)
17 /** Value used as "unknown". */
18 #define MRVL_UNKNOWN_TC (0xFF)
23 struct pp2_parse_udfs prs_udfs;
26 enum pp2_ppio_eth_start_hdr eth_start_hdr;
27 int rate_limit_enable;
28 struct pp2_ppio_rate_limit_params rate_limit_params;
30 uint8_t inq[MRVL_PP2_RXQ_MAX];
31 uint8_t dscp[MRVL_CP_PER_TC];
32 uint8_t pcp[MRVL_CP_PER_TC];
36 enum pp2_ppio_color color;
37 } tc[MRVL_PP2_TC_MAX];
39 enum pp2_ppio_outq_sched_mode sched_mode;
41 int rate_limit_enable;
42 struct pp2_ppio_rate_limit_params rate_limit_params;
43 } outq[MRVL_PP2_RXQ_MAX];
44 enum pp2_cls_qos_tbl_type mapping_priority;
48 uint8_t use_qos_global_defaults;
49 struct pp2_cls_plcr_params policer_params;
50 uint8_t setup_policer;
51 uint8_t forward_bad_frames;
52 uint32_t fill_bpool_buffs;
53 } port[RTE_MAX_ETHPORTS];
56 /** Global configuration. */
57 extern struct mrvl_cfg *mrvl_cfg;
60 * Parse configuration - rte_kvargs_process handler.
62 * Opens configuration file and parses its content.
65 * @param path Path to config file.
66 * @param extra_args Pointer to configuration structure.
67 * @returns 0 in case of success, exits otherwise.
70 mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args);
73 * Configure RX Queues in a given port.
75 * Sets up RX queues, their Traffic Classes and DPDK rxq->(TC,inq) mapping.
77 * @param priv Port's private data
78 * @param portid DPDK port ID
79 * @param max_queues Maximum number of queues to configure.
80 * @returns 0 in case of success, negative value otherwise.
83 mrvl_configure_rxqs(struct mrvl_priv *priv, uint16_t portid,
87 * Configure TX Queues in a given port.
89 * Sets up TX queues egress scheduler and limiter.
91 * @param priv Port's private data
92 * @param portid DPDK port ID
93 * @param max_queues Maximum number of queues to configure.
94 * @returns 0 in case of success, negative value otherwise.
97 mrvl_configure_txqs(struct mrvl_priv *priv, uint16_t portid,
103 * Finalize QoS table configuration and initialize it in SDK. It can be done
104 * only after port is started, so we have a valid ppio reference.
106 * @param priv Port's private (configuration) data.
107 * @returns 0 in case of success, exits otherwise.
110 mrvl_start_qos_mapping(struct mrvl_priv *priv);
112 #endif /* _MRVL_QOS_H_ */