DPDK  24.07.0
rte_event_eth_tx_adapter.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation.
3  */
4 
5 #ifndef _RTE_EVENT_ETH_TX_ADAPTER_
6 #define _RTE_EVENT_ETH_TX_ADAPTER_
7 
79 #ifdef __cplusplus
80 extern "C" {
81 #endif
82 
83 #include <stdint.h>
84 
85 #include <rte_compat.h>
86 #include <rte_mbuf.h>
87 
88 #include "rte_eventdev.h"
89 
97  uint8_t event_port_id;
102  uint32_t max_nb_tx;
107 };
108 
113  uint32_t max_nb_tx;
129  uint16_t flush_threshold;
136  uint16_t rsvd[29];
138 };
139 
160 typedef int (*rte_event_eth_tx_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
161  struct rte_event_eth_tx_adapter_conf *conf,
162  void *arg);
163 
168  uint64_t tx_retry;
170  uint64_t tx_packets;
172  uint64_t tx_dropped;
174 };
175 
204 int
205 rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id,
206  struct rte_event_port_conf *port_config);
207 
225 int
226 rte_event_eth_tx_adapter_create_ext(uint8_t id, uint8_t dev_id,
228  void *conf_arg);
229 
240 int
242 
252 int
254 
264 int
266 
282 int
284  uint16_t eth_dev_id,
285  int32_t queue);
286 
303 int
305  uint16_t eth_dev_id,
306  int32_t queue);
307 
317 static __rte_always_inline void
318 rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
319 {
320  pkt->hash.txadapter.txq = queue;
321 }
322 
333 static __rte_always_inline uint16_t
335 {
336  return pkt->hash.txadapter.txq;
337 }
338 
352 int
354 
355 #define RTE_EVENT_ETH_TX_ADAPTER_ENQUEUE_SAME_DEST 0x1
356 
403 static inline uint16_t
405  uint8_t port_id,
406  struct rte_event ev[],
407  uint16_t nb_events,
408  const uint8_t flags)
409 {
410  const struct rte_event_fp_ops *fp_ops;
411  void *port;
412 
413  fp_ops = &rte_event_fp_ops[dev_id];
414  port = fp_ops->data[port_id];
415 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
416  if (dev_id >= RTE_EVENT_MAX_DEVS ||
417  port_id >= RTE_EVENT_MAX_PORTS_PER_DEV) {
418  rte_errno = EINVAL;
419  return 0;
420  }
421 
422  if (port == NULL) {
423  rte_errno = EINVAL;
424  return 0;
425  }
426 #endif
427  rte_eventdev_trace_eth_tx_adapter_enqueue(dev_id, port_id, ev,
428  nb_events, flags);
429  if (flags)
430  return fp_ops->txa_enqueue_same_dest(port, ev, nb_events);
431  else
432  return fp_ops->txa_enqueue(port, ev, nb_events);
433 }
434 
446 int
448  struct rte_event_eth_tx_adapter_stats *stats);
449 
459 int
461 
475 int
476 rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
477 
495 int
496 rte_event_eth_tx_adapter_instance_get(uint16_t eth_dev_id,
497  uint16_t tx_queue_id,
498  uint8_t *txa_inst_id);
529 int
530 rte_event_eth_tx_adapter_queue_start(uint16_t eth_dev_id, uint16_t tx_queue_id);
531 
547 int
548 rte_event_eth_tx_adapter_queue_stop(uint16_t eth_dev_id, uint16_t tx_queue_id);
549 
560 __rte_experimental
561 int
563  struct rte_event_eth_tx_adapter_runtime_params *txa_params);
564 
582 __rte_experimental
583 int
586 
600 __rte_experimental
601 int
604 
605 #ifdef __cplusplus
606 }
607 #endif
608 #endif /* _RTE_EVENT_ETH_TX_ADAPTER_ */
int rte_event_eth_tx_adapter_queue_start(uint16_t eth_dev_id, uint16_t tx_queue_id)
#define __rte_always_inline
Definition: rte_common.h:370
int rte_event_eth_tx_adapter_start(uint8_t id)
#define rte_errno
Definition: rte_errno.h:29
static uint16_t rte_event_eth_tx_adapter_enqueue(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events, const uint8_t flags)
int rte_event_eth_tx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, int32_t queue)
int rte_event_eth_tx_adapter_stop(uint8_t id)
__rte_experimental int rte_event_eth_tx_adapter_runtime_params_set(uint8_t id, struct rte_event_eth_tx_adapter_runtime_params *params)
int rte_event_eth_tx_adapter_queue_add(uint8_t id, uint16_t eth_dev_id, int32_t queue)
static __rte_always_inline void rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
int rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
static __rte_always_inline uint16_t rte_event_eth_tx_adapter_txq_get(struct rte_mbuf *pkt)
int rte_event_eth_tx_adapter_stats_reset(uint8_t id)
int rte_event_eth_tx_adapter_stats_get(uint8_t id, struct rte_event_eth_tx_adapter_stats *stats)
int rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id, struct rte_event_port_conf *port_config)
__rte_experimental int rte_event_eth_tx_adapter_runtime_params_get(uint8_t id, struct rte_event_eth_tx_adapter_runtime_params *params)
int(* rte_event_eth_tx_adapter_conf_cb)(uint8_t id, uint8_t dev_id, struct rte_event_eth_tx_adapter_conf *conf, void *arg)
int rte_event_eth_tx_adapter_free(uint8_t id)
int rte_event_eth_tx_adapter_create_ext(uint8_t id, uint8_t dev_id, rte_event_eth_tx_adapter_conf_cb conf_cb, void *conf_arg)
int rte_event_eth_tx_adapter_instance_get(uint16_t eth_dev_id, uint16_t tx_queue_id, uint8_t *txa_inst_id)
int rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
int rte_event_eth_tx_adapter_queue_stop(uint16_t eth_dev_id, uint16_t tx_queue_id)
__rte_experimental int rte_event_eth_tx_adapter_runtime_params_init(struct rte_event_eth_tx_adapter_runtime_params *txa_params)