dpdk/examples/ip_pipeline/tmgr.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: BSD-3-Clause
   2 * Copyright(c) 2010-2018 Intel Corporation
   3 */
   4
   5#ifndef _INCLUDE_TMGR_H_
   6#define _INCLUDE_TMGR_H_
   7
   8#include <stdint.h>
   9#include <sys/queue.h>
  10
  11#include <rte_sched.h>
  12#include <rte_red.h>
  13
  14#include "common.h"
  15
  16#ifndef TMGR_PIPE_SUBPORT_MAX
  17#define TMGR_PIPE_SUBPORT_MAX                              4096
  18#endif
  19
  20#ifndef TMGR_SUBPORT_PROFILE_MAX
  21#define TMGR_SUBPORT_PROFILE_MAX                           256
  22#endif
  23
  24#ifndef TMGR_PIPE_PROFILE_MAX
  25#define TMGR_PIPE_PROFILE_MAX                              256
  26#endif
  27
  28struct tmgr_port {
  29        TAILQ_ENTRY(tmgr_port) node;
  30        char name[NAME_SIZE];
  31        struct rte_sched_port *s;
  32        uint32_t n_subports_per_port;
  33        uint32_t n_pipes_per_subport;
  34};
  35
  36TAILQ_HEAD(tmgr_port_list, tmgr_port);
  37
  38int
  39tmgr_init(void);
  40
  41struct tmgr_port *
  42tmgr_port_find(const char *name);
  43
  44struct tmgr_port_params {
  45        uint64_t rate;
  46        uint32_t n_subports_per_port;
  47        uint32_t n_pipes_per_subport;
  48        uint32_t frame_overhead;
  49        uint32_t mtu;
  50        uint32_t cpu_id;
  51};
  52
  53int
  54tmgr_subport_profile_add(struct rte_sched_subport_profile_params *sp);
  55
  56int
  57tmgr_pipe_profile_add(struct rte_sched_pipe_params *p);
  58
  59struct tmgr_port *
  60tmgr_port_create(const char *name, struct tmgr_port_params *params);
  61
  62int
  63tmgr_subport_config(const char *port_name,
  64        uint32_t subport_id,
  65        uint32_t subport_profile_id);
  66
  67int
  68tmgr_pipe_config(const char *port_name,
  69        uint32_t subport_id,
  70        uint32_t pipe_id_first,
  71        uint32_t pipe_id_last,
  72        uint32_t pipe_profile_id);
  73
  74#endif /* _INCLUDE_TMGR_H_ */
  75