Commit Graph
18 Commits
Author SHA1 Message Date
Yuri Benditovich 2cfd4a4207 netkvmp-prot: add device notification to trigger working thread
When network devices come to enabled/disabled state or
added/removed - process the change immediately and not only
via periodical polling

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich b5548aeab9 netkvm-prot: refactor CInterfaceTable for flexibility
Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 235e6e7f20 netkvm-prot: add ability to dump existing network adapters
"netkvmp e" - for internal purposes

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 936106aead netkvm-prot: check for vioprot.inf on install
"netkvmp i" must have vioprot.inf (and CAT) in the current
directory. To avoid misunderstandings, add a check for the
INF file in the current directory.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich ff174d21f3 netkvm-prot: add query whether VIOPROT installed
Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 9641b25a97 netkvm-prot: add sequence for case of protocol uninstall
The goal is to keep full functionality after protocol uninstall
in several major cases:
- VF present and the failover pair works
  After uninstall the virtio-net should become link off (suppressed)
  and the VF should obtain the IP address correctly
- VF not present and the virtio-net works
  After uninstall the virtio-net should become link off (suppressed)
The flag 'NoRestoreOnStop' is for future possibility to stop/start
the service without protocol uninstall.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 56e0fe767a netkvm-prot: make CheckBinding more flexible
Add several useful binding settings (bind VIOPROT only, other
only, all, disable/enable tcpip).

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich d9e2854861 netkvm-prot: move SET_LINK command to separate procedure
We'll reuse it later.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 32ea737009 netkvm-prot: fix stopped state indication
Indicate stopped state only after the thread is finished.
Otherwise the structures in the memory might be unpredictably
modified.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 9f1e4e6be3 netkvm-prot: fix INetCfg WriteLock usage
Make it exactly as in the Microsoft example.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 0f423bf5fe netkvm-prot: make state machine table explicitly static
Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 9e3e49a6be netkvm-prot: add INF uninstall to the uninstall procedure
Add scan for INF files and uninstall of the protocol's INF file.
Now the uninstall script is not needed, just "netkvmp u".

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 88d3797583 netkvm-prot: add d(ump) command to the netkvmp
Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich fd5ab060f4 netkvm-prot: install/uninstall protocol via netkvmp.exe
netkvmp i/u installs and uninstalls the protocol.
The goal is to avoid additional batch files.

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 705aaea93d netkvm-prot: add protocol state machine
Add logic to the user-mode protocol service to replace and
extend the functionality of the notification object:
- install VIOPROT for all the network adapters
- disable all other protocols for relevant VF only when needed
- enable all the protocols on netkvm disable
- enable all the protocol on VIOPROT uninstall
- ... (see in the source code)

Signed-off-by: Yuri Benditovich <[email protected]>
2023-07-02 12:57:58 +03:00
Yuri Benditovich 289f2e4ae6 netkvm: handle protocol uninstallation
The netkvmp service on protocol uninstall is stopped
automatically (by INF statement). Upon stop the service
will run its own binary with command-line ' -x' that
directs the executable to run post-uninstall action:
1. Send WMI set 'NetKvm_Standby.value=0' to force all
   the instances that support standby feature to indicate
   link off (return to their initial behavior)
2. Send WMI query for 'NetKvm_Standby' and parse the response.
   Note friendly names of all the instances that support
   standby feature. Access these instances via SetupAPI and
   restart them.

Signed-off-by: Yuri Benditovich <[email protected]>
2021-04-01 15:11:46 +03:00
Yuri Benditovich f1723b6e40 netkvm: protocol service: add copyright text
Signed-off-by: Yuri Benditovich <[email protected]>
2020-07-09 15:23:33 +03:00
Yuri Benditovich aa303f9a86 netkvm: introduce dummy service project
This service binary will be used as an executable for the
installation of the protocol.

Signed-off-by: Yuri Benditovich <[email protected]>
2020-07-07 17:53:39 +03:00