xref: /dpdk/app/graph/ethdev_priv.h (revision 0f32dac4bbf74761972249090523f4581ca13126)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2023 Marvell.
3  */
4 
5 #ifndef APP_GRAPH_ETHDEV_PRIV_H
6 #define APP_GRAPH_ETHDEV_PRIV_H
7 
8 #include "ethdev.h"
9 
10 #define NS_PER_SEC 1E9
11 
12 #define ETHDEV_RXQ_RSS_MAX	16
13 #define ETHDEV_RX_DESC_DEFAULT 1024
14 #define ETHDEV_TX_DESC_DEFAULT 1024
15 
16 struct ethdev_rss_config {
17 	uint32_t queue_id[ETHDEV_RXQ_RSS_MAX];
18 	uint32_t n_queues;
19 };
20 
21 struct ethdev_config {
22 	char dev_name[RTE_ETH_NAME_MAX_LEN];
23 	uint16_t port_id;
24 
25 	struct {
26 		uint32_t n_queues;
27 		uint32_t queue_size;
28 		char mempool_name[RTE_MEMPOOL_NAMESIZE];
29 		struct rte_mempool *mp;
30 		struct ethdev_rss_config *rss;
31 	} rx;
32 
33 	struct {
34 		uint32_t n_queues;
35 		uint32_t queue_size;
36 	} tx;
37 
38 	int promiscuous;
39 	uint32_t mtu;
40 };
41 
42 struct ethdev {
43 	TAILQ_ENTRY(ethdev) next;
44 	uint16_t tx_port_id;
45 	struct ethdev_config config;
46 	struct ipv4_addr_config ip4_addr;
47 	struct ipv6_addr_config ip6_addr;
48 };
49 TAILQ_HEAD(ethdev_head, ethdev);
50 #endif
51