{"action":"created","comment":{"url":"https://api.github.com/repos/Mellanox/sockperf/pulls/comments/76739592","id":76739592,"diff_hunk":"@@ -140,21 +141,48 @@ class Client : public ClientBase{\n \t\tint serverNo = 0;\n \n \t\tTicksTime rxTime;\n-\n-\t\tret = msg_recvfrom(ifd,\n-\t\t\t\t           g_fds_array[ifd]->recv.cur_addr + g_fds_array[ifd]->recv.cur_offset,\n-\t\t\t\t           g_fds_array[ifd]->recv.cur_size,\n-\t\t\t\t           &recvfrom_addr);\n-\t\tif (ret == RET_SOCKET_SHUTDOWN) {\n-\t\t\tif (g_fds_array[ifd]->sock_type == SOCK_STREAM) {\n-\t\t\t\texit_with_log(\"A connection was forcibly closed by a peer\",SOCKPERF_ERR_SOCKET,g_fds_array[ifd]);\n+#ifdef  USING_VMA_EXTRA_API\n+\t\tif (!g_vma_api || !g_pApp->m_const_params.is_vmapoll)\n+#endif\n+\t\t{\n+\t\t\tret = msg_recvfrom(ifd,\n+\t\t\t\t\t   g_fds_array[ifd]->recv.cur_addr + g_fds_array[ifd]->recv.cur_offset,\n+\t\t\t\t\t   g_fds_array[ifd]->recv.cur_size,\n+\t\t\t\t\t   &recvfrom_addr);\n+\t\t\tif (ret == RET_SOCKET_SHUTDOWN) {\n+\t\t\t\tif (g_fds_array[ifd]->sock_type == SOCK_STREAM) {\n+\t\t\t\t\texit_with_log(\"A connection was forcibly closed by a peer\",SOCKPERF_ERR_SOCKET,g_fds_array[ifd]);\n+\t\t\t\t}\n \t\t\t}\n+\t\t\tif (ret < 0) return 0;\n \t\t}\n-\t\tif (ret < 0) return 0;\n+#ifdef USING_VMA_EXTRA_API\n+\t\tint nbytes = ret;\n+\t\tvma_buff_t* tmp_vma_poll_buff = g_vma_poll_buff;\n+\t\twhile(tmp_vma_poll_buff || nbytes) {\n+\t\t\tif (tmp_vma_poll_buff && !nbytes){\n+\t\t\t\tif (g_fds_array[ifd]->recv.cur_offset) {\n+\t\t\t\t\tg_fds_array[ifd]->recv.cur_addr = g_fds_array[ifd]->recv.buf;\n+\t\t\t\t\tmemcpy(g_fds_array[ifd]->recv.cur_addr + g_fds_array[ifd]->recv.cur_offset,(uint8_t*)tmp_vma_poll_buff->payload, tmp_vma_poll_buff->len);\n+\t\t\t\t}\n+\t\t\t\telse {\n+\t\t\t\t\tg_fds_array[ifd]->recv.cur_addr = (uint8_t*)tmp_vma_poll_buff->payload;\n+\t\t\t\t}\n+\t\t\t\tret = tmp_vma_poll_buff->len;\n+\t\t\t\trecvfrom_addr = g_vma_comps->src;\n+\t\t\t\tif (ret == RET_SOCKET_SHUTDOWN) {\n+\t\t\t\t\tif (g_fds_array[ifd]->sock_type == SOCK_STREAM) {\n+\t\t\t\t\t\texit_with_log(\"A connection was forcibly closed by a peer\",SOCKPERF_ERR_SOCKET,g_fds_array[ifd]);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\tif (ret < 0) return 0;\n+\t\t\t\tnbytes = ret;\n+\t\t\t}\n ","path":"src/Client.h","position":58,"original_position":58,"commit_id":"9ac410864265ef12849beb89234d37d6b6c0c4cb","original_commit_id":"9ac410864265ef12849beb89234d37d6b6c0c4cb","user":{"login":"igor-ivanov","id":9037172,"avatar_url":"https://avatars.githubusercontent.com/u/9037172?v=3","gravatar_id":"","url":"https://api.github.com/users/igor-ivanov","html_url":"https://github.com/igor-ivanov","followers_url":"https://api.github.com/users/igor-ivanov/followers","following_url":"https://api.github.com/users/igor-ivanov/following{/other_user}","gists_url":"https://api.github.com/users/igor-ivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/igor-ivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igor-ivanov/subscriptions","organizations_url":"https://api.github.com/users/igor-ivanov/orgs","repos_url":"https://api.github.com/users/igor-ivanov/repos","events_url":"https://api.github.com/users/igor-ivanov/events{/privacy}","received_events_url":"https://api.github.com/users/igor-ivanov/received_events","type":"User","site_admin":false},"body":"I think we could extend msg_recvfrom() function to accept additional void * context argument if it is required. There are two places in code this function is called. I believe that hiding this code inside  makes the code better.","created_at":"2016-08-30T07:00:24Z","updated_at":"2016-08-30T07:00:24Z","html_url":"https://github.com/Mellanox/sockperf/pull/76#discussion_r76739592","pull_request_url":"https://api.github.com/repos/Mellanox/sockperf/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/Mellanox/sockperf/pulls/comments/76739592"},"html":{"href":"https://github.com/Mellanox/sockperf/pull/76#discussion_r76739592"},"pull_request":{"href":"https://api.github.com/repos/Mellanox/sockperf/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/Mellanox/sockperf/pulls/76","id":82710345,"html_url":"https://github.com/Mellanox/sockperf/pull/76","diff_url":"https://github.com/Mellanox/sockperf/pull/76.diff","patch_url":"https://github.com/Mellanox/sockperf/pull/76.patch","issue_url":"https://api.github.com/repos/Mellanox/sockperf/issues/76","number":76,"state":"open","locked":false,"title":"Support VMA Poll API","user":{"login":"AlaAyesh","id":11372831,"avatar_url":"https://avatars.githubusercontent.com/u/11372831?v=3","gravatar_id":"","url":"https://api.github.com/users/AlaAyesh","html_url":"https://github.com/AlaAyesh","followers_url":"https://api.github.com/users/AlaAyesh/followers","following_url":"https://api.github.com/users/AlaAyesh/following{/other_user}","gists_url":"https://api.github.com/users/AlaAyesh/gists{/gist_id}","starred_url":"https://api.github.com/users/AlaAyesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlaAyesh/subscriptions","organizations_url":"https://api.github.com/users/AlaAyesh/orgs","repos_url":"https://api.github.com/users/AlaAyesh/repos","events_url":"https://api.github.com/users/AlaAyesh/events{/privacy}","received_events_url":"https://api.github.com/users/AlaAyesh/received_events","type":"User","site_admin":false},"body":"Signed-off-by: AlaAyesh <AAyesh@asaltech.com>","created_at":"2016-08-25T12:27:58Z","updated_at":"2016-08-30T07:00:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a55c7f3ebc9d8e7ba26ada6d125da0ef7e0287e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Mellanox/sockperf/pulls/76/commits","review_comments_url":"https://api.github.com/repos/Mellanox/sockperf/pulls/76/comments","review_comment_url":"https://api.github.com/repos/Mellanox/sockperf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mellanox/sockperf/issues/76/comments","statuses_url":"https://api.github.com/repos/Mellanox/sockperf/statuses/9ac410864265ef12849beb89234d37d6b6c0c4cb","head":{"label":"AlaAyesh:vmapollapi_support","ref":"vmapollapi_support","sha":"9ac410864265ef12849beb89234d37d6b6c0c4cb","user":{"login":"AlaAyesh","id":11372831,"avatar_url":"https://avatars.githubusercontent.com/u/11372831?v=3","gravatar_id":"","url":"https://api.github.com/users/AlaAyesh","html_url":"https://github.com/AlaAyesh","followers_url":"https://api.github.com/users/AlaAyesh/followers","following_url":"https://api.github.com/users/AlaAyesh/following{/other_user}","gists_url":"https://api.github.com/users/AlaAyesh/gists{/gist_id}","starred_url":"https://api.github.com/users/AlaAyesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlaAyesh/subscriptions","organizations_url":"https://api.github.com/users/AlaAyesh/orgs","repos_url":"https://api.github.com/users/AlaAyesh/repos","events_url":"https://api.github.com/users/AlaAyesh/events{/privacy}","received_events_url":"https://api.github.com/users/AlaAyesh/received_events","type":"User","site_admin":false},"repo":{"id":64835574,"name":"sockperf","full_name":"AlaAyesh/sockperf","owner":{"login":"AlaAyesh","id":11372831,"avatar_url":"https://avatars.githubusercontent.com/u/11372831?v=3","gravatar_id":"","url":"https://api.github.com/users/AlaAyesh","html_url":"https://github.com/AlaAyesh","followers_url":"https://api.github.com/users/AlaAyesh/followers","following_url":"https://api.github.com/users/AlaAyesh/following{/other_user}","gists_url":"https://api.github.com/users/AlaAyesh/gists{/gist_id}","starred_url":"https://api.github.com/users/AlaAyesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlaAyesh/subscriptions","organizations_url":"https://api.github.com/users/AlaAyesh/orgs","repos_url":"https://api.github.com/users/AlaAyesh/repos","events_url":"https://api.github.com/users/AlaAyesh/events{/privacy}","received_events_url":"https://api.github.com/users/AlaAyesh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlaAyesh/sockperf","description":"Network Benchmarking Utility (exported from code.google.com/p/sockperf)","fork":true,"url":"https://api.github.com/repos/AlaAyesh/sockperf","forks_url":"https://api.github.com/repos/AlaAyesh/sockperf/forks","keys_url":"https://api.github.com/repos/AlaAyesh/sockperf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlaAyesh/sockperf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlaAyesh/sockperf/teams","hooks_url":"https://api.github.com/repos/AlaAyesh/sockperf/hooks","issue_events_url":"https://api.github.com/repos/AlaAyesh/sockperf/issues/events{/number}","events_url":"https://api.github.com/repos/AlaAyesh/sockperf/events","assignees_url":"https://api.github.com/repos/AlaAyesh/sockperf/assignees{/user}","branches_url":"https://api.github.com/repos/AlaAyesh/sockperf/branches{/branch}","tags_url":"https://api.github.com/repos/AlaAyesh/sockperf/tags","blobs_url":"https://api.github.com/repos/AlaAyesh/sockperf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlaAyesh/sockperf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlaAyesh/sockperf/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlaAyesh/sockperf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlaAyesh/sockperf/statuses/{sha}","languages_url":"https://api.github.com/repos/AlaAyesh/sockperf/languages","stargazers_url":"https://api.github.com/repos/AlaAyesh/sockperf/stargazers","contributors_url":"https://api.github.com/repos/AlaAyesh/sockperf/contributors","subscribers_url":"https://api.github.com/repos/AlaAyesh/sockperf/subscribers","subscription_url":"https://api.github.com/repos/AlaAyesh/sockperf/subscription","commits_url":"https://api.github.com/repos/AlaAyesh/sockperf/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlaAyesh/sockperf/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlaAyesh/sockperf/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlaAyesh/sockperf/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlaAyesh/sockperf/contents/{+path}","compare_url":"https://api.github.com/repos/AlaAyesh/sockperf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlaAyesh/sockperf/merges","archive_url":"https://api.github.com/repos/AlaAyesh/sockperf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlaAyesh/sockperf/downloads","issues_url":"https://api.github.com/repos/AlaAyesh/sockperf/issues{/number}","pulls_url":"https://api.github.com/repos/AlaAyesh/sockperf/pulls{/number}","milestones_url":"https://api.github.com/repos/AlaAyesh/sockperf/milestones{/number}","notifications_url":"https://api.github.com/repos/AlaAyesh/sockperf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlaAyesh/sockperf/labels{/name}","releases_url":"https://api.github.com/repos/AlaAyesh/sockperf/releases{/id}","deployments_url":"https://api.github.com/repos/AlaAyesh/sockperf/deployments","created_at":"2016-08-03T10:01:36Z","updated_at":"2016-08-03T10:01:37Z","pushed_at":"2016-08-25T12:25:21Z","git_url":"git://github.com/AlaAyesh/sockperf.git","ssh_url":"git@github.com:AlaAyesh/sockperf.git","clone_url":"https://github.com/AlaAyesh/sockperf.git","svn_url":"https://github.com/AlaAyesh/sockperf","homepage":"","size":476,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"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":"sockperf_v2"}},"base":{"label":"Mellanox:sockperf_v2","ref":"sockperf_v2","sha":"3dd5971d7d7a28980aee4fc13b10a51c43eec813","user":{"login":"Mellanox","id":5813145,"avatar_url":"https://avatars.githubusercontent.com/u/5813145?v=3","gravatar_id":"","url":"https://api.github.com/users/Mellanox","html_url":"https://github.com/Mellanox","followers_url":"https://api.github.com/users/Mellanox/followers","following_url":"https://api.github.com/users/Mellanox/following{/other_user}","gists_url":"https://api.github.com/users/Mellanox/gists{/gist_id}","starred_url":"https://api.github.com/users/Mellanox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mellanox/subscriptions","organizations_url":"https://api.github.com/users/Mellanox/orgs","repos_url":"https://api.github.com/users/Mellanox/repos","events_url":"https://api.github.com/users/Mellanox/events{/privacy}","received_events_url":"https://api.github.com/users/Mellanox/received_events","type":"Organization","site_admin":false},"repo":{"id":34728735,"name":"sockperf","full_name":"Mellanox/sockperf","owner":{"login":"Mellanox","id":5813145,"avatar_url":"https://avatars.githubusercontent.com/u/5813145?v=3","gravatar_id":"","url":"https://api.github.com/users/Mellanox","html_url":"https://github.com/Mellanox","followers_url":"https://api.github.com/users/Mellanox/followers","following_url":"https://api.github.com/users/Mellanox/following{/other_user}","gists_url":"https://api.github.com/users/Mellanox/gists{/gist_id}","starred_url":"https://api.github.com/users/Mellanox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mellanox/subscriptions","organizations_url":"https://api.github.com/users/Mellanox/orgs","repos_url":"https://api.github.com/users/Mellanox/repos","events_url":"https://api.github.com/users/Mellanox/events{/privacy}","received_events_url":"https://api.github.com/users/Mellanox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mellanox/sockperf","description":"Network Benchmarking Utility (exported from code.google.com/p/sockperf)","fork":false,"url":"https://api.github.com/repos/Mellanox/sockperf","forks_url":"https://api.github.com/repos/Mellanox/sockperf/forks","keys_url":"https://api.github.com/repos/Mellanox/sockperf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mellanox/sockperf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mellanox/sockperf/teams","hooks_url":"https://api.github.com/repos/Mellanox/sockperf/hooks","issue_events_url":"https://api.github.com/repos/Mellanox/sockperf/issues/events{/number}","events_url":"https://api.github.com/repos/Mellanox/sockperf/events","assignees_url":"https://api.github.com/repos/Mellanox/sockperf/assignees{/user}","branches_url":"https://api.github.com/repos/Mellanox/sockperf/branches{/branch}","tags_url":"https://api.github.com/repos/Mellanox/sockperf/tags","blobs_url":"https://api.github.com/repos/Mellanox/sockperf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mellanox/sockperf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mellanox/sockperf/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mellanox/sockperf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mellanox/sockperf/statuses/{sha}","languages_url":"https://api.github.com/repos/Mellanox/sockperf/languages","stargazers_url":"https://api.github.com/repos/Mellanox/sockperf/stargazers","contributors_url":"https://api.github.com/repos/Mellanox/sockperf/contributors","subscribers_url":"https://api.github.com/repos/Mellanox/sockperf/subscribers","subscription_url":"https://api.github.com/repos/Mellanox/sockperf/subscription","commits_url":"https://api.github.com/repos/Mellanox/sockperf/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mellanox/sockperf/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mellanox/sockperf/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mellanox/sockperf/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mellanox/sockperf/contents/{+path}","compare_url":"https://api.github.com/repos/Mellanox/sockperf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mellanox/sockperf/merges","archive_url":"https://api.github.com/repos/Mellanox/sockperf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mellanox/sockperf/downloads","issues_url":"https://api.github.com/repos/Mellanox/sockperf/issues{/number}","pulls_url":"https://api.github.com/repos/Mellanox/sockperf/pulls{/number}","milestones_url":"https://api.github.com/repos/Mellanox/sockperf/milestones{/number}","notifications_url":"https://api.github.com/repos/Mellanox/sockperf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mellanox/sockperf/labels{/name}","releases_url":"https://api.github.com/repos/Mellanox/sockperf/releases{/id}","deployments_url":"https://api.github.com/repos/Mellanox/sockperf/deployments","created_at":"2015-04-28T12:20:10Z","updated_at":"2016-08-24T03:02:13Z","pushed_at":"2016-08-25T12:27:58Z","git_url":"git://github.com/Mellanox/sockperf.git","ssh_url":"git@github.com:Mellanox/sockperf.git","clone_url":"https://github.com/Mellanox/sockperf.git","svn_url":"https://github.com/Mellanox/sockperf","homepage":"","size":718,"stargazers_count":46,"watchers_count":46,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":21,"forks":18,"open_issues":21,"watchers":46,"default_branch":"sockperf_v2"}},"_links":{"self":{"href":"https://api.github.com/repos/Mellanox/sockperf/pulls/76"},"html":{"href":"https://github.com/Mellanox/sockperf/pull/76"},"issue":{"href":"https://api.github.com/repos/Mellanox/sockperf/issues/76"},"comments":{"href":"https://api.github.com/repos/Mellanox/sockperf/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/Mellanox/sockperf/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/Mellanox/sockperf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mellanox/sockperf/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/Mellanox/sockperf/statuses/9ac410864265ef12849beb89234d37d6b6c0c4cb"}}}}
{"actor":{"display_login":"igor-ivanov"}}