netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	jiri@resnulli.us, idosch@idosch.org, johannes@sipsolutions.net,
	fw@strlen.de, pablo@netfilter.org,
	Jakub Kicinski <kuba@kernel.org>,
	amritha.nambiar@intel.com, sridhar.samudrala@intel.com,
	hawk@kernel.org
Subject: [PATCH net-next v2 2/3] netdev: let netlink core handle -EMSGSIZE errors
Date: Sat,  2 Mar 2024 21:24:07 -0800	[thread overview]
Message-ID: <20240303052408.310064-3-kuba@kernel.org> (raw)
In-Reply-To: <20240303052408.310064-1-kuba@kernel.org>

Previous change added -EMSGSIZE handling to af_netlink, we don't
have to hide these errors any longer.

Theoretically the error handling changes from:
 if (err == -EMSGSIZE)
to
 if (err == -EMSGSIZE && skb->len)

everywhere, but in practice it doesn't matter.
All messages fit into NLMSG_GOODSIZE, so overflow of an empty
skb cannot happen.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: amritha.nambiar@intel.com
CC: sridhar.samudrala@intel.com
CC: hawk@kernel.org
---
 net/core/netdev-genl.c    | 15 +++------------
 net/core/page_pool_user.c |  2 --
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index fd98936da3ae..918b109e0cf4 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -152,10 +152,7 @@ int netdev_nl_dev_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
 	}
 	rtnl_unlock();
 
-	if (err != -EMSGSIZE)
-		return err;
-
-	return skb->len;
+	return err;
 }
 
 static int
@@ -287,10 +284,7 @@ int netdev_nl_napi_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
 	}
 	rtnl_unlock();
 
-	if (err != -EMSGSIZE)
-		return err;
-
-	return skb->len;
+	return err;
 }
 
 static int
@@ -463,10 +457,7 @@ int netdev_nl_queue_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
 	}
 	rtnl_unlock();
 
-	if (err != -EMSGSIZE)
-		return err;
-
-	return skb->len;
+	return err;
 }
 
 static int netdev_genl_netdevice_event(struct notifier_block *nb,
diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
index 278294aca66a..3a3277ba167b 100644
--- a/net/core/page_pool_user.c
+++ b/net/core/page_pool_user.c
@@ -103,8 +103,6 @@ netdev_nl_page_pool_get_dump(struct sk_buff *skb, struct netlink_callback *cb,
 	mutex_unlock(&page_pools_lock);
 	rtnl_unlock();
 
-	if (skb->len && err == -EMSGSIZE)
-		return skb->len;
 	return err;
 }
 
-- 
2.44.0


  parent reply	other threads:[~2024-03-03  5:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03  5:24 [PATCH net-next v2 0/3] netlink: handle EMSGSIZE errors in the core Jakub Kicinski
2024-03-03  5:24 ` [PATCH net-next v2 1/3] " Jakub Kicinski
2024-03-03 15:01   ` Ido Schimmel
2024-03-03  5:24 ` Jakub Kicinski [this message]
2024-03-03 15:08   ` [PATCH net-next v2 2/3] netdev: let netlink core handle -EMSGSIZE errors Ido Schimmel
2024-03-03  5:24 ` [PATCH net-next v2 3/3] genetlink: fit NLMSG_DONE into same read() as families Jakub Kicinski
2024-03-03 15:10   ` Ido Schimmel
2024-03-15 11:48   ` Stefano Brivio
2024-03-19 15:55     ` Jakub Kicinski
2024-03-19 17:17       ` Eric Dumazet
2024-03-19 17:40         ` Jakub Kicinski
2024-03-21 12:56           ` Gal Pressman
2024-03-21 13:51             ` Ido Schimmel
2024-03-21 15:03               ` Gal Pressman
2024-03-21 17:26               ` Eric Dumazet
2024-03-21 17:41                 ` Ido Schimmel
2024-04-03 22:52           ` Ilya Maximets
2024-04-11 15:16             ` Jakub Kicinski
2024-04-11 15:39               ` Ilya Maximets
2024-04-11 15:52                 ` Jakub Kicinski
2024-04-11 16:38                   ` Ilya Maximets
2024-04-11 18:03                     ` Jakub Kicinski
2024-04-11 18:04                       ` Jakub Kicinski
2024-03-19 23:36       ` David Gibson
2024-03-06  8:10 ` [PATCH net-next v2 0/3] netlink: handle EMSGSIZE errors in the core patchwork-bot+netdevbpf

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=20240303052408.310064-3-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=amritha.nambiar@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=hawk@kernel.org \
    --cc=idosch@idosch.org \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=sridhar.samudrala@intel.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).