Skip to content

Drivers: hv: utils: re-implement the kernel/userspace communication layer

K. Y. Srinivasan lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest21 patches 0 repliesNew

Changes in v3 from the cover letter

- Removed RFC from subject, rebased on top of current char-misc-next tree.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21Drivers: hv: util: move kvp/vss function declarations to hyperv_vmbus.hdrivers/hv/hv_kvp.c drivers/hv/hv_snapshot.c drivers/hv/hyperv_vmbus.h +1 more+11 -70 replies
2/21Drivers: hv: kvp: reset kvp_contextdrivers/hv/hv_kvp.c+1 -00 replies
3/21Drivers: hv: kvp: move poll_channel() to hyperv_vmbus.hdrivers/hv/hv_kvp.c drivers/hv/hyperv_vmbus.h+15 -140 replies
4/21Drivers: hv: fcopy: process deferred messages when we complete the transactiondrivers/hv/hv_fcopy.c+9 -30 replies
5/21Drivers: hv: vss: process deferred messages when we complete the transactiondrivers/hv/hv_snapshot.c+9 -50 replies
6/21Drivers: hv: kvp: rename kvp_work -> kvp_timeout_workdrivers/hv/hv_kvp.c+8 -80 replies
7/21Drivers: hv: fcopy: rename fcopy_work -> fcopy_timeout_workdrivers/hv/hv_fcopy.c+7 -70 replies
8/21Drivers: hv: util: introduce state machine for util driversdrivers/hv/hyperv_vmbus.h+9 -00 replies
9/21Drivers: hv: kvp: switch to using the hvutil_device_state state machinedrivers/hv/hv_kvp.c+49 -380 replies
10/21Drivers: hv: vss: switch to using the hvutil_device_state state machinedrivers/hv/hv_snapshot.c+58 -290 replies
11/21Drivers: hv: fcopy: switch to using the hvutil_device_state state machinedrivers/hv/hv_fcopy.c+30 -400 replies
12/21Drivers: hv: fcopy: set .owner reference for file operationsdrivers/hv/hv_fcopy.c+2 -40 replies
13/21Drivers: hv: util: introduce hv_utils_transport abstractiondrivers/hv/Makefile drivers/hv/hv_utils_transport.c drivers/hv/hv_utils_transport.h+328 -10 replies
14/21Drivers: hv: vss: convert to hv_utils_transportdrivers/hv/hv_snapshot.c+27 -250 replies
15/21Drivers: hv: fcopy: convert to hv_utils_transportdrivers/hv/hv_fcopy.c+46 -1480 replies
16/21Drivers: hv: kvp: convert to hv_utils_transportdrivers/hv/hv_kvp.c+42 -490 replies
17/21Tools: hv: kvp: use misc char device to communicate with kerneltools/hv/hv_kvp_daemon.c+31 -1350 replies
18/21Tools: hv: vss: use misc char device to communicate with kerneltools/hv/hv_vss_daemon.c+25 -1140 replies
19/21Drivers: hv: vss: full handshake supportdrivers/hv/hv_snapshot.c include/uapi/linux/hyperv.h tools/hv/hv_vss_daemon.c+56 -120 replies
20/21Drivers: hv: fcopy: full handshake supportdrivers/hv/hv_fcopy.c include/uapi/linux/hyperv.h tools/hv/hv_fcopy_daemon.c+32 -20 replies
21/21Drivers: hv: utils: unify driver registration reportingdrivers/hv/hv_fcopy.c drivers/hv/hv_kvp.c drivers/hv/hv_snapshot.c+4 -40 replies

Reviews trailers per patch

None of the 21 patches has a Reviewed-by or Acked-by.

PatchAlex Ng
1/21T-b
2/21T-b
3/21T-b
4/21T-b
5/21T-b
6/21T-b
7/21T-b
8/21T-b
9/21T-b
10/21T-b
11/21T-b
12/21T-b
13/21T-b
14/21T-b
15/21T-b
16/21T-b
17/21T-b
18/21T-b
19/21T-b
20/21T-b
21/21T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/21] Drivers: hv: utils: re-implement the kernel/userspace communication layer

