LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Yajun Deng <yajun.deng@linux.dev>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-decnet-user@lists.sourceforge.net
Cc: Yajun Deng <yajun.deng@linux.dev>
Subject: [PATCH 4/4] net/sched: use rtnl_notify() instead of rtnetlink_send()
Date: Mon, 19 Jul 2021 20:47:43 +0800	[thread overview]
Message-ID: <20210719124743.9076-1-yajun.deng@linux.dev> (raw)

The rtnetlink_send() is already removed. use rtnl_notify() instead.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 net/sched/act_api.c | 13 ++++++-------
 net/sched/cls_api.c | 14 +++++++-------
 net/sched/sch_api.c | 13 ++++++-------
 3 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 998a2374f7ae..d25678b1ebec 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -1349,8 +1349,8 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
 	nlh->nlmsg_len = skb_tail_pointer(skb) - b;
 	nlh->nlmsg_flags |= NLM_F_ROOT;
 	module_put(ops->owner);
-	err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-			     n->nlmsg_flags & NLM_F_ECHO);
+	err = rtnl_notify(skb, net, portid, RTNLGRP_TC,
+			  nlmsg_report(n), GFP_KERNEL);
 	if (err < 0)
 		NL_SET_ERR_MSG(extack, "Failed to send TC action flush notification");
 
@@ -1419,9 +1419,8 @@ tcf_del_notify(struct net *net, struct nlmsghdr *n, struct tc_action *actions[],
 		return ret;
 	}
 
-	ret = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-			     n->nlmsg_flags & NLM_F_ECHO);
-	return ret;
+	return rtnl_notify(skb, net, portid, RTNLGRP_TC,
+			   nlmsg_report(n), GFP_KERNEL);
 }
 
 static int
@@ -1490,8 +1489,8 @@ tcf_add_notify(struct net *net, struct nlmsghdr *n, struct tc_action *actions[],
 		return -EINVAL;
 	}
 
-	return rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-			      n->nlmsg_flags & NLM_F_ECHO);
+	return rtnl_notify(skb, net, portid, RTNLGRP_TC,
+			   nlmsg_report(n), GFP_KERNEL);
 }
 
 static int tcf_action_add(struct net *net, struct nlattr *nla,
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index c8cb59a11098..63ca7afc472d 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1872,8 +1872,8 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb,
 	if (unicast)
 		err = rtnl_unicast(skb, net, portid);
 	else
-		err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-				     n->nlmsg_flags & NLM_F_ECHO);
+		err = rtnl_notify(skb, net, portid, RTNLGRP_TC,
+				  nlmsg_report(n), GFP_KERNEL);
 	return err;
 }
 
@@ -1908,8 +1908,8 @@ static int tfilter_del_notify(struct net *net, struct sk_buff *oskb,
 	if (unicast)
 		err = rtnl_unicast(skb, net, portid);
 	else
-		err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-				     n->nlmsg_flags & NLM_F_ECHO);
+		err = rtnl_notify(skb, net, portid, RTNLGRP_TC,
+				  nlmsg_report(n), GFP_KERNEL);
 	if (err < 0)
 		NL_SET_ERR_MSG(extack, "Failed to send filter delete notification");
 
@@ -2708,8 +2708,8 @@ static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb,
 	if (unicast)
 		err = rtnl_unicast(skb, net, portid);
 	else
-		err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-				     flags & NLM_F_ECHO);
+		err = rtnl_notify(skb, net, portid, RTNLGRP_TC,
+				  flags & NLM_F_ECHO, GFP_KERNEL);
 
 	return err;
 }
@@ -2736,7 +2736,7 @@ static int tc_chain_notify_delete(const struct tcf_proto_ops *tmplt_ops,
 	if (unicast)
 		return rtnl_unicast(skb, net, portid);
 
-	return rtnetlink_send(skb, net, portid, RTNLGRP_TC, flags & NLM_F_ECHO);
+	return rtnl_notify(skb, net, portid, RTNLGRP_TC, flags & NLM_F_ECHO, GFP_KERNEL);
 }
 
 static int tc_chain_tmplt_add(struct tcf_chain *chain, struct net *net,
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 5e90e9b160e3..01858fd08b2a 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -987,8 +987,8 @@ static int qdisc_notify(struct net *net, struct sk_buff *oskb,
 	}
 
 	if (skb->len)
-		return rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-				      n->nlmsg_flags & NLM_F_ECHO);
+		return rtnl_notify(skb, net, portid, RTNLGRP_TC,
+				   nlmsg_report(n), GFP_KERNEL);
 
 err_out:
 	kfree_skb(skb);
@@ -1855,8 +1855,8 @@ static int tclass_notify(struct net *net, struct sk_buff *oskb,
 		return -EINVAL;
 	}
 
-	return rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-			      n->nlmsg_flags & NLM_F_ECHO);
+	return rtnl_notify(skb, net, portid, RTNLGRP_TC,
+			   nlmsg_report(n), GFP_KERNEL);
 }
 
 static int tclass_del_notify(struct net *net,
@@ -1888,9 +1888,8 @@ static int tclass_del_notify(struct net *net,
 		return err;
 	}
 
-	err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
-			     n->nlmsg_flags & NLM_F_ECHO);
-	return err;
+	return rtnl_notify(skb, net, portid, RTNLGRP_TC,
+			   nlmsg_report(n), GFP_KERNEL);
 }
 
 #ifdef CONFIG_NET_CLS
-- 
2.32.0


                 reply	other threads:[~2021-07-19 12:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210719124743.9076-1-yajun.deng@linux.dev \
    --to=yajun.deng@linux.dev \
    --cc=linux-decnet-user@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH 4/4] net/sched: use rtnl_notify() instead of rtnetlink_send()' \
    /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

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).