Search code examples
linux-device-driverinfiniband

What is the meaning of "driver core" in the context of Linux kernel device drivers?


I was reading through the Linux Device Drivers, Third Edition book and in the "Putting It All Together" section in Chapter 14, they mention the interaction between "PCI core, driver core and the individual PCI drivers." And they used the word "driver core" multiple other times. Is the "driver core" different from the "character device driver"?

My question is arises from the intent of understanding the InfiniBand stack. The IB stack spans both the user-space and the kernel-space. So, if I am writing a simple ping-pong InfiniBand program to run on the Mellanox ConnectX-4 NIC, my binary will depend on 2 user-space libraries: libibverbs and libmlx5, AND 3 kernel-modules: ib_uverbs, mlx5_ib and mlx5_core. I know ib_uverbs is a character device driver. But can we consider the mlx5_ib and mlx5_core kernel modules as some category of driver? Or are their functions just globally exported in order to interface with them?


Solution

  • The driver core is the generic code that manages drivers, devices, buses, classes, etc. It is not tied to a specific bus or device. I believe the chapter you refer to provides several examples to the division of labor between the PCI bus driver and the driver core, for example, see Figure 14-3 (Device-creation process).

    Of the three kernel modules you mention, two participate in the device core: ib_uverbs registers its character devices to export RDMA functionality to user-space; mlx5_core registers a PCI driver to handle ConnectX NICs; mlx5_ib can also be considered a driver, but the RDMA subsystem doesn't use the device core to register drivers (it has its own API - ib_register_device).