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

Function pipeline_port_in_create

dpdk/examples/ip_pipeline/pipeline.c:145–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145int
146pipeline_port_in_create(const char *pipeline_name,
147 struct port_in_params *params,
148 int enabled)
149{
150 struct rte_pipeline_port_in_params p;
151
152 union {
153 struct rte_port_ethdev_reader_params ethdev;
154 struct rte_port_ring_reader_params ring;
155 struct rte_port_sched_reader_params sched;
156 struct rte_port_fd_reader_params fd;
157 struct rte_port_source_params source;
158 struct rte_port_sym_crypto_reader_params sym_crypto;
159 } pp;
160
161 struct pipeline *pipeline;
162 struct port_in *port_in;
163 struct port_in_action_profile *ap;
164 struct rte_port_in_action *action;
165 uint32_t port_id;
166 int status;
167
168 memset(&p, 0, sizeof(p));
169 memset(&pp, 0, sizeof(pp));
170
171 /* Check input params */
172 if ((pipeline_name == NULL) ||
173 (params == NULL) ||
174 (params->burst_size == 0) ||
175 (params->burst_size > RTE_PORT_IN_BURST_SIZE_MAX))
176 return -1;
177
178 pipeline = pipeline_find(pipeline_name);
179 if (pipeline == NULL)
180 return -1;
181
182 ap = NULL;
183 if (params->action_profile_name) {
184 ap = port_in_action_profile_find(params->action_profile_name);
185 if (ap == NULL)
186 return -1;
187 }
188
189 switch (params->type) {
190 case PORT_IN_RXQ:
191 {
192 struct link *link;
193
194 link = link_find(params->dev_name);
195 if (link == NULL)
196 return -1;
197
198 if (params->rxq.queue_id >= link->n_rxq)
199 return -1;
200
201 pp.ethdev.port_id = link->port_id;
202 pp.ethdev.queue_id = params->rxq.queue_id;

Callers 1

cmd_pipeline_port_inFunction · 0.85

Calls 15

memsetFunction · 0.85
link_findFunction · 0.85
swq_findFunction · 0.85
tmgr_port_findFunction · 0.85
tap_findFunction · 0.85
mempool_findFunction · 0.85
rte_port_in_action_freeFunction · 0.85

Tested by

no test coverage detected