{"action":"created","comment":{"url":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/comments/84953786","pull_request_review_id":5680900,"id":84953786,"diff_hunk":"@@ -169,6 +190,86 @@ get_if_back(struct net_config *net_conf)\n \treturn &net_conf->back;\n }\n \n+int\n+gatekeeper_setup_rss(uint8_t portid, uint16_t queues[], uint16_t num_queues)\n+{\n+\tint ret = 0;\n+\tuint32_t i;\n+\tstruct rte_eth_dev_info dev_info;\n+\tstruct rte_eth_rss_reta_entry64 reta_conf[GATEKEEPER_RETA_MAX_SIZE];\n+\n+\t/* Get RSS redirection table (RETA) information. */\n+\tmemset(&dev_info, 0, sizeof(dev_info));\n+\trte_eth_dev_info_get(portid, &dev_info);\n+\tif (dev_info.reta_size == 0) {\n+\t\tRTE_LOG(ERR, PORT,\n+\t\t\t\"failed to setup RSS at port %hhu\"\n+\t\t\t\" (invalid RETA size = 0)!\\n\",\n+\t\t\tportid);\n+\t\tret = -1;\n+\t\tgoto out;\n+\t}\n+\n+\tif (dev_info.reta_size > ETH_RSS_RETA_SIZE_512) {\n+\t\tRTE_LOG(ERR, PORT,\n+\t\t\t\"failed to setup RSS at port %hhu\"\n+\t\t\t\" (invalid RETA size = %u)!\\n\",\n+\t\t\tportid, dev_info.reta_size);\n+\t\tret = -1;\n+\t\tgoto out;\n+\t}\n+\n+\t/* Setup RSS RETA contents. */\n+\tmemset(reta_conf, 0, sizeof(reta_conf));\n+\n+\tfor (i = 0; i < dev_info.reta_size; i++) {\n+\t\tuint32_t idx = i / RTE_RETA_GROUP_SIZE;\n+\t\tuint32_t shift = i % RTE_RETA_GROUP_SIZE;\n+\t\tuint32_t queue_idx = i % num_queues; \n+\n+\t\t/* Select all fields to set. */\n+\t\treta_conf[idx].mask = ~0LL;\n+\t\treta_conf[idx].reta[shift] = (uint16_t)queues[queue_idx];\n+\t}\n+\n+\t/* RETA update. */\n+\tret = rte_eth_dev_rss_reta_update(portid, reta_conf, dev_info.reta_size);\n+\tif (ret == -ENOTSUP) {\n+\t\tRTE_LOG(ERR, PORT,\n+\t\t\t\"failed to setup RSS at port %hhu\"\n+\t\t\t\" hardware doesn't support.\",\n+\t\t\tportid);\n+\t\tret = -1;\n+\t\tgoto out;\n+\t} else if (ret == -EINVAL) {\n+\t\tRTE_LOG(ERR, PORT,\n+\t\t\t\"failed to setup RSS at port %hhu\"\n+\t\t\t\" (RETA update with bad redirection table parameter)!\\n\",","path":"lib/net.c","position":104,"original_position":92,"commit_id":"0b84de9d9cfc8dc296c36dfbd9fa1739d00439cc","original_commit_id":"0b84de9d9cfc8dc296c36dfbd9fa1739d00439cc","user":{"login":"AltraMayor","id":727014,"avatar_url":"https://avatars.githubusercontent.com/u/727014?v=3","gravatar_id":"","url":"https://api.github.com/users/AltraMayor","html_url":"https://github.com/AltraMayor","followers_url":"https://api.github.com/users/AltraMayor/followers","following_url":"https://api.github.com/users/AltraMayor/following{/other_user}","gists_url":"https://api.github.com/users/AltraMayor/gists{/gist_id}","starred_url":"https://api.github.com/users/AltraMayor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltraMayor/subscriptions","organizations_url":"https://api.github.com/users/AltraMayor/orgs","repos_url":"https://api.github.com/users/AltraMayor/repos","events_url":"https://api.github.com/users/AltraMayor/events{/privacy}","received_events_url":"https://api.github.com/users/AltraMayor/received_events","type":"User","site_admin":false},"body":"Combine error strings.","created_at":"2016-10-25T17:17:24Z","updated_at":"2016-10-25T17:17:24Z","html_url":"https://github.com/AltraMayor/gatekeeper/pull/7#discussion_r84953786","pull_request_url":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/comments/84953786"},"html":{"href":"https://github.com/AltraMayor/gatekeeper/pull/7#discussion_r84953786"},"pull_request":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7","id":89516077,"html_url":"https://github.com/AltraMayor/gatekeeper/pull/7","diff_url":"https://github.com/AltraMayor/gatekeeper/pull/7.diff","patch_url":"https://github.com/AltraMayor/gatekeeper/pull/7.patch","issue_url":"https://api.github.com/repos/AltraMayor/gatekeeper/issues/7","number":7,"state":"open","locked":false,"title":"Implement the basic algorithm for GK block","user":{"login":"mengxiang0811","id":4590679,"avatar_url":"https://avatars.githubusercontent.com/u/4590679?v=3","gravatar_id":"","url":"https://api.github.com/users/mengxiang0811","html_url":"https://github.com/mengxiang0811","followers_url":"https://api.github.com/users/mengxiang0811/followers","following_url":"https://api.github.com/users/mengxiang0811/following{/other_user}","gists_url":"https://api.github.com/users/mengxiang0811/gists{/gist_id}","starred_url":"https://api.github.com/users/mengxiang0811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mengxiang0811/subscriptions","organizations_url":"https://api.github.com/users/mengxiang0811/orgs","repos_url":"https://api.github.com/users/mengxiang0811/repos","events_url":"https://api.github.com/users/mengxiang0811/events{/privacy}","received_events_url":"https://api.github.com/users/mengxiang0811/received_events","type":"User","site_admin":false},"body":"This pull request tries to add the basic algorithm for GK block.\r\n\r\nCommit 1: tries to remove unused fields from Lua scripts. When I tried to remove the internal fields in ``struct gatekeeper_if``, the program quits with a segment fault. It seems that the Lua script function ``init_iface()`` cannot obtain the address of the ``front`` and ``back`` interfaces in it.\r\n\r\nCommit 2: tries to obtain the system time resolution, e.g., ``cycles_per_sec`` and ``picosec_per_cycle``. These metrics are system dependent, so I wrap them up as a function.\r\n\r\nCommit 3: tries to implement the basic algorithm of a GK block. To make this component complete, we still need to implement other components like ``RT``, ``GK-GT Unit``, ``IP over IP Encapsulation/Decapsulation``, and ``Request/Granted Queues``.","created_at":"2016-10-16T04:58:09Z","updated_at":"2016-10-25T17:27:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2cc2a68b6769fff11f99172ae374b6f13a32085","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7/commits","review_comments_url":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7/comments","review_comment_url":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AltraMayor/gatekeeper/issues/7/comments","statuses_url":"https://api.github.com/repos/AltraMayor/gatekeeper/statuses/0b84de9d9cfc8dc296c36dfbd9fa1739d00439cc","head":{"label":"mengxiang0811:gk-pull","ref":"gk-pull","sha":"0b84de9d9cfc8dc296c36dfbd9fa1739d00439cc","user":{"login":"mengxiang0811","id":4590679,"avatar_url":"https://avatars.githubusercontent.com/u/4590679?v=3","gravatar_id":"","url":"https://api.github.com/users/mengxiang0811","html_url":"https://github.com/mengxiang0811","followers_url":"https://api.github.com/users/mengxiang0811/followers","following_url":"https://api.github.com/users/mengxiang0811/following{/other_user}","gists_url":"https://api.github.com/users/mengxiang0811/gists{/gist_id}","starred_url":"https://api.github.com/users/mengxiang0811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mengxiang0811/subscriptions","organizations_url":"https://api.github.com/users/mengxiang0811/orgs","repos_url":"https://api.github.com/users/mengxiang0811/repos","events_url":"https://api.github.com/users/mengxiang0811/events{/privacy}","received_events_url":"https://api.github.com/users/mengxiang0811/received_events","type":"User","site_admin":false},"repo":{"id":67135759,"name":"gatekeeper","full_name":"mengxiang0811/gatekeeper","owner":{"login":"mengxiang0811","id":4590679,"avatar_url":"https://avatars.githubusercontent.com/u/4590679?v=3","gravatar_id":"","url":"https://api.github.com/users/mengxiang0811","html_url":"https://github.com/mengxiang0811","followers_url":"https://api.github.com/users/mengxiang0811/followers","following_url":"https://api.github.com/users/mengxiang0811/following{/other_user}","gists_url":"https://api.github.com/users/mengxiang0811/gists{/gist_id}","starred_url":"https://api.github.com/users/mengxiang0811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mengxiang0811/subscriptions","organizations_url":"https://api.github.com/users/mengxiang0811/orgs","repos_url":"https://api.github.com/users/mengxiang0811/repos","events_url":"https://api.github.com/users/mengxiang0811/events{/privacy}","received_events_url":"https://api.github.com/users/mengxiang0811/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mengxiang0811/gatekeeper","description":"First open source DoS protection system","fork":true,"url":"https://api.github.com/repos/mengxiang0811/gatekeeper","forks_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/forks","keys_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/teams","hooks_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/hooks","issue_events_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/issues/events{/number}","events_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/events","assignees_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/assignees{/user}","branches_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/branches{/branch}","tags_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/tags","blobs_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/languages","stargazers_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/stargazers","contributors_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/contributors","subscribers_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/subscribers","subscription_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/subscription","commits_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/contents/{+path}","compare_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/merges","archive_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/downloads","issues_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/issues{/number}","pulls_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/labels{/name}","releases_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/releases{/id}","deployments_url":"https://api.github.com/repos/mengxiang0811/gatekeeper/deployments","created_at":"2016-09-01T13:55:13Z","updated_at":"2016-09-01T13:56:38Z","pushed_at":"2016-10-24T21:47:25Z","git_url":"git://github.com/mengxiang0811/gatekeeper.git","ssh_url":"git@github.com:mengxiang0811/gatekeeper.git","clone_url":"https://github.com/mengxiang0811/gatekeeper.git","svn_url":"https://github.com/mengxiang0811/gatekeeper","homepage":"","size":94,"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":"AltraMayor:master","ref":"master","sha":"c436096a9379f816af71d18bd736575197d23be1","user":{"login":"AltraMayor","id":727014,"avatar_url":"https://avatars.githubusercontent.com/u/727014?v=3","gravatar_id":"","url":"https://api.github.com/users/AltraMayor","html_url":"https://github.com/AltraMayor","followers_url":"https://api.github.com/users/AltraMayor/followers","following_url":"https://api.github.com/users/AltraMayor/following{/other_user}","gists_url":"https://api.github.com/users/AltraMayor/gists{/gist_id}","starred_url":"https://api.github.com/users/AltraMayor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltraMayor/subscriptions","organizations_url":"https://api.github.com/users/AltraMayor/orgs","repos_url":"https://api.github.com/users/AltraMayor/repos","events_url":"https://api.github.com/users/AltraMayor/events{/privacy}","received_events_url":"https://api.github.com/users/AltraMayor/received_events","type":"User","site_admin":false},"repo":{"id":62745741,"name":"gatekeeper","full_name":"AltraMayor/gatekeeper","owner":{"login":"AltraMayor","id":727014,"avatar_url":"https://avatars.githubusercontent.com/u/727014?v=3","gravatar_id":"","url":"https://api.github.com/users/AltraMayor","html_url":"https://github.com/AltraMayor","followers_url":"https://api.github.com/users/AltraMayor/followers","following_url":"https://api.github.com/users/AltraMayor/following{/other_user}","gists_url":"https://api.github.com/users/AltraMayor/gists{/gist_id}","starred_url":"https://api.github.com/users/AltraMayor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltraMayor/subscriptions","organizations_url":"https://api.github.com/users/AltraMayor/orgs","repos_url":"https://api.github.com/users/AltraMayor/repos","events_url":"https://api.github.com/users/AltraMayor/events{/privacy}","received_events_url":"https://api.github.com/users/AltraMayor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AltraMayor/gatekeeper","description":"First open source DoS protection system","fork":false,"url":"https://api.github.com/repos/AltraMayor/gatekeeper","forks_url":"https://api.github.com/repos/AltraMayor/gatekeeper/forks","keys_url":"https://api.github.com/repos/AltraMayor/gatekeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AltraMayor/gatekeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AltraMayor/gatekeeper/teams","hooks_url":"https://api.github.com/repos/AltraMayor/gatekeeper/hooks","issue_events_url":"https://api.github.com/repos/AltraMayor/gatekeeper/issues/events{/number}","events_url":"https://api.github.com/repos/AltraMayor/gatekeeper/events","assignees_url":"https://api.github.com/repos/AltraMayor/gatekeeper/assignees{/user}","branches_url":"https://api.github.com/repos/AltraMayor/gatekeeper/branches{/branch}","tags_url":"https://api.github.com/repos/AltraMayor/gatekeeper/tags","blobs_url":"https://api.github.com/repos/AltraMayor/gatekeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AltraMayor/gatekeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AltraMayor/gatekeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/AltraMayor/gatekeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AltraMayor/gatekeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/AltraMayor/gatekeeper/languages","stargazers_url":"https://api.github.com/repos/AltraMayor/gatekeeper/stargazers","contributors_url":"https://api.github.com/repos/AltraMayor/gatekeeper/contributors","subscribers_url":"https://api.github.com/repos/AltraMayor/gatekeeper/subscribers","subscription_url":"https://api.github.com/repos/AltraMayor/gatekeeper/subscription","commits_url":"https://api.github.com/repos/AltraMayor/gatekeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/AltraMayor/gatekeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/AltraMayor/gatekeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/AltraMayor/gatekeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/AltraMayor/gatekeeper/contents/{+path}","compare_url":"https://api.github.com/repos/AltraMayor/gatekeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AltraMayor/gatekeeper/merges","archive_url":"https://api.github.com/repos/AltraMayor/gatekeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AltraMayor/gatekeeper/downloads","issues_url":"https://api.github.com/repos/AltraMayor/gatekeeper/issues{/number}","pulls_url":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/AltraMayor/gatekeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/AltraMayor/gatekeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AltraMayor/gatekeeper/labels{/name}","releases_url":"https://api.github.com/repos/AltraMayor/gatekeeper/releases{/id}","deployments_url":"https://api.github.com/repos/AltraMayor/gatekeeper/deployments","created_at":"2016-07-06T18:53:45Z","updated_at":"2016-09-01T12:23:53Z","pushed_at":"2016-10-24T21:47:26Z","git_url":"git://github.com/AltraMayor/gatekeeper.git","ssh_url":"git@github.com:AltraMayor/gatekeeper.git","clone_url":"https://github.com/AltraMayor/gatekeeper.git","svn_url":"https://github.com/AltraMayor/gatekeeper","homepage":"","size":60,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7"},"html":{"href":"https://github.com/AltraMayor/gatekeeper/pull/7"},"issue":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/issues/7"},"comments":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/AltraMayor/gatekeeper/statuses/0b84de9d9cfc8dc296c36dfbd9fa1739d00439cc"}}}}
{"actor":{"display_login":"AltraMayor"}}