Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

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

" Def: 0 | Min: 0 | Max: 15"},
/* Reserved: u / w */

{0,0,0,0, "TX control:" },
Expand Down Expand Up @@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The 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");
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
Expand Down