{"action":"created","comment":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/63747123","id":63747123,"diff_hunk":"@@ -76,3 +77,54 @@ usdf_endpoint_open(struct fid_domain *domain, struct fi_info *info,\n \t\treturn -FI_ENODEV;\n \t}\n }\n+\n+int usdf_ep_getopt_connected(fid_t fid, int level, int optname, void *optval,\n+\t\tsize_t *optlen)\n+{\n+\tsize_t *cm_size;\n+\tsize_t dest_size;\n+\n+\tUSDF_TRACE_SYS(EP_CTRL, \"\\n\");\n+\n+\tif (!optval || !optlen)\n+\t\treturn -FI_EINVAL;\n+\n+\tif (level != FI_OPT_ENDPOINT)\n+\t\treturn -FI_ENOPROTOOPT;\n+\n+\tswitch (optname) {\n+\tcase FI_OPT_CM_DATA_SIZE:\n+\t\tdest_size = *optlen;\n+\t\t*optlen = sizeof(*cm_size);\n+\n+\t\tif (dest_size < sizeof(*cm_size))\n+\t\t\treturn -FI_ETOOSMALL;\n+\n+\t\tcm_size = optval;\n+\t\t*cm_size = USDF_MAX_CONN_DATA;\n+\t\tbreak;\n+\tcase FI_OPT_ENDPOINT:","path":"prov/usnic/src/usdf_endpoint.c","position":45,"original_position":45,"commit_id":"0740eaea139239aee752facfc9af58ba7f90a885","original_commit_id":"0740eaea139239aee752facfc9af58ba7f90a885","user":{"login":"goodell","id":78560,"avatar_url":"https://avatars.githubusercontent.com/u/78560?v=3","gravatar_id":"","url":"https://api.github.com/users/goodell","html_url":"https://github.com/goodell","followers_url":"https://api.github.com/users/goodell/followers","following_url":"https://api.github.com/users/goodell/following{/other_user}","gists_url":"https://api.github.com/users/goodell/gists{/gist_id}","starred_url":"https://api.github.com/users/goodell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goodell/subscriptions","organizations_url":"https://api.github.com/users/goodell/orgs","repos_url":"https://api.github.com/users/goodell/repos","events_url":"https://api.github.com/users/goodell/events{/privacy}","received_events_url":"https://api.github.com/users/goodell/received_events","type":"User","site_admin":false},"body":"`FI_OPT_ENDPOINT` is a level constant, not an optname constant.  Please delete this `case`.\r\n\r\nIt's too late for this without breaking ABI, but in an ideal world I think we'd have separated the value space a bit so that the error checking could be the more user friendly (`FI_OPT_MIN_MULTI_RECV` and `FI_OPT_ENDPOINT` have the same value but different conceptual roles).  Another tweak that would have been good would have been changing the name to `FI_OPT_LVL_ENDPOINT' or something that indicates the constant is for \"levels\".  Oh well, it's a minor thing.","created_at":"2016-05-18T17:33:13Z","updated_at":"2016-05-18T17:33:13Z","html_url":"https://github.com/ofiwg/libfabric/pull/2033#discussion_r63747123","pull_request_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033","_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/63747123"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/2033#discussion_r63747123"},"pull_request":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033"}}},"pull_request":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033","id":70293473,"html_url":"https://github.com/ofiwg/libfabric/pull/2033","diff_url":"https://github.com/ofiwg/libfabric/pull/2033.diff","patch_url":"https://github.com/ofiwg/libfabric/pull/2033.patch","issue_url":"https://api.github.com/repos/ofiwg/libfabric/issues/2033","number":2033,"state":"open","locked":false,"title":"usnic: Enhance getopt support.","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":"- Unify into connected vs. unconnected as it is likely that the only\r\n  differing call is to get the CM size.\r\n- Support getopt in passive endpoints to retrieve the CM size. Since the\r\n  only CM data we support is on MSG, the implementations should not\r\n  differ.\r\n- Set the length of the field before returning in error cases.\r\n- Unify the setopt and getopt implementations that return ENOPROTOOPT\r\n  into common code.\r\n\r\n@goodell \r\n\r\nSigned-off-by: Ben Turrubiates <bturrubi@cisco.com>","created_at":"2016-05-17T03:03:37Z","updated_at":"2016-05-18T17:33:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2068dff2b09cf3f2aa5bfe0f1122a257e4bc8f3","assignee":null,"milestone":{"url":"https://api.github.com/repos/ofiwg/libfabric/milestones/13","html_url":"https://github.com/ofiwg/libfabric/milestones/release%201.4.0","labels_url":"https://api.github.com/repos/ofiwg/libfabric/milestones/13/labels","id":1671739,"number":13,"title":"release 1.4.0","description":"","creator":{"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},"open_issues":17,"closed_issues":16,"state":"open","created_at":"2016-03-29T12:35:33Z","updated_at":"2016-05-17T22:32:45Z","due_on":"2016-06-30T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033/commits","review_comments_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033/comments","review_comment_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/issues/2033/comments","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/0740eaea139239aee752facfc9af58ba7f90a885","head":{"label":"bturrubiates:usnic-getopt","ref":"usnic-getopt","sha":"0740eaea139239aee752facfc9af58ba7f90a885","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-05-17T23:44:06Z","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":10188,"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":"286a955d7dbd2f6bf0db22dd585c4eb3f0476014","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-04-14T15:34:09Z","pushed_at":"2016-05-18T17:29:19Z","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":12237,"stargazers_count":67,"watchers_count":67,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":65,"mirror_url":null,"open_issues_count":76,"forks":65,"open_issues":76,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/2033"},"issue":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/2033"},"comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/2033/comments"},"review_comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033/comments"},"review_comment":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2033/commits"},"statuses":{"href":"https://api.github.com/repos/ofiwg/libfabric/statuses/0740eaea139239aee752facfc9af58ba7f90a885"}}}}