netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Pedro Tammela <pctammela@mojatatu.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, marcelo.leitner@gmail.com,
	vladbu@nvidia.com
Subject: Re: [PATCH net-next v2 4/5] net/sched: act_api: conditional notification of events
Date: Tue, 5 Dec 2023 12:32:56 +0100	[thread overview]
Message-ID: <ZW8KaANgu0DpryWV@nanopsycho> (raw)
In-Reply-To: <20231204203907.413435-5-pctammela@mojatatu.com>

Mon, Dec 04, 2023 at 09:39:06PM CET, pctammela@mojatatu.com wrote:
>As of today tc-action events are unconditionally built and sent to
>RTNLGRP_TC. As with the introduction of tc_should_notify we can check
>before-hand if they are really needed.
>
>Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
>---
> net/sched/act_api.c | 105 ++++++++++++++++++++++++++++++++------------
> 1 file changed, 76 insertions(+), 29 deletions(-)
>
>diff --git a/net/sched/act_api.c b/net/sched/act_api.c
>index c39252d61ebb..55c62a8e8803 100644
>--- a/net/sched/act_api.c
>+++ b/net/sched/act_api.c
>@@ -1780,31 +1780,45 @@ static int tcf_action_delete(struct net *net, struct tc_action *actions[])
> 	return 0;
> }
> 
>-static int
>-tcf_reoffload_del_notify(struct net *net, struct tc_action *action)
>+static struct sk_buff *tcf_reoffload_del_notify_msg(struct net *net,

I wonder, why this new function is needed? If I'm reading things
correctly, tcf_reoffload_del_notify() with added check would be just ok,
woundn't it?

Same for others.

>+						    struct tc_action *action)
> {
> 	size_t attr_size = tcf_action_fill_size(action);
> 	struct tc_action *actions[TCA_ACT_MAX_PRIO] = {
> 		[0] = action,
> 	};
>-	const struct tc_action_ops *ops = action->ops;
> 	struct sk_buff *skb;
>-	int ret;
> 
>-	skb = alloc_skb(attr_size <= NLMSG_GOODSIZE ? NLMSG_GOODSIZE : attr_size,
>-			GFP_KERNEL);
>+	skb = alloc_skb(max(attr_size, NLMSG_GOODSIZE), GFP_KERNEL);

I don't see how this is related to this patch. Can't you do it in separate
patch?

Same for others.

> 	if (!skb)
>-		return -ENOBUFS;
>+		return ERR_PTR(-ENOBUFS);
> 
> 	if (tca_get_fill(skb, actions, 0, 0, 0, RTM_DELACTION, 0, 1, NULL) <= 0) {
> 		kfree_skb(skb);
>-		return -EINVAL;
>+		return ERR_PTR(-EINVAL);
> 	}
> 
>+	return skb;
>+}
>+

[...]

  reply	other threads:[~2023-12-05 11:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 20:39 [PATCH net-next v2 0/5] net/sched: conditional notification of events for cls and act Pedro Tammela
2023-12-04 20:39 ` [PATCH net-next v2 1/5] rtnl: add helper to check if rtnl group has listeners Pedro Tammela
2023-12-05 11:50   ` Jiri Pirko
2023-12-04 20:39 ` [PATCH net-next v2 2/5] rtnl: add helper to check if a notification is needed Pedro Tammela
2023-12-05 11:50   ` Jiri Pirko
2023-12-04 20:39 ` [PATCH net-next v2 3/5] rtnl: add helper to send if skb is not null Pedro Tammela
2023-12-05 11:50   ` Jiri Pirko
2023-12-04 20:39 ` [PATCH net-next v2 4/5] net/sched: act_api: conditional notification of events Pedro Tammela
2023-12-05 11:32   ` Jiri Pirko [this message]
2023-12-05 14:45     ` Pedro Tammela
2023-12-06  7:53       ` Jiri Pirko
2023-12-04 20:39 ` [PATCH net-next v2 5/5] net/sched: cls_api: " Pedro Tammela
2023-12-05 11:51   ` Jiri Pirko
2023-12-05 14:49 ` [PATCH net-next v2 0/5] net/sched: conditional notification of events for cls and act Pedro Tammela

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=ZW8KaANgu0DpryWV@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=kuba@kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pctammela@mojatatu.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 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).