flow_offload: fill flags to action structure
authorBaowen Zheng <baowen.zheng@corigine.com>
Fri, 17 Dec 2021 18:16:17 +0000 (19:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:57:10 +0000 (12:57 +0100)
[ Upstream commit 40bd094d65fc9f83941b024cde7c24516f036879 ]

Fill flags to action structure to allow user control if
the action should be offloaded to hardware or not.

Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 21c167aa0ba9 ("net/sched: act_ctinfo: use percpu stats")
Signed-off-by: Sasha Levin <sashal@kernel.org>
14 files changed:
net/sched/act_bpf.c
net/sched/act_connmark.c
net/sched/act_ctinfo.c
net/sched/act_gate.c
net/sched/act_ife.c
net/sched/act_ipt.c
net/sched/act_mpls.c
net/sched/act_nat.c
net/sched/act_pedit.c
net/sched/act_police.c
net/sched/act_sample.c
net/sched/act_simple.c
net/sched/act_skbedit.c
net/sched/act_skbmod.c

index 5c36013339e1138086d918479328f65c06925cff..2a05bad56ef3eaaad44d82e823ba35472accbac9 100644 (file)
@@ -305,7 +305,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla,
        ret = tcf_idr_check_alloc(tn, &index, act, bind);
        if (!ret) {
                ret = tcf_idr_create(tn, index, est, act,
-                                    &act_bpf_ops, bind, true, 0);
+                                    &act_bpf_ops, bind, true, flags);
                if (ret < 0) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 032ef927d0ebb931ca9591accd6d930b7193f04f..0deb4e96a6c2e5796d76a7d44a05316079d6136d 100644 (file)
@@ -124,7 +124,7 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla,
        ret = tcf_idr_check_alloc(tn, &index, a, bind);
        if (!ret) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_connmark_ops, bind, false, 0);
+                                    &act_connmark_ops, bind, false, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 2d75fe1223ac47c492222b345426a182700e35c5..65a20f3c9514e80da03ee2701f434d1519e12f04 100644 (file)
@@ -212,7 +212,7 @@ static int tcf_ctinfo_init(struct net *net, struct nlattr *nla,
        err = tcf_idr_check_alloc(tn, &index, a, bind);
        if (!err) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_ctinfo_ops, bind, false, 0);
+                                    &act_ctinfo_ops, bind, false, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 7df72a4197a3fc98f504086e1d2697a5c5b911da..ac985c53ebafe4db2e40946dfef49cbb181cf683 100644 (file)
@@ -357,7 +357,7 @@ static int tcf_gate_init(struct net *net, struct nlattr *nla,
 
        if (!err) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_gate_ops, bind, false, 0);
+                                    &act_gate_ops, bind, false, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 7064a365a1a9834244549b110771d89e1b2895d0..ec987ec7580701c299085ef8e7488e7accecaa1f 100644 (file)
@@ -553,7 +553,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, est, a, &act_ife_ops,
-                                    bind, true, 0);
+                                    bind, true, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        kfree(p);
index 265b1443e252f1bda87f92fb4652298ad4358157..2f3d507c24a1fbfcc242dc4ac21a0d12cf4b0a11 100644 (file)
@@ -145,7 +145,7 @@ static int __tcf_ipt_init(struct net *net, unsigned int id, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, est, a, ops, bind,
-                                    false, 0);
+                                    false, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index db0ef0486309b56a7146142e88150f3c6a0d7f76..980ad795727e91441be1d8418ca7af252f5c3b14 100644 (file)
@@ -254,7 +254,7 @@ static int tcf_mpls_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_mpls_ops, bind, true, 0);
+                                    &act_mpls_ops, bind, true, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 7dd6b586ba7f680ee555c1e0d20abca3f9e4583f..2a39b3729e8449a45f0e1630e3102d85a8a52acf 100644 (file)
@@ -61,7 +61,7 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est,
        err = tcf_idr_check_alloc(tn, &index, a, bind);
        if (!err) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_nat_ops, bind, false, 0);
+                                    &act_nat_ops, bind, false, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 1262a84b725fc4063a76a9467e796b271d7aab52..4f72e6e7dbda539bf4c3b49fb6906f81183a789c 100644 (file)
@@ -189,7 +189,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
        err = tcf_idr_check_alloc(tn, &index, a, bind);
        if (!err) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_pedit_ops, bind, false, 0);
+                                    &act_pedit_ops, bind, false, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        goto out_free;
index 5c0a3ea9fe12047fe644bef2d706651af6c281d1..d44b933b821d7904f30ce4595888cba91c625beb 100644 (file)
@@ -90,7 +90,7 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, NULL, a,
-                                    &act_police_ops, bind, true, 0);
+                                    &act_police_ops, bind, true, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 230501eb9e069fbcb8de3889161e0cf9d8326b6b..ab4ae24ab886f0685c2fc3f8584300a217d77f85 100644 (file)
@@ -70,7 +70,7 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_sample_ops, bind, true, 0);
+                                    &act_sample_ops, bind, true, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index cbbe1861d3a20c263fa6fe01a7113e1812cc7f7b..78852715402593f05778a7b59bbe6b699e746fc6 100644 (file)
@@ -128,7 +128,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_simp_ops, bind, false, 0);
+                                    &act_simp_ops, bind, false, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index 605418538347482cc27812442df10ef73ce02732..6088ceaf582e8ab70806d95b28ab60035d5c5cd3 100644 (file)
@@ -176,7 +176,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_skbedit_ops, bind, true, 0);
+                                    &act_skbedit_ops, bind, true, act_flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;
index ecb9ee6660954c1195cd682032138aae53a51ce8..ee9cc0abf9e10d5724c03b5b863abcd03c4b8821 100644 (file)
@@ -168,7 +168,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla,
 
        if (!exists) {
                ret = tcf_idr_create(tn, index, est, a,
-                                    &act_skbmod_ops, bind, true, 0);
+                                    &act_skbmod_ops, bind, true, flags);
                if (ret) {
                        tcf_idr_cleanup(tn, index);
                        return ret;