Commit ff249be5 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

docs: netdev: convert to a non-FAQ document

The netdev-FAQ document has grown over the years to the point
where finding information in it is somewhat challenging.
The length of the questions prevents readers from locating
content that's relevant at a glance.

Convert to a more standard documentation format with sections
and sub-sections rather than questions and answers.

The content edits are limited to what's necessary to change
the format, and very minor clarifications.
Reviewed-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f4ef6811
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
.. _netdev-FAQ: .. _netdev-FAQ:
========== =============================
netdev FAQ Networking subsystem (netdev)
========== =============================
tl;dr tl;dr
----- -----
...@@ -15,14 +15,15 @@ tl;dr ...@@ -15,14 +15,15 @@ tl;dr
- don't repost your patches within one 24h period - don't repost your patches within one 24h period
- reverse xmas tree - reverse xmas tree
What is netdev? netdev
--------------- ------
It is a mailing list for all network-related Linux stuff. This
netdev is a mailing list for all network-related Linux stuff. This
includes anything found under net/ (i.e. core code like IPv6) and includes anything found under net/ (i.e. core code like IPv6) and
drivers/net (i.e. hardware specific drivers) in the Linux source tree. drivers/net (i.e. hardware specific drivers) in the Linux source tree.
Note that some subsystems (e.g. wireless drivers) which have a high Note that some subsystems (e.g. wireless drivers) which have a high
volume of traffic have their own specific mailing lists. volume of traffic have their own specific mailing lists and trees.
The netdev list is managed (like many other Linux mailing lists) through The netdev list is managed (like many other Linux mailing lists) through
VGER (http://vger.kernel.org/) with archives available at VGER (http://vger.kernel.org/) with archives available at
...@@ -32,21 +33,10 @@ Aside from subsystems like those mentioned above, all network-related ...@@ -32,21 +33,10 @@ Aside from subsystems like those mentioned above, all network-related
Linux development (i.e. RFC, review, comments, etc.) takes place on Linux development (i.e. RFC, review, comments, etc.) takes place on
netdev. netdev.
How do the changes posted to netdev make their way into Linux? Development cycle
-------------------------------------------------------------- -----------------
There are always two trees (git repositories) in play. Both are
driven by David Miller, the main network maintainer. There is the
``net`` tree, and the ``net-next`` tree. As you can probably guess from
the names, the ``net`` tree is for fixes to existing code already in the
mainline tree from Linus, and ``net-next`` is where the new code goes
for the future release. You can find the trees here:
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
How often do changes from these trees make it to the mainline Linus tree? Here is a bit of background information on
-------------------------------------------------------------------------
To understand this, you need to know a bit of background information on
the cadence of Linux development. Each new release starts off with a the cadence of Linux development. Each new release starts off with a
two week "merge window" where the main maintainers feed their new stuff two week "merge window" where the main maintainers feed their new stuff
to Linus for merging into the mainline tree. After the two weeks, the to Linus for merging into the mainline tree. After the two weeks, the
...@@ -58,9 +48,33 @@ rc2 is released. This repeats on a roughly weekly basis until rc7 ...@@ -58,9 +48,33 @@ rc2 is released. This repeats on a roughly weekly basis until rc7
state of churn), and a week after the last vX.Y-rcN was done, the state of churn), and a week after the last vX.Y-rcN was done, the
official vX.Y is released. official vX.Y is released.
Relating that to netdev: At the beginning of the 2-week merge window, To find out where we are now in the cycle - load the mainline (Linus)
the ``net-next`` tree will be closed - no new changes/features. The page here:
accumulated new content of the past ~10 weeks will be passed onto
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
and note the top of the "tags" section. If it is rc1, it is early in
the dev cycle. If it was tagged rc7 a week ago, then a release is
probably imminent. If the most recent tag is a final release tag
(without an ``-rcN`` suffix) - we are most likely in a merge window
and ``net-next`` is closed.
git trees and patch flow
------------------------
There are two networking trees (git repositories) in play. Both are
driven by David Miller, the main network maintainer. There is the
``net`` tree, and the ``net-next`` tree. As you can probably guess from
the names, the ``net`` tree is for fixes to existing code already in the
mainline tree from Linus, and ``net-next`` is where the new code goes
for the future release. You can find the trees here:
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
Relating that to kernel development: At the beginning of the 2-week
merge window, the ``net-next`` tree will be closed - no new changes/features.
The accumulated new content of the past ~10 weeks will be passed onto
mainline/Linus via a pull request for vX.Y -- at the same time, the mainline/Linus via a pull request for vX.Y -- at the same time, the
``net`` tree will start accumulating fixes for this pulled content ``net`` tree will start accumulating fixes for this pulled content
relating to vX.Y relating to vX.Y
...@@ -92,22 +106,14 @@ focus for ``net`` is on stabilization and bug fixes. ...@@ -92,22 +106,14 @@ focus for ``net`` is on stabilization and bug fixes.
Finally, the vX.Y gets released, and the whole cycle starts over. Finally, the vX.Y gets released, and the whole cycle starts over.
So where are we now in this cycle? netdev patch review
---------------------------------- -------------------
Load the mainline (Linus) page here: Patch status
~~~~~~~~~~~~
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Status of a patch can be checked by looking at the main patchwork
queue for netdev:
and note the top of the "tags" section. If it is rc1, it is early in
the dev cycle. If it was tagged rc7 a week ago, then a release is
probably imminent. If the most recent tag is a final release tag
(without an ``-rcN`` suffix) - we are most likely in a merge window
and ``net-next`` is closed.
How can I tell the status of a patch I've sent?
-----------------------------------------------
Start by looking at the main patchworks queue for netdev:
https://patchwork.kernel.org/project/netdevbpf/list/ https://patchwork.kernel.org/project/netdevbpf/list/
...@@ -116,17 +122,20 @@ patch. Patches are indexed by the ``Message-ID`` header of the emails ...@@ -116,17 +122,20 @@ patch. Patches are indexed by the ``Message-ID`` header of the emails
which carried them so if you have trouble finding your patch append which carried them so if you have trouble finding your patch append
the value of ``Message-ID`` to the URL above. the value of ``Message-ID`` to the URL above.
Should I directly update patchwork state of my own patches? Updating patch status
----------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~
It may be tempting to help the maintainers and update the state of your It may be tempting to help the maintainers and update the state of your
own patches when you post a new version or spot a bug. Please do not do that. own patches when you post a new version or spot a bug. Please **do not**
do that.
Interfering with the patch status on patchwork will only cause confusion. Leave Interfering with the patch status on patchwork will only cause confusion. Leave
it to the maintainer to figure out what is the most recent and current it to the maintainer to figure out what is the most recent and current
version that should be applied. If there is any doubt, the maintainer version that should be applied. If there is any doubt, the maintainer
will reply and ask what should be done. will reply and ask what should be done.
How long before my patch is accepted? Review timelines
------------------------------------- ~~~~~~~~~~~~~~~~
Generally speaking, the patches get triaged quickly (in less than Generally speaking, the patches get triaged quickly (in less than
48h). But be patient, if your patch is active in patchwork (i.e. it's 48h). But be patient, if your patch is active in patchwork (i.e. it's
listed on the project's patch list) the chances it was missed are close to zero. listed on the project's patch list) the chances it was missed are close to zero.
...@@ -134,37 +143,47 @@ Asking the maintainer for status updates on your ...@@ -134,37 +143,47 @@ Asking the maintainer for status updates on your
patch is a good way to ensure your patch is ignored or pushed to the patch is a good way to ensure your patch is ignored or pushed to the
bottom of the priority list. bottom of the priority list.
I made changes to only a few patches in a patch series should I resend only those changed? Partial resends
------------------------------------------------------------------------------------------ ~~~~~~~~~~~~~~~
No, please resend the entire patch series and make sure you do number your
Please always resend the entire patch series and make sure you do number your
patches such that it is clear this is the latest and greatest set of patches patches such that it is clear this is the latest and greatest set of patches
that can be applied. that can be applied. Do not try to resend just the patches which changed.
Handling misapplied patches
~~~~~~~~~~~~~~~~~~~~~~~~~~~
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? Occasionally a patch series gets applied before receiving critical feedback,
---------------------------------------------------------------------------------------------------------------------------------------- or the wrong version of a series gets applied.
There is no revert possible, once it is pushed out, it stays like that. There is no revert possible, once it is pushed out, it stays like that.
Please send incremental versions on top of what has been merged in order to fix Please send incremental versions on top of what has been merged in order to fix
the patches the way they would look like if your latest patch series was to be the patches the way they would look like if your latest patch series was to be
merged. merged.
Are there special rules regarding stable submissions on netdev? Stable tree
--------------------------------------------------------------- ~~~~~~~~~~~
While it used to be the case that netdev submissions were not supposed While it used to be the case that netdev submissions were not supposed
to carry explicit ``CC: stable@vger.kernel.org`` tags that is no longer to carry explicit ``CC: stable@vger.kernel.org`` tags that is no longer
the case today. Please follow the standard stable rules in the case today. Please follow the standard stable rules in
:ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`, :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`,
and make sure you include appropriate Fixes tags! and make sure you include appropriate Fixes tags!
I found a bug that might have possible security implications or similar. Should I mail the main netdev maintainer off-list? Security fixes
--------------------------------------------------------------------------------------------------------------------------- ~~~~~~~~~~~~~~
No. The current netdev maintainer has consistently requested that
Do not email netdev maintainers directly if you think you discovered
a bug that might have possible security implications.
The current netdev maintainer has consistently requested that
people use the mailing lists and not reach out directly. If you aren't people use the mailing lists and not reach out directly. If you aren't
OK with that, then perhaps consider mailing security@kernel.org or OK with that, then perhaps consider mailing security@kernel.org or
reading about http://oss-security.openwall.org/wiki/mailing-lists/distros reading about http://oss-security.openwall.org/wiki/mailing-lists/distros
as possible alternative mechanisms. as possible alternative mechanisms.
How do I post corresponding changes to user space components?
------------------------------------------------------------- Co-posting changes to user space components
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
User space code exercising kernel features should be posted User space code exercising kernel features should be posted
alongside kernel patches. This gives reviewers a chance to see alongside kernel patches. This gives reviewers a chance to see
how any new interface is used and how well it works. how any new interface is used and how well it works.
...@@ -189,9 +208,10 @@ to the mailing list, e.g.:: ...@@ -189,9 +208,10 @@ to the mailing list, e.g.::
Posting as one thread is discouraged because it confuses patchwork Posting as one thread is discouraged because it confuses patchwork
(as of patchwork 2.2.2). (as of patchwork 2.2.2).
Any other tips to help ensure my net/net-next patch gets OK'd? Preparing changes
-------------------------------------------------------------- -----------------
Attention to detail. Re-read your own work as if you were the
Attention to detail is important. Re-read your own work as if you were the
reviewer. You can start with using ``checkpatch.pl``, perhaps even with reviewer. You can start with using ``checkpatch.pl``, perhaps even with
the ``--strict`` flag. But do not be mindlessly robotic in doing so. the ``--strict`` flag. But do not be mindlessly robotic in doing so.
If your change is a bug fix, make sure your commit log indicates the If your change is a bug fix, make sure your commit log indicates the
...@@ -206,8 +226,9 @@ Finally, go back and read ...@@ -206,8 +226,9 @@ Finally, go back and read
:ref:`Documentation/process/submitting-patches.rst <submittingpatches>` :ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
to be sure you are not repeating some common mistake documented there. to be sure you are not repeating some common mistake documented there.
How do I indicate which tree (net vs. net-next) my patch should be in? Indicating target tree
---------------------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~
To help maintainers and CI bots you should explicitly mark which tree To help maintainers and CI bots you should explicitly mark which tree
your patch is targeting. Assuming that you use git, use the prefix your patch is targeting. Assuming that you use git, use the prefix
flag:: flag::
...@@ -217,8 +238,8 @@ flag:: ...@@ -217,8 +238,8 @@ flag::
Use ``net`` instead of ``net-next`` (always lower case) in the above for Use ``net`` instead of ``net-next`` (always lower case) in the above for
bug-fix ``net`` content. bug-fix ``net`` content.
How do I divide my work into patches? Dividing work into patches
------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~
Put yourself in the shoes of the reviewer. Each patch is read separately Put yourself in the shoes of the reviewer. Each patch is read separately
and therefore should constitute a comprehensible step towards your stated and therefore should constitute a comprehensible step towards your stated
...@@ -231,9 +252,11 @@ just do it. As a result, a sequence of smaller series gets merged quicker and ...@@ -231,9 +252,11 @@ just do it. As a result, a sequence of smaller series gets merged quicker and
with better review coverage. Re-posting large series also increases the mailing with better review coverage. Re-posting large series also increases the mailing
list traffic. list traffic.
Is the comment style convention different for the networking content? Multi-line comments
--------------------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~
Yes, in a largely trivial way. Instead of this::
Comment style convention is slightly different for networking and most of
the tree. Instead of this::
/* /*
* foobar blah blah blah * foobar blah blah blah
...@@ -246,8 +269,8 @@ it is requested that you make it look like this:: ...@@ -246,8 +269,8 @@ it is requested that you make it look like this::
* another line of text * another line of text
*/ */
What is "reverse xmas tree"? Local variable ordering ("reverse xmas tree", "RCS")
---------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Netdev has a convention for ordering local variables in functions. Netdev has a convention for ordering local variables in functions.
Order the variable declaration lines longest to shortest, e.g.:: Order the variable declaration lines longest to shortest, e.g.::
...@@ -259,13 +282,16 @@ Order the variable declaration lines longest to shortest, e.g.:: ...@@ -259,13 +282,16 @@ Order the variable declaration lines longest to shortest, e.g.::
If there are dependencies between the variables preventing the ordering If there are dependencies between the variables preventing the ordering
move the initialization out of line. move the initialization out of line.
I am working in existing code which uses non-standard formatting. Which formatting should I use? Format precedence
------------------------------------------------------------------------------------------------ ~~~~~~~~~~~~~~~~~
Make your code follow the most recent guidelines, so that eventually all code
When working in existing code which uses nonstandard formatting make
your code follow the most recent guidelines, so that eventually all code
in the domain of netdev is in the preferred format. in the domain of netdev is in the preferred format.
I have received review feedback, when should I post a revised version of the patches? Resending after review
------------------------------------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~
Allow at least 24 hours to pass between postings. This will ensure reviewers Allow at least 24 hours to pass between postings. This will ensure reviewers
from all geographical locations have a chance to chime in. Do not wait from all geographical locations have a chance to chime in. Do not wait
too long (weeks) between postings either as it will make it harder for reviewers too long (weeks) between postings either as it will make it harder for reviewers
...@@ -275,8 +301,12 @@ Make sure you address all the feedback in your new posting. Do not post a new ...@@ -275,8 +301,12 @@ Make sure you address all the feedback in your new posting. Do not post a new
version of the code if the discussion about the previous version is still version of the code if the discussion about the previous version is still
ongoing, unless directly instructed by a reviewer. ongoing, unless directly instructed by a reviewer.
What level of testing is expected before I submit my change? Testing
------------------------------------------------------------ -------
Expected level of testing
~~~~~~~~~~~~~~~~~~~~~~~~~
At the very minimum your changes must survive an ``allyesconfig`` and an At the very minimum your changes must survive an ``allyesconfig`` and an
``allmodconfig`` build with ``W=1`` set without new warnings or failures. ``allmodconfig`` build with ``W=1`` set without new warnings or failures.
...@@ -287,43 +317,42 @@ and the patch series contains a set of kernel selftest for ...@@ -287,43 +317,42 @@ and the patch series contains a set of kernel selftest for
You are expected to test your changes on top of the relevant networking You are expected to test your changes on top of the relevant networking
tree (``net`` or ``net-next``) and not e.g. a stable tree or ``linux-next``. tree (``net`` or ``net-next``) and not e.g. a stable tree or ``linux-next``.
Can I reproduce the checks from patchwork on my local machine? patchwork checks
-------------------------------------------------------------- ~~~~~~~~~~~~~~~~
Checks in patchwork are mostly simple wrappers around existing kernel Checks in patchwork are mostly simple wrappers around existing kernel
scripts, the sources are available at: scripts, the sources are available at:
https://github.com/kuba-moo/nipa/tree/master/tests https://github.com/kuba-moo/nipa/tree/master/tests
Running all the builds and checks locally is a pain, can I post my patches and have the patchwork bot validate them? **Do not** post your patches just to run them through the checks.
-------------------------------------------------------------------------------------------------------------------- You must ensure that your patches are ready by testing them locally
No, you must ensure that your patches are ready by testing them locally
before posting to the mailing list. The patchwork build bot instance before posting to the mailing list. The patchwork build bot instance
gets overloaded very easily and netdev@vger really doesn't need more gets overloaded very easily and netdev@vger really doesn't need more
traffic if we can help it. traffic if we can help it.
netdevsim is great, can I extend it for my out-of-tree tests? netdevsim
------------------------------------------------------------- ~~~~~~~~~
No, ``netdevsim`` is a test vehicle solely for upstream tests. ``netdevsim`` is a test driver which can be used to exercise driver
(Please add your tests under ``tools/testing/selftests/``.) configuration APIs without requiring capable hardware.
Mock-ups and tests based on ``netdevsim`` are strongly encouraged when
adding new APIs, but ``netdevsim`` in itself is **not** considered
a use case/user. You must also implement the new APIs in a real driver.
We also give no guarantees that ``netdevsim`` won't change in the future We give no guarantees that ``netdevsim`` won't change in the future
in a way which would break what would normally be considered uAPI. in a way which would break what would normally be considered uAPI.
Is netdevsim considered a "user" of an API? ``netdevsim`` is reserved for use by upstream tests only, so any
------------------------------------------- new ``netdevsim`` features must be accompanied by selftests under
``tools/testing/selftests/``.
Linux kernel has a long standing rule that no API should be added unless
it has a real, in-tree user. Mock-ups and tests based on ``netdevsim`` are
strongly encouraged when adding new APIs, but ``netdevsim`` in itself
is **not** considered a use case/user.
My company uses peer feedback in employee performance reviews. Can I ask netdev maintainers for feedback? Testimonials / feedback
--------------------------------------------------------------------------------------------------------- -----------------------
Yes, especially if you spend significant amount of time reviewing code Some companies use peer feedback in employee performance reviews.
Please feel free to request feedback from netdev maintainers,
especially if you spend significant amount of time reviewing code
and go out of your way to improve shared infrastructure. and go out of your way to improve shared infrastructure.
The feedback must be requested by you, the contributor, and will always The feedback must be requested by you, the contributor, and will always
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment