maintainer-netdev.rst 15 KB

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