xref: /dpdk/examples/ip_pipeline/tmgr.h (revision 54a298e5f7f41c5883233dcd0f66fc57d7b351a2)
125961ff3SJasvinder Singh /* SPDX-License-Identifier: BSD-3-Clause
225961ff3SJasvinder Singh  * Copyright(c) 2010-2018 Intel Corporation
325961ff3SJasvinder Singh  */
425961ff3SJasvinder Singh 
525961ff3SJasvinder Singh #ifndef _INCLUDE_TMGR_H_
625961ff3SJasvinder Singh #define _INCLUDE_TMGR_H_
725961ff3SJasvinder Singh 
825961ff3SJasvinder Singh #include <stdint.h>
925961ff3SJasvinder Singh #include <sys/queue.h>
1025961ff3SJasvinder Singh 
1125961ff3SJasvinder Singh #include <rte_sched.h>
12*54a298e5SSavinay Dharmappa #include <rte_red.h>
1325961ff3SJasvinder Singh 
1425961ff3SJasvinder Singh #include "common.h"
1525961ff3SJasvinder Singh 
1629169a41SJasvinder Singh #ifndef TMGR_PIPE_SUBPORT_MAX
1729169a41SJasvinder Singh #define TMGR_PIPE_SUBPORT_MAX                              4096
1829169a41SJasvinder Singh #endif
1929169a41SJasvinder Singh 
2025961ff3SJasvinder Singh #ifndef TMGR_SUBPORT_PROFILE_MAX
2125961ff3SJasvinder Singh #define TMGR_SUBPORT_PROFILE_MAX                           256
2225961ff3SJasvinder Singh #endif
2325961ff3SJasvinder Singh 
2425961ff3SJasvinder Singh #ifndef TMGR_PIPE_PROFILE_MAX
2525961ff3SJasvinder Singh #define TMGR_PIPE_PROFILE_MAX                              256
2625961ff3SJasvinder Singh #endif
2725961ff3SJasvinder Singh 
2825961ff3SJasvinder Singh struct tmgr_port {
2925961ff3SJasvinder Singh 	TAILQ_ENTRY(tmgr_port) node;
3025961ff3SJasvinder Singh 	char name[NAME_SIZE];
3125961ff3SJasvinder Singh 	struct rte_sched_port *s;
3225961ff3SJasvinder Singh 	uint32_t n_subports_per_port;
33*54a298e5SSavinay Dharmappa 	uint32_t n_pipes_per_subport;
3425961ff3SJasvinder Singh };
3525961ff3SJasvinder Singh 
3625961ff3SJasvinder Singh TAILQ_HEAD(tmgr_port_list, tmgr_port);
3725961ff3SJasvinder Singh 
3825961ff3SJasvinder Singh int
3925961ff3SJasvinder Singh tmgr_init(void);
4025961ff3SJasvinder Singh 
4125961ff3SJasvinder Singh struct tmgr_port *
4225961ff3SJasvinder Singh tmgr_port_find(const char *name);
4325961ff3SJasvinder Singh 
4425961ff3SJasvinder Singh struct tmgr_port_params {
450edf18eeSJasvinder Singh 	uint64_t rate;
4625961ff3SJasvinder Singh 	uint32_t n_subports_per_port;
47*54a298e5SSavinay Dharmappa 	uint32_t n_pipes_per_subport;
4825961ff3SJasvinder Singh 	uint32_t frame_overhead;
4925961ff3SJasvinder Singh 	uint32_t mtu;
5025961ff3SJasvinder Singh 	uint32_t cpu_id;
5125961ff3SJasvinder Singh };
5225961ff3SJasvinder Singh 
5325961ff3SJasvinder Singh int
54*54a298e5SSavinay Dharmappa tmgr_subport_profile_add(struct rte_sched_subport_profile_params *sp);
5525961ff3SJasvinder Singh 
5625961ff3SJasvinder Singh int
5725961ff3SJasvinder Singh tmgr_pipe_profile_add(struct rte_sched_pipe_params *p);
5825961ff3SJasvinder Singh 
5925961ff3SJasvinder Singh struct tmgr_port *
6025961ff3SJasvinder Singh tmgr_port_create(const char *name, struct tmgr_port_params *params);
6125961ff3SJasvinder Singh 
6225961ff3SJasvinder Singh int
6325961ff3SJasvinder Singh tmgr_subport_config(const char *port_name,
6425961ff3SJasvinder Singh 	uint32_t subport_id,
6525961ff3SJasvinder Singh 	uint32_t subport_profile_id);
6625961ff3SJasvinder Singh 
6725961ff3SJasvinder Singh int
6825961ff3SJasvinder Singh tmgr_pipe_config(const char *port_name,
6925961ff3SJasvinder Singh 	uint32_t subport_id,
7025961ff3SJasvinder Singh 	uint32_t pipe_id_first,
7125961ff3SJasvinder Singh 	uint32_t pipe_id_last,
7225961ff3SJasvinder Singh 	uint32_t pipe_profile_id);
7325961ff3SJasvinder Singh 
7425961ff3SJasvinder Singh #endif /* _INCLUDE_TMGR_H_ */
75