]> www.infradead.org Git - users/hch/misc.git/commitdiff
netdev: define NETDEV_INTERNAL
authorJakub Kicinski <kuba@kernel.org>
Tue, 7 Jan 2025 16:08:40 +0000 (08:08 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 Jan 2025 14:33:08 +0000 (15:33 +0100)
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>
Documentation/networking/netdevices.rst
net/core/netdev_rx_queue.c

index 857c9784f87efc704e185ee81876c23376d10367..1d37038e9fbed945aa95c08879289c288b7d5cc2 100644 (file)
@@ -297,3 +297,13 @@ napi->poll:
        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.
index e217a5838c875340713ccf7344b3a1bdd9fb15f2..db82786fa0c40543404922108feb8c1099ecf6ac 100644 (file)
@@ -79,3 +79,4 @@ err_free_new_mem:
 
        return err;
 }
+EXPORT_SYMBOL_NS_GPL(netdev_rx_queue_restart, "NETDEV_INTERNAL");