dpdk/examples/ip_pipeline/link.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: BSD-3-Clause
   2 * Copyright(c) 2010-2018 Intel Corporation
   3 */
   4
   5#ifndef _INCLUDE_LINK_H_
   6#define _INCLUDE_LINK_H_
   7
   8#include <stdint.h>
   9#include <sys/queue.h>
  10
  11#include "common.h"
  12
  13#ifndef LINK_RXQ_RSS_MAX
  14#define LINK_RXQ_RSS_MAX                                   16
  15#endif
  16
  17struct link {
  18        TAILQ_ENTRY(link) node;
  19        char name[NAME_SIZE];
  20        uint16_t port_id;
  21        uint32_t n_rxq;
  22        uint32_t n_txq;
  23};
  24
  25TAILQ_HEAD(link_list, link);
  26
  27int
  28link_init(void);
  29
  30struct link *
  31link_find(const char *name);
  32
  33struct link *
  34link_next(struct link *link);
  35
  36struct link_params_rss {
  37        uint32_t queue_id[LINK_RXQ_RSS_MAX];
  38        uint32_t n_queues;
  39};
  40
  41struct link_params {
  42        const char *dev_name;
  43        uint16_t port_id; /**< Valid only when *dev_name* is NULL. */
  44
  45        struct {
  46                uint32_t n_queues;
  47                uint32_t queue_size;
  48                const char *mempool_name;
  49                struct link_params_rss *rss;
  50        } rx;
  51
  52        struct {
  53                uint32_t n_queues;
  54                uint32_t queue_size;
  55        } tx;
  56
  57        int promiscuous;
  58};
  59
  60struct link *
  61link_create(const char *name, struct link_params *params);
  62
  63int
  64link_is_up(const char *name);
  65
  66#endif /* _INCLUDE_LINK_H_ */
  67