DPDK  19.02.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 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 #include <stdint.h>
78 
79 #include <rte_mbuf.h>
80 
81 #include "rte_eventdev.h"
82 
93  uint8_t event_port_id;
98  uint32_t max_nb_tx;
103 };
104 
128 typedef int (*rte_event_eth_tx_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
129  struct rte_event_eth_tx_adapter_conf *conf,
130  void *arg);
131 
139  uint64_t tx_retry;
141  uint64_t tx_packets;
143  uint64_t tx_dropped;
145 };
146 
164 int __rte_experimental
165 rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id,
166  struct rte_event_port_conf *port_config);
167 
188 int __rte_experimental
189 rte_event_eth_tx_adapter_create_ext(uint8_t id, uint8_t dev_id,
191  void *conf_arg);
192 
206 int __rte_experimental
208 
221 int __rte_experimental
223 
236 int __rte_experimental
238 
257 int __rte_experimental
259  uint16_t eth_dev_id,
260  int32_t queue);
261 
281 int __rte_experimental
283  uint16_t eth_dev_id,
284  int32_t queue);
285 
298 static __rte_always_inline void __rte_experimental
299 rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
300 {
301  pkt->hash.txadapter.txq = queue;
302 }
303 
317 static __rte_always_inline uint16_t __rte_experimental
319 {
320  return pkt->hash.txadapter.txq;
321 }
322 
339 int __rte_experimental
340 rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
341 
380 static inline uint16_t __rte_experimental
382  uint8_t port_id,
383  struct rte_event ev[],
384  uint16_t nb_events)
385 {
386  const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
387 
388 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
389  if (dev_id >= RTE_EVENT_MAX_DEVS ||
390  !rte_eventdevs[dev_id].attached) {
391  rte_errno = -EINVAL;
392  return 0;
393  }
394 
395  if (port_id >= dev->data->nb_ports) {
396  rte_errno = -EINVAL;
397  return 0;
398  }
399 #endif
400  return dev->txa_enqueue(dev->data->ports[port_id], ev, nb_events);
401 }
402 
417 int __rte_experimental
419  struct rte_event_eth_tx_adapter_stats *stats);
420 
433 int __rte_experimental
435 
452 int __rte_experimental
453 rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
454 
455 #ifdef __cplusplus
456 }
457 #endif
458 #endif /* _RTE_EVENT_ETH_TX_ADAPTER_ */