All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Blakey <paulb@nvidia.com>
To: Jiri Pirko <jiri@nvidia.com>, Paul Blakey <paulb@nvidia.com>,
	Roi Dayan <roid@nvidia.com>, Yossi Kuperman <yossiku@nvidia.com>,
	Oz Shlomo <ozsh@nvidia.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	Aaron Conole <aconole@redhat.com>, Zhike Wang <wangzhike@jd.com>
Cc: Rony Efraim <ronye@nvidia.com>,
	nst-kernel@redhat.com, John Hurley <john.hurley@netronome.com>,
	Simon Horman <simon.horman@netronome.com>,
	Justin Pettit <jpettit@ovn.org>
Subject: [PATCH iproute2/net-next] tc: flower: Add support for ct_state reply flag
Date: Tue,  2 Feb 2021 14:24:42 +0200	[thread overview]
Message-ID: <1612268682-29525-1-git-send-email-paulb@nvidia.com> (raw)

Matches on conntrack rpl ct_state.

Example:
$ tc filter add dev ens1f0_0 ingress prio 1 chain 1 proto ip flower \
  ct_state +trk+est+rpl \
  action mirred egress redirect dev ens1f0_1
$ tc filter add dev ens1f0_1 ingress prio 1 chain 1 proto ip flower \
  ct_state +trk+est-rpl \
  action mirred egress redirect dev ens1f0_0

Signed-off-by: Paul Blakey <paulb@nvidia.com>
---
 man/man8/tc-flower.8 | 2 ++
 tc/f_flower.c        | 1 +
 2 files changed, 3 insertions(+)

diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8
index 226d1cc..f7336b6 100644
--- a/man/man8/tc-flower.8
+++ b/man/man8/tc-flower.8
@@ -387,6 +387,8 @@ new - New connection.
 .TP
 est - Established connection.
 .TP
+rpl - The packet is in the reply direction, meaning that it is in the opposite direction from the packet that initiated the connection.
+.TP
 inv - The state is invalid. The packet couldn't be associated to a connection.
 .TP
 Example: +trk+est
diff --git a/tc/f_flower.c b/tc/f_flower.c
index 85c1043..53822a9 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -346,6 +346,7 @@ static struct flower_ct_states {
 	{ "new", TCA_FLOWER_KEY_CT_FLAGS_NEW },
 	{ "est", TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED },
 	{ "inv", TCA_FLOWER_KEY_CT_FLAGS_INVALID },
+	{ "rpl", TCA_FLOWER_KEY_CT_FLAGS_REPLY },
 };
 
 static int flower_parse_ct_state(char *str, struct nlmsghdr *n)
-- 
1.8.3.1


             reply	other threads:[~2021-02-02 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 12:24 Paul Blakey [this message]
2021-02-02 12:41 ` [PATCH iproute2/net-next] tc: flower: Add support for ct_state reply flag Marcelo Ricardo Leitner
2021-02-03  7:56   ` Paul Blakey
2021-02-05  4:58 ` David Ahern

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=1612268682-29525-1-git-send-email-paulb@nvidia.com \
    --to=paulb@nvidia.com \
    --cc=aconole@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jiri@nvidia.com \
    --cc=john.hurley@netronome.com \
    --cc=jpettit@ovn.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nst-kernel@redhat.com \
    --cc=ozsh@nvidia.com \
    --cc=roid@nvidia.com \
    --cc=ronye@nvidia.com \
    --cc=simon.horman@netronome.com \
    --cc=wangzhike@jd.com \
    --cc=yossiku@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.