netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Paul Blakey <paulb@mellanox.com>
Cc: Roi Dayan <roid@mellanox.com>,
	John Hurley <john.hurley@netronome.com>,
	Yossi@redhat.com, Oz Shlomo <ozsh@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Aaron Conole <aconole@redhat.com>,
	Rony Efraim <ronye@mellanox.com>, Justin Pettit <jpettit@ovn.org>,
	Jiri Pirko <jiri@mellanox.com>,
	"nst-kernel@redhat.com" <nst-kernel@redhat.com>,
	Simon Horman <simon.horman@netronome.com>,
	Zhike Wang <wangzhike@jd.com>, David Miller <davem@davemloft.net>,
	Kuperman <yossiku@mellanox.com>
Subject: Re: [PATCH net-next iproute2 2/3] tc: Introduce tc ct action
Date: Thu, 11 Jul 2019 14:40:56 -0300	[thread overview]
Message-ID: <20190711174056.GW3449@localhost.localdomain> (raw)
In-Reply-To: <5ded2e5b-958e-eca3-76ad-909ebf79234e@mellanox.com>

On Thu, Jul 11, 2019 at 07:21:51AM +0000, Paul Blakey wrote:
> 
> On 7/9/2019 6:36 PM, Marcelo Ricardo Leitner wrote:
> > On Tue, Jul 09, 2019 at 06:58:36AM +0000, Paul Blakey wrote:
> >> On 7/8/2019 8:54 PM, Marcelo Ricardo Leitner wrote:
> >>> On Sun, Jul 07, 2019 at 11:53:47AM +0300, Paul Blakey wrote:
> >>>> New tc action to send packets to conntrack module, commit
> >>>> them, and set a zone, labels, mark, and nat on the connection.
> >>>>
> >>>> It can also clear the packet's conntrack state by using clear.
> >>>>
> >>>> Usage:
> >>>>      ct clear
> >>>>      ct commit [force] [zone] [mark] [label] [nat]
> >>> Isn't the 'commit' also optional? More like
> >>>       ct [commit [force]] [zone] [mark] [label] [nat]
> >>>
> >>>>      ct [nat] [zone]
> >>>>
> >>>> Signed-off-by: Paul Blakey <paulb@mellanox.com>
> >>>> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> >>>> Signed-off-by: Yossi Kuperman <yossiku@mellanox.com>
> >>>> Acked-by: Jiri Pirko <jiri@mellanox.com>
> >>>> Acked-by: Roi Dayan <roid@mellanox.com>
> >>>> ---
> >>> ...
> >>>> +static void
> >>>> +usage(void)
> >>>> +{
> >>>> +	fprintf(stderr,
> >>>> +		"Usage: ct clear\n"
> >>>> +		"	ct commit [force] [zone ZONE] [mark MASKED_MARK] [label MASKED_LABEL] [nat NAT_SPEC]\n"
> >>> Ditto here then.
> >>
> >> In commit msg and here, it means there is multiple modes of operation. I
> >> think it's easier to split those.
> > Yep, that is good.
> > More below.
> >
> >> "ct clear" to clear it , not other options can be added here.
> >>
> >> "ct commit  [force].... " sends to conntrack and commit a connection,
> >> and only for commit can you specify force mark  label, and nat with
> >> nat_spec....
> >>
> >> and the last one, "ct [nat] [zone ZONE]" is to just send the packet to
> >> conntrack on some zone [optional], restore nat [optional].
> >>
> >>
> >>>> +		"	ct [nat] [zone ZONE]\n"
> >>>> +		"Where: ZONE is the conntrack zone table number\n"
> >>>> +		"	NAT_SPEC is {src|dst} addr addr1[-addr2] [port port1[-port2]]\n"
> >>>> +		"\n");
> >>>> +	exit(-1);
> >>>> +}
> >>> ...
> >>>
> >>> The validation below doesn't enforce that commit must be there for
> >>> such case.
> >> which case? commit is optional. the above are the three valid patterns.
> > That's the point. But the 2nd example is saying 'commit' word is
> > mandatory in that mode. It is written as it is a command that was
> > selected.
> >
> > One may use just:
> >      ct [zone]
> > And not
> >      ct commit [zone]
> > Right?
> 
> It is optional in the overall syntax.
> 
> 
> But I split it into modes:
> 
> clear, commit, and "restore" (I unofficial call it like that, because it 
> usually used to get the +est state on the packet and can restore nat, it 
> doesn't actually restore anything for the first packet on the -trk rule)
> 
> It is mandatory in the second mode (commit), if you don't specify commit 
> or clear, you can only use the third form - "restore", which is to send 
> to ct on some optional zone, and optionally and restore nat (so we get 
> ct [zone] [nat]).

I see. Thanks Paul.

  Marcelo

  reply	other threads:[~2019-07-11 17:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-07  8:53 [PATCH net-next iproute2 0/3] net/sched: Introduce tc connection tracking Paul Blakey
2019-07-07  8:53 ` [PATCH net-next iproute2 1/3] tc: add NLA_F_NESTED flag to all actions options nested block Paul Blakey
2019-07-07  8:53 ` [PATCH net-next iproute2 2/3] tc: Introduce tc ct action Paul Blakey
2019-07-08 17:54   ` Marcelo Ricardo Leitner
2019-07-09  6:58     ` Paul Blakey
2019-07-09 15:36       ` Marcelo Ricardo Leitner
2019-07-11  7:21         ` Paul Blakey
2019-07-11 17:40           ` Marcelo Ricardo Leitner [this message]
2019-07-07  8:53 ` [PATCH net-next iproute2 3/3] tc: flower: Add matching on conntrack info Paul Blakey

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=20190711174056.GW3449@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=Yossi@redhat.com \
    --cc=aconole@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=john.hurley@netronome.com \
    --cc=jpettit@ovn.org \
    --cc=netdev@vger.kernel.org \
    --cc=nst-kernel@redhat.com \
    --cc=ozsh@mellanox.com \
    --cc=paulb@mellanox.com \
    --cc=roid@mellanox.com \
    --cc=ronye@mellanox.com \
    --cc=simon.horman@netronome.com \
    --cc=wangzhike@jd.com \
    --cc=yossiku@mellanox.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).