{"action":"created","issue":{"url":"https://api.github.com/repos/LIS/lis-next/issues/593","repository_url":"https://api.github.com/repos/LIS/lis-next","labels_url":"https://api.github.com/repos/LIS/lis-next/issues/593/labels{/name}","comments_url":"https://api.github.com/repos/LIS/lis-next/issues/593/comments","events_url":"https://api.github.com/repos/LIS/lis-next/issues/593/events","html_url":"https://github.com/LIS/lis-next/issues/593","id":365137322,"node_id":"MDU6SXNzdWUzNjUxMzczMjI=","number":593,"title":"KVP version queries","user":{"login":"capsl0cker","id":34022528,"node_id":"MDQ6VXNlcjM0MDIyNTI4","avatar_url":"https://avatars0.githubusercontent.com/u/34022528?v=4","gravatar_id":"","url":"https://api.github.com/users/capsl0cker","html_url":"https://github.com/capsl0cker","followers_url":"https://api.github.com/users/capsl0cker/followers","following_url":"https://api.github.com/users/capsl0cker/following{/other_user}","gists_url":"https://api.github.com/users/capsl0cker/gists{/gist_id}","starred_url":"https://api.github.com/users/capsl0cker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capsl0cker/subscriptions","organizations_url":"https://api.github.com/users/capsl0cker/orgs","repos_url":"https://api.github.com/users/capsl0cker/repos","events_url":"https://api.github.com/users/capsl0cker/events{/privacy}","received_events_url":"https://api.github.com/users/capsl0cker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-09-29T14:33:35Z","updated_at":"2018-10-09T06:40:00Z","closed_at":null,"author_association":"NONE","body":"Hi all,\r\n\r\nWe have a customized Linux VM running on Hyper-V and we use Linux 4.4 stable kernel. For some reasons, we can't install LIS service directly from this git repository so we compile and install from the 4.4 code.\r\nEverything seems good but the KVP database doesn't be created correctly. These file(.kvp_pool_1/2/3/4) exist but contains nothing.\r\nOne issue observed from Windows EventViewer is the message version is not matched(negotiated version 4 but expected 5).\r\nI do some debug to both LIS kernel code and hv_kvp_daemon code and find that seems Hyper-V doesn't send OP_SET message to kernel so that kvp daemon doesn't write information to file.\r\n\r\nSo my question is that is it because the message version not matched which lead to Hyper-V doesn't send OP_SET message to kernel? Or provide a little more information about how Hyper-V side works.\r\n\r\nBy the way, I use Windows Server 2012 R2."},"comment":{"url":"https://api.github.com/repos/LIS/lis-next/issues/comments/428077809","html_url":"https://github.com/LIS/lis-next/issues/593#issuecomment-428077809","issue_url":"https://api.github.com/repos/LIS/lis-next/issues/593","id":428077809,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODA3NzgwOQ==","user":{"login":"capsl0cker","id":34022528,"node_id":"MDQ6VXNlcjM0MDIyNTI4","avatar_url":"https://avatars0.githubusercontent.com/u/34022528?v=4","gravatar_id":"","url":"https://api.github.com/users/capsl0cker","html_url":"https://github.com/capsl0cker","followers_url":"https://api.github.com/users/capsl0cker/followers","following_url":"https://api.github.com/users/capsl0cker/following{/other_user}","gists_url":"https://api.github.com/users/capsl0cker/gists{/gist_id}","starred_url":"https://api.github.com/users/capsl0cker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capsl0cker/subscriptions","organizations_url":"https://api.github.com/users/capsl0cker/orgs","repos_url":"https://api.github.com/users/capsl0cker/repos","events_url":"https://api.github.com/users/capsl0cker/events{/privacy}","received_events_url":"https://api.github.com/users/capsl0cker/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T06:40:00Z","updated_at":"2018-10-09T06:40:00Z","author_association":"NONE","body":"HI,\nSeems only these 3 patches are not enough. We still need to poll channel\nafter negotiating version(the *bold *line code in below pathch). Or\nsometimes I find that kernel can't get other messages after negotiating\nversion. Don't know why.\nUpstream also does similar things.\n\n--- a/drivers/hv/hv_kvp.c 2018-10-09 22:57:01.000857000 +0800\n+++ b/drivers/hv/hv_kvp.c 2018-10-10 03:24:08.000195000 +0800\n@@ -155,7 +155,7 @@\n        pr_debug(\"KVP: userspace daemon ver. %d registered\\n\",\n                 KVP_OP_REGISTER);\n        kvp_register(dm_reg_value);\n-       kvp_transaction.state = HVUTIL_READY;\n+        hv_poll_channel(kvp_transaction.recv_channel, kvp_poll_wrapper);\n\n        return 0;\n }\n@@ -596,7 +596,9 @@\n        int util_fw_version;\n        int kvp_srv_version;\n\n-       if (kvp_transaction.state > HVUTIL_READY)\n+        kvp_transaction.recv_channel = channel;\n+\n+       if (kvp_transaction.state != HVUTIL_READY)\n                return;\n\n        vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 4, &recvlen,\n@@ -640,7 +642,6 @@\n                         */\n\n                        kvp_transaction.recv_len = recvlen;\n-                       kvp_transaction.recv_channel = channel;\n                        kvp_transaction.recv_req_id = requestid;\n                        kvp_transaction.kvp_msg = kvp_msg;\n\n@@ -674,6 +675,7 @@\n                vmbus_sendpacket(channel, recv_buffer,\n                                       recvlen, requestid,\n                                       VM_PKT_DATA_INBAND, 0);\n+               * hv_kvp_onchannelcallback(kvp_transaction.recv_channel);*\n        }\n\n }\n\n\nOn Tue, Oct 9, 2018 at 3:50 AM Dexuan Cui <notifications@github.com> wrote:\n\n> @capsl0cker <https://github.com/capsl0cker> :\n> Instead of accepting \"new\" patches, the maintainers of the stable kernels\n> usually ask for the upstream patches that fixed the issue.\n>\n> For this particular issue, according to my test, you can cherry-pick the 3\n> upstream patches from the Linus's tree to v4.4.159:\n> 2d0c3b5ad739 (\"Drivers: hv: utils: Invoke the poll function after\n> handshake\")\n> b9830d120cbe (\"Drivers: hv: util: Pass the channel information during the\n> init call\")\n> 4dbfc2e68004 (\"Drivers: hv: kvp: fix IP Failover\")\n>\n> But it looks v4.4.159 lacks a lot of fixes... I'm not sure if the\n> maintainer will accept so many backport requests:\n>\n> $ git log v4.4.159..v4.17-rc7 --oneline -- drivers/hv/hv_util.c\n> drivers/hv/hv_kvp.c drivers/hv/hv_snapshot.c drivers/hv/hv_fcopy.c\n> drivers/hv/hv_utils_transport.h\n> 549e658 Drivers: hv: fcopy: restore correct transfer length\n> ddce54b Drivers: hv: kvp: Use MAX_ADAPTER_ID_SIZE for translating adapter\n> id\n> 1d10602 hv_utils: fix TimeSync work on pre-TimeSync-v4 hosts\n> 4f9bac0 hv_utils: drop .getcrosststamp() support from PTP driver\n> a3ade8c HV: properly delay KVP packets when negotiation is in progress\n> 57c0eab Merge 4.11-rc4 into char-misc-next\n> bdc1dd4 vmbus: fix spelling errors\n> 8b1f91f vmbus: remove useless return's\n> 5a16dfc Drivers: hv: util: don't forget to init host_ts.lock\n> e9c18ae Drivers: hv: util: move waiting for release to hv_utils_transport\n> itself\n> b71e328 vmbus: add direct isr callback mode\n> bb6a4db Drivers: hv: util: Fix a typo\n> 3716a49 hv_utils: implement Hyper-V PTP source\n> 1274a69 Drivers: hv: Log the negotiated IC versions.\n> a165645 Drivers: hv: vmbus: Use all supported IC versions to negotiate\n> 1724462 hv_util: switch to using timespec64\n> 305f754 Drivers: hv: util: Use hv_get_current_tick() to get current tick\n> d77044d Drivers: hv: util: Backup: Fix a rescind processing issue\n> 20951c7 Drivers: hv: util: Fcopy: Fix a rescind processing issue\n> 5a66fec Drivers: hv: util: kvp: Fix a rescind processing issue\n> b357fd3 Drivers: hv: vss: Operation timeouts should match host expectation\n> 23d2cc0 Drivers: hv: vss: Improve log messages.\n> 3da0401b Drivers: hv: utils: Fix the mapping between host version and\n> protocol to use\n> 407a3ae hv: do not lose pending heartbeat vmbus packets\n> 3ba1eb1 Drivers: hv: hv_util: Avoid dynamic allocation in time synch\n> 8e1d260 Drivers: hv: utils: Support TimeSync version 4.0 protocol samples.\n> 2e338f7 Drivers: hv: utils: Use TimeSync samples to adjust the clock after\n> boot.\n> abeda47 Drivers: hv: utils: Rename version definitions to reflect protocol\n> version.\n> db886e4 Drivers: hv: utils: Check VSS daemon is listening before a hot\n> backup\n> 497af84 Drivers: hv: utils: Continue to poll VSS channel after handling\n> requests.\n> e0fa3e5 Drivers: hv: utils: fix a race on userspace daemons registration\n> 4dbfc2e Drivers: hv: kvp: fix IP Failover\n> b9830d1 Drivers: hv: util: Pass the channel information during the init\n> call\n> a150256 Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode\n> a72f3a4 Drivers: hv: utils: rename outmsg_lock\n> 2d0c3b5 Drivers: hv: utils: Invoke the poll function after handshake\n> ed9ba60 Drivers: hv: vss: run only on supported host versions\n> 3cace4a Drivers: hv: utils: run polling callback always in interrupt\n> context\n> c0b200c Drivers: hv: util: Increase the timeout for util services\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/LIS/lis-next/issues/593#issuecomment-427958099>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/AgckgEqKKzv7wET2i5hhRiejPP1JcgEyks5ui6yGgaJpZM4XAiCd>\n> .\n>\n\n\n-- \nRegards,\nWang Jian\n"}}
{"actor":{"display_login":"capsl0cker"}}