[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170605143945.7094-1-jiri@resnulli.us>
Date: Mon, 5 Jun 2017 16:39:45 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, jhs@...atatu.com, xiyou.wangcong@...il.com,
edumazet@...gle.com, alexander.h.duyck@...el.com,
stephen@...workplumber.org, daniel@...earbox.net,
mlxsw@...lanox.com
Subject: [patch iproute2/net-next] tc: add support for TRAP action
From: Jiri Pirko <jiri@...lanox.com>
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
include/linux/pkt_cls.h | 5 +++++
tc/tc_util.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index c6e8cf5..477ed05 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -37,6 +37,11 @@ enum {
#define TC_ACT_QUEUED 5
#define TC_ACT_REPEAT 6
#define TC_ACT_REDIRECT 7
+#define TC_ACT_TRAP 8 /* For hw path, this means "trap to cpu",
+ * for sw path, this is equivalent of
+ * TC_ACT_STOLEN - drop the skb and act
+ * like everything is allright.
+ */
/* There is a special kind of actions called "extended actions",
* which need a value parameter. These have a local opcode located in
diff --git a/tc/tc_util.c b/tc/tc_util.c
index 4f7283d..5a0f96a 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -430,6 +430,8 @@ static const char *action_n2a(int action)
return "pipe";
case TC_ACT_STOLEN:
return "stolen";
+ case TC_ACT_TRAP:
+ return "trap";
default:
snprintf(buf, 64, "%d", action);
buf[63] = '\0';
@@ -462,6 +464,7 @@ static int action_a2n(char *arg, int *result, bool allow_num)
{"reclassify", TC_ACT_RECLASSIFY},
{"pipe", TC_ACT_PIPE},
{"goto", TC_ACT_GOTO_CHAIN},
+ {"trap", TC_ACT_TRAP},
{ NULL },
}, *iter;
--
2.9.3
Powered by blists - more mailing lists