[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180109080120.230eb2a5@xeon-e3>
Date: Tue, 9 Jan 2018 08:01:20 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Chris Mi <chrism@...lanox.com>
Cc: netdev@...r.kernel.org, gerlitz.or@...il.com, dsahern@...il.com,
marcelo.leitner@...il.com, phil@....cc
Subject: Re: [patch iproute2 v7 2/2] tc: Add batchsize feature for filter
and actions
On Tue, 9 Jan 2018 15:59:08 +0900
Chris Mi <chrism@...lanox.com> wrote:
> +static bool batchsize_enabled(int argc, char *argv[])
> +{
> + if (argc < 2)
> + return false;
> + if ((strcmp(argv[0], "filter") && strcmp(argv[0], "action"))
> + || (strcmp(argv[1], "add") && strcmp(argv[1], "delete")
> + && strcmp(argv[1], "change") && strcmp(argv[1], "replace")))
> + return false;
> +
> + return true;
> +}
Maybe this should be a table, also the action can be abbreviated as in:
tc qd a dev eth0 ...
Actually, I have been wondering if all of IP commmand parsing needs to be
more table driven.
Powered by blists - more mailing lists