DPDK  18.02.2
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;
168  uint16_t servicing_weight;
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;
211  uint64_t rx_enq_block_cycles;
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 
332  uint8_t eth_dev_id,
333  int32_t rx_queue_id,
334  const struct rte_event_eth_rx_adapter_queue_conf *conf);
335 
360 int rte_event_eth_rx_adapter_queue_del(uint8_t id, uint8_t eth_dev_id,
361  int32_t rx_queue_id);
362 
376 int rte_event_eth_rx_adapter_start(uint8_t id);
377 
391 int rte_event_eth_rx_adapter_stop(uint8_t id);
392 
410  struct rte_event_eth_rx_adapter_stats *stats);
411 
426 
445 int rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
446 
447 #ifdef __cplusplus
448 }
449 #endif
450 #endif /* _RTE_EVENT_ETH_RX_ADAPTER_ */