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