{"action":"opened","number":553,"pull_request":{"url":"https://api.github.com/repos/google/gopacket/pulls/553","id":227684134,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3Njg0MTM0","html_url":"https://github.com/google/gopacket/pull/553","diff_url":"https://github.com/google/gopacket/pull/553.diff","patch_url":"https://github.com/google/gopacket/pull/553.patch","issue_url":"https://api.github.com/repos/google/gopacket/issues/553","number":553,"state":"open","locked":false,"title":"Fix pf_ring 7.2 and maybe performance issues. This fixes #467, #419","user":{"login":"notti","id":25723,"node_id":"MDQ6VXNlcjI1NzIz","avatar_url":"https://avatars1.githubusercontent.com/u/25723?v=4","gravatar_id":"","url":"https://api.github.com/users/notti","html_url":"https://github.com/notti","followers_url":"https://api.github.com/users/notti/followers","following_url":"https://api.github.com/users/notti/following{/other_user}","gists_url":"https://api.github.com/users/notti/gists{/gist_id}","starred_url":"https://api.github.com/users/notti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notti/subscriptions","organizations_url":"https://api.github.com/users/notti/orgs","repos_url":"https://api.github.com/users/notti/repos","events_url":"https://api.github.com/users/notti/events{/privacy}","received_events_url":"https://api.github.com/users/notti/received_events","type":"User","site_admin":false},"body":"Rework of the core parts of pfring. Due to the use of packed structures in\r\n7.2 cgo can't access some fields of `struct pfring_pkthdr`.\r\nThis copies the needed fields to a non-packed struct first.\r\n\r\nTo improve speed, `pfring_recv` is now called with a length of zero,\r\nenabling zero copy. The old version caused the userlab pf_ring library\r\nto copy the packet contents. This maybe fixes #543, #329, #185.\r\nAdditionally, pfring now uses `timestamp_ns` instead of `ts`, which increases\r\nthe timestamp resolution from microsecond to nanosecond. Furthermore,\r\ncgo usage was improved by using the same techniques as in pcap\r\n(allocations on the heap).\r\n\r\nAdded `ZeroCopyReadPacketData`. This one uses not zero copy from kernel\r\nspace directly to the buffer. The old `ReadPacketDataTo` caused pf_ring\r\nuserspace library to copy the data (buffer_len != 0). The new\r\n`ReadPacketDataTo` still does the copy (but now in gocode) since zero\r\ncopy is not possible with the current interface. This method is there to\r\nkeep legacy code working, but newer versions should switch over to\r\n`ZeroCopyReadPacketData`.\r\n\r\nThe following benchmarks were performed in a virtual machine by using\r\npktgen kernel module on the host and virtio-net in the guest. Since\r\nthere is no `ZeroCopyReadPacketData`, the `PfringReadZero` lines compare\r\n`ReadPacketDataTo` in the old implementation with\r\n`ZeroCopyReadPacketData` in the new version.\r\n\r\n65536 byte size packets:\r\n```\r\nname              old time/op    new time/op    delta\r\nPfringRead-2        47.5µs ±10%    42.8µs ± 7%    -9.85%  (p=0.012 n=8+10)\r\nPfringReadZero-2    42.5µs ±25%    32.9µs ± 7%   -22.65%  (p=0.000 n=10+10)\r\nPfringReadTo-2      42.5µs ±25%    36.8µs ± 9%      ~     (p=0.143 n=10+10)\r\n\r\nname              old speed      new speed      delta\r\nPfringRead-2      1.30GB/s ±26%  1.53GB/s ± 7%   +17.57%  (p=0.003 n=10+10)\r\nPfringReadZero-2  1.58GB/s ±22%  1.99GB/s ± 7%   +25.90%  (p=0.000 n=10+10)\r\nPfringReadTo-2    1.58GB/s ±22%  1.79GB/s ± 9%      ~     (p=0.143 n=10+10)\r\n\r\nname              old alloc/op   new alloc/op   delta\r\nPfringRead-2        65.6kB ± 0%    65.5kB ± 0%    -0.02%  (p=0.000 n=10+10)\r\nPfringReadZero-2     16.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)\r\nPfringReadTo-2       16.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)\r\n\r\nname              old allocs/op  new allocs/op  delta\r\nPfringRead-2          2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)\r\nPfringReadZero-2      1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)\r\nPfringReadTo-2        1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)\r\n```\r\n\r\n58 byte size packets:\r\n```\r\nname              old time/op    new time/op     delta\r\nPfringRead-2        46.8µs ±23%      3.2µs ±85%    -93.15%  (p=0.000 n=10+10)\r\nPfringReadZero-2    2.48µs ±11%     2.33µs ± 2%     -6.37%  (p=0.022 n=10+8)\r\nPfringReadTo-2      2.48µs ±11%     2.63µs ± 6%       ~     (p=0.053 n=10+9)\r\n\r\nname              old speed      new speed       delta\r\nPfringRead-2      1.27MB/s ±24%  21.17MB/s ±60%  +1570.88%  (p=0.000 n=10+10)\r\nPfringReadZero-2  23.5MB/s ±10%   24.9MB/s ± 2%     +6.33%  (p=0.017 n=10+8)\r\nPfringReadTo-2    23.5MB/s ±10%   22.0MB/s ± 6%       ~     (p=0.053 n=10+9)\r\n\r\nname              old alloc/op   new alloc/op    delta\r\nPfringRead-2        65.6kB ± 0%      0.1kB ± 0%    -99.90%  (p=0.000 n=10+10)\r\nPfringReadZero-2     16.0B ± 0%       0.0B        -100.00%  (p=0.000 n=10+10)\r\nPfringReadTo-2       16.0B ± 0%       0.0B        -100.00%  (p=0.000 n=10+10)\r\n\r\nname              old allocs/op  new allocs/op   delta\r\nPfringRead-2          2.00 ± 0%       1.00 ± 0%    -50.00%  (p=0.000 n=10+10)\r\nPfringReadZero-2      1.00 ± 0%       0.00        -100.00%  (p=0.000 n=10+10)\r\nPfringReadTo-2        1.00 ± 0%       0.00        -100.00%  (p=0.000 n=10+10)\r\n```","created_at":"2018-11-01T16:46:32Z","updated_at":"2018-11-01T16:46:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/gopacket/pulls/553/commits","review_comments_url":"https://api.github.com/repos/google/gopacket/pulls/553/comments","review_comment_url":"https://api.github.com/repos/google/gopacket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/gopacket/issues/553/comments","statuses_url":"https://api.github.com/repos/google/gopacket/statuses/f17706dacb4d698a6105573c837ada00b4e035b7","head":{"label":"notti:fix_pfring","ref":"fix_pfring","sha":"f17706dacb4d698a6105573c837ada00b4e035b7","user":{"login":"notti","id":25723,"node_id":"MDQ6VXNlcjI1NzIz","avatar_url":"https://avatars1.githubusercontent.com/u/25723?v=4","gravatar_id":"","url":"https://api.github.com/users/notti","html_url":"https://github.com/notti","followers_url":"https://api.github.com/users/notti/followers","following_url":"https://api.github.com/users/notti/following{/other_user}","gists_url":"https://api.github.com/users/notti/gists{/gist_id}","starred_url":"https://api.github.com/users/notti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notti/subscriptions","organizations_url":"https://api.github.com/users/notti/orgs","repos_url":"https://api.github.com/users/notti/repos","events_url":"https://api.github.com/users/notti/events{/privacy}","received_events_url":"https://api.github.com/users/notti/received_events","type":"User","site_admin":false},"repo":{"id":36874503,"node_id":"MDEwOlJlcG9zaXRvcnkzNjg3NDUwMw==","name":"gopacket","full_name":"notti/gopacket","private":false,"owner":{"login":"notti","id":25723,"node_id":"MDQ6VXNlcjI1NzIz","avatar_url":"https://avatars1.githubusercontent.com/u/25723?v=4","gravatar_id":"","url":"https://api.github.com/users/notti","html_url":"https://github.com/notti","followers_url":"https://api.github.com/users/notti/followers","following_url":"https://api.github.com/users/notti/following{/other_user}","gists_url":"https://api.github.com/users/notti/gists{/gist_id}","starred_url":"https://api.github.com/users/notti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notti/subscriptions","organizations_url":"https://api.github.com/users/notti/orgs","repos_url":"https://api.github.com/users/notti/repos","events_url":"https://api.github.com/users/notti/events{/privacy}","received_events_url":"https://api.github.com/users/notti/received_events","type":"User","site_admin":false},"html_url":"https://github.com/notti/gopacket","description":"Provides packet processing capabilities for Go","fork":true,"url":"https://api.github.com/repos/notti/gopacket","forks_url":"https://api.github.com/repos/notti/gopacket/forks","keys_url":"https://api.github.com/repos/notti/gopacket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/notti/gopacket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/notti/gopacket/teams","hooks_url":"https://api.github.com/repos/notti/gopacket/hooks","issue_events_url":"https://api.github.com/repos/notti/gopacket/issues/events{/number}","events_url":"https://api.github.com/repos/notti/gopacket/events","assignees_url":"https://api.github.com/repos/notti/gopacket/assignees{/user}","branches_url":"https://api.github.com/repos/notti/gopacket/branches{/branch}","tags_url":"https://api.github.com/repos/notti/gopacket/tags","blobs_url":"https://api.github.com/repos/notti/gopacket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/notti/gopacket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/notti/gopacket/git/refs{/sha}","trees_url":"https://api.github.com/repos/notti/gopacket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/notti/gopacket/statuses/{sha}","languages_url":"https://api.github.com/repos/notti/gopacket/languages","stargazers_url":"https://api.github.com/repos/notti/gopacket/stargazers","contributors_url":"https://api.github.com/repos/notti/gopacket/contributors","subscribers_url":"https://api.github.com/repos/notti/gopacket/subscribers","subscription_url":"https://api.github.com/repos/notti/gopacket/subscription","commits_url":"https://api.github.com/repos/notti/gopacket/commits{/sha}","git_commits_url":"https://api.github.com/repos/notti/gopacket/git/commits{/sha}","comments_url":"https://api.github.com/repos/notti/gopacket/comments{/number}","issue_comment_url":"https://api.github.com/repos/notti/gopacket/issues/comments{/number}","contents_url":"https://api.github.com/repos/notti/gopacket/contents/{+path}","compare_url":"https://api.github.com/repos/notti/gopacket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/notti/gopacket/merges","archive_url":"https://api.github.com/repos/notti/gopacket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/notti/gopacket/downloads","issues_url":"https://api.github.com/repos/notti/gopacket/issues{/number}","pulls_url":"https://api.github.com/repos/notti/gopacket/pulls{/number}","milestones_url":"https://api.github.com/repos/notti/gopacket/milestones{/number}","notifications_url":"https://api.github.com/repos/notti/gopacket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/notti/gopacket/labels{/name}","releases_url":"https://api.github.com/repos/notti/gopacket/releases{/id}","deployments_url":"https://api.github.com/repos/notti/gopacket/deployments","created_at":"2015-06-04T14:16:08Z","updated_at":"2018-10-29T23:13:12Z","pushed_at":"2018-11-01T16:45:12Z","git_url":"git://github.com/notti/gopacket.git","ssh_url":"git@github.com:notti/gopacket.git","clone_url":"https://github.com/notti/gopacket.git","svn_url":"https://github.com/notti/gopacket","homepage":"","size":4745,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"4a840851b59d36c81f4259f382632fc7a53bc794","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":32351944,"node_id":"MDEwOlJlcG9zaXRvcnkzMjM1MTk0NA==","name":"gopacket","full_name":"google/gopacket","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/gopacket","description":"Provides packet processing capabilities for Go","fork":false,"url":"https://api.github.com/repos/google/gopacket","forks_url":"https://api.github.com/repos/google/gopacket/forks","keys_url":"https://api.github.com/repos/google/gopacket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/gopacket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/gopacket/teams","hooks_url":"https://api.github.com/repos/google/gopacket/hooks","issue_events_url":"https://api.github.com/repos/google/gopacket/issues/events{/number}","events_url":"https://api.github.com/repos/google/gopacket/events","assignees_url":"https://api.github.com/repos/google/gopacket/assignees{/user}","branches_url":"https://api.github.com/repos/google/gopacket/branches{/branch}","tags_url":"https://api.github.com/repos/google/gopacket/tags","blobs_url":"https://api.github.com/repos/google/gopacket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/gopacket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/gopacket/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/gopacket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/gopacket/statuses/{sha}","languages_url":"https://api.github.com/repos/google/gopacket/languages","stargazers_url":"https://api.github.com/repos/google/gopacket/stargazers","contributors_url":"https://api.github.com/repos/google/gopacket/contributors","subscribers_url":"https://api.github.com/repos/google/gopacket/subscribers","subscription_url":"https://api.github.com/repos/google/gopacket/subscription","commits_url":"https://api.github.com/repos/google/gopacket/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/gopacket/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/gopacket/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/gopacket/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/gopacket/contents/{+path}","compare_url":"https://api.github.com/repos/google/gopacket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/gopacket/merges","archive_url":"https://api.github.com/repos/google/gopacket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/gopacket/downloads","issues_url":"https://api.github.com/repos/google/gopacket/issues{/number}","pulls_url":"https://api.github.com/repos/google/gopacket/pulls{/number}","milestones_url":"https://api.github.com/repos/google/gopacket/milestones{/number}","notifications_url":"https://api.github.com/repos/google/gopacket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/gopacket/labels{/name}","releases_url":"https://api.github.com/repos/google/gopacket/releases{/id}","deployments_url":"https://api.github.com/repos/google/gopacket/deployments","created_at":"2015-03-16T20:46:00Z","updated_at":"2018-10-31T16:20:58Z","pushed_at":"2018-10-30T19:52:27Z","git_url":"git://github.com/google/gopacket.git","ssh_url":"git@github.com:google/gopacket.git","clone_url":"https://github.com/google/gopacket.git","svn_url":"https://github.com/google/gopacket","homepage":"","size":4774,"stargazers_count":2246,"watchers_count":2246,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":423,"mirror_url":null,"archived":false,"open_issues_count":87,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":423,"open_issues":87,"watchers":2246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/gopacket/pulls/553"},"html":{"href":"https://github.com/google/gopacket/pull/553"},"issue":{"href":"https://api.github.com/repos/google/gopacket/issues/553"},"comments":{"href":"https://api.github.com/repos/google/gopacket/issues/553/comments"},"review_comments":{"href":"https://api.github.com/repos/google/gopacket/pulls/553/comments"},"review_comment":{"href":"https://api.github.com/repos/google/gopacket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/gopacket/pulls/553/commits"},"statuses":{"href":"https://api.github.com/repos/google/gopacket/statuses/f17706dacb4d698a6105573c837ada00b4e035b7"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":154,"deletions":43,"changed_files":2}}
{"actor":{"display_login":"notti"}}