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

Function rte_devargs_insert

dpdk/lib/eal/common/eal_common_devargs.c:292–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292int
293rte_devargs_insert(struct rte_devargs **da)
294{
295 struct rte_devargs *listed_da;
296 void *tmp;
297
298 if (*da == NULL || (*da)->bus == NULL)
299 return -1;
300
301 RTE_TAILQ_FOREACH_SAFE(listed_da, &devargs_list, next, tmp) {
302 if (listed_da == *da)
303 /* devargs already in the list */
304 return 0;
305 if (strcmp(listed_da->bus->name, (*da)->bus->name) == 0 &&
306 strcmp(listed_da->name, (*da)->name) == 0) {
307 /* device already in devargs list, must be updated */
308 (*da)->next = listed_da->next;
309 rte_devargs_reset(listed_da);
310 *listed_da = **da;
311 /* replace provided devargs with found one */
312 free(*da);
313 *da = listed_da;
314 return 0;
315 }
316 }
317 /* new device in the list */
318 TAILQ_INSERT_TAIL(&devargs_list, *da, next);
319 return 0;
320}
321
322/* store in allowed list parameter for later parsing */
323int

Callers 2

local_dev_probeFunction · 0.85
insert_vdevFunction · 0.85

Calls 3

strcmpFunction · 0.85
rte_devargs_resetFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected