Skip to content

Staging: hv: Consolidate driver and device abstractions

K. Y. Srinivasan lkml virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16Staging: hv: Use generic device_driver probe functiondrivers/staging/hv/blkvsc_drv.c drivers/staging/hv/hv_mouse.c drivers/staging/hv/netvsc_drv.c +2 more+7 -60 replies
2/16Staging: hv: Use generic device_driver remove functiondrivers/staging/hv/blkvsc_drv.c drivers/staging/hv/hv_mouse.c drivers/staging/hv/netvsc_drv.c +2 more+6 -60 replies
3/16Staging: hv: Use generic device_driver shutdown functiondrivers/staging/hv/blkvsc_drv.c drivers/staging/hv/vmbus_drv.c+3 -30 replies
4/16Staging: hv: Remove unnecessary function pointers in driver_contextdrivers/staging/hv/vmbus.h+0 -80 replies
5/16Staging: hv: Change the signature for vmbus_child_driver_registerdrivers/staging/hv/blkvsc_drv.c drivers/staging/hv/hv_mouse.c drivers/staging/hv/netvsc_drv.c +3 more+10 -110 replies
6/16Staging: hv: Change the signature for vmbus_child_driver_unregisterdrivers/staging/hv/blkvsc_drv.c drivers/staging/hv/hv_mouse.c drivers/staging/hv/netvsc_drv.c +3 more+10 -110 replies
7/16Staging: hv: Eliminate driver_context structuredrivers/staging/hv/blkvsc_drv.c drivers/staging/hv/hv_mouse.c drivers/staging/hv/netvsc_drv.c +4 more+103 -1180 replies
8/16Staging: hv: Eliminate blkvsc_driver_context structuredrivers/staging/hv/blkvsc_drv.c+8 -180 replies
9/16Staging: hv: Eliminate mousevsc_driver_contextdrivers/staging/hv/hv_mouse.c+7 -140 replies
9/16Staging: hv: Eliminate mousevsc_driver_contextdrivers/staging/hv/hv_mouse.c+7 -140 replies
10/16Staging: hv: Eliminate netvsc_driver_contextdrivers/staging/hv/netvsc_drv.c+8 -170 replies
11/16Staging: hv: Eliminate storvsc_driver_context structuredrivers/staging/hv/storvsc_drv.c+8 -200 replies
12/16Staging: hv: Move probe_failed_work_item from vm_devicedrivers/staging/hv/vmbus.h drivers/staging/hv/vmbus_api.h drivers/staging/hv/vmbus_drv.c+6 -30 replies
13/16Staging: hv: Remove probe_error from vm_devicedrivers/staging/hv/vmbus.h drivers/staging/hv/vmbus_api.h drivers/staging/hv/vmbus_drv.c+4 -30 replies
14/16Staging: hv: Get rid of class_id from vm_devicedrivers/staging/hv/vmbus.h drivers/staging/hv/vmbus_drv.c+29 -320 replies
15/16Staging: hv: Eliminate device_id from vm_devicedrivers/staging/hv/vmbus.h drivers/staging/hv/vmbus_drv.c+16 -200 replies
16/16Staging: hv: Remove the vm_device structuredrivers/staging/hv/blkvsc_drv.c drivers/staging/hv/hv_mouse.c drivers/staging/hv/netvsc_drv.c +4 more+73 -1010 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/16] Staging: hv: Consolidate driver and device abstractions

Hyper-V has maintained both its class independent driver and device state in two independent data structures:
Driver state: struct driver_context (vmbus.h) and struct hv_driver (vmbus_api.h)
Device state: struct vm_device (vmbus.h) and struct hv_device (vmbus_api.h)

While sruct driver_context and struct vm_device embed generic Linux abstractions of struct device_driver and struct device respectively; the lower level hyperv abstraction: struct hv_driver and struct hv_device have maintained state needed to communicate with the host. This partitioning made sense at a point in time when it was not clear how much of the hypervisor interaction would be open sourced. Given where we are today, there is no reason to keep this layering. This patchset consolidates all the driver state into a single structure:
struct hv_driver while all the device state is consolidated into a single structure: struct hv_device. This consolidation simplifies the code while simultaneously getting rid of redundant state - for instance in the current code, both struct driver_context and struct hv_driver both have state to represent the class as well as instance id. We do this consolidation by moving state from higher level structures (struct driver_context and struct vm_device) to lower level structures (struct hv_driver and hv_device) respectively.

While it has not been a goal of this effort to cleanup structure and variable names, this consolidation effort has resulted in some cleanup with regards to structure and variable names: a) Some of the badly named structures have been eliminated (struct driver_context etc.) while hopefully all newly introduced names are acceptable.

Patches 1 through 11 deal with consolidating the device driver state while patches 12 through 16 deal with consolidating device state.

Regards,

K. Y