All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: davem@davemloft.net, dsahern@gmail.com, daniel@iogearbox.net,
	john.fastabend@gmail.com, jiri@resnulli.us
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
	aring@mojatatu.com, Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net-next 05/12] cls_bpf: propagate extack to offload delete callback
Date: Tue, 23 Jan 2018 18:46:01 -0800	[thread overview]
Message-ID: <20180124024608.11328-6-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20180124024608.11328-1-jakub.kicinski@netronome.com>

Propagate extack on removal of offloaded filter.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
---
 net/sched/cls_bpf.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
index 323b01f76a4c..8e5326bc6440 100644
--- a/net/sched/cls_bpf.c
+++ b/net/sched/cls_bpf.c
@@ -212,11 +212,12 @@ static int cls_bpf_offload(struct tcf_proto *tp, struct cls_bpf_prog *prog,
 }
 
 static void cls_bpf_stop_offload(struct tcf_proto *tp,
-				 struct cls_bpf_prog *prog)
+				 struct cls_bpf_prog *prog,
+				 struct netlink_ext_ack *extack)
 {
 	int err;
 
-	err = cls_bpf_offload_cmd(tp, NULL, prog, NULL);
+	err = cls_bpf_offload_cmd(tp, NULL, prog, extack);
 	if (err)
 		pr_err("Stopping hardware offload failed: %d\n", err);
 }
@@ -289,12 +290,13 @@ static void cls_bpf_delete_prog_rcu(struct rcu_head *rcu)
 	tcf_queue_work(&prog->work);
 }
 
-static void __cls_bpf_delete(struct tcf_proto *tp, struct cls_bpf_prog *prog)
+static void __cls_bpf_delete(struct tcf_proto *tp, struct cls_bpf_prog *prog,
+			     struct netlink_ext_ack *extack)
 {
 	struct cls_bpf_head *head = rtnl_dereference(tp->root);
 
 	idr_remove_ext(&head->handle_idr, prog->handle);
-	cls_bpf_stop_offload(tp, prog);
+	cls_bpf_stop_offload(tp, prog, extack);
 	list_del_rcu(&prog->link);
 	tcf_unbind_filter(tp, &prog->res);
 	if (tcf_exts_get_net(&prog->exts))
@@ -308,7 +310,7 @@ static int cls_bpf_delete(struct tcf_proto *tp, void *arg, bool *last,
 {
 	struct cls_bpf_head *head = rtnl_dereference(tp->root);
 
-	__cls_bpf_delete(tp, arg);
+	__cls_bpf_delete(tp, arg, extack);
 	*last = list_empty(&head->plist);
 	return 0;
 }
@@ -320,7 +322,7 @@ static void cls_bpf_destroy(struct tcf_proto *tp,
 	struct cls_bpf_prog *prog, *tmp;
 
 	list_for_each_entry_safe(prog, tmp, &head->plist, link)
-		__cls_bpf_delete(tp, prog);
+		__cls_bpf_delete(tp, prog, extack);
 
 	idr_destroy(&head->handle_idr);
 	kfree_rcu(head, rcu);
-- 
2.15.1

  parent reply	other threads:[~2018-01-24  2:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  2:45 [PATCH net-next 00/12] net: sched: propagate extack to cls offloads on destroy and only with skip_sw Jakub Kicinski
2018-01-24  2:45 ` [PATCH net-next 01/12] net: sched: propagate extack to cls->destroy callbacks Jakub Kicinski
2018-01-24  2:45 ` [PATCH net-next 02/12] net: sched: prepare for reimplementation of tc_cls_common_offload_init() Jakub Kicinski
2018-01-24  8:52   ` Jiri Pirko
2018-01-24  9:04     ` Jakub Kicinski
2018-01-24 15:37   ` David Miller
2018-01-24 19:48     ` Jakub Kicinski
2018-01-24  2:45 ` [PATCH net-next 03/12] cls_bpf: remove gen_flags from bpf_offload Jakub Kicinski
2018-01-24  2:46 ` [PATCH net-next 04/12] cls_bpf: pass offload flags to tc_cls_common_offload_init() Jakub Kicinski
2018-01-24  2:46 ` Jakub Kicinski [this message]
2018-01-24  2:46 ` [PATCH net-next 06/12] cls_matchall: " Jakub Kicinski
2018-01-24  2:46 ` [PATCH net-next 07/12] cls_matchall: propagate extack to delete callback Jakub Kicinski
2018-01-24  2:46 ` [PATCH net-next 08/12] cls_flower: pass offload flags to tc_cls_common_offload_init() Jakub Kicinski
2018-01-24  2:46 ` [PATCH net-next 09/12] cls_flower: propagate extack to delete callback Jakub Kicinski
2018-01-24  2:46 ` [PATCH net-next 10/12] cls_u32: pass offload flags to tc_cls_common_offload_init() Jakub Kicinski
2018-01-24  2:46 ` [PATCH net-next 11/12] cls_u32: propagate extack to delete callback Jakub Kicinski
2018-01-24  2:46 ` [PATCH net-next 12/12] net: sched: remove tc_cls_common_offload_init__() Jakub Kicinski

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=20180124024608.11328-6-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=aring@mojatatu.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@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 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.