-
Notifications
You must be signed in to change notification settings - Fork 70
Added manually configuring socket prio #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,8 @@ static struct argp_option options[] = { | |
{"wakeup", 'w', 0, 0, "enable need_wakeup"}, | ||
{"vlan-prio", 'q', "NUM", 0, "packet vlan priority, also socket priority\n" | ||
" Def: 0 | Min: 0 | Max: 7"}, | ||
{"socket-prio", 'g', "NUM", 0, "packet socket priority\n" | ||
" Def: 0 | Min: 0 | Max: 15"}, | ||
/* Reserved: u / w */ | ||
|
||
{0,0,0,0, "TX control:" }, | ||
|
@@ -188,6 +190,19 @@ static error_t parser(int key, char *arg, struct argp_state *state) | |
#endif | ||
opt->vlan_prio = opt->socket_prio * 32; | ||
break; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the option 'g' specifically for socket priority then the socket priority need to be decouple out from option 'q' to prevent any error occur. |
||
case 'g': | ||
len = strlen(arg); | ||
res = strtol((const char *)arg, &str_end, 10); | ||
if (errno || res < 0 || res >= 15 || str_end != &arg[len]) | ||
exit_with_error("Invalid queue number/socket priority. Check --help"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if this specifically for socket priority only then queue number need to be removed |
||
opt->socket_prio = (uint32_t)res; | ||
//printf("\n%d\n", opt->socket_prio); | ||
//#ifdef WITH_XDP | ||
if (opt->socket_mode == MODE_AFXDP) | ||
exit_with_error("AF_XDP does not support setting socket priority."); | ||
//#endif | ||
//opt->vlan_prio = opt->socket_prio * 32; | ||
break; | ||
case 'X': | ||
opt->socket_mode = MODE_AFXDP; | ||
break; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unwanted indentation between socket priority