From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org,
willemdebruijn.kernel@gmail.com, sdf@fomichev.me,
Jakub Kicinski <kuba@kernel.org>,
Willem de Bruijn <willemb@google.com>
Subject: [PATCH net-next v2 2/8] netdev: define NETDEV_INTERNAL
Date: Tue, 7 Jan 2025 08:08:40 -0800 [thread overview]
Message-ID: <20250107160846.2223263-3-kuba@kernel.org> (raw)
In-Reply-To: <20250107160846.2223263-1-kuba@kernel.org>
Linus suggested during one of past maintainer summits (in context of
a DMA_BUF discussion) that symbol namespaces can be used to prevent
unwelcome but in-tree code from using all exported functions.
Create a namespace for netdev.
Export netdev_rx_queue_restart(), drivers may want to use it since
it gives them a simple and safe way to restart a queue to apply
config changes. But it's both too low level and too actively developed
to be used outside netdev.
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
Documentation/networking/netdevices.rst | 10 ++++++++++
net/core/netdev_rx_queue.c | 1 +
2 files changed, 11 insertions(+)
diff --git a/Documentation/networking/netdevices.rst b/Documentation/networking/netdevices.rst
index 857c9784f87e..1d37038e9fbe 100644
--- a/Documentation/networking/netdevices.rst
+++ b/Documentation/networking/netdevices.rst
@@ -297,3 +297,13 @@ struct napi_struct synchronization rules
Context:
softirq
will be called with interrupts disabled by netconsole.
+
+NETDEV_INTERNAL symbol namespace
+================================
+
+Symbols exported as NETDEV_INTERNAL can only be used in networking
+core and drivers which exclusively flow via the main networking list and trees.
+Note that the inverse is not true, most symbols outside of NETDEV_INTERNAL
+are not expected to be used by random code outside netdev either.
+Symbols may lack the designation because they predate the namespaces,
+or simply due to an oversight.
diff --git a/net/core/netdev_rx_queue.c b/net/core/netdev_rx_queue.c
index e217a5838c87..db82786fa0c4 100644
--- a/net/core/netdev_rx_queue.c
+++ b/net/core/netdev_rx_queue.c
@@ -79,3 +79,4 @@ int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq_idx)
return err;
}
+EXPORT_SYMBOL_NS_GPL(netdev_rx_queue_restart, "NETDEV_INTERNAL");
--
2.47.1
next prev parent reply other threads:[~2025-01-07 16:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 16:08 [PATCH net-next v2 0/8] net: make sure we retain NAPI ordering on netdev->napi_list Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 1/8] " Jakub Kicinski
2025-01-07 16:08 ` Jakub Kicinski [this message]
2025-01-07 16:08 ` [PATCH net-next v2 3/8] netdevsim: support NAPI config Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 4/8] netdevsim: allocate rqs individually Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 5/8] netdevsim: add queue alloc/free helpers Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 6/8] netdevsim: add queue management API support Jakub Kicinski
2025-01-07 22:53 ` Mina Almasry
2025-01-08 0:45 ` Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 7/8] netdevsim: add debugfs-triggered queue reset Jakub Kicinski
2025-01-07 23:00 ` Mina Almasry
2025-01-08 0:50 ` Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 8/8] selftests: net: test listing NAPI vs queue resets Jakub Kicinski
2025-01-09 14:40 ` [PATCH net-next v2 0/8] net: make sure we retain NAPI ordering on netdev->napi_list 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=20250107160846.2223263-3-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@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).