From: John Hurley <john.hurley@netronome.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, simon.horman@netronome.com,
jakub.kicinski@netronome.com, oss-drivers@netronome.com,
John Hurley <john.hurley@netronome.com>
Subject: [PATCH net-next 02/10] net: sched: add skbedit of ptype action to hardware IR
Date: Sun, 4 Aug 2019 16:09:04 +0100 [thread overview]
Message-ID: <1564931351-1036-3-git-send-email-john.hurley@netronome.com> (raw)
In-Reply-To: <1564931351-1036-1-git-send-email-john.hurley@netronome.com>
TC rules can impliment skbedit actions. Currently actions that modify the
skb mark are passed to offloading drivers via the hardware intermediate
representation in the flow_offload API.
Extend this to include skbedit actions that modify the packet type of the
skb. Such actions may be used to set the ptype to HOST when redirecting a
packet to ingress.
Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
include/net/flow_offload.h | 2 ++
net/sched/cls_api.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index 00b9aab..04c29f5 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -126,6 +126,7 @@ enum flow_action_id {
FLOW_ACTION_ADD,
FLOW_ACTION_CSUM,
FLOW_ACTION_MARK,
+ FLOW_ACTION_PTYPE,
FLOW_ACTION_WAKE,
FLOW_ACTION_QUEUE,
FLOW_ACTION_SAMPLE,
@@ -168,6 +169,7 @@ struct flow_action_entry {
const struct ip_tunnel_info *tunnel; /* FLOW_ACTION_TUNNEL_ENCAP */
u32 csum_flags; /* FLOW_ACTION_CSUM */
u32 mark; /* FLOW_ACTION_MARK */
+ u16 ptype; /* FLOW_ACTION_PTYPE */
struct { /* FLOW_ACTION_QUEUE */
u32 ctx;
u32 index;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 3565d9a..ae73d37 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3294,6 +3294,9 @@ int tc_setup_flow_action(struct flow_action *flow_action,
default:
goto err_out;
}
+ } else if (is_tcf_skbedit_ptype(act)) {
+ entry->id = FLOW_ACTION_PTYPE;
+ entry->ptype = tcf_skbedit_ptype(act);
} else {
goto err_out;
}
--
2.7.4
next prev parent reply other threads:[~2019-08-04 15:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-04 15:09 [PATCH net-next 00/10] Support tunnels over VLAN in NFP John Hurley
2019-08-04 15:09 ` [PATCH net-next 01/10] net: tc_act: add skbedit_ptype helper functions John Hurley
2019-08-04 15:09 ` John Hurley [this message]
2019-08-04 15:09 ` [PATCH net-next 03/10] net: tc_act: add helpers to detect ingress mirred actions John Hurley
2019-08-04 15:09 ` [PATCH net-next 04/10] net: sched: add ingress mirred action to hardware IR John Hurley
2019-08-04 15:09 ` [PATCH net-next 05/10] nfp: flower: push vlan after tunnel in merge John Hurley
2019-08-04 15:09 ` [PATCH net-next 06/10] nfp: flower: detect potential pre-tunnel rules John Hurley
2019-08-04 15:09 ` [PATCH net-next 07/10] nfp: flower: verify " John Hurley
2019-08-04 15:09 ` [PATCH net-next 08/10] nfp: flower: offload " John Hurley
2019-08-04 15:09 ` [PATCH net-next 09/10] nfp: flower: remove offloaded MACs when reprs are applied to OvS bridges John Hurley
2019-08-06 21:24 ` [PATCH net-next 00/10] Support tunnels over VLAN in NFP David Miller
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=1564931351-1036-3-git-send-email-john.hurley@netronome.com \
--to=john.hurley@netronome.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
--cc=simon.horman@netronome.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).