DPDK  18.11.11
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 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
79 #include <stdint.h>
80 
81 #include <rte_mbuf.h>
82 
83 #include "rte_eventdev.h"
84 
95  uint8_t event_port_id;
100  uint32_t max_nb_tx;
105 };
106 
130 typedef int (*rte_event_eth_tx_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
131  struct rte_event_eth_tx_adapter_conf *conf,
132  void *arg);
133 
141  uint64_t tx_retry;
143  uint64_t tx_packets;
145  uint64_t tx_dropped;
147 };
148 
166 int __rte_experimental
167 rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id,
168  struct rte_event_port_conf *port_config);
169 
190 int __rte_experimental
191 rte_event_eth_tx_adapter_create_ext(uint8_t id, uint8_t dev_id,
193  void *conf_arg);
194 
208 int __rte_experimental
210 
223 int __rte_experimental
225 
238 int __rte_experimental
240 
259 int __rte_experimental
261  uint16_t eth_dev_id,
262  int32_t queue);
263 
283 int __rte_experimental
285  uint16_t eth_dev_id,
286  int32_t queue);
287 
300 static __rte_always_inline void __rte_experimental
301 rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
302 {
303  uint16_t *p = (uint16_t *)&pkt->hash.sched.hi;
304  p[1] = queue;
305 }
306 
320 static __rte_always_inline uint16_t __rte_experimental
322 {
323  uint16_t *p = (uint16_t *)&pkt->hash.sched.hi;
324  return p[1];
325 }
326 
343 int __rte_experimental
344 rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
345 
385 static inline uint16_t __rte_experimental
387  uint8_t port_id,
388  struct rte_event ev[],
389  uint16_t nb_events)
390 {
391  const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
392 
393 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
394  if (dev_id >= RTE_EVENT_MAX_DEVS ||
395  !rte_eventdevs[dev_id].attached) {
396  rte_errno = EINVAL;
397  return 0;
398  }
399 
400  if (port_id >= dev->data->nb_ports) {
401  rte_errno = EINVAL;
402  return 0;
403  }
404 #endif
405  return dev->txa_enqueue(dev->data->ports[port_id], ev, nb_events);
406 }
407 
422 int __rte_experimental
424  struct rte_event_eth_tx_adapter_stats *stats);
425 
438 int __rte_experimental
440 
457 int __rte_experimental
458 rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
459 
460 #ifdef __cplusplus
461 }
462 #endif
463 #endif /* _RTE_EVENT_ETH_TX_ADAPTER_ */
#define __rte_always_inline
Definition: rte_common.h:146
static __rte_always_inline void __rte_experimental rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
int __rte_experimental rte_event_eth_tx_adapter_stop(uint8_t id)
#define rte_errno
Definition: rte_errno.h:29
int __rte_experimental 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_experimental rte_event_eth_tx_adapter_stats_reset(uint8_t id)
int __rte_experimental rte_event_eth_tx_adapter_stats_get(uint8_t id, struct rte_event_eth_tx_adapter_stats *stats)
int __rte_experimental rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id, struct rte_event_port_conf *port_config)
int __rte_experimental rte_event_eth_tx_adapter_free(uint8_t id)
int __rte_experimental rte_event_eth_tx_adapter_start(uint8_t id)
int __rte_experimental rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
static uint16_t __rte_experimental rte_event_eth_tx_adapter_enqueue(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events)
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_experimental rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id)
int __rte_experimental rte_event_eth_tx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, int32_t queue)
int __rte_experimental rte_event_eth_tx_adapter_queue_add(uint8_t id, uint16_t eth_dev_id, int32_t queue)
static __rte_always_inline uint16_t __rte_experimental rte_event_eth_tx_adapter_txq_get(struct rte_mbuf *pkt)