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

Function pmd_probe

dpdk/drivers/net/softnic/rte_eth_softnic.c:441–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441static int
442pmd_probe(struct rte_vdev_device *vdev)
443{
444 struct pmd_params p;
445 const char *params;
446 int status = 0;
447
448 void *dev_private;
449 const char *name = rte_vdev_device_name(vdev);
450
451 PMD_LOG(INFO, "Probing device \"%s\"", name);
452
453 /* Parse input arguments */
454 params = rte_vdev_device_args(vdev);
455 if (!params)
456 return -EINVAL;
457
458 status = pmd_parse_args(&p, params);
459 if (status)
460 return status;
461
462 if (rte_strscpy(p.name, name, sizeof(p.name)) < 0) {
463 PMD_LOG(WARNING,
464 "\"%s\": device name should be shorter than %zu",
465 name, sizeof(p.name));
466 return -EINVAL;
467 }
468
469 /* Allocate and initialize soft ethdev private data */
470 dev_private = pmd_init(&p);
471 if (dev_private == NULL)
472 return -ENOMEM;
473
474 /* Register soft ethdev */
475 PMD_LOG(INFO, "Creating soft ethdev \"%s\"", p.name);
476
477 status = pmd_ethdev_register(vdev, &p, dev_private);
478 if (status) {
479 pmd_free(dev_private);
480 return status;
481 }
482
483 return 0;
484}
485
486static int
487pmd_remove(struct rte_vdev_device *vdev)

Callers

nothing calls this directly

Calls 7

rte_vdev_device_nameFunction · 0.85
rte_vdev_device_argsFunction · 0.85
pmd_parse_argsFunction · 0.85
rte_strscpyFunction · 0.85
pmd_initFunction · 0.85
pmd_ethdev_registerFunction · 0.85
pmd_freeFunction · 0.85

Tested by

no test coverage detected