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

Function vdev_netvsc_scan_callback

dpdk/drivers/net/vdev_netvsc/vdev_netvsc.c:788–806  ·  view source on GitHub ↗

* A callback called by vdev bus scan function to ensure this driver probing * automatically in Hyper-V VM system unless it already exists in the * devargs list. */

Source from the content-addressed store, hash-verified

786 * devargs list.
787 */
788static void
789vdev_netvsc_scan_callback(__rte_unused void *arg)
790{
791 struct rte_device *dev;
792 struct rte_devargs *devargs;
793 struct rte_bus *vbus = rte_bus_find_by_name("vdev");
794
795 RTE_EAL_DEVARGS_FOREACH("vdev", devargs)
796 if (!strncmp(devargs->name, VDEV_NETVSC_DRIVER_NAME,
797 VDEV_NETVSC_DRIVER_NAME_LEN))
798 return;
799
800 dev = vbus->find_device(NULL, vdev_netvsc_cmp_rte_device,
801 VDEV_NETVSC_DRIVER_NAME);
802 if (dev)
803 return;
804 if (rte_devargs_add(RTE_DEVTYPE_VIRTUAL, VDEV_NETVSC_DRIVER_NAME))
805 DRV_LOG(ERR, "unable to add netvsc devargs.");
806}
807
808/** Initialize the custom scan. */
809RTE_INIT(vdev_netvsc_custom_scan_add)

Callers

nothing calls this directly

Calls 4

rte_bus_find_by_nameFunction · 0.85
RTE_EAL_DEVARGS_FOREACHFunction · 0.85
strncmpFunction · 0.85
rte_devargs_addFunction · 0.85

Tested by

no test coverage detected