DPDK 22.11.5
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
76#ifdef __cplusplus
77extern "C" {
78#endif
79
80#include <stdint.h>
81
82#include <rte_compat.h>
83#include <rte_mbuf.h>
84
85#include "rte_eventdev.h"
86
99 uint32_t max_nb_tx;
104};
105
126typedef int (*rte_event_eth_tx_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
128 void *arg);
129
134 uint64_t tx_retry;
136 uint64_t tx_packets;
138 uint64_t tx_dropped;
140};
141
156int
157rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id,
158 struct rte_event_port_conf *port_config);
159
177int
178rte_event_eth_tx_adapter_create_ext(uint8_t id, uint8_t dev_id,
180 void *conf_arg);
181
192int
194
204int
206
216int
218
234int
236 uint16_t eth_dev_id,
237 int32_t queue);
238
255int
257 uint16_t eth_dev_id,
258 int32_t queue);
259
269static __rte_always_inline void
270rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
271{
272 pkt->hash.txadapter.txq = queue;
273}
274
285static __rte_always_inline uint16_t
287{
288 return pkt->hash.txadapter.txq;
289}
290
304int
305rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
306
307#define RTE_EVENT_ETH_TX_ADAPTER_ENQUEUE_SAME_DEST 0x1
355static inline uint16_t
357 uint8_t port_id,
358 struct rte_event ev[],
359 uint16_t nb_events,
360 const uint8_t flags)
361{
362 const struct rte_event_fp_ops *fp_ops;
363 void *port;
364
365 fp_ops = &rte_event_fp_ops[dev_id];
366 port = fp_ops->data[port_id];
367#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
368 if (dev_id >= RTE_EVENT_MAX_DEVS ||
369 port_id >= RTE_EVENT_MAX_PORTS_PER_DEV) {
370 rte_errno = EINVAL;
371 return 0;
372 }
373
374 if (port == NULL) {
375 rte_errno = EINVAL;
376 return 0;
377 }
378#endif
379 rte_eventdev_trace_eth_tx_adapter_enqueue(dev_id, port_id, ev,
380 nb_events, flags);
381 if (flags)
382 return fp_ops->txa_enqueue_same_dest(port, ev, nb_events);
383 else
384 return fp_ops->txa_enqueue(port, ev, nb_events);
385}
386
398int
400 struct rte_event_eth_tx_adapter_stats *stats);
401
411int
413
427int
428rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
429
447__rte_experimental
448int
450 uint16_t tx_queue_id,
451 uint8_t *txa_inst_id);
482__rte_experimental
483int
484rte_event_eth_tx_adapter_queue_start(uint16_t eth_dev_id, uint16_t tx_queue_id);
485
501__rte_experimental
502int
503rte_event_eth_tx_adapter_queue_stop(uint16_t eth_dev_id, uint16_t tx_queue_id);
504
505#ifdef __cplusplus
506}
507#endif
508#endif /* _RTE_EVENT_ETH_TX_ADAPTER_ */
#define __rte_always_inline
Definition: rte_common.h:255
#define rte_errno
Definition: rte_errno.h:29
int rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
int rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
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)
static __rte_always_inline void rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
__rte_experimental int rte_event_eth_tx_adapter_queue_start(uint16_t eth_dev_id, uint16_t tx_queue_id)
int rte_event_eth_tx_adapter_free(uint8_t id)
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_instance_get(uint16_t eth_dev_id, uint16_t tx_queue_id, uint8_t *txa_inst_id)
int rte_event_eth_tx_adapter_queue_add(uint8_t id, uint16_t eth_dev_id, int32_t queue)
int rte_event_eth_tx_adapter_stats_reset(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_stop(uint8_t id)
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)
__rte_experimental int rte_event_eth_tx_adapter_queue_stop(uint16_t eth_dev_id, uint16_t tx_queue_id)
int rte_event_eth_tx_adapter_stats_get(uint8_t id, struct rte_event_eth_tx_adapter_stats *stats)
static __rte_always_inline uint16_t rte_event_eth_tx_adapter_txq_get(struct rte_mbuf *pkt)
int rte_event_eth_tx_adapter_start(uint8_t id)
int rte_event_eth_tx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, int32_t queue)