Skip to content

Commit 42ff1e5

Browse files
committed
netdev: define NETDEV_INTERNAL
JIRA: https://issues.redhat.com/browse/RHEL-127480 commit 0b7bdc7 Author: Jakub Kicinski <kuba@kernel.org> Date: Tue Jan 7 08:08:40 2025 -0800 netdev: define NETDEV_INTERNAL 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> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
1 parent 3adf010 commit 42ff1e5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Documentation/networking/netdevices.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,13 @@ napi->poll:
297297
Context:
298298
softirq
299299
will be called with interrupts disabled by netconsole.
300+
301+
NETDEV_INTERNAL symbol namespace
302+
================================
303+
304+
Symbols exported as NETDEV_INTERNAL can only be used in networking
305+
core and drivers which exclusively flow via the main networking list and trees.
306+
Note that the inverse is not true, most symbols outside of NETDEV_INTERNAL
307+
are not expected to be used by random code outside netdev either.
308+
Symbols may lack the designation because they predate the namespaces,
309+
or simply due to an oversight.

net/core/netdev_rx_queue.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,4 @@ int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq_idx)
7979

8080
return err;
8181
}
82+
EXPORT_SYMBOL_NS_GPL(netdev_rx_queue_restart, "NETDEV_INTERNAL");

0 commit comments

Comments
 (0)