{"action":"created","comment":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/56144635","id":56144635,"diff_hunk":"@@ -916,14 +1010,174 @@ usdf_cq_process_attr(struct fi_cq_attr *attr, struct usdf_domain *udp)\n \treturn 0;\n }\n \n+static int usdf_cq_fd_set_nonblock(int fd)\n+{\n+\tint flags;\n+\n+\tflags = fcntl(fd, F_GETFL, 0);\n+\tif (flags == -1) {\n+\t\tUSDF_WARN_SYS(CQ, \"fcntl getfl failed[%d]\\n\", errno);\n+\t\treturn -errno;\n+\t}\n+\n+\tif (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {\n+\t\tUSDF_WARN_SYS(CQ, \"fcntl setfl failed[%d]\\n\", errno);\n+\t\treturn -errno;\n+\t}\n+\n+\treturn FI_SUCCESS;\n+}\n+\n+static int usdf_cq_create_fd(struct usdf_cq *cq)\n+{\n+\tint ret;\n+\n+\tret = usd_ib_cmd_create_comp_channel(cq->cq_domain->dom_dev,\n+\t\t\t&cq->object.fd);\n+\tif (ret) {\n+\t\tUSDF_WARN_SYS(CQ, \"failed to create comp channel\\n\");\n+\t\treturn -FI_EINVAL;\n+\t}\n+\n+\tUSDF_DBG_SYS(CQ, \"successfully created comp channel with fd %d\\n\",\n+\t\t\tcq->object.fd);\n+\n+\t/* Going to need this assuming edge-triggered semantics.\n+\t */\n+\treturn usdf_cq_fd_set_nonblock(cq->object.fd);\n+}\n+\n+int usdf_cq_trywait(struct fid *fcq)\n+{\n+\tstruct usdf_cq *cq;\n+\tuint64_t ev;\n+\tint empty;\n+\tint ret;\n+\n+\tcq = cq_fidtou(fcq);\n+\n+\tswitch (cq->cq_attr.wait_obj) {\n+\tcase FI_WAIT_UNSPEC:\n+\t\treturn FI_SUCCESS;\n+\tcase FI_WAIT_FD:\n+\tcase FI_WAIT_SET:\n+\t\tbreak;\n+\tdefault:\n+\t\tUSDF_WARN_SYS(CQ, \"unsupported wait object type\\n\");\n+\t\treturn -FI_EINVAL;\n+\t}\n+\n+\twhile (1) {\n+\t\terrno = 0;","path":"prov/usnic/src/usdf_cq.c","position":313,"original_position":313,"commit_id":"65cad870926f6b9619a9f2a2728e90158ada04a0","original_commit_id":"65cad870926f6b9619a9f2a2728e90158ada04a0","user":{"login":"jsquyres","id":617316,"avatar_url":"https://avatars.githubusercontent.com/u/617316?v=3","gravatar_id":"","url":"https://api.github.com/users/jsquyres","html_url":"https://github.com/jsquyres","followers_url":"https://api.github.com/users/jsquyres/followers","following_url":"https://api.github.com/users/jsquyres/following{/other_user}","gists_url":"https://api.github.com/users/jsquyres/gists{/gist_id}","starred_url":"https://api.github.com/users/jsquyres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsquyres/subscriptions","organizations_url":"https://api.github.com/users/jsquyres/orgs","repos_url":"https://api.github.com/users/jsquyres/repos","events_url":"https://api.github.com/users/jsquyres/events{/privacy}","received_events_url":"https://api.github.com/users/jsquyres/received_events","type":"User","site_admin":false},"body":"You shouldn't need to reset errno.","created_at":"2016-03-15T10:49:04Z","updated_at":"2016-03-15T10:49:04Z","html_url":"https://github.com/ofiwg/libfabric/pull/1851#discussion_r56144635","pull_request_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851","_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/56144635"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/1851#discussion_r56144635"},"pull_request":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851"}}},"pull_request":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851","id":62466886,"html_url":"https://github.com/ofiwg/libfabric/pull/1851","diff_url":"https://github.com/ofiwg/libfabric/pull/1851.diff","patch_url":"https://github.com/ofiwg/libfabric/pull/1851.patch","issue_url":"https://api.github.com/repos/ofiwg/libfabric/issues/1851","number":1851,"state":"open","locked":false,"title":"usnic: Implement waitsets","user":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"body":"At the moment this only implements waitsets for `FI_EP_DGRAM`. Still working on the emulated endpoint support. \r\n\r\nThis has been tested with `fi_dgram_waitset` and a modified `fi_ud_pingpong`. \r\n\r\n- [ ] Support EQ for waitset\r\n- [ ] Support waitset for emulated endpoints\r\n- [x] Support CQ for waitsets\r\n- [x] Support waitset for hardware based endpoints (`FI_EP_DGRAM`)\r\n- [x] Implement FD based `fi_cq_sread`\r\n- [x] Implement `fi_trywait`\r\n\r\n@goodell @jsquyres ","created_at":"2016-03-10T22:26:47Z","updated_at":"2016-03-15T10:49:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2df6710f4467b73ccc2d8a656b5732b0d37a464","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851/commits","review_comments_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851/comments","review_comment_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/issues/1851/comments","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/65cad870926f6b9619a9f2a2728e90158ada04a0","head":{"label":"bturrubiates:waitset","ref":"waitset","sha":"65cad870926f6b9619a9f2a2728e90158ada04a0","user":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"repo":{"id":29930238,"name":"libfabric","full_name":"bturrubiates/libfabric","owner":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bturrubiates/libfabric","description":"Open Fabric Interfaces","fork":true,"url":"https://api.github.com/repos/bturrubiates/libfabric","forks_url":"https://api.github.com/repos/bturrubiates/libfabric/forks","keys_url":"https://api.github.com/repos/bturrubiates/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bturrubiates/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bturrubiates/libfabric/teams","hooks_url":"https://api.github.com/repos/bturrubiates/libfabric/hooks","issue_events_url":"https://api.github.com/repos/bturrubiates/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/bturrubiates/libfabric/events","assignees_url":"https://api.github.com/repos/bturrubiates/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/bturrubiates/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/bturrubiates/libfabric/tags","blobs_url":"https://api.github.com/repos/bturrubiates/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bturrubiates/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bturrubiates/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/bturrubiates/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bturrubiates/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/bturrubiates/libfabric/languages","stargazers_url":"https://api.github.com/repos/bturrubiates/libfabric/stargazers","contributors_url":"https://api.github.com/repos/bturrubiates/libfabric/contributors","subscribers_url":"https://api.github.com/repos/bturrubiates/libfabric/subscribers","subscription_url":"https://api.github.com/repos/bturrubiates/libfabric/subscription","commits_url":"https://api.github.com/repos/bturrubiates/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/bturrubiates/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/bturrubiates/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/bturrubiates/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/bturrubiates/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/bturrubiates/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bturrubiates/libfabric/merges","archive_url":"https://api.github.com/repos/bturrubiates/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bturrubiates/libfabric/downloads","issues_url":"https://api.github.com/repos/bturrubiates/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/bturrubiates/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/bturrubiates/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/bturrubiates/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bturrubiates/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/bturrubiates/libfabric/releases{/id}","deployments_url":"https://api.github.com/repos/bturrubiates/libfabric/deployments","created_at":"2015-01-27T19:13:34Z","updated_at":"2016-03-10T00:41:07Z","pushed_at":"2016-03-11T19:15:34Z","git_url":"git://github.com/bturrubiates/libfabric.git","ssh_url":"git@github.com:bturrubiates/libfabric.git","clone_url":"https://github.com/bturrubiates/libfabric.git","svn_url":"https://github.com/bturrubiates/libfabric","homepage":"http://ofiwg.github.io/libfabric/","size":9132,"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":"ofiwg:master","ref":"master","sha":"8d74257d451443939f3d7bdc51d0bb2d159c537f","user":{"login":"ofiwg","id":8459445,"avatar_url":"https://avatars.githubusercontent.com/u/8459445?v=3","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"repo":{"id":22996097,"name":"libfabric","full_name":"ofiwg/libfabric","owner":{"login":"ofiwg","id":8459445,"avatar_url":"https://avatars.githubusercontent.com/u/8459445?v=3","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ofiwg/libfabric","description":"Open Fabric Interfaces","fork":false,"url":"https://api.github.com/repos/ofiwg/libfabric","forks_url":"https://api.github.com/repos/ofiwg/libfabric/forks","keys_url":"https://api.github.com/repos/ofiwg/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ofiwg/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ofiwg/libfabric/teams","hooks_url":"https://api.github.com/repos/ofiwg/libfabric/hooks","issue_events_url":"https://api.github.com/repos/ofiwg/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/ofiwg/libfabric/events","assignees_url":"https://api.github.com/repos/ofiwg/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/ofiwg/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/ofiwg/libfabric/tags","blobs_url":"https://api.github.com/repos/ofiwg/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ofiwg/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ofiwg/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/ofiwg/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/ofiwg/libfabric/languages","stargazers_url":"https://api.github.com/repos/ofiwg/libfabric/stargazers","contributors_url":"https://api.github.com/repos/ofiwg/libfabric/contributors","subscribers_url":"https://api.github.com/repos/ofiwg/libfabric/subscribers","subscription_url":"https://api.github.com/repos/ofiwg/libfabric/subscription","commits_url":"https://api.github.com/repos/ofiwg/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/ofiwg/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/ofiwg/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/ofiwg/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/ofiwg/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ofiwg/libfabric/merges","archive_url":"https://api.github.com/repos/ofiwg/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ofiwg/libfabric/downloads","issues_url":"https://api.github.com/repos/ofiwg/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/ofiwg/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/ofiwg/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/ofiwg/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ofiwg/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/ofiwg/libfabric/releases{/id}","deployments_url":"https://api.github.com/repos/ofiwg/libfabric/deployments","created_at":"2014-08-15T16:45:53Z","updated_at":"2016-03-10T08:50:51Z","pushed_at":"2016-03-14T22:21:53Z","git_url":"git://github.com/ofiwg/libfabric.git","ssh_url":"git@github.com:ofiwg/libfabric.git","clone_url":"https://github.com/ofiwg/libfabric.git","svn_url":"https://github.com/ofiwg/libfabric","homepage":"http://ofiwg.github.io/libfabric/","size":11159,"stargazers_count":64,"watchers_count":64,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":61,"mirror_url":null,"open_issues_count":74,"forks":61,"open_issues":74,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/1851"},"issue":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/1851"},"comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/1851/comments"},"review_comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851/comments"},"review_comment":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/1851/commits"},"statuses":{"href":"https://api.github.com/repos/ofiwg/libfabric/statuses/65cad870926f6b9619a9f2a2728e90158ada04a0"}}}}