{"action":"created","comment":{"url":"https://api.github.com/repos/kohler/click/pulls/comments/31544857","id":31544857,"diff_hunk":"@@ -388,6 +404,38 @@ click_current_processor()\n #endif\n }\n \n+inline unsigned\n+click_current_cpu_id()\n+{\n+#if !HAVE_MULTITHREAD\n+    return 0;\n+#elif CLICK_USERLEVEL\n+#  if HAVE___THREAD_STORAGE_CLASS\n+    return click_current_thread_id & 0xffff;\n+#  else\n+    return sched_getcpu();","path":"include/click/glue.hh","position":54,"original_position":54,"commit_id":"0130e100e91d21eea94e0dfdbc62ad6f7a96035f","original_commit_id":"0130e100e91d21eea94e0dfdbc62ad6f7a96035f","user":{"login":"kohler","id":410647,"avatar_url":"https://avatars.githubusercontent.com/u/410647?v=3","gravatar_id":"","url":"https://api.github.com/users/kohler","html_url":"https://github.com/kohler","followers_url":"https://api.github.com/users/kohler/followers","following_url":"https://api.github.com/users/kohler/following{/other_user}","gists_url":"https://api.github.com/users/kohler/gists{/gist_id}","starred_url":"https://api.github.com/users/kohler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kohler/subscriptions","organizations_url":"https://api.github.com/users/kohler/orgs","repos_url":"https://api.github.com/users/kohler/repos","events_url":"https://api.github.com/users/kohler/events{/privacy}","received_events_url":"https://api.github.com/users/kohler/received_events","type":"User","site_admin":false},"body":"This seems very dangerous to me. sched_getcpu() isn't guaranteed to be < click_max_cpu_ids().","created_at":"2015-06-02T16:58:30Z","updated_at":"2015-06-02T16:58:30Z","html_url":"https://github.com/kohler/click/pull/191#discussion_r31544857","pull_request_url":"https://api.github.com/repos/kohler/click/pulls/191","_links":{"self":{"href":"https://api.github.com/repos/kohler/click/pulls/comments/31544857"},"html":{"href":"https://github.com/kohler/click/pull/191#discussion_r31544857"},"pull_request":{"href":"https://api.github.com/repos/kohler/click/pulls/191"}}},"pull_request":{"url":"https://api.github.com/repos/kohler/click/pulls/191","id":35059523,"html_url":"https://github.com/kohler/click/pull/191","diff_url":"https://github.com/kohler/click/pull/191.diff","patch_url":"https://github.com/kohler/click/pull/191.patch","issue_url":"https://api.github.com/repos/kohler/click/issues/191","number":191,"state":"open","locked":false,"title":"Move lookupiproutemp, cpuqueue and cpuswitch to userspace","user":{"login":"MappaM","id":248961,"avatar_url":"https://avatars.githubusercontent.com/u/248961?v=3","gravatar_id":"","url":"https://api.github.com/users/MappaM","html_url":"https://github.com/MappaM","followers_url":"https://api.github.com/users/MappaM/followers","following_url":"https://api.github.com/users/MappaM/following{/other_user}","gists_url":"https://api.github.com/users/MappaM/gists{/gist_id}","starred_url":"https://api.github.com/users/MappaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MappaM/subscriptions","organizations_url":"https://api.github.com/users/MappaM/orgs","repos_url":"https://api.github.com/users/MappaM/repos","events_url":"https://api.github.com/users/MappaM/events{/privacy}","received_events_url":"https://api.github.com/users/MappaM/received_events","type":"User","site_admin":false},"body":"Add click_nr_cpu() and click_current_cpu_id() in glue.hh for convenience.\r\n\r\nclick_current_cpu_id should give a number usable in a structure access, which is different from click_current_processor() which gives a reference of any type (like a pthread_t for userlevel)","created_at":"2015-05-09T02:00:51Z","updated_at":"2015-06-02T16:58:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0eae8c703256480653fa31bda5000db5992441a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kohler/click/pulls/191/commits","review_comments_url":"https://api.github.com/repos/kohler/click/pulls/191/comments","review_comment_url":"https://api.github.com/repos/kohler/click/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kohler/click/issues/191/comments","statuses_url":"https://api.github.com/repos/kohler/click/statuses/0130e100e91d21eea94e0dfdbc62ad6f7a96035f","head":{"label":"MappaM:userlevel_stuff","ref":"userlevel_stuff","sha":"0130e100e91d21eea94e0dfdbc62ad6f7a96035f","user":{"login":"MappaM","id":248961,"avatar_url":"https://avatars.githubusercontent.com/u/248961?v=3","gravatar_id":"","url":"https://api.github.com/users/MappaM","html_url":"https://github.com/MappaM","followers_url":"https://api.github.com/users/MappaM/followers","following_url":"https://api.github.com/users/MappaM/following{/other_user}","gists_url":"https://api.github.com/users/MappaM/gists{/gist_id}","starred_url":"https://api.github.com/users/MappaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MappaM/subscriptions","organizations_url":"https://api.github.com/users/MappaM/orgs","repos_url":"https://api.github.com/users/MappaM/repos","events_url":"https://api.github.com/users/MappaM/events{/privacy}","received_events_url":"https://api.github.com/users/MappaM/received_events","type":"User","site_admin":false},"repo":{"id":21820687,"name":"click","full_name":"MappaM/click","owner":{"login":"MappaM","id":248961,"avatar_url":"https://avatars.githubusercontent.com/u/248961?v=3","gravatar_id":"","url":"https://api.github.com/users/MappaM","html_url":"https://github.com/MappaM","followers_url":"https://api.github.com/users/MappaM/followers","following_url":"https://api.github.com/users/MappaM/following{/other_user}","gists_url":"https://api.github.com/users/MappaM/gists{/gist_id}","starred_url":"https://api.github.com/users/MappaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MappaM/subscriptions","organizations_url":"https://api.github.com/users/MappaM/orgs","repos_url":"https://api.github.com/users/MappaM/repos","events_url":"https://api.github.com/users/MappaM/events{/privacy}","received_events_url":"https://api.github.com/users/MappaM/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MappaM/click","description":"FastClick - A faster version the Click Modular Router featuring an improved Netmap support and an improved DPDK support","fork":true,"url":"https://api.github.com/repos/MappaM/click","forks_url":"https://api.github.com/repos/MappaM/click/forks","keys_url":"https://api.github.com/repos/MappaM/click/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MappaM/click/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MappaM/click/teams","hooks_url":"https://api.github.com/repos/MappaM/click/hooks","issue_events_url":"https://api.github.com/repos/MappaM/click/issues/events{/number}","events_url":"https://api.github.com/repos/MappaM/click/events","assignees_url":"https://api.github.com/repos/MappaM/click/assignees{/user}","branches_url":"https://api.github.com/repos/MappaM/click/branches{/branch}","tags_url":"https://api.github.com/repos/MappaM/click/tags","blobs_url":"https://api.github.com/repos/MappaM/click/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MappaM/click/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MappaM/click/git/refs{/sha}","trees_url":"https://api.github.com/repos/MappaM/click/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MappaM/click/statuses/{sha}","languages_url":"https://api.github.com/repos/MappaM/click/languages","stargazers_url":"https://api.github.com/repos/MappaM/click/stargazers","contributors_url":"https://api.github.com/repos/MappaM/click/contributors","subscribers_url":"https://api.github.com/repos/MappaM/click/subscribers","subscription_url":"https://api.github.com/repos/MappaM/click/subscription","commits_url":"https://api.github.com/repos/MappaM/click/commits{/sha}","git_commits_url":"https://api.github.com/repos/MappaM/click/git/commits{/sha}","comments_url":"https://api.github.com/repos/MappaM/click/comments{/number}","issue_comment_url":"https://api.github.com/repos/MappaM/click/issues/comments{/number}","contents_url":"https://api.github.com/repos/MappaM/click/contents/{+path}","compare_url":"https://api.github.com/repos/MappaM/click/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MappaM/click/merges","archive_url":"https://api.github.com/repos/MappaM/click/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MappaM/click/downloads","issues_url":"https://api.github.com/repos/MappaM/click/issues{/number}","pulls_url":"https://api.github.com/repos/MappaM/click/pulls{/number}","milestones_url":"https://api.github.com/repos/MappaM/click/milestones{/number}","notifications_url":"https://api.github.com/repos/MappaM/click/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MappaM/click/labels{/name}","releases_url":"https://api.github.com/repos/MappaM/click/releases{/id}","created_at":"2014-07-14T13:36:07Z","updated_at":"2015-05-19T13:29:09Z","pushed_at":"2015-05-29T13:53:47Z","git_url":"git://github.com/MappaM/click.git","ssh_url":"git@github.com:MappaM/click.git","clone_url":"https://github.com/MappaM/click.git","svn_url":"https://github.com/MappaM/click","homepage":"http://fastclick.run.montefiore.ulg.ac.be","size":22429,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"kohler:master","ref":"master","sha":"07441a48d44262f060fc40e53d94e396e3187b62","user":{"login":"kohler","id":410647,"avatar_url":"https://avatars.githubusercontent.com/u/410647?v=3","gravatar_id":"","url":"https://api.github.com/users/kohler","html_url":"https://github.com/kohler","followers_url":"https://api.github.com/users/kohler/followers","following_url":"https://api.github.com/users/kohler/following{/other_user}","gists_url":"https://api.github.com/users/kohler/gists{/gist_id}","starred_url":"https://api.github.com/users/kohler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kohler/subscriptions","organizations_url":"https://api.github.com/users/kohler/orgs","repos_url":"https://api.github.com/users/kohler/repos","events_url":"https://api.github.com/users/kohler/events{/privacy}","received_events_url":"https://api.github.com/users/kohler/received_events","type":"User","site_admin":false},"repo":{"id":929129,"name":"click","full_name":"kohler/click","owner":{"login":"kohler","id":410647,"avatar_url":"https://avatars.githubusercontent.com/u/410647?v=3","gravatar_id":"","url":"https://api.github.com/users/kohler","html_url":"https://github.com/kohler","followers_url":"https://api.github.com/users/kohler/followers","following_url":"https://api.github.com/users/kohler/following{/other_user}","gists_url":"https://api.github.com/users/kohler/gists{/gist_id}","starred_url":"https://api.github.com/users/kohler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kohler/subscriptions","organizations_url":"https://api.github.com/users/kohler/orgs","repos_url":"https://api.github.com/users/kohler/repos","events_url":"https://api.github.com/users/kohler/events{/privacy}","received_events_url":"https://api.github.com/users/kohler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kohler/click","description":"The Click modular router: fast modular packet processing and analysis","fork":false,"url":"https://api.github.com/repos/kohler/click","forks_url":"https://api.github.com/repos/kohler/click/forks","keys_url":"https://api.github.com/repos/kohler/click/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kohler/click/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kohler/click/teams","hooks_url":"https://api.github.com/repos/kohler/click/hooks","issue_events_url":"https://api.github.com/repos/kohler/click/issues/events{/number}","events_url":"https://api.github.com/repos/kohler/click/events","assignees_url":"https://api.github.com/repos/kohler/click/assignees{/user}","branches_url":"https://api.github.com/repos/kohler/click/branches{/branch}","tags_url":"https://api.github.com/repos/kohler/click/tags","blobs_url":"https://api.github.com/repos/kohler/click/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kohler/click/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kohler/click/git/refs{/sha}","trees_url":"https://api.github.com/repos/kohler/click/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kohler/click/statuses/{sha}","languages_url":"https://api.github.com/repos/kohler/click/languages","stargazers_url":"https://api.github.com/repos/kohler/click/stargazers","contributors_url":"https://api.github.com/repos/kohler/click/contributors","subscribers_url":"https://api.github.com/repos/kohler/click/subscribers","subscription_url":"https://api.github.com/repos/kohler/click/subscription","commits_url":"https://api.github.com/repos/kohler/click/commits{/sha}","git_commits_url":"https://api.github.com/repos/kohler/click/git/commits{/sha}","comments_url":"https://api.github.com/repos/kohler/click/comments{/number}","issue_comment_url":"https://api.github.com/repos/kohler/click/issues/comments{/number}","contents_url":"https://api.github.com/repos/kohler/click/contents/{+path}","compare_url":"https://api.github.com/repos/kohler/click/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kohler/click/merges","archive_url":"https://api.github.com/repos/kohler/click/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kohler/click/downloads","issues_url":"https://api.github.com/repos/kohler/click/issues{/number}","pulls_url":"https://api.github.com/repos/kohler/click/pulls{/number}","milestones_url":"https://api.github.com/repos/kohler/click/milestones{/number}","notifications_url":"https://api.github.com/repos/kohler/click/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kohler/click/labels{/name}","releases_url":"https://api.github.com/repos/kohler/click/releases{/id}","created_at":"2010-09-21T22:45:25Z","updated_at":"2015-05-26T18:32:54Z","pushed_at":"2015-06-02T16:51:39Z","git_url":"git://github.com/kohler/click.git","ssh_url":"git@github.com:kohler/click.git","clone_url":"https://github.com/kohler/click.git","svn_url":"https://github.com/kohler/click","homepage":"http://www.read.cs.ucla.edu/click/","size":26836,"stargazers_count":167,"watchers_count":167,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":19,"forks":100,"open_issues":19,"watchers":167,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kohler/click/pulls/191"},"html":{"href":"https://github.com/kohler/click/pull/191"},"issue":{"href":"https://api.github.com/repos/kohler/click/issues/191"},"comments":{"href":"https://api.github.com/repos/kohler/click/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/kohler/click/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/kohler/click/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kohler/click/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/kohler/click/statuses/0130e100e91d21eea94e0dfdbc62ad6f7a96035f"}}}}