18df01363SJakub Kicinski.. SPDX-License-Identifier: GPL-2.0
28df01363SJakub Kicinski
38df01363SJakub Kicinski.. _netdev-FAQ:
48df01363SJakub Kicinski
5ff249be5SJakub Kicinski=============================
6ff249be5SJakub KicinskiNetworking subsystem (netdev)
7ff249be5SJakub Kicinski=============================
88df01363SJakub Kicinski
95d407ca7SJakub Kicinskitl;dr
105d407ca7SJakub Kicinski-----
115d407ca7SJakub Kicinski
125d407ca7SJakub Kicinski - designate your patch to a tree - ``[PATCH net]`` or ``[PATCH net-next]``
135d407ca7SJakub Kicinski - for fixes the ``Fixes:`` tag is required, regardless of the tree
145d407ca7SJakub Kicinski - don't post large series (> 15 patches), break them up
155d407ca7SJakub Kicinski - don't repost your patches within one 24h period
165d407ca7SJakub Kicinski - reverse xmas tree
175d407ca7SJakub Kicinski
18ff249be5SJakub Kicinskinetdev
19ff249be5SJakub Kicinski------
20ff249be5SJakub Kicinski
21ff249be5SJakub Kicinskinetdev is a mailing list for all network-related Linux stuff.  This
228df01363SJakub Kicinskiincludes anything found under net/ (i.e. core code like IPv6) and
238df01363SJakub Kicinskidrivers/net (i.e. hardware specific drivers) in the Linux source tree.
248df01363SJakub Kicinski
258df01363SJakub KicinskiNote that some subsystems (e.g. wireless drivers) which have a high
26ff249be5SJakub Kicinskivolume of traffic have their own specific mailing lists and trees.
278df01363SJakub Kicinski
28413e775eSKonstantin RyabitsevLike many other Linux mailing lists, the netdev list is hosted at
29413e775eSKonstantin Ryabitsevkernel.org with archives available at https://lore.kernel.org/netdev/.
308df01363SJakub Kicinski
318df01363SJakub KicinskiAside from subsystems like those mentioned above, all network-related
328df01363SJakub KicinskiLinux development (i.e. RFC, review, comments, etc.) takes place on
338df01363SJakub Kicinskinetdev.
348df01363SJakub Kicinski
35ff249be5SJakub KicinskiDevelopment cycle
36ff249be5SJakub Kicinski-----------------
378df01363SJakub Kicinski
38ff249be5SJakub KicinskiHere is a bit of background information on
398df01363SJakub Kicinskithe cadence of Linux development.  Each new release starts off with a
408df01363SJakub Kicinskitwo week "merge window" where the main maintainers feed their new stuff
418df01363SJakub Kicinskito Linus for merging into the mainline tree.  After the two weeks, the
428df01363SJakub Kicinskimerge window is closed, and it is called/tagged ``-rc1``.  No new
438df01363SJakub Kicinskifeatures get mainlined after this -- only fixes to the rc1 content are
448df01363SJakub Kicinskiexpected.  After roughly a week of collecting fixes to the rc1 content,
458df01363SJakub Kicinskirc2 is released.  This repeats on a roughly weekly basis until rc7
468df01363SJakub Kicinski(typically; sometimes rc6 if things are quiet, or rc8 if things are in a
478df01363SJakub Kicinskistate of churn), and a week after the last vX.Y-rcN was done, the
488df01363SJakub Kicinskiofficial vX.Y is released.
498df01363SJakub Kicinski
50ff249be5SJakub KicinskiTo find out where we are now in the cycle - load the mainline (Linus)
51ff249be5SJakub Kicinskipage here:
52ff249be5SJakub Kicinski
53ff249be5SJakub Kicinski  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
54ff249be5SJakub Kicinski
55ff249be5SJakub Kicinskiand note the top of the "tags" section.  If it is rc1, it is early in
56ff249be5SJakub Kicinskithe dev cycle.  If it was tagged rc7 a week ago, then a release is
57ff249be5SJakub Kicinskiprobably imminent. If the most recent tag is a final release tag
58ff249be5SJakub Kicinski(without an ``-rcN`` suffix) - we are most likely in a merge window
59ff249be5SJakub Kicinskiand ``net-next`` is closed.
60ff249be5SJakub Kicinski
61ff249be5SJakub Kicinskigit trees and patch flow
62ff249be5SJakub Kicinski------------------------
63ff249be5SJakub Kicinski
64ff249be5SJakub KicinskiThere are two networking trees (git repositories) in play.  Both are
65ff249be5SJakub Kicinskidriven by David Miller, the main network maintainer.  There is the
66ff249be5SJakub Kicinski``net`` tree, and the ``net-next`` tree.  As you can probably guess from
67ff249be5SJakub Kicinskithe names, the ``net`` tree is for fixes to existing code already in the
68ff249be5SJakub Kicinskimainline tree from Linus, and ``net-next`` is where the new code goes
69ff249be5SJakub Kicinskifor the future release.  You can find the trees here:
70ff249be5SJakub Kicinski
71ff249be5SJakub Kicinski- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
72ff249be5SJakub Kicinski- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
73ff249be5SJakub Kicinski
74ff249be5SJakub KicinskiRelating that to kernel development: At the beginning of the 2-week
75ff249be5SJakub Kicinskimerge window, the ``net-next`` tree will be closed - no new changes/features.
76ff249be5SJakub KicinskiThe accumulated new content of the past ~10 weeks will be passed onto
778df01363SJakub Kicinskimainline/Linus via a pull request for vX.Y -- at the same time, the
788df01363SJakub Kicinski``net`` tree will start accumulating fixes for this pulled content
798df01363SJakub Kicinskirelating to vX.Y
808df01363SJakub Kicinski
818df01363SJakub KicinskiAn announcement indicating when ``net-next`` has been closed is usually
828df01363SJakub Kicinskisent to netdev, but knowing the above, you can predict that in advance.
838df01363SJakub Kicinski
848df01363SJakub Kicinski.. warning::
858df01363SJakub Kicinski  Do not send new ``net-next`` content to netdev during the
868df01363SJakub Kicinski  period during which ``net-next`` tree is closed.
878df01363SJakub Kicinski
888df01363SJakub KicinskiRFC patches sent for review only are obviously welcome at any time
898df01363SJakub Kicinski(use ``--subject-prefix='RFC net-next'`` with ``git format-patch``).
908df01363SJakub Kicinski
918df01363SJakub KicinskiShortly after the two weeks have passed (and vX.Y-rc1 is released), the
928df01363SJakub Kicinskitree for ``net-next`` reopens to collect content for the next (vX.Y+1)
938df01363SJakub Kicinskirelease.
948df01363SJakub Kicinski
958df01363SJakub KicinskiIf you aren't subscribed to netdev and/or are simply unsure if
968df01363SJakub Kicinski``net-next`` has re-opened yet, simply check the ``net-next`` git
978df01363SJakub Kicinskirepository link above for any new networking-related commits.  You may
988df01363SJakub Kicinskialso check the following website for the current status:
998df01363SJakub Kicinski
10052450087SJakub Kicinski  https://netdev.bots.linux.dev/net-next.html
1018df01363SJakub Kicinski
1028df01363SJakub KicinskiThe ``net`` tree continues to collect fixes for the vX.Y content, and is
1038df01363SJakub Kicinskifed back to Linus at regular (~weekly) intervals.  Meaning that the
1048df01363SJakub Kicinskifocus for ``net`` is on stabilization and bug fixes.
1058df01363SJakub Kicinski
1068df01363SJakub KicinskiFinally, the vX.Y gets released, and the whole cycle starts over.
1078df01363SJakub Kicinski
108ff249be5SJakub Kicinskinetdev patch review
109ff249be5SJakub Kicinski-------------------
1108df01363SJakub Kicinski
111e110ba65SJakub Kicinski.. _patch_status:
112e110ba65SJakub Kicinski
113ff249be5SJakub KicinskiPatch status
114ff249be5SJakub Kicinski~~~~~~~~~~~~
1158df01363SJakub Kicinski
116ff249be5SJakub KicinskiStatus of a patch can be checked by looking at the main patchwork
117ff249be5SJakub Kicinskiqueue for netdev:
1188df01363SJakub Kicinski
1198df01363SJakub Kicinski  https://patchwork.kernel.org/project/netdevbpf/list/
1208df01363SJakub Kicinski
1218df01363SJakub KicinskiThe "State" field will tell you exactly where things are at with your
122ee8ab74aSJakub Kicinskipatch:
123ee8ab74aSJakub Kicinski
124ee8ab74aSJakub Kicinski================== =============================================================
125ee8ab74aSJakub KicinskiPatch state        Description
126ee8ab74aSJakub Kicinski================== =============================================================
127ee8ab74aSJakub KicinskiNew, Under review  pending review, patch is in the maintainer’s queue for
128ee8ab74aSJakub Kicinski                   review; the two states are used interchangeably (depending on
129ee8ab74aSJakub Kicinski                   the exact co-maintainer handling patchwork at the time)
130ee8ab74aSJakub KicinskiAccepted           patch was applied to the appropriate networking tree, this is
131ee8ab74aSJakub Kicinski                   usually set automatically by the pw-bot
132ee8ab74aSJakub KicinskiNeeds ACK          waiting for an ack from an area expert or testing
133ee8ab74aSJakub KicinskiChanges requested  patch has not passed the review, new revision is expected
134ee8ab74aSJakub Kicinski                   with appropriate code and commit message changes
135ee8ab74aSJakub KicinskiRejected           patch has been rejected and new revision is not expected
136ee8ab74aSJakub KicinskiNot applicable     patch is expected to be applied outside of the networking
137ee8ab74aSJakub Kicinski                   subsystem
138ee8ab74aSJakub KicinskiAwaiting upstream  patch should be reviewed and handled by appropriate
139ee8ab74aSJakub Kicinski                   sub-maintainer, who will send it on to the networking trees;
140ee8ab74aSJakub Kicinski                   patches set to ``Awaiting upstream`` in netdev's patchwork
141ee8ab74aSJakub Kicinski                   will usually remain in this state, whether the sub-maintainer
142ee8ab74aSJakub Kicinski                   requested changes, accepted or rejected the patch
143ee8ab74aSJakub KicinskiDeferred           patch needs to be reposted later, usually due to dependency
144ee8ab74aSJakub Kicinski                   or because it was posted for a closed tree
145ee8ab74aSJakub KicinskiSuperseded         new version of the patch was posted, usually set by the
146ee8ab74aSJakub Kicinski                   pw-bot
147ee8ab74aSJakub KicinskiRFC                not to be applied, usually not in maintainer’s review queue,
148ee8ab74aSJakub Kicinski                   pw-bot can automatically set patches to this state based
149ee8ab74aSJakub Kicinski                   on subject tags
150ee8ab74aSJakub Kicinski================== =============================================================
151ee8ab74aSJakub Kicinski
152ee8ab74aSJakub KicinskiPatches are indexed by the ``Message-ID`` header of the emails
1538df01363SJakub Kicinskiwhich carried them so if you have trouble finding your patch append
1548df01363SJakub Kicinskithe value of ``Message-ID`` to the URL above.
1558df01363SJakub Kicinski
156ff249be5SJakub KicinskiUpdating patch status
157ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~
158ff249be5SJakub Kicinski
1597e7b3b09SJakub KicinskiContributors and reviewers do not have the permissions to update patch
1607e7b3b09SJakub Kicinskistate directly in patchwork. Patchwork doesn't expose much information
1617e7b3b09SJakub Kicinskiabout the history of the state of patches, therefore having multiple
1627e7b3b09SJakub Kicinskipeople update the state leads to confusion.
1637e7b3b09SJakub Kicinski
1647e7b3b09SJakub KicinskiInstead of delegating patchwork permissions netdev uses a simple mail
1657e7b3b09SJakub Kicinskibot which looks for special commands/lines within the emails sent to
1667e7b3b09SJakub Kicinskithe mailing list. For example to mark a series as Changes Requested
1677e7b3b09SJakub Kicinskione needs to send the following line anywhere in the email thread::
1687e7b3b09SJakub Kicinski
1697e7b3b09SJakub Kicinski  pw-bot: changes-requested
1707e7b3b09SJakub Kicinski
1717e7b3b09SJakub KicinskiAs a result the bot will set the entire series to Changes Requested.
1727e7b3b09SJakub KicinskiThis may be useful when author discovers a bug in their own series
1737e7b3b09SJakub Kicinskiand wants to prevent it from getting applied.
1747e7b3b09SJakub Kicinski
1757e7b3b09SJakub KicinskiThe use of the bot is entirely optional, if in doubt ignore its existence
1767e7b3b09SJakub Kicinskicompletely. Maintainers will classify and update the state of the patches
1777e7b3b09SJakub Kicinskithemselves. No email should ever be sent to the list with the main purpose
1787e7b3b09SJakub Kicinskiof communicating with the bot, the bot commands should be seen as metadata.
1797e7b3b09SJakub Kicinski
1807e7b3b09SJakub KicinskiThe use of the bot is restricted to authors of the patches (the ``From:``
181d5dc3945SJakub Kicinskiheader on patch submission and command must match!), maintainers of
182d5dc3945SJakub Kicinskithe modified code according to the MAINTAINERS file (again, ``From:``
183d5dc3945SJakub Kicinskimust match the MAINTAINERS entry) and a handful of senior reviewers.
184d5dc3945SJakub Kicinski
185d5dc3945SJakub KicinskiBot records its activity here:
1867e7b3b09SJakub Kicinski
18752450087SJakub Kicinski  https://netdev.bots.linux.dev/pw-bot.html
1888df01363SJakub Kicinski
189ff249be5SJakub KicinskiReview timelines
190ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~
191ff249be5SJakub Kicinski
192f4ef6811SJakub KicinskiGenerally speaking, the patches get triaged quickly (in less than
193f4ef6811SJakub Kicinski48h). But be patient, if your patch is active in patchwork (i.e. it's
194f4ef6811SJakub Kicinskilisted on the project's patch list) the chances it was missed are close to zero.
195495ec91bSJakub Kicinski
196495ec91bSJakub KicinskiThe high volume of development on netdev makes reviewers move on
197495ec91bSJakub Kicinskifrom discussions relatively quickly. New comments and replies
198495ec91bSJakub Kicinskiare very unlikely to arrive after a week of silence. If a patch
199495ec91bSJakub Kicinskiis no longer active in patchwork and the thread went idle for more
200495ec91bSJakub Kicinskithan a week - clarify the next steps and/or post the next version.
201495ec91bSJakub Kicinski
202495ec91bSJakub KicinskiFor RFC postings specifically, if nobody responded in a week - reviewers
203495ec91bSJakub Kicinskieither missed the posting or have no strong opinions. If the code is ready,
204495ec91bSJakub Kicinskirepost as a PATCH.
205495ec91bSJakub Kicinski
206495ec91bSJakub KicinskiEmails saying just "ping" or "bump" are considered rude. If you can't figure
207495ec91bSJakub Kicinskiout the status of the patch from patchwork or where the discussion has
208495ec91bSJakub Kicinskilanded - describe your best guess and ask if it's correct. For example::
209495ec91bSJakub Kicinski
210495ec91bSJakub Kicinski  I don't understand what the next steps are. Person X seems to be unhappy
211495ec91bSJakub Kicinski  with A, should I do B and repost the patches?
21202514a06SJakub Kicinski
21335b4b6d0SJakub Kicinski.. _Changes requested:
21435b4b6d0SJakub Kicinski
215e110ba65SJakub KicinskiChanges requested
216e110ba65SJakub Kicinski~~~~~~~~~~~~~~~~~
217e110ba65SJakub Kicinski
218e110ba65SJakub KicinskiPatches :ref:`marked<patch_status>` as ``Changes Requested`` need
219e110ba65SJakub Kicinskito be revised. The new version should come with a change log,
220e110ba65SJakub Kicinskipreferably including links to previous postings, for example::
221e110ba65SJakub Kicinski
222e110ba65SJakub Kicinski  [PATCH net-next v3] net: make cows go moo
223e110ba65SJakub Kicinski
224e110ba65SJakub Kicinski  Even users who don't drink milk appreciate hearing the cows go "moo".
225e110ba65SJakub Kicinski
226e110ba65SJakub Kicinski  The amount of mooing will depend on packet rate so should match
227e110ba65SJakub Kicinski  the diurnal cycle quite well.
228e110ba65SJakub Kicinski
229c519cf9bSThorsten Blum  Signed-off-by: Joe Defarmer <[email protected]>
230e110ba65SJakub Kicinski  ---
231e110ba65SJakub Kicinski  v3:
232e110ba65SJakub Kicinski    - add a note about time-of-day mooing fluctuation to the commit message
233e110ba65SJakub Kicinski  v2: https://lore.kernel.org/netdev/[email protected]/
234e110ba65SJakub Kicinski    - fix missing argument in kernel doc for netif_is_bovine()
235e110ba65SJakub Kicinski    - fix memory leak in netdev_register_cow()
236e110ba65SJakub Kicinski  v1: https://lore.kernel.org/netdev/[email protected]/
237e110ba65SJakub Kicinski
238e110ba65SJakub KicinskiThe commit message should be revised to answer any questions reviewers
239e110ba65SJakub Kicinskihad to ask in previous discussions. Occasionally the update of
240e110ba65SJakub Kicinskithe commit message will be the only change in the new version.
241e110ba65SJakub Kicinski
242ff249be5SJakub KicinskiPartial resends
243ff249be5SJakub Kicinski~~~~~~~~~~~~~~~
2448df01363SJakub Kicinski
245ff249be5SJakub KicinskiPlease always resend the entire patch series and make sure you do number your
246ff249be5SJakub Kicinskipatches such that it is clear this is the latest and greatest set of patches
247ff249be5SJakub Kicinskithat can be applied. Do not try to resend just the patches which changed.
248ff249be5SJakub Kicinski
249ff249be5SJakub KicinskiHandling misapplied patches
250ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~~~~~~
251ff249be5SJakub Kicinski
252ff249be5SJakub KicinskiOccasionally a patch series gets applied before receiving critical feedback,
253ff249be5SJakub Kicinskior the wrong version of a series gets applied.
254e70f94c6SJakub Kicinski
255e70f94c6SJakub KicinskiMaking the patch disappear once it is pushed out is not possible, the commit
256e70f94c6SJakub Kicinskihistory in netdev trees is immutable.
2578df01363SJakub KicinskiPlease send incremental versions on top of what has been merged in order to fix
2588df01363SJakub Kicinskithe patches the way they would look like if your latest patch series was to be
2598df01363SJakub Kicinskimerged.
2608df01363SJakub Kicinski
261e70f94c6SJakub KicinskiIn cases where full revert is needed the revert has to be submitted
262e70f94c6SJakub Kicinskias a patch to the list with a commit message explaining the technical
263e70f94c6SJakub Kicinskiproblems with the reverted commit. Reverts should be used as a last resort,
264e70f94c6SJakub Kicinskiwhen original change is completely wrong; incremental fixes are preferred.
265e70f94c6SJakub Kicinski
266ff249be5SJakub KicinskiStable tree
267ff249be5SJakub Kicinski~~~~~~~~~~~
268ff249be5SJakub Kicinski
2698df01363SJakub KicinskiWhile it used to be the case that netdev submissions were not supposed
2708df01363SJakub Kicinskito carry explicit ``CC: [email protected]`` tags that is no longer
2718df01363SJakub Kicinskithe case today. Please follow the standard stable rules in
2728df01363SJakub Kicinski:ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`,
2738df01363SJakub Kicinskiand make sure you include appropriate Fixes tags!
2748df01363SJakub Kicinski
275ff249be5SJakub KicinskiSecurity fixes
276ff249be5SJakub Kicinski~~~~~~~~~~~~~~
277ff249be5SJakub Kicinski
278ff249be5SJakub KicinskiDo not email netdev maintainers directly if you think you discovered
279ff249be5SJakub Kicinskia bug that might have possible security implications.
280ff249be5SJakub KicinskiThe current netdev maintainer has consistently requested that
281f4ef6811SJakub Kicinskipeople use the mailing lists and not reach out directly.  If you aren't
282f4ef6811SJakub KicinskiOK with that, then perhaps consider mailing [email protected] or
283f4ef6811SJakub Kicinskireading about http://oss-security.openwall.org/wiki/mailing-lists/distros
284f4ef6811SJakub Kicinskias possible alternative mechanisms.
285f4ef6811SJakub Kicinski
286ff249be5SJakub Kicinski
287ff249be5SJakub KicinskiCo-posting changes to user space components
288ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
289ff249be5SJakub Kicinski
290f4ef6811SJakub KicinskiUser space code exercising kernel features should be posted
291f4ef6811SJakub Kicinskialongside kernel patches. This gives reviewers a chance to see
292f4ef6811SJakub Kicinskihow any new interface is used and how well it works.
293f4ef6811SJakub Kicinski
294f4ef6811SJakub KicinskiWhen user space tools reside in the kernel repo itself all changes
295f4ef6811SJakub Kicinskishould generally come as one series. If series becomes too large
296f4ef6811SJakub Kicinskior the user space project is not reviewed on netdev include a link
297f4ef6811SJakub Kicinskito a public repo where user space patches can be seen.
298f4ef6811SJakub Kicinski
299f4ef6811SJakub KicinskiIn case user space tooling lives in a separate repository but is
300f4ef6811SJakub Kicinskireviewed on netdev  (e.g. patches to ``iproute2`` tools) kernel and
301f4ef6811SJakub Kicinskiuser space patches should form separate series (threads) when posted
302f4ef6811SJakub Kicinskito the mailing list, e.g.::
303f4ef6811SJakub Kicinski
304f4ef6811SJakub Kicinski  [PATCH net-next 0/3] net: some feature cover letter
305f4ef6811SJakub Kicinski   └─ [PATCH net-next 1/3] net: some feature prep
306f4ef6811SJakub Kicinski   └─ [PATCH net-next 2/3] net: some feature do it
307f4ef6811SJakub Kicinski   └─ [PATCH net-next 3/3] selftest: net: some feature
308f4ef6811SJakub Kicinski
309f4ef6811SJakub Kicinski  [PATCH iproute2-next] ip: add support for some feature
310f4ef6811SJakub Kicinski
311f4ef6811SJakub KicinskiPosting as one thread is discouraged because it confuses patchwork
312f4ef6811SJakub Kicinski(as of patchwork 2.2.2).
313f4ef6811SJakub Kicinski
314*0ea09cbfSJakub KicinskiCo-posting selftests
315*0ea09cbfSJakub Kicinski--------------------
316*0ea09cbfSJakub Kicinski
317*0ea09cbfSJakub KicinskiSelftests should be part of the same series as the code changes.
318*0ea09cbfSJakub KicinskiSpecifically for fixes both code change and related test should go into
319*0ea09cbfSJakub Kicinskithe same tree (the tests may lack a Fixes tag, which is expected).
320*0ea09cbfSJakub KicinskiMixing code changes and test changes in a single commit is discouraged.
321*0ea09cbfSJakub Kicinski
322ff249be5SJakub KicinskiPreparing changes
323ff249be5SJakub Kicinski-----------------
324ff249be5SJakub Kicinski
325ff249be5SJakub KicinskiAttention to detail is important.  Re-read your own work as if you were the
326f4ef6811SJakub Kicinskireviewer.  You can start with using ``checkpatch.pl``, perhaps even with
327f4ef6811SJakub Kicinskithe ``--strict`` flag.  But do not be mindlessly robotic in doing so.
328f4ef6811SJakub KicinskiIf your change is a bug fix, make sure your commit log indicates the
329f4ef6811SJakub Kicinskiend-user visible symptom, the underlying reason as to why it happens,
330f4ef6811SJakub Kicinskiand then if necessary, explain why the fix proposed is the best way to
331f4ef6811SJakub Kicinskiget things done.  Don't mangle whitespace, and as is common, don't
332f4ef6811SJakub Kicinskimis-indent function arguments that span multiple lines.  If it is your
333f4ef6811SJakub Kicinskifirst patch, mail it to yourself so you can test apply it to an
334f4ef6811SJakub Kicinskiunpatched tree to confirm infrastructure didn't mangle it.
335f4ef6811SJakub Kicinski
336f4ef6811SJakub KicinskiFinally, go back and read
337f4ef6811SJakub Kicinski:ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
338f4ef6811SJakub Kicinskito be sure you are not repeating some common mistake documented there.
339f4ef6811SJakub Kicinski
340ff249be5SJakub KicinskiIndicating target tree
341ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~
342ff249be5SJakub Kicinski
343f4ef6811SJakub KicinskiTo help maintainers and CI bots you should explicitly mark which tree
344f4ef6811SJakub Kicinskiyour patch is targeting. Assuming that you use git, use the prefix
345f4ef6811SJakub Kicinskiflag::
346f4ef6811SJakub Kicinski
347f4ef6811SJakub Kicinski  git format-patch --subject-prefix='PATCH net-next' start..finish
348f4ef6811SJakub Kicinski
349f4ef6811SJakub KicinskiUse ``net`` instead of ``net-next`` (always lower case) in the above for
350f4ef6811SJakub Kicinskibug-fix ``net`` content.
351f4ef6811SJakub Kicinski
352ff249be5SJakub KicinskiDividing work into patches
353ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~~~~~
354f4ef6811SJakub Kicinski
355f4ef6811SJakub KicinskiPut yourself in the shoes of the reviewer. Each patch is read separately
356f4ef6811SJakub Kicinskiand therefore should constitute a comprehensible step towards your stated
357f4ef6811SJakub Kicinskigoal.
358f4ef6811SJakub Kicinski
359f4ef6811SJakub KicinskiAvoid sending series longer than 15 patches. Larger series takes longer
360f4ef6811SJakub Kicinskito review as reviewers will defer looking at it until they find a large
361f4ef6811SJakub Kicinskichunk of time. A small series can be reviewed in a short time, so Maintainers
362f4ef6811SJakub Kicinskijust do it. As a result, a sequence of smaller series gets merged quicker and
363f4ef6811SJakub Kicinskiwith better review coverage. Re-posting large series also increases the mailing
364f4ef6811SJakub Kicinskilist traffic.
365f4ef6811SJakub Kicinski
366aeb218d9SSimon Horman.. _rcs:
367aeb218d9SSimon Horman
368ff249be5SJakub KicinskiLocal variable ordering ("reverse xmas tree", "RCS")
369ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
370a2487564SJakub Kicinski
371a2487564SJakub KicinskiNetdev has a convention for ordering local variables in functions.
372a2487564SJakub KicinskiOrder the variable declaration lines longest to shortest, e.g.::
373a2487564SJakub Kicinski
374a2487564SJakub Kicinski  struct scatterlist *sg;
375a2487564SJakub Kicinski  struct sk_buff *skb;
376a2487564SJakub Kicinski  int err, i;
377a2487564SJakub Kicinski
378a2487564SJakub KicinskiIf there are dependencies between the variables preventing the ordering
379a2487564SJakub Kicinskimove the initialization out of line.
380a2487564SJakub Kicinski
381ff249be5SJakub KicinskiFormat precedence
382ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~
383ff249be5SJakub Kicinski
384ff249be5SJakub KicinskiWhen working in existing code which uses nonstandard formatting make
385ff249be5SJakub Kicinskiyour code follow the most recent guidelines, so that eventually all code
3868df01363SJakub Kicinskiin the domain of netdev is in the preferred format.
3878df01363SJakub Kicinski
388c82299fbSJakub KicinskiUsing device-managed and cleanup.h constructs
389c82299fbSJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390c82299fbSJakub Kicinski
391c82299fbSJakub KicinskiNetdev remains skeptical about promises of all "auto-cleanup" APIs,
392c82299fbSJakub Kicinskiincluding even ``devm_`` helpers, historically. They are not the preferred
393c82299fbSJakub Kicinskistyle of implementation, merely an acceptable one.
394c82299fbSJakub Kicinski
395c82299fbSJakub KicinskiUse of ``guard()`` is discouraged within any function longer than 20 lines,
396c82299fbSJakub Kicinski``scoped_guard()`` is considered more readable. Using normal lock/unlock is
397c82299fbSJakub Kicinskistill (weakly) preferred.
398c82299fbSJakub Kicinski
399c82299fbSJakub KicinskiLow level cleanup constructs (such as ``__free()``) can be used when building
400c82299fbSJakub KicinskiAPIs and helpers, especially scoped iterators. However, direct use of
401c82299fbSJakub Kicinski``__free()`` within networking core and drivers is discouraged.
402c82299fbSJakub KicinskiSimilar guidance applies to declaring variables mid-function.
403c82299fbSJakub Kicinski
404aeb218d9SSimon HormanClean-up patches
405aeb218d9SSimon Horman~~~~~~~~~~~~~~~~
406aeb218d9SSimon Horman
407aeb218d9SSimon HormanNetdev discourages patches which perform simple clean-ups, which are not in
408aeb218d9SSimon Hormanthe context of other work. For example:
409aeb218d9SSimon Horman
410aeb218d9SSimon Horman* Addressing ``checkpatch.pl`` warnings
411aeb218d9SSimon Horman* Addressing :ref:`Local variable ordering<rcs>` issues
412aeb218d9SSimon Horman* Conversions to device-managed APIs (``devm_`` helpers)
413aeb218d9SSimon Horman
414aeb218d9SSimon HormanThis is because it is felt that the churn that such changes produce comes
415aeb218d9SSimon Hormanat a greater cost than the value of such clean-ups.
416aeb218d9SSimon Horman
417aeb218d9SSimon HormanConversely, spelling and grammar fixes are not discouraged.
418aeb218d9SSimon Horman
419ff249be5SJakub KicinskiResending after review
420ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~
421ff249be5SJakub Kicinski
422f4ef6811SJakub KicinskiAllow at least 24 hours to pass between postings. This will ensure reviewers
423f4ef6811SJakub Kicinskifrom all geographical locations have a chance to chime in. Do not wait
424f4ef6811SJakub Kicinskitoo long (weeks) between postings either as it will make it harder for reviewers
425f4ef6811SJakub Kicinskito recall all the context.
426f4ef6811SJakub Kicinski
427f4ef6811SJakub KicinskiMake sure you address all the feedback in your new posting. Do not post a new
428f4ef6811SJakub Kicinskiversion of the code if the discussion about the previous version is still
429f4ef6811SJakub Kicinskiongoing, unless directly instructed by a reviewer.
4308df01363SJakub Kicinski
43135b4b6d0SJakub KicinskiThe new version of patches should be posted as a separate thread,
43235b4b6d0SJakub Kicinskinot as a reply to the previous posting. Change log should include a link
43335b4b6d0SJakub Kicinskito the previous posting (see :ref:`Changes requested`).
43435b4b6d0SJakub Kicinski
435ff249be5SJakub KicinskiTesting
436ff249be5SJakub Kicinski-------
437ff249be5SJakub Kicinski
438ff249be5SJakub KicinskiExpected level of testing
439ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~~~~~~~~~~
440ff249be5SJakub Kicinski
4418df01363SJakub KicinskiAt the very minimum your changes must survive an ``allyesconfig`` and an
4428df01363SJakub Kicinski``allmodconfig`` build with ``W=1`` set without new warnings or failures.
4438df01363SJakub Kicinski
4448df01363SJakub KicinskiIdeally you will have done run-time testing specific to your change,
4458df01363SJakub Kicinskiand the patch series contains a set of kernel selftest for
4468df01363SJakub Kicinski``tools/testing/selftests/net`` or using the KUnit framework.
4478df01363SJakub Kicinski
4488df01363SJakub KicinskiYou are expected to test your changes on top of the relevant networking
4498df01363SJakub Kicinskitree (``net`` or ``net-next``) and not e.g. a stable tree or ``linux-next``.
4508df01363SJakub Kicinski
451ff249be5SJakub Kicinskipatchwork checks
452ff249be5SJakub Kicinski~~~~~~~~~~~~~~~~
4538df01363SJakub Kicinski
4548df01363SJakub KicinskiChecks in patchwork are mostly simple wrappers around existing kernel
4558df01363SJakub Kicinskiscripts, the sources are available at:
4568df01363SJakub Kicinski
45723f9c2c0SJakub Kicinskihttps://github.com/linux-netdev/nipa/tree/master/tests
4588df01363SJakub Kicinski
459ff249be5SJakub Kicinski**Do not** post your patches just to run them through the checks.
460ff249be5SJakub KicinskiYou must ensure that your patches are ready by testing them locally
4618df01363SJakub Kicinskibefore posting to the mailing list. The patchwork build bot instance
4628df01363SJakub Kicinskigets overloaded very easily and netdev@vger really doesn't need more
4638df01363SJakub Kicinskitraffic if we can help it.
4648df01363SJakub Kicinski
465ff249be5SJakub Kicinskinetdevsim
466ff249be5SJakub Kicinski~~~~~~~~~
4678df01363SJakub Kicinski
468ff249be5SJakub Kicinski``netdevsim`` is a test driver which can be used to exercise driver
469ff249be5SJakub Kicinskiconfiguration APIs without requiring capable hardware.
470ff249be5SJakub KicinskiMock-ups and tests based on ``netdevsim`` are strongly encouraged when
471ff249be5SJakub Kicinskiadding new APIs, but ``netdevsim`` in itself is **not** considered
472ff249be5SJakub Kicinskia use case/user. You must also implement the new APIs in a real driver.
4738df01363SJakub Kicinski
474ff249be5SJakub KicinskiWe give no guarantees that ``netdevsim`` won't change in the future
4758df01363SJakub Kicinskiin a way which would break what would normally be considered uAPI.
4768df01363SJakub Kicinski
477ff249be5SJakub Kicinski``netdevsim`` is reserved for use by upstream tests only, so any
478ff249be5SJakub Kicinskinew ``netdevsim`` features must be accompanied by selftests under
479ff249be5SJakub Kicinski``tools/testing/selftests/``.
4808df01363SJakub Kicinski
48105baba80SJakub KicinskiSupported status for drivers
48205baba80SJakub Kicinski----------------------------
48305baba80SJakub Kicinski
48405baba80SJakub Kicinski.. note: The following requirements apply only to Ethernet NIC drivers.
48505baba80SJakub Kicinski
48605baba80SJakub KicinskiNetdev defines additional requirements for drivers which want to acquire
48705baba80SJakub Kicinskithe ``Supported`` status in the MAINTAINERS file. ``Supported`` drivers must
48805baba80SJakub Kicinskibe running all upstream driver tests and reporting the results twice a day.
48905baba80SJakub KicinskiDrivers which do not comply with this requirement should use the ``Maintained``
49005baba80SJakub Kicinskistatus. There is currently no difference in how ``Supported`` and ``Maintained``
49105baba80SJakub Kicinskidrivers are treated upstream.
49205baba80SJakub Kicinski
49305baba80SJakub KicinskiThe exact rules a driver must follow to acquire the ``Supported`` status:
49405baba80SJakub Kicinski
49505baba80SJakub Kicinski1. Must run all tests under ``drivers/net`` and ``drivers/net/hw`` targets
49605baba80SJakub Kicinski   of Linux selftests. Running and reporting private / internal tests is
49705baba80SJakub Kicinski   also welcome, but upstream tests are a must.
49805baba80SJakub Kicinski
49905baba80SJakub Kicinski2. The minimum run frequency is once every 12 hours. Must test the
50005baba80SJakub Kicinski   designated branch from the selected branch feed. Note that branches
50105baba80SJakub Kicinski   are auto-constructed and exposed to intentional malicious patch posting,
50205baba80SJakub Kicinski   so the test systems must be isolated.
50305baba80SJakub Kicinski
50405baba80SJakub Kicinski3. Drivers supporting multiple generations of devices must test at
50505baba80SJakub Kicinski   least one device from each generation. A testbed manifest (exact
50605baba80SJakub Kicinski   format TBD) should describe the device models tested.
50705baba80SJakub Kicinski
50805baba80SJakub Kicinski4. The tests must run reliably, if multiple branches are skipped or tests
50905baba80SJakub Kicinski   are failing due to execution environment problems the ``Supported``
51005baba80SJakub Kicinski   status will be withdrawn.
51105baba80SJakub Kicinski
51205baba80SJakub Kicinski5. Test failures due to bugs either in the driver or the test itself,
51305baba80SJakub Kicinski   or lack of support for the feature the test is targgeting are
51405baba80SJakub Kicinski   *not* a basis for losing the ``Supported`` status.
51505baba80SJakub Kicinski
51605baba80SJakub Kicinskinetdev CI will maintain an official page of supported devices, listing their
51705baba80SJakub Kicinskirecent test results.
51805baba80SJakub Kicinski
51905baba80SJakub KicinskiThe driver maintainer may arrange for someone else to run the test,
52005baba80SJakub Kicinskithere is no requirement for the person listed as maintainer (or their
52105baba80SJakub Kicinskiemployer) to be responsible for running the tests. Collaboration between
52205baba80SJakub Kicinskivendors, hosting GH CI, other repos under linux-netdev, etc. is most welcome.
52305baba80SJakub Kicinski
52405baba80SJakub KicinskiSee https://github.com/linux-netdev/nipa/wiki for more information about
52505baba80SJakub Kicinskinetdev CI. Feel free to reach out to maintainers or the list with any questions.
52605baba80SJakub Kicinski
5276e55b1cbSJakub KicinskiReviewer guidance
5286e55b1cbSJakub Kicinski-----------------
5296e55b1cbSJakub Kicinski
5306e55b1cbSJakub KicinskiReviewing other people's patches on the list is highly encouraged,
5316e55b1cbSJakub Kicinskiregardless of the level of expertise. For general guidance and
5326e55b1cbSJakub Kicinskihelpful tips please see :ref:`development_advancedtopics_reviews`.
5336e55b1cbSJakub Kicinski
5346e55b1cbSJakub KicinskiIt's safe to assume that netdev maintainers know the community and the level
5356e55b1cbSJakub Kicinskiof expertise of the reviewers. The reviewers should not be concerned about
5366e55b1cbSJakub Kicinskitheir comments impeding or derailing the patch flow.
5376e55b1cbSJakub Kicinski
5386e55b1cbSJakub KicinskiLess experienced reviewers are highly encouraged to do more in-depth
5396e55b1cbSJakub Kicinskireview of submissions and not focus exclusively on trivial or subjective
5406e55b1cbSJakub Kicinskimatters like code formatting, tags etc.
5416e55b1cbSJakub Kicinski
542ff249be5SJakub KicinskiTestimonials / feedback
543ff249be5SJakub Kicinski-----------------------
5448df01363SJakub Kicinski
545ff249be5SJakub KicinskiSome companies use peer feedback in employee performance reviews.
546ff249be5SJakub KicinskiPlease feel free to request feedback from netdev maintainers,
547ff249be5SJakub Kicinskiespecially if you spend significant amount of time reviewing code
548c5884ef4SJakub Kicinskiand go out of your way to improve shared infrastructure.
549c5884ef4SJakub Kicinski
550c5884ef4SJakub KicinskiThe feedback must be requested by you, the contributor, and will always
551c5884ef4SJakub Kicinskibe shared with you (even if you request for it to be submitted to your
552c5884ef4SJakub Kicinskimanager).
553