MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_node_eth_config

Function rte_node_eth_config

dpdk/lib/node/ethdev_ctrl.c:22–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20} ctrl;
21
22int
23rte_node_eth_config(struct rte_node_ethdev_config *conf, uint16_t nb_confs,
24 uint16_t nb_graphs)
25{
26 struct rte_node_register *ip4_rewrite_node;
27 struct rte_node_register *ip6_rewrite_node;
28 struct ethdev_tx_node_main *tx_node_data;
29 uint16_t tx_q_used, rx_q_used, port_id;
30 struct rte_node_register *tx_node;
31 char name[RTE_NODE_NAMESIZE];
32 const char *next_nodes = name;
33 struct rte_mempool *mp;
34 int i, j, rc;
35 uint32_t id;
36
37 ip4_rewrite_node = ip4_rewrite_node_get();
38 ip6_rewrite_node = ip6_rewrite_node_get();
39 tx_node_data = ethdev_tx_node_data_get();
40 tx_node = ethdev_tx_node_get();
41 for (i = 0; i < nb_confs; i++) {
42 port_id = conf[i].port_id;
43
44 if (!rte_eth_dev_is_valid_port(port_id))
45 return -EINVAL;
46
47 /* Check for mbuf minimum private size requirement */
48 for (j = 0; j < conf[i].mp_count; j++) {
49 mp = conf[i].mp[j];
50 if (!mp)
51 continue;
52 /* Check for minimum private space */
53 if (rte_pktmbuf_priv_size(mp) < NODE_MBUF_PRIV2_SIZE) {
54 node_err("ethdev",
55 "Minimum mbuf priv size requirement not met by mp %s",
56 mp->name);
57 return -EINVAL;
58 }
59 }
60
61 rx_q_used = conf[i].num_rx_queues;
62 tx_q_used = conf[i].num_tx_queues;
63 /* Check if we have a txq for each worker */
64 if (tx_q_used < nb_graphs)
65 return -EINVAL;
66
67 /* Create node for each rx port queue pair */
68 for (j = 0; j < rx_q_used; j++) {
69 struct ethdev_rx_node_main *rx_node_data;
70 struct rte_node_register *rx_node;
71 ethdev_rx_node_elem_t *elem;
72
73 rx_node_data = ethdev_rx_get_node_data_get();
74 rx_node = ethdev_rx_node_get();
75 snprintf(name, sizeof(name), "%u-%u", port_id, j);
76 /* Clone a new rx node with same edges as parent */
77 id = rte_node_clone(rx_node->id, name);
78 if (id == RTE_NODE_ID_INVALID)
79 return -EIO;

Callers 2

usecase_l3fwd_configureFunction · 0.85
mainFunction · 0.85

Calls 15

ip4_rewrite_node_getFunction · 0.85
ip6_rewrite_node_getFunction · 0.85
ethdev_tx_node_data_getFunction · 0.85
ethdev_tx_node_getFunction · 0.85
rte_pktmbuf_priv_sizeFunction · 0.85
ethdev_rx_node_getFunction · 0.85
snprintfFunction · 0.85
rte_node_cloneFunction · 0.85
mallocFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected