12 #include <netlink/cli/utils.h>
13 #include <netlink/cli/tc.h>
14 #include <netlink/route/qdisc/fq_codel.h>
16 static void print_usage(
void)
19 "Usage: nl-qdisc-add [...] fq_codel [OPTIONS]...\n"
22 " --help Show this help text.\n"
23 " --limit=LIMIT Maximum queue length in number of bytes.\n"
24 " --quantum=SIZE Amount of bytes to serve at once.\n"
25 " --flows=N Number of flows.\n"
26 " --interval=N The interval in usec.\n"
27 " --target=N The minimum delay in usec.\n"
30 " # Attach fq_codel with a 4096 packets limit to eth1\n"
31 " nl-qdisc-add --dev=eth1 --parent=root fq_codel --limit=4096\n");
34 static void fq_codel_parse_argv(
struct rtnl_tc *tc,
int argc,
char **argv)
36 struct rtnl_qdisc *qdisc = (
struct rtnl_qdisc *) tc;
38 uint32_t quantum, target, interval;
49 static struct option long_opts[] = {
50 {
"help", 0, 0,
'h' },
51 {
"limit", 1, 0, ARG_LIMIT },
52 {
"quantum", 1, 0, ARG_QUANTUM },
53 {
"flows", 1, 0, ARG_FLOWS},
54 {
"interval", 1, 0, ARG_INTERVAL},
55 {
"target", 1, 0, ARG_TARGET},
59 c = getopt_long(argc, argv,
"h", long_opts, &optidx);
99 .tm_name =
"fq_codel",
100 .tm_type = RTNL_TC_TYPE_QDISC,
101 .tm_parse_argv = fq_codel_parse_argv,
104 static void __init fq_codel_init(
void)
106 nl_cli_tc_register(&fq_codel_module);
109 static void __exit fq_codel_exit(
void)
111 nl_cli_tc_unregister(&fq_codel_module);