From: Stephen Hemminger <stephen@networkplumber.org>
To: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us,
Vinicius Costa Gomes <vinicius.gomes@intel.com>
Subject: Re: [PATCH v3 iproute2 2/3] tc: Add support for the ETF Qdisc
Date: Fri, 6 Jul 2018 14:32:37 -0700 [thread overview]
Message-ID: <20180706143237.60807e16@xeon-e3> (raw)
In-Reply-To: <20180705224227.22843-3-jesus.sanchez-palencia@intel.com>
> diff --git a/tc/q_etf.c b/tc/q_etf.c
> new file mode 100644
> index 00000000..5db1dd6f
> --- /dev/null
> +++ b/tc/q_etf.c
> @@ -0,0 +1,168 @@
> +/*
> + * q_etf.c Earliest TxTime First (ETF).
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + *
> + * Authors: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> + * Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
> + *
> + */
Please use SPDX tag rather than GPL boilerplate when adding new code.
> +static int get_clockid(__s32 *val, const char *arg)
> +{
> + const struct static_clockid {
> + const char *name;
> + clockid_t clockid;
> + } clockids_sysv[] = {
> + { "CLOCK_REALTIME", CLOCK_REALTIME },
> + { "CLOCK_TAI", CLOCK_TAI },
> + { "CLOCK_BOOTTIME", CLOCK_BOOTTIME },
> + { "CLOCK_MONOTONIC", CLOCK_MONOTONIC },
> + { NULL }
> + };
> +
> + const struct static_clockid *c;
> +
> + for (c = clockids_sysv; c->name; c++) {
> + if (strncasecmp(c->name, arg, 25) == 0) {
> + *val = c->clockid;
> +
> + return 0;
> + }
> + }
> +
> + return -1;
> +}
Internally, kernel must use ktime. For the userspace part the TC standard
is to use USER HZ of 100.
Please change user kernel API of this module to match other existing modules.
Doing something unique for this module is not necessary.
next prev parent reply other threads:[~2018-07-06 21:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 22:42 [PATCH v3 iproute2 0/3] Add support for ETF qdisc Jesus Sanchez-Palencia
2018-07-05 22:42 ` [PATCH v3 iproute2 1/3] uapi pkt_sched: Add etf info - DO NOT COMMIT Jesus Sanchez-Palencia
2018-07-05 22:42 ` [PATCH v3 iproute2 2/3] tc: Add support for the ETF Qdisc Jesus Sanchez-Palencia
2018-07-06 15:58 ` David Ahern
2018-07-09 15:48 ` Jesus Sanchez-Palencia
2018-07-09 17:32 ` David Ahern
2018-07-09 23:16 ` Jesus Sanchez-Palencia
2018-07-06 21:32 ` Stephen Hemminger [this message]
2018-07-06 21:54 ` Jesus Sanchez-Palencia
2018-07-05 22:42 ` [PATCH v3 iproute2 3/3] man: Add initial manpage for tc-etf(8) Jesus Sanchez-Palencia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180706143237.60807e16@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=jesus.sanchez-palencia@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=vinicius.gomes@intel.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).