{"action":"created","comment":{"url":"https://api.github.com/repos/Solo5/solo5/pulls/comments/80791903","pull_request_review_id":1822721,"id":80791903,"diff_hunk":"@@ -44,176 +44,84 @@ struct virtio_blk_hdr {\n     uint64_t sector;\n };\n \n-struct virtio_blk_req {\n-    struct virtio_blk_hdr hdr;\n-    uint8_t data[VIRTIO_BLK_SECTOR_SIZE];\n-\n-    volatile uint8_t status;\n-    volatile uint8_t hw_used;\n-};\n-\n #define VIRTQ_BLK_MAX_QUEUE_SIZE 8192","path":"kernel/virtio/virtio_blk.c","position":null,"original_position":12,"commit_id":"0cf5634fa698a63b8e5c7b906e41d6183b72eb09","original_commit_id":"43ad6c792ba3e8f4506d731fb389a593df5d5927","user":{"login":"ricarkol","id":11448949,"avatar_url":"https://avatars.githubusercontent.com/u/11448949?v=3","gravatar_id":"","url":"https://api.github.com/users/ricarkol","html_url":"https://github.com/ricarkol","followers_url":"https://api.github.com/users/ricarkol/followers","following_url":"https://api.github.com/users/ricarkol/following{/other_user}","gists_url":"https://api.github.com/users/ricarkol/gists{/gist_id}","starred_url":"https://api.github.com/users/ricarkol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricarkol/subscriptions","organizations_url":"https://api.github.com/users/ricarkol/orgs","repos_url":"https://api.github.com/users/ricarkol/repos","events_url":"https://api.github.com/users/ricarkol/events{/privacy}","received_events_url":"https://api.github.com/users/ricarkol/received_events","type":"User","site_admin":false},"body":"removed","created_at":"2016-09-27T20:51:52Z","updated_at":"2016-09-27T20:51:52Z","html_url":"https://github.com/Solo5/solo5/pull/98#discussion_r80791903","pull_request_url":"https://api.github.com/repos/Solo5/solo5/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/Solo5/solo5/pulls/comments/80791903"},"html":{"href":"https://github.com/Solo5/solo5/pull/98#discussion_r80791903"},"pull_request":{"href":"https://api.github.com/repos/Solo5/solo5/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/Solo5/solo5/pulls/98","id":86193881,"html_url":"https://github.com/Solo5/solo5/pull/98","diff_url":"https://github.com/Solo5/solo5/pull/98.diff","patch_url":"https://github.com/Solo5/solo5/pull/98.patch","issue_url":"https://api.github.com/repos/Solo5/solo5/issues/98","number":98,"state":"open","locked":false,"title":"virtio-net changes for freebsd","user":{"login":"ricarkol","id":11448949,"avatar_url":"https://avatars.githubusercontent.com/u/11448949?v=3","gravatar_id":"","url":"https://api.github.com/users/ricarkol","html_url":"https://github.com/ricarkol","followers_url":"https://api.github.com/users/ricarkol/followers","following_url":"https://api.github.com/users/ricarkol/following{/other_user}","gists_url":"https://api.github.com/users/ricarkol/gists{/gist_id}","starred_url":"https://api.github.com/users/ricarkol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricarkol/subscriptions","organizations_url":"https://api.github.com/users/ricarkol/orgs","repos_url":"https://api.github.com/users/ricarkol/repos","events_url":"https://api.github.com/users/ricarkol/events{/privacy}","received_events_url":"https://api.github.com/users/ricarkol/received_events","type":"User","site_admin":false},"body":"This PR is for two changes:\r\n\r\n1. The network header in bhyve's virtio-net implementation is hard coded to use the extra `num_buffers` field (or `vrh_bufs` in freebsd code) even when the `VIRTIO_NET_F_MRG_RXBUF` feature is not negotiated. This proposed change uses the extended network header, asserts the host feature `VIRTIO_NET_F_MRG_RXBUF`, and negotiates it with the host (always). Here is the freebsd code with the hardcoded struct for reference: https://github.com/freebsd/freebsd/blob/master/usr.sbin/bhyve/pci_virtio_net.c#L120\r\n\r\n2. The Tx path in bhyve's virtio-net assumes that all Tx'es will have a first descriptor with the header alone. Here is the code. https://github.com/freebsd/freebsd/blob/master/usr.sbin/bhyve/pci_virtio_net.c#L617 has an interesting comment, and https://github.com/freebsd/freebsd/blob/master/usr.sbin/bhyve/pci_virtio_net.c#L631 only copies data for tx after the first descriptor. The proposed change uses two descriptors per Tx operation. All I could find in the virtio 1.0 spec is this:\r\n\r\n> \"Most common is to begin the data with a header (containing little-endian ﬁelds) for the device to read, and postﬁx it with a status tailer for the device to write.\".\r\n\r\nTested this changes with the static_website unikernel locally and in GCE. Also tested the ping_test_serve unikernel in freebsd (after applying @hannesm change to Makefile.common and following the instructions).","created_at":"2016-09-21T16:09:18Z","updated_at":"2016-09-27T20:51:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb993cfeff75b035333ccaf3874802f85624d369","assignee":{"login":"mato","id":190797,"avatar_url":"https://avatars.githubusercontent.com/u/190797?v=3","gravatar_id":"","url":"https://api.github.com/users/mato","html_url":"https://github.com/mato","followers_url":"https://api.github.com/users/mato/followers","following_url":"https://api.github.com/users/mato/following{/other_user}","gists_url":"https://api.github.com/users/mato/gists{/gist_id}","starred_url":"https://api.github.com/users/mato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mato/subscriptions","organizations_url":"https://api.github.com/users/mato/orgs","repos_url":"https://api.github.com/users/mato/repos","events_url":"https://api.github.com/users/mato/events{/privacy}","received_events_url":"https://api.github.com/users/mato/received_events","type":"User","site_admin":false},"assignees":[{"login":"mato","id":190797,"avatar_url":"https://avatars.githubusercontent.com/u/190797?v=3","gravatar_id":"","url":"https://api.github.com/users/mato","html_url":"https://github.com/mato","followers_url":"https://api.github.com/users/mato/followers","following_url":"https://api.github.com/users/mato/following{/other_user}","gists_url":"https://api.github.com/users/mato/gists{/gist_id}","starred_url":"https://api.github.com/users/mato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mato/subscriptions","organizations_url":"https://api.github.com/users/mato/orgs","repos_url":"https://api.github.com/users/mato/repos","events_url":"https://api.github.com/users/mato/events{/privacy}","received_events_url":"https://api.github.com/users/mato/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Solo5/solo5/pulls/98/commits","review_comments_url":"https://api.github.com/repos/Solo5/solo5/pulls/98/comments","review_comment_url":"https://api.github.com/repos/Solo5/solo5/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Solo5/solo5/issues/98/comments","statuses_url":"https://api.github.com/repos/Solo5/solo5/statuses/0cf5634fa698a63b8e5c7b906e41d6183b72eb09","head":{"label":"ricarkol:virtio-net-changes-for-freebsd","ref":"virtio-net-changes-for-freebsd","sha":"0cf5634fa698a63b8e5c7b906e41d6183b72eb09","user":{"login":"ricarkol","id":11448949,"avatar_url":"https://avatars.githubusercontent.com/u/11448949?v=3","gravatar_id":"","url":"https://api.github.com/users/ricarkol","html_url":"https://github.com/ricarkol","followers_url":"https://api.github.com/users/ricarkol/followers","following_url":"https://api.github.com/users/ricarkol/following{/other_user}","gists_url":"https://api.github.com/users/ricarkol/gists{/gist_id}","starred_url":"https://api.github.com/users/ricarkol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricarkol/subscriptions","organizations_url":"https://api.github.com/users/ricarkol/orgs","repos_url":"https://api.github.com/users/ricarkol/repos","events_url":"https://api.github.com/users/ricarkol/events{/privacy}","received_events_url":"https://api.github.com/users/ricarkol/received_events","type":"User","site_admin":false},"repo":{"id":51105759,"name":"solo5","full_name":"ricarkol/solo5","owner":{"login":"ricarkol","id":11448949,"avatar_url":"https://avatars.githubusercontent.com/u/11448949?v=3","gravatar_id":"","url":"https://api.github.com/users/ricarkol","html_url":"https://github.com/ricarkol","followers_url":"https://api.github.com/users/ricarkol/followers","following_url":"https://api.github.com/users/ricarkol/following{/other_user}","gists_url":"https://api.github.com/users/ricarkol/gists{/gist_id}","starred_url":"https://api.github.com/users/ricarkol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricarkol/subscriptions","organizations_url":"https://api.github.com/users/ricarkol/orgs","repos_url":"https://api.github.com/users/ricarkol/repos","events_url":"https://api.github.com/users/ricarkol/events{/privacy}","received_events_url":"https://api.github.com/users/ricarkol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ricarkol/solo5","description":"The Solo5 unikernel","fork":true,"url":"https://api.github.com/repos/ricarkol/solo5","forks_url":"https://api.github.com/repos/ricarkol/solo5/forks","keys_url":"https://api.github.com/repos/ricarkol/solo5/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ricarkol/solo5/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ricarkol/solo5/teams","hooks_url":"https://api.github.com/repos/ricarkol/solo5/hooks","issue_events_url":"https://api.github.com/repos/ricarkol/solo5/issues/events{/number}","events_url":"https://api.github.com/repos/ricarkol/solo5/events","assignees_url":"https://api.github.com/repos/ricarkol/solo5/assignees{/user}","branches_url":"https://api.github.com/repos/ricarkol/solo5/branches{/branch}","tags_url":"https://api.github.com/repos/ricarkol/solo5/tags","blobs_url":"https://api.github.com/repos/ricarkol/solo5/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ricarkol/solo5/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ricarkol/solo5/git/refs{/sha}","trees_url":"https://api.github.com/repos/ricarkol/solo5/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ricarkol/solo5/statuses/{sha}","languages_url":"https://api.github.com/repos/ricarkol/solo5/languages","stargazers_url":"https://api.github.com/repos/ricarkol/solo5/stargazers","contributors_url":"https://api.github.com/repos/ricarkol/solo5/contributors","subscribers_url":"https://api.github.com/repos/ricarkol/solo5/subscribers","subscription_url":"https://api.github.com/repos/ricarkol/solo5/subscription","commits_url":"https://api.github.com/repos/ricarkol/solo5/commits{/sha}","git_commits_url":"https://api.github.com/repos/ricarkol/solo5/git/commits{/sha}","comments_url":"https://api.github.com/repos/ricarkol/solo5/comments{/number}","issue_comment_url":"https://api.github.com/repos/ricarkol/solo5/issues/comments{/number}","contents_url":"https://api.github.com/repos/ricarkol/solo5/contents/{+path}","compare_url":"https://api.github.com/repos/ricarkol/solo5/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ricarkol/solo5/merges","archive_url":"https://api.github.com/repos/ricarkol/solo5/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ricarkol/solo5/downloads","issues_url":"https://api.github.com/repos/ricarkol/solo5/issues{/number}","pulls_url":"https://api.github.com/repos/ricarkol/solo5/pulls{/number}","milestones_url":"https://api.github.com/repos/ricarkol/solo5/milestones{/number}","notifications_url":"https://api.github.com/repos/ricarkol/solo5/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ricarkol/solo5/labels{/name}","releases_url":"https://api.github.com/repos/ricarkol/solo5/releases{/id}","deployments_url":"https://api.github.com/repos/ricarkol/solo5/deployments","created_at":"2016-02-04T21:10:34Z","updated_at":"2016-02-04T21:10:35Z","pushed_at":"2016-09-27T20:51:26Z","git_url":"git://github.com/ricarkol/solo5.git","ssh_url":"git@github.com:ricarkol/solo5.git","clone_url":"https://github.com/ricarkol/solo5.git","svn_url":"https://github.com/ricarkol/solo5","homepage":"","size":716,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Solo5:master","ref":"master","sha":"302d832fc81ed261c9d105c6e37f5e7e0732d61a","user":{"login":"Solo5","id":20474498,"avatar_url":"https://avatars.githubusercontent.com/u/20474498?v=3","gravatar_id":"","url":"https://api.github.com/users/Solo5","html_url":"https://github.com/Solo5","followers_url":"https://api.github.com/users/Solo5/followers","following_url":"https://api.github.com/users/Solo5/following{/other_user}","gists_url":"https://api.github.com/users/Solo5/gists{/gist_id}","starred_url":"https://api.github.com/users/Solo5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Solo5/subscriptions","organizations_url":"https://api.github.com/users/Solo5/orgs","repos_url":"https://api.github.com/users/Solo5/repos","events_url":"https://api.github.com/users/Solo5/events{/privacy}","received_events_url":"https://api.github.com/users/Solo5/received_events","type":"Organization","site_admin":false},"repo":{"id":47781176,"name":"solo5","full_name":"Solo5/solo5","owner":{"login":"Solo5","id":20474498,"avatar_url":"https://avatars.githubusercontent.com/u/20474498?v=3","gravatar_id":"","url":"https://api.github.com/users/Solo5","html_url":"https://github.com/Solo5","followers_url":"https://api.github.com/users/Solo5/followers","following_url":"https://api.github.com/users/Solo5/following{/other_user}","gists_url":"https://api.github.com/users/Solo5/gists{/gist_id}","starred_url":"https://api.github.com/users/Solo5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Solo5/subscriptions","organizations_url":"https://api.github.com/users/Solo5/orgs","repos_url":"https://api.github.com/users/Solo5/repos","events_url":"https://api.github.com/users/Solo5/events{/privacy}","received_events_url":"https://api.github.com/users/Solo5/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Solo5/solo5","description":"The Solo5 unikernel","fork":false,"url":"https://api.github.com/repos/Solo5/solo5","forks_url":"https://api.github.com/repos/Solo5/solo5/forks","keys_url":"https://api.github.com/repos/Solo5/solo5/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Solo5/solo5/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Solo5/solo5/teams","hooks_url":"https://api.github.com/repos/Solo5/solo5/hooks","issue_events_url":"https://api.github.com/repos/Solo5/solo5/issues/events{/number}","events_url":"https://api.github.com/repos/Solo5/solo5/events","assignees_url":"https://api.github.com/repos/Solo5/solo5/assignees{/user}","branches_url":"https://api.github.com/repos/Solo5/solo5/branches{/branch}","tags_url":"https://api.github.com/repos/Solo5/solo5/tags","blobs_url":"https://api.github.com/repos/Solo5/solo5/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Solo5/solo5/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Solo5/solo5/git/refs{/sha}","trees_url":"https://api.github.com/repos/Solo5/solo5/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Solo5/solo5/statuses/{sha}","languages_url":"https://api.github.com/repos/Solo5/solo5/languages","stargazers_url":"https://api.github.com/repos/Solo5/solo5/stargazers","contributors_url":"https://api.github.com/repos/Solo5/solo5/contributors","subscribers_url":"https://api.github.com/repos/Solo5/solo5/subscribers","subscription_url":"https://api.github.com/repos/Solo5/solo5/subscription","commits_url":"https://api.github.com/repos/Solo5/solo5/commits{/sha}","git_commits_url":"https://api.github.com/repos/Solo5/solo5/git/commits{/sha}","comments_url":"https://api.github.com/repos/Solo5/solo5/comments{/number}","issue_comment_url":"https://api.github.com/repos/Solo5/solo5/issues/comments{/number}","contents_url":"https://api.github.com/repos/Solo5/solo5/contents/{+path}","compare_url":"https://api.github.com/repos/Solo5/solo5/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Solo5/solo5/merges","archive_url":"https://api.github.com/repos/Solo5/solo5/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Solo5/solo5/downloads","issues_url":"https://api.github.com/repos/Solo5/solo5/issues{/number}","pulls_url":"https://api.github.com/repos/Solo5/solo5/pulls{/number}","milestones_url":"https://api.github.com/repos/Solo5/solo5/milestones{/number}","notifications_url":"https://api.github.com/repos/Solo5/solo5/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Solo5/solo5/labels{/name}","releases_url":"https://api.github.com/repos/Solo5/solo5/releases{/id}","deployments_url":"https://api.github.com/repos/Solo5/solo5/deployments","created_at":"2015-12-10T18:54:36Z","updated_at":"2016-09-24T13:58:49Z","pushed_at":"2016-09-27T20:51:27Z","git_url":"git://github.com/Solo5/solo5.git","ssh_url":"git@github.com:Solo5/solo5.git","clone_url":"https://github.com/Solo5/solo5.git","svn_url":"https://github.com/Solo5/solo5","homepage":"","size":637,"stargazers_count":159,"watchers_count":159,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":14,"forks":22,"open_issues":14,"watchers":159,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Solo5/solo5/pulls/98"},"html":{"href":"https://github.com/Solo5/solo5/pull/98"},"issue":{"href":"https://api.github.com/repos/Solo5/solo5/issues/98"},"comments":{"href":"https://api.github.com/repos/Solo5/solo5/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/Solo5/solo5/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/Solo5/solo5/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Solo5/solo5/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/Solo5/solo5/statuses/0cf5634fa698a63b8e5c7b906e41d6183b72eb09"}}}}
{"actor":{"display_login":"ricarkol"}}