DPDK  17.11.10
rte_event_eth_rx_adapter.h
Go to the documentation of this file.
1 /*
2  * Copyright(c) 2017 Intel Corporation. All rights reserved.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * * Neither the name of Intel Corporation nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef _RTE_EVENT_ETH_RX_ADAPTER_
33 #define _RTE_EVENT_ETH_RX_ADAPTER_
34 
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94 
95 #include <stdint.h>
96 
97 #include <rte_service.h>
98 
99 #include "rte_eventdev.h"
100 
101 #define RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE 32
102 
103 /* struct rte_event_eth_rx_adapter_queue_conf flags definitions */
104 #define RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID 0x1
105 
118  uint8_t event_port_id;
122  uint32_t max_nb_rx;
127 };
128 
153 typedef int (*rte_event_eth_rx_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
154  struct rte_event_eth_rx_adapter_conf *conf,
155  void *arg);
156 
164  uint32_t rx_queue_flags;
175  struct rte_event ev;
192 };
193 
201  uint64_t rx_poll_count;
203  uint64_t rx_packets;
205  uint64_t rx_enq_count;
207  uint64_t rx_enq_retry;
209  uint64_t rx_enq_start_ts;
215  uint64_t rx_enq_end_ts;
221 };
222 
247 int rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
249  void *conf_arg);
250 
277 int rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id,
278  struct rte_event_port_conf *port_config);
279 
294 int rte_event_eth_rx_adapter_free(uint8_t id);
295 
326  uint8_t eth_dev_id,
327  int32_t rx_queue_id,
328  const struct rte_event_eth_rx_adapter_queue_conf *conf);
329 
354 int rte_event_eth_rx_adapter_queue_del(uint8_t id, uint8_t eth_dev_id,
355  int32_t rx_queue_id);
356 
370 int rte_event_eth_rx_adapter_start(uint8_t id);
371 
385 int rte_event_eth_rx_adapter_stop(uint8_t id);
386 
404  struct rte_event_eth_rx_adapter_stats *stats);
405 
420 
439 int rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
440 
441 #ifdef __cplusplus
442 }
443 #endif
444 #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)
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)
int rte_event_eth_rx_adapter_queue_del(uint8_t id, uint8_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_queue_add(uint8_t id, uint8_t eth_dev_id, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *conf)