Changes in v3:
- Removed RFC from subject, rebased on top of current char-misc-next tree.

RFCv2: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-March/066629.html

Anatomy of the series:
Patches 01 - 07 are cleanup with minor functional change.
Patch 08 defines the state machine.
Patches 09-11 convert all 3 drivers to using the state machine. Patch 12 fixes a bug in fcopy. This change is going away in Patch 15,
I just want to highlight the fix.
Patch 13 introduces a transport abstraction.
Patch 14-16 convert all drivers to using the transport abstraction. Patches 17-18 switch KVP and VSS daemon to using char devices. Patches 19-20 convert FCOPY and VSS to hull handshake (the same we have in
KVP). These two can be postponed till we really need to distinguish between different kernels in the daemon code.
Patch 21 unifies log messages on daemons connect across all drivers and moves
these messages to debug level.

I smoke-tested this series with both old (netlink) and new (char devices) daemons and tested the daemon upgrade procedure.

Original description:
This series converts kvp/vss daemons to use misc char devices instead of netlink for userspace/kernel communication and then updates fcopy to be consistent with kvp/vss.

Userspace/kernel communication via netlink has a number of issues:
- It is hard for userspace to figure out if the kernel part was loaded or not and this fact can change as there is a way to enable/disable the service from host side. Racy daemon startup is also a problem.
- When the userspace daemon restarts/dies kernel part doesn't receive a notification.
- Netlink communication is not stable under heavy load.
- ...

Vitaly Kuznetsov (21):
Drivers: hv: util: move kvp/vss function declarations to
hyperv_vmbus.h
Drivers: hv: kvp: reset kvp_context
Drivers: hv: kvp: move poll_channel() to hyperv_vmbus.h
Drivers: hv: fcopy: process deferred messages when we complete the
transaction
Drivers: hv: vss: process deferred messages when we complete the
transaction
Drivers: hv: kvp: rename kvp_work -> kvp_timeout_work
Drivers: hv: fcopy: rename fcopy_work -> fcopy_timeout_work
Drivers: hv: util: introduce state machine for util drivers
Drivers: hv: kvp: switch to using the hvutil_device_state state
machine
Drivers: hv: vss: switch to using the hvutil_device_state state
machine
Drivers: hv: fcopy: switch to using the hvutil_device_state state
machine
Drivers: hv: fcopy: set .owner reference for file operations
Drivers: hv: util: introduce hv_utils_transport abstraction
Drivers: hv: vss: convert to hv_utils_transport
Drivers: hv: fcopy: convert to hv_utils_transport
Drivers: hv: kvp: convert to hv_utils_transport
Tools: hv: kvp: use misc char device to communicate with kernel
Tools: hv: vss: use misc char device to communicate with kernel
Drivers: hv: vss: full handshake support
Drivers: hv: fcopy: full handshake support
Drivers: hv: utils: unify driver registration reporting

 drivers/hv/Makefile             |    2 +-
 drivers/hv/hv_fcopy.c           |  287 +++++++++++++--------------------------
 drivers/hv/hv_kvp.c             |  192 +++++++++++++-------------
 drivers/hv/hv_snapshot.c        |  168 ++++++++++++++++-------
 drivers/hv/hv_utils_transport.c |  276 +++++++++++++++++++++++++++++++++++++
 drivers/hv/hv_utils_transport.h |   51 +++++++
 drivers/hv/hyperv_vmbus.h       |   29 ++++
 include/linux/hyperv.h          |    7 -
 include/uapi/linux/hyperv.h     |    8 +-
 tools/hv/hv_fcopy_daemon.c      |   15 ++
 tools/hv/hv_kvp_daemon.c        |  166 ++++------------------
 tools/hv/hv_vss_daemon.c        |  149 +++++---------------
 12 files changed, 752 insertions(+), 598 deletions(-)
 create mode 100644 drivers/hv/hv_utils_transport.c
 create mode 100644 drivers/hv/hv_utils_transport.h
Signature · 1 line
1.7.4.1