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

Function find_bbdev_data

dpdk/lib/bbdev/rte_bbdev.c:143–159  ·  view source on GitHub ↗

* Find data allocated for the device or if not found return first unused bbdev * data. If all structures are in use and none is used by the device return * NULL. */

Source from the content-addressed store, hash-verified

141 * NULL.
142 */
143static struct rte_bbdev_data *
144find_bbdev_data(const char *name)
145{
146 uint16_t data_id;
147
148 for (data_id = 0; data_id < RTE_BBDEV_MAX_DEVS; ++data_id) {
149 if (strlen(rte_bbdev_data[data_id].name) == 0) {
150 memset(&rte_bbdev_data[data_id], 0,
151 sizeof(struct rte_bbdev_data));
152 return &rte_bbdev_data[data_id];
153 } else if (strncmp(rte_bbdev_data[data_id].name, name,
154 RTE_BBDEV_NAME_MAX_LEN) == 0)
155 return &rte_bbdev_data[data_id];
156 }
157
158 return NULL;
159}
160
161/* Find lowest device id with no attached device */
162static uint16_t

Callers 1

rte_bbdev_allocateFunction · 0.85

Calls 2

memsetFunction · 0.85
strncmpFunction · 0.85

Tested by

no test coverage detected