public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, tariqt@nvidia.com, moshe@nvidia.com,
	saeedm@nvidia.com, linux-rdma@vger.kernel.org
Subject: [patch net-next v4 08/13] net: devlink: remove net namespace check from devlink_nl_port_fill()
Date: Wed,  2 Nov 2022 17:02:06 +0100	[thread overview]
Message-ID: <20221102160211.662752-9-jiri@resnulli.us> (raw)
In-Reply-To: <20221102160211.662752-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@nvidia.com>

It is ensured by the netdevice notifier event processing, that only
netdev pointers from the same net namespaces are filled. Remove the
net namespace check from devlink_nl_port_fill() as it is no longer
needed.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 net/core/devlink.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 70a374c828ae..d948bb2fdd5f 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -1305,10 +1305,9 @@ static int devlink_nl_port_fill(struct sk_buff *msg,
 			devlink_port->desired_type))
 		goto nla_put_failure_type_locked;
 	if (devlink_port->type == DEVLINK_PORT_TYPE_ETH) {
-		struct net *net = devlink_net(devlink_port->devlink);
 		struct net_device *netdev = devlink_port->type_eth.netdev;
 
-		if (netdev && net_eq(net, dev_net(netdev)) &&
+		if (netdev &&
 		    (nla_put_u32(msg, DEVLINK_ATTR_PORT_NETDEV_IFINDEX,
 				 netdev->ifindex) ||
 		     nla_put_string(msg, DEVLINK_ATTR_PORT_NETDEV_NAME,
-- 
2.37.3


  parent reply	other threads:[~2022-11-02 16:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 16:01 [patch net-next v4 00/13] net: fix netdev to devlink_port linkage and expose to user Jiri Pirko
2022-11-02 16:01 ` [patch net-next v4 01/13] net: devlink: convert devlink port type-specific pointers to union Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 02/13] net: devlink: move port_type_warn_schedule() call to __devlink_port_type_set() Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 03/13] net: devlink: move port_type_netdev_checks() " Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 04/13] net: devlink: take RTNL in port_fill() function only if it is not held Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 05/13] net: devlink: track netdev with devlink_port assigned Jiri Pirko
2022-11-06  9:09   ` Ido Schimmel
2022-11-07  7:40     ` Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 06/13] net: make drivers to use SET_NETDEV_DEVLINK_PORT to set devlink_port Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 07/13] net: devlink: remove netdev arg from devlink_port_type_eth_set() Jiri Pirko
2022-11-02 16:02 ` Jiri Pirko [this message]
2022-11-02 16:02 ` [patch net-next v4 09/13] net: devlink: store copy netdevice ifindex and ifname to allow port_fill() without RTNL held Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 10/13] net: devlink: add not cleared type warning to port unregister Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 11/13] net: devlink: use devlink_port pointer instead of ndo_get_devlink_port Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 12/13] net: remove unused ndo_get_devlink_port Jiri Pirko
2022-11-02 16:02 ` [patch net-next v4 13/13] net: expose devlink port over rtnetlink Jiri Pirko
2022-11-04  5:00 ` [patch net-next v4 00/13] net: fix netdev to devlink_port linkage and expose to user 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=20221102160211.662752-9-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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