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

Function skeleton_rawdev_get_attr

dpdk/drivers/raw/skeleton/skeleton_rawdev.c:333–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333static int skeleton_rawdev_get_attr(struct rte_rawdev *dev,
334 const char *attr_name,
335 uint64_t *attr_value)
336{
337 int i;
338 uint8_t done = 0;
339 struct skeleton_rawdev *skeldev;
340
341 SKELETON_PMD_FUNC_TRACE();
342
343 if (!dev || !attr_name || !attr_value) {
344 SKELETON_PMD_ERR("Invalid arguments for getting attributes");
345 return -EINVAL;
346 }
347
348 skeldev = skeleton_rawdev_get_priv(dev);
349
350 for (i = 0; i < SKELETON_MAX_ATTRIBUTES; i++) {
351 if (!skeldev->attr[i].name)
352 continue;
353
354 if (!strncmp(skeldev->attr[i].name, attr_name,
355 SKELETON_ATTRIBUTE_NAME_MAX)) {
356 *attr_value = skeldev->attr[i].value;
357 done = 1;
358 SKELETON_PMD_DEBUG("Attribute (%s) Value (%" PRIu64 ")",
359 attr_name, *attr_value);
360 break;
361 }
362 }
363
364 if (done)
365 return 0;
366
367 /* Attribute not found */
368 return -EINVAL;
369}
370
371static int skeleton_rawdev_set_attr(struct rte_rawdev *dev,
372 const char *attr_name,

Callers

nothing calls this directly

Calls 2

skeleton_rawdev_get_privFunction · 0.85
strncmpFunction · 0.85

Tested by

no test coverage detected