Message ID | 1563479743-8371-1-git-send-email-vedang.patel@intel.com |
---|---|
State | Accepted |
Delegated to: | David Ahern |
Headers | show |
Series | [iproute2,net-next,v5,1/5] etf: Add skip_sock_check | expand |
On 7/18/19 1:55 PM, Vedang Patel wrote: > ETF Qdisc currently checks for a socket with SO_TXTIME socket option. If > either is not present, the packet is dropped. In the future commits, we > want other Qdiscs to add packet with launchtime to the ETF Qdisc. Also, > there are some packets (e.g. ICMP packets) which may not have a socket > associated with them. So, add an option to skip this check. > > Signed-off-by: Vedang Patel <vedang.patel@intel.com> > --- > tc/q_etf.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > applied all to iproute2-next. Thanks
On Thu, 18 Jul 2019 12:55:39 -0700 Vedang Patel <vedang.patel@intel.com> wrote: > - print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s", > + print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s ", > (qopt->flags & TC_ETF_DEADLINE_MODE_ON) ? "on" : "off"); > + print_string(PRINT_ANY, "skip_sock_check", "skip_sock_check %s", > + (qopt->flags & TC_ETF_SKIP_SOCK_CHECK) ? "on" : "off"); These should really be boolean options in JSON, not string values.
> On Jul 18, 2019, at 10:12 PM, Stephen Hemminger <stephen@networkplumber.org> wrote: > > On Thu, 18 Jul 2019 12:55:39 -0700 > Vedang Patel <vedang.patel@intel.com> wrote: > >> - print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s", >> + print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s ", >> (qopt->flags & TC_ETF_DEADLINE_MODE_ON) ? "on" : "off"); >> + print_string(PRINT_ANY, "skip_sock_check", "skip_sock_check %s", >> + (qopt->flags & TC_ETF_SKIP_SOCK_CHECK) ? "on" : "off"); > > These should really be boolean options in JSON, not string values. Ok. Sending out a patch to fix this. Thanks, Vedang
diff --git a/tc/q_etf.c b/tc/q_etf.c index 76aca476c61d..c2090589bc64 100644 --- a/tc/q_etf.c +++ b/tc/q_etf.c @@ -130,6 +130,13 @@ static int etf_parse_opt(struct qdisc_util *qu, int argc, explain_clockid(*argv); return -1; } + } else if (strcmp(*argv, "skip_sock_check") == 0) { + if (opt.flags & TC_ETF_SKIP_SOCK_CHECK) { + fprintf(stderr, "etf: duplicate \"skip_sock_check\" specification\n"); + return -1; + } + + opt.flags |= TC_ETF_SKIP_SOCK_CHECK; } else if (strcmp(*argv, "help") == 0) { explain(); return -1; @@ -171,8 +178,10 @@ static int etf_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) print_uint(PRINT_ANY, "delta", "delta %d ", qopt->delta); print_string(PRINT_ANY, "offload", "offload %s ", (qopt->flags & TC_ETF_OFFLOAD_ON) ? "on" : "off"); - print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s", + print_string(PRINT_ANY, "deadline_mode", "deadline_mode %s ", (qopt->flags & TC_ETF_DEADLINE_MODE_ON) ? "on" : "off"); + print_string(PRINT_ANY, "skip_sock_check", "skip_sock_check %s", + (qopt->flags & TC_ETF_SKIP_SOCK_CHECK) ? "on" : "off"); return 0; }
ETF Qdisc currently checks for a socket with SO_TXTIME socket option. If either is not present, the packet is dropped. In the future commits, we want other Qdiscs to add packet with launchtime to the ETF Qdisc. Also, there are some packets (e.g. ICMP packets) which may not have a socket associated with them. So, add an option to skip this check. Signed-off-by: Vedang Patel <vedang.patel@intel.com> --- tc/q_etf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)