lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [EXT] Re: [v4,iproute2-next 1/2] iproute2-next:tc:action: add a gate control action
    Date
    Hi Davide,


    > -----Original Message-----
    > From: Davide Caratti <dcaratti@redhat.com>
    > Sent: 2020年5月6日 20:54
    > To: Po Liu <po.liu@nxp.com>; dsahern@gmail.com; linux-
    > kernel@vger.kernel.org; netdev@vger.kernel.org
    > Cc: vinicius.gomes@intel.com; stephen@networkplumber.org;
    > davem@davemloft.net; vlad@buslov.dev; Claudiu Manoil
    > <claudiu.manoil@nxp.com>; Vladimir Oltean <vladimir.oltean@nxp.com>;
    > Alexandru Marginean <alexandru.marginean@nxp.com>
    > Subject: [EXT] Re: [v4,iproute2-next 1/2] iproute2-next:tc:action: add a
    > gate control action
    >
    > Caution: EXT Email
    >
    > On Wed, 2020-05-06 at 16:40 +0800, Po Liu wrote:
    > > Introduce a ingress frame gate control flow action.
    > [...]
    >
    > hello Po Liu,
    >
    > [...]
    >
    > > +create_entry:
    > > + e = create_gate_entry(gate_state, interval,
    > > + ipv, maxoctets);
    > > + if (!e) {
    > > + fprintf(stderr, "gate: not enough memory\n");
    > > + free_entries(&gate_entries);
    > > + return -1;
    > > + }
    > > +
    > > + list_add_tail(&e->list, &gate_entries);
    > > + entry_num++;
    > > +
    > > + } else if (matches(*argv, "reclassify") == 0 ||
    > > + matches(*argv, "drop") == 0 ||
    > > + matches(*argv, "shot") == 0 ||
    > > + matches(*argv, "continue") == 0 ||
    > > + matches(*argv, "pass") == 0 ||
    > > + matches(*argv, "ok") == 0 ||
    > > + matches(*argv, "pipe") == 0 ||
    > > + matches(*argv, "goto") == 0) {
    > > + if (parse_action_control(&argc, &argv,
    > > + &parm.action, false)) {
    > > + free_entries(&gate_entries);
    > > + return -1;
    > > + }
    > > + } else if (matches(*argv, "help") == 0) {
    > > + usage();
    > > + } else {
    > > + break;
    > > + }
    > > +
    > > + argc--;
    > > + argv++;
    > > + }
    > > +
    > > + parse_action_control_dflt(&argc, &argv, &parm.action,
    > > + false, TC_ACT_PIPE);
    >
    > it seems that the control action is parsed twice, and the first time it does
    > not allow "jump" and "trap". Is that intentional? IOW, are there some
    > "act_gate" configurations that don't allow jump or trap?

    It is allowed to jump and trap. I didn't notice it was loaded twice. I would correct here and remove one parse_action_control()
    Thanks a lot!

    >
    > I don't see anything similar in kernel act_gate.c, where tcf_gate_act() can
    > return TC_ACT_SHOT or whatever is written in parm.action. That's why I'm
    > asking, if these two control actions are forbidden you should let the kernel
    > return -EINVAL with a proper extack in tcf_gate_init(). Can you please
    > clarify?
    >
    > thank you in advance!
    > --
    > davide
    >


    Br,
    Po Liu
    \
     
     \ /
      Last update: 2020-05-07 04:29    [W:4.376 / U:0.220 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site