All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: netdev@vger.kernel.org
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
	Ido Schimmel <idosch@nvidia.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>, Oz Shlomo <ozsh@nvidia.com>,
	Roi Dayan <roid@nvidia.com>, Vlad Buslov <vladbu@nvidia.com>,
	Baowen Zheng <baowen.zheng@corigine.com>,
	Louis Peens <louis.peens@corigine.com>,
	oss-drivers@corigine.com,
	Simon Horman <simon.horman@corigine.com>
Subject: [PATCH v5 net-next 09/12] net: sched: save full flags for tc action
Date: Fri,  3 Dec 2021 13:24:41 +0100	[thread overview]
Message-ID: <20211203122444.11756-10-simon.horman@corigine.com> (raw)
In-Reply-To: <20211203122444.11756-1-simon.horman@corigine.com>

From: Baowen Zheng <baowen.zheng@corigine.com>

Save full action flags and return user flags when return flags to
user space.

Save full action flags to distinguish if the action is created
independent from classifier.

We made this change mainly for further patch to reoffload tc actions.

Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
 net/sched/act_api.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 4e309b8e49bb..e11a73b5934c 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -668,7 +668,7 @@ int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
 	p->tcfa_tm.install = jiffies;
 	p->tcfa_tm.lastuse = jiffies;
 	p->tcfa_tm.firstuse = 0;
-	p->tcfa_flags = flags & TCA_ACT_FLAGS_USER_MASK;
+	p->tcfa_flags = flags;
 	if (est) {
 		err = gen_new_estimator(&p->tcfa_bstats, p->cpu_bstats,
 					&p->tcfa_rate_est,
@@ -995,6 +995,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
 	int err = -EINVAL;
 	unsigned char *b = skb_tail_pointer(skb);
 	struct nlattr *nest;
+	u32 flags;
 
 	if (tcf_action_dump_terse(skb, a, false))
 		goto nla_put_failure;
@@ -1009,9 +1010,10 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
 			       a->used_hw_stats, TCA_ACT_HW_STATS_ANY))
 		goto nla_put_failure;
 
-	if (a->tcfa_flags &&
+	flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK;
+	if (flags &&
 	    nla_put_bitfield32(skb, TCA_ACT_FLAGS,
-			       a->tcfa_flags, a->tcfa_flags))
+			       flags, flags))
 		goto nla_put_failure;
 
 	if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
-- 
2.20.1


  parent reply	other threads:[~2021-12-03 12:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 12:24 [PATCH v5 net-next 00/12] allow user to offload tc action to net device Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 01/12] flow_offload: fill flags to action structure Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 02/12] flow_offload: reject to offload tc actions in offload drivers Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 03/12] flow_offload: add index to flow_action_entry structure Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 04/12] flow_offload: return EOPNOTSUPP for the unsupported mpls action type Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 05/12] flow_offload: add ops to tc_action_ops for flow action setup Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 06/12] flow_offload: allow user to offload tc action to net device Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 07/12] flow_offload: add skip_hw and skip_sw to control if offload the action Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 08/12] flow_offload: add process to update action stats from hardware Simon Horman
2021-12-03 12:24 ` Simon Horman [this message]
2021-12-03 12:24 ` [PATCH v5 net-next 10/12] flow_offload: add reoffload process to update hw_count Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 11/12] flow_offload: validate flags of filter and actions Simon Horman
2021-12-03 12:24 ` [PATCH v5 net-next 12/12] selftests: tc-testing: add action offload selftest for action and filter Simon Horman
2021-12-07  1:32 [PATCH v5 net-next 10/12] flow_offload: add reoffload process to update hw_count kernel test robot
2021-12-07 12:02 ` Dan Carpenter
2021-12-07 12:02 ` Dan Carpenter

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=20211203122444.11756-10-simon.horman@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=baowen.zheng@corigine.com \
    --cc=idosch@nvidia.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=louis.peens@corigine.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@corigine.com \
    --cc=ozsh@nvidia.com \
    --cc=roid@nvidia.com \
    --cc=vladbu@nvidia.com \
    --cc=xiyou.wangcong@gmail.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.