Lines Matching defs:driver

155     mods = [{"Name": driver, "Found": False} for driver in dpdk_drivers]
166 # change DPDK driver list to only contain drivers that are loaded
171 '''return true if a device is assigned to a driver. False otherwise'''
274 for driver in dpdk_drivers:
275 if driver not in devices[d]["Module_str"]:
277 devices[d]["Module_str"] + ",%s" % driver
281 # make sure the driver and module strings do not have any duplicates
330 '''Unbind the device identified by "dev_id" from its current driver'''
333 print("Notice: %s %s %s is not currently managed by any driver" %
354 def bind_one(dev_id, driver, force):
355 '''Bind the device given by "dev_id" to the driver "driver". If the device
356 is already bound to a different driver, it will be unbound first'''
368 if dev["Driver_str"] == driver:
369 print("Notice: %s already bound to driver %s, skipping" %
370 (dev_id, driver), file=sys.stderr)
374 dev["Driver_str"] = "" # clear driver string
376 # For kernels >= 3.15 driver_override can be used to specify the driver
377 # for a device rather than relying on the driver to provide a positive
379 # the vendor and device ID, adding them to the driver new_id,
382 if driver in dpdk_drivers:
392 f.write("%s" % driver)
395 print("Error: bind failed for %s - Cannot write driver %s to "
396 "PCI ID: %s" % (dev_id, driver, err), file=sys.stderr)
398 # For kernels < 3.15 use new_id to add PCI id's to the driver
400 filename = "/sys/bus/pci/drivers/%s/new_id" % driver
414 "driver %s: %s" % (dev_id, driver, err), file=sys.stderr)
418 filename = "/sys/bus/pci/drivers/%s/bind" % driver
424 if saved_driver is not None: # restore any previous driver
435 if "Driver_str" in tmp and tmp["Driver_str"] == driver:
437 print("Error: bind failed for %s - Cannot bind to driver %s: %s"
438 % (dev_id, driver, err), file=sys.stderr)
439 if saved_driver is not None: # restore any previous driver
443 # For kernels > 3.15 driver_override is used to bind a device to a driver.
445 # the device can be bound to any other driver
510 def bind_all(dev_list, driver, force=False):
514 # a common user error is to forget to specify the driver the devices need to
515 # be bound to. check if the driver is a valid device, and if it is, show
518 dev_id_from_dev_name(driver)
519 # if we've made it this far, this means that the "driver" was a valid
520 # device string, so it's probably not a valid driver name.
521 sys.exit("Error: Driver '%s' does not look like a valid driver. "
522 "Did you forget to specify the driver to bind devices to?" % driver)
524 # driver generated error - it's not a valid device ID, so all is well
527 # check if we're attempting to bind to a driver that isn't loaded
528 if not module_is_loaded(driver.replace('-', '_')):
529 sys.exit("Error: Driver '%s' is not loaded." % driver)
537 if driver == "vfio-pci" and not has_iommu():
541 bind_one(d, driver, force)
543 # For kernels < 3.15 when binding devices to a generic driver
545 # that are not bound to any other driver could be bound even if no one has
622 display_devices("%s devices using DPDK-compatible driver" % device_name,
631 display_devices("%s devices using kernel driver" % device_name,
642 Displays to the user what devices are bound to the igb_uio driver, the
643 kernel driver or to no driver'''
711 To bind eth1 from the current driver and move to use vfio-pci
714 To unbind 0000:01:00.0 from using any driver
717 To bind 0000:02:00.0 and 0000:02:00.1 to the ixgbe kernel driver
736 help="Select the driver to use or \"none\" to unbind the device")