]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - include/linux/netdevice.h
inet: protect against too small mtu values.
[mirror_ubuntu-hirsute-kernel.git] / include / linux / netdevice.h
index cf0923579af4f50f60b1daa2aece483787e260cd..9ef20389622d7bbefbf5ab30a2897ba8b2290cb1 100644 (file)
@@ -1881,6 +1881,11 @@ struct net_device {
        unsigned char           if_port;
        unsigned char           dma;
 
+       /* Note : dev->mtu is often read without holding a lock.
+        * Writers usually hold RTNL.
+        * It is recommended to use READ_ONCE() to annotate the reads,
+        * and to use WRITE_ONCE() to annotate the writes.
+        */
        unsigned int            mtu;
        unsigned int            min_mtu;
        unsigned int            max_mtu;