1.. SPDX-License-Identifier: GPL-2.0 2 3.. _netdev-FAQ: 4 5========== 6netdev FAQ 7========== 8 9tl;dr 10----- 11 12 - designate your patch to a tree - ``[PATCH net]`` or ``[PATCH net-next]`` 13 - for fixes the ``Fixes:`` tag is required, regardless of the tree 14 - don't post large series (> 15 patches), break them up 15 - don't repost your patches within one 24h period 16 - reverse xmas tree 17 18What is netdev? 19--------------- 20It is a mailing list for all network-related Linux stuff. This 21includes anything found under net/ (i.e. core code like IPv6) and 22drivers/net (i.e. hardware specific drivers) in the Linux source tree. 23 24Note that some subsystems (e.g. wireless drivers) which have a high 25volume of traffic have their own specific mailing lists. 26 27The netdev list is managed (like many other Linux mailing lists) through 28VGER (http://vger.kernel.org/) with archives available at 29https://lore.kernel.org/netdev/ 30 31Aside from subsystems like those mentioned above, all network-related 32Linux development (i.e. RFC, review, comments, etc.) takes place on 33netdev. 34 35How do the changes posted to netdev make their way into Linux? 36-------------------------------------------------------------- 37There are always two trees (git repositories) in play. Both are 38driven by David Miller, the main network maintainer. There is the 39``net`` tree, and the ``net-next`` tree. As you can probably guess from 40the names, the ``net`` tree is for fixes to existing code already in the 41mainline tree from Linus, and ``net-next`` is where the new code goes 42for the future release. You can find the trees here: 43 44- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git 45- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git 46 47How do I indicate which tree (net vs. net-next) my patch should be in? 48---------------------------------------------------------------------- 49To help maintainers and CI bots you should explicitly mark which tree 50your patch is targeting. Assuming that you use git, use the prefix 51flag:: 52 53 git format-patch --subject-prefix='PATCH net-next' start..finish 54 55Use ``net`` instead of ``net-next`` (always lower case) in the above for 56bug-fix ``net`` content. 57 58How often do changes from these trees make it to the mainline Linus tree? 59------------------------------------------------------------------------- 60To understand this, you need to know a bit of background information on 61the cadence of Linux development. Each new release starts off with a 62two week "merge window" where the main maintainers feed their new stuff 63to Linus for merging into the mainline tree. After the two weeks, the 64merge window is closed, and it is called/tagged ``-rc1``. No new 65features get mainlined after this -- only fixes to the rc1 content are 66expected. After roughly a week of collecting fixes to the rc1 content, 67rc2 is released. This repeats on a roughly weekly basis until rc7 68(typically; sometimes rc6 if things are quiet, or rc8 if things are in a 69state of churn), and a week after the last vX.Y-rcN was done, the 70official vX.Y is released. 71 72Relating that to netdev: At the beginning of the 2-week merge window, 73the ``net-next`` tree will be closed - no new changes/features. The 74accumulated new content of the past ~10 weeks will be passed onto 75mainline/Linus via a pull request for vX.Y -- at the same time, the 76``net`` tree will start accumulating fixes for this pulled content 77relating to vX.Y 78 79An announcement indicating when ``net-next`` has been closed is usually 80sent to netdev, but knowing the above, you can predict that in advance. 81 82.. warning:: 83 Do not send new ``net-next`` content to netdev during the 84 period during which ``net-next`` tree is closed. 85 86RFC patches sent for review only are obviously welcome at any time 87(use ``--subject-prefix='RFC net-next'`` with ``git format-patch``). 88 89Shortly after the two weeks have passed (and vX.Y-rc1 is released), the 90tree for ``net-next`` reopens to collect content for the next (vX.Y+1) 91release. 92 93If you aren't subscribed to netdev and/or are simply unsure if 94``net-next`` has re-opened yet, simply check the ``net-next`` git 95repository link above for any new networking-related commits. You may 96also check the following website for the current status: 97 98 http://vger.kernel.org/~davem/net-next.html 99 100The ``net`` tree continues to collect fixes for the vX.Y content, and is 101fed back to Linus at regular (~weekly) intervals. Meaning that the 102focus for ``net`` is on stabilization and bug fixes. 103 104Finally, the vX.Y gets released, and the whole cycle starts over. 105 106So where are we now in this cycle? 107---------------------------------- 108 109Load the mainline (Linus) page here: 110 111 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 112 113and note the top of the "tags" section. If it is rc1, it is early in 114the dev cycle. If it was tagged rc7 a week ago, then a release is 115probably imminent. If the most recent tag is a final release tag 116(without an ``-rcN`` suffix) - we are most likely in a merge window 117and ``net-next`` is closed. 118 119How can I tell the status of a patch I've sent? 120----------------------------------------------- 121Start by looking at the main patchworks queue for netdev: 122 123 https://patchwork.kernel.org/project/netdevbpf/list/ 124 125The "State" field will tell you exactly where things are at with your 126patch. Patches are indexed by the ``Message-ID`` header of the emails 127which carried them so if you have trouble finding your patch append 128the value of ``Message-ID`` to the URL above. 129 130How long before my patch is accepted? 131------------------------------------- 132Generally speaking, the patches get triaged quickly (in less than 13348h). But be patient, if your patch is active in patchwork (i.e. it's 134listed on the project's patch list) the chances it was missed are close to zero. 135Asking the maintainer for status updates on your 136patch is a good way to ensure your patch is ignored or pushed to the 137bottom of the priority list. 138 139Should I directly update patchwork state of my own patches? 140----------------------------------------------------------- 141It may be tempting to help the maintainers and update the state of your 142own patches when you post a new version or spot a bug. Please do not do that. 143Interfering with the patch status on patchwork will only cause confusion. Leave 144it to the maintainer to figure out what is the most recent and current 145version that should be applied. If there is any doubt, the maintainer 146will reply and ask what should be done. 147 148How do I divide my work into patches? 149------------------------------------- 150 151Put yourself in the shoes of the reviewer. Each patch is read separately 152and therefore should constitute a comprehensible step towards your stated 153goal. 154 155Avoid sending series longer than 15 patches. Larger series takes longer 156to review as reviewers will defer looking at it until they find a large 157chunk of time. A small series can be reviewed in a short time, so Maintainers 158just do it. As a result, a sequence of smaller series gets merged quicker and 159with better review coverage. Re-posting large series also increases the mailing 160list traffic. 161 162I made changes to only a few patches in a patch series should I resend only those changed? 163------------------------------------------------------------------------------------------ 164No, please resend the entire patch series and make sure you do number your 165patches such that it is clear this is the latest and greatest set of patches 166that can be applied. 167 168I have received review feedback, when should I post a revised version of the patches? 169------------------------------------------------------------------------------------- 170Allow at least 24 hours to pass between postings. This will ensure reviewers 171from all geographical locations have a chance to chime in. Do not wait 172too long (weeks) between postings either as it will make it harder for reviewers 173to recall all the context. 174 175Make sure you address all the feedback in your new posting. Do not post a new 176version of the code if the discussion about the previous version is still 177ongoing, unless directly instructed by a reviewer. 178 179I submitted multiple versions of a patch series and it looks like a version other than the last one has been accepted, what should I do? 180---------------------------------------------------------------------------------------------------------------------------------------- 181There is no revert possible, once it is pushed out, it stays like that. 182Please send incremental versions on top of what has been merged in order to fix 183the patches the way they would look like if your latest patch series was to be 184merged. 185 186Are there special rules regarding stable submissions on netdev? 187--------------------------------------------------------------- 188While it used to be the case that netdev submissions were not supposed 189to carry explicit ``CC: stable@vger.kernel.org`` tags that is no longer 190the case today. Please follow the standard stable rules in 191:ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`, 192and make sure you include appropriate Fixes tags! 193 194Is the comment style convention different for the networking content? 195--------------------------------------------------------------------- 196Yes, in a largely trivial way. Instead of this:: 197 198 /* 199 * foobar blah blah blah 200 * another line of text 201 */ 202 203it is requested that you make it look like this:: 204 205 /* foobar blah blah blah 206 * another line of text 207 */ 208 209What is "reverse xmas tree"? 210---------------------------- 211 212Netdev has a convention for ordering local variables in functions. 213Order the variable declaration lines longest to shortest, e.g.:: 214 215 struct scatterlist *sg; 216 struct sk_buff *skb; 217 int err, i; 218 219If there are dependencies between the variables preventing the ordering 220move the initialization out of line. 221 222I am working in existing code which uses non-standard formatting. Which formatting should I use? 223------------------------------------------------------------------------------------------------ 224Make your code follow the most recent guidelines, so that eventually all code 225in the domain of netdev is in the preferred format. 226 227I found a bug that might have possible security implications or similar. Should I mail the main netdev maintainer off-list? 228--------------------------------------------------------------------------------------------------------------------------- 229No. The current netdev maintainer has consistently requested that 230people use the mailing lists and not reach out directly. If you aren't 231OK with that, then perhaps consider mailing security@kernel.org or 232reading about http://oss-security.openwall.org/wiki/mailing-lists/distros 233as possible alternative mechanisms. 234 235What level of testing is expected before I submit my change? 236------------------------------------------------------------ 237At the very minimum your changes must survive an ``allyesconfig`` and an 238``allmodconfig`` build with ``W=1`` set without new warnings or failures. 239 240Ideally you will have done run-time testing specific to your change, 241and the patch series contains a set of kernel selftest for 242``tools/testing/selftests/net`` or using the KUnit framework. 243 244You are expected to test your changes on top of the relevant networking 245tree (``net`` or ``net-next``) and not e.g. a stable tree or ``linux-next``. 246 247How do I post corresponding changes to user space components? 248------------------------------------------------------------- 249User space code exercising kernel features should be posted 250alongside kernel patches. This gives reviewers a chance to see 251how any new interface is used and how well it works. 252 253When user space tools reside in the kernel repo itself all changes 254should generally come as one series. If series becomes too large 255or the user space project is not reviewed on netdev include a link 256to a public repo where user space patches can be seen. 257 258In case user space tooling lives in a separate repository but is 259reviewed on netdev (e.g. patches to ``iproute2`` tools) kernel and 260user space patches should form separate series (threads) when posted 261to the mailing list, e.g.:: 262 263 [PATCH net-next 0/3] net: some feature cover letter 264 └─ [PATCH net-next 1/3] net: some feature prep 265 └─ [PATCH net-next 2/3] net: some feature do it 266 └─ [PATCH net-next 3/3] selftest: net: some feature 267 268 [PATCH iproute2-next] ip: add support for some feature 269 270Posting as one thread is discouraged because it confuses patchwork 271(as of patchwork 2.2.2). 272 273Can I reproduce the checks from patchwork on my local machine? 274-------------------------------------------------------------- 275 276Checks in patchwork are mostly simple wrappers around existing kernel 277scripts, the sources are available at: 278 279https://github.com/kuba-moo/nipa/tree/master/tests 280 281Running all the builds and checks locally is a pain, can I post my patches and have the patchwork bot validate them? 282-------------------------------------------------------------------------------------------------------------------- 283 284No, you must ensure that your patches are ready by testing them locally 285before posting to the mailing list. The patchwork build bot instance 286gets overloaded very easily and netdev@vger really doesn't need more 287traffic if we can help it. 288 289netdevsim is great, can I extend it for my out-of-tree tests? 290------------------------------------------------------------- 291 292No, ``netdevsim`` is a test vehicle solely for upstream tests. 293(Please add your tests under ``tools/testing/selftests/``.) 294 295We also give no guarantees that ``netdevsim`` won't change in the future 296in a way which would break what would normally be considered uAPI. 297 298Is netdevsim considered a "user" of an API? 299------------------------------------------- 300 301Linux kernel has a long standing rule that no API should be added unless 302it has a real, in-tree user. Mock-ups and tests based on ``netdevsim`` are 303strongly encouraged when adding new APIs, but ``netdevsim`` in itself 304is **not** considered a use case/user. 305 306Any other tips to help ensure my net/net-next patch gets OK'd? 307-------------------------------------------------------------- 308Attention to detail. Re-read your own work as if you were the 309reviewer. You can start with using ``checkpatch.pl``, perhaps even with 310the ``--strict`` flag. But do not be mindlessly robotic in doing so. 311If your change is a bug fix, make sure your commit log indicates the 312end-user visible symptom, the underlying reason as to why it happens, 313and then if necessary, explain why the fix proposed is the best way to 314get things done. Don't mangle whitespace, and as is common, don't 315mis-indent function arguments that span multiple lines. If it is your 316first patch, mail it to yourself so you can test apply it to an 317unpatched tree to confirm infrastructure didn't mangle it. 318 319Finally, go back and read 320:ref:`Documentation/process/submitting-patches.rst <submittingpatches>` 321to be sure you are not repeating some common mistake documented there. 322