DPDK  21.08.0
rte_event_eth_rx_adapter.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Intel Corporation.
3  * All rights reserved.
4  */
5 
6 #ifndef _RTE_EVENT_ETH_RX_ADAPTER_
7 #define _RTE_EVENT_ETH_RX_ADAPTER_
8 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
82 #include <stdint.h>
83 
84 #include <rte_service.h>
85 
86 #include "rte_eventdev.h"
87 
88 #define RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE 32
89 
90 /* struct rte_event_eth_rx_adapter_queue_conf flags definitions */
91 #define RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID 0x1
92 
95 #define RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR 0x2
96 
106  uint8_t event_port_id;
110  uint32_t max_nb_rx;
115 };
116 
138 typedef int (*rte_event_eth_rx_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
139  struct rte_event_eth_rx_adapter_conf *conf,
140  void *arg);
141 
146  uint32_t rx_queue_flags;
157  struct rte_event ev;
174 };
175 
176 struct rte_event_eth_rx_adapter_event_vector_config {
177  uint16_t vector_sz;
186  uint64_t vector_timeout_ns;
196  struct rte_mempool *vector_mp;
204 };
205 
210  uint64_t rx_poll_count;
212  uint64_t rx_packets;
214  uint64_t rx_enq_count;
216  uint64_t rx_enq_retry;
218  uint64_t rx_dropped;
220  uint64_t rx_enq_start_ts;
226  uint64_t rx_enq_end_ts;
232  uint64_t rx_intr_packets;
234 };
235 
240  uint16_t min_sz;
244  uint16_t max_sz;
248  uint8_t log2_sz;
252  uint64_t min_timeout_ns;
256  uint64_t max_timeout_ns;
260 };
261 
302 typedef uint16_t (*rte_event_eth_rx_adapter_cb_fn)(uint16_t eth_dev_id,
303  uint16_t queue_id,
304  uint32_t enqueue_buf_size,
305  uint32_t enqueue_buf_count,
306  struct rte_event *ev,
307  uint16_t nb_event,
308  void *cb_arg,
309  uint16_t *nb_dropped);
310 
332 int rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
334  void *conf_arg);
335 
359 int rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id,
360  struct rte_event_port_conf *port_config);
361 
373 int rte_event_eth_rx_adapter_free(uint8_t id);
374 
408  uint16_t eth_dev_id,
409  int32_t rx_queue_id,
410  const struct rte_event_eth_rx_adapter_queue_conf *conf);
411 
433 int rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id,
434  int32_t rx_queue_id);
435 
450 int rte_event_eth_rx_adapter_start(uint8_t id);
451 
462 int rte_event_eth_rx_adapter_stop(uint8_t id);
463 
478  struct rte_event_eth_rx_adapter_stats *stats);
479 
491 
507 int rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
508 
526 int rte_event_eth_rx_adapter_cb_register(uint8_t id, uint16_t eth_dev_id,
528  void *cb_arg);
529 
546 __rte_experimental
548  uint8_t dev_id, uint16_t eth_port_id,
550 
573 __rte_experimental
575  uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id,
576  struct rte_event_eth_rx_adapter_event_vector_config *config);
577 
578 #ifdef __cplusplus
579 }
580 #endif
581 #endif /* _RTE_EVENT_ETH_RX_ADAPTER_ */
int rte_event_eth_rx_adapter_start(uint8_t id)
int rte_event_eth_rx_adapter_free(uint8_t id)
__rte_experimental int rte_event_eth_rx_adapter_vector_limits_get(uint8_t dev_id, uint16_t eth_port_id, struct rte_event_eth_rx_adapter_vector_limits *limits)
int rte_event_eth_rx_adapter_stats_get(uint8_t id, struct rte_event_eth_rx_adapter_stats *stats)
int rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, rte_event_eth_rx_adapter_conf_cb conf_cb, void *conf_arg)
int rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
int rte_event_eth_rx_adapter_stats_reset(uint8_t id)
uint16_t(* rte_event_eth_rx_adapter_cb_fn)(uint16_t eth_dev_id, uint16_t queue_id, uint32_t enqueue_buf_size, uint32_t enqueue_buf_count, struct rte_event *ev, uint16_t nb_event, void *cb_arg, uint16_t *nb_dropped)
int rte_event_eth_rx_adapter_queue_add(uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *conf)
__rte_experimental int rte_event_eth_rx_adapter_queue_event_vector_config(uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id, struct rte_event_eth_rx_adapter_event_vector_config *config)
int rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id)
int rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, struct rte_event_port_conf *port_config)
int rte_event_eth_rx_adapter_stop(uint8_t id)
int(* rte_event_eth_rx_adapter_conf_cb)(uint8_t id, uint8_t dev_id, struct rte_event_eth_rx_adapter_conf *conf, void *arg)
int rte_event_eth_rx_adapter_cb_register(uint8_t id, uint16_t eth_dev_id, rte_event_eth_rx_adapter_cb_fn cb_fn, void *cb_arg)