499 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3.. _netdev-FAQ:4 5=============================6Networking subsystem (netdev)7=============================8 9tl;dr10-----11 12 - designate your patch to a tree - ``[PATCH net]`` or ``[PATCH net-next]``13 - for fixes the ``Fixes:`` tag is required, regardless of the tree14 - don't post large series (> 15 patches), break them up15 - don't repost your patches within one 24h period16 - reverse xmas tree17 18netdev19------20 21netdev is a mailing list for all network-related Linux stuff. This22includes anything found under net/ (i.e. core code like IPv6) and23drivers/net (i.e. hardware specific drivers) in the Linux source tree.24 25Note that some subsystems (e.g. wireless drivers) which have a high26volume of traffic have their own specific mailing lists and trees.27 28Like many other Linux mailing lists, the netdev list is hosted at29kernel.org with archives available at https://lore.kernel.org/netdev/.30 31Aside from subsystems like those mentioned above, all network-related32Linux development (i.e. RFC, review, comments, etc.) takes place on33netdev.34 35Development cycle36-----------------37 38Here is a bit of background information on39the cadence of Linux development. Each new release starts off with a40two week "merge window" where the main maintainers feed their new stuff41to Linus for merging into the mainline tree. After the two weeks, the42merge window is closed, and it is called/tagged ``-rc1``. No new43features get mainlined after this -- only fixes to the rc1 content are44expected. After roughly a week of collecting fixes to the rc1 content,45rc2 is released. This repeats on a roughly weekly basis until rc746(typically; sometimes rc6 if things are quiet, or rc8 if things are in a47state of churn), and a week after the last vX.Y-rcN was done, the48official vX.Y is released.49 50To find out where we are now in the cycle - load the mainline (Linus)51page here:52 53 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git54 55and note the top of the "tags" section. If it is rc1, it is early in56the dev cycle. If it was tagged rc7 a week ago, then a release is57probably imminent. If the most recent tag is a final release tag58(without an ``-rcN`` suffix) - we are most likely in a merge window59and ``net-next`` is closed.60 61git trees and patch flow62------------------------63 64There are two networking trees (git repositories) in play. Both are65driven by David Miller, the main network maintainer. There is the66``net`` tree, and the ``net-next`` tree. As you can probably guess from67the names, the ``net`` tree is for fixes to existing code already in the68mainline tree from Linus, and ``net-next`` is where the new code goes69for the future release. You can find the trees here:70 71- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git72- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git73 74Relating that to kernel development: At the beginning of the 2-week75merge window, the ``net-next`` tree will be closed - no new changes/features.76The accumulated new content of the past ~10 weeks will be passed onto77mainline/Linus via a pull request for vX.Y -- at the same time, the78``net`` tree will start accumulating fixes for this pulled content79relating to vX.Y80 81An announcement indicating when ``net-next`` has been closed is usually82sent to netdev, but knowing the above, you can predict that in advance.83 84.. warning::85 Do not send new ``net-next`` content to netdev during the86 period during which ``net-next`` tree is closed.87 88RFC patches sent for review only are obviously welcome at any time89(use ``--subject-prefix='RFC net-next'`` with ``git format-patch``).90 91Shortly after the two weeks have passed (and vX.Y-rc1 is released), the92tree for ``net-next`` reopens to collect content for the next (vX.Y+1)93release.94 95If you aren't subscribed to netdev and/or are simply unsure if96``net-next`` has re-opened yet, simply check the ``net-next`` git97repository link above for any new networking-related commits. You may98also check the following website for the current status:99 100 https://netdev.bots.linux.dev/net-next.html101 102The ``net`` tree continues to collect fixes for the vX.Y content, and is103fed back to Linus at regular (~weekly) intervals. Meaning that the104focus for ``net`` is on stabilization and bug fixes.105 106Finally, the vX.Y gets released, and the whole cycle starts over.107 108netdev patch review109-------------------110 111.. _patch_status:112 113Patch status114~~~~~~~~~~~~115 116Status of a patch can be checked by looking at the main patchwork117queue for netdev:118 119 https://patchwork.kernel.org/project/netdevbpf/list/120 121The "State" field will tell you exactly where things are at with your122patch:123 124================== =============================================================125Patch state Description126================== =============================================================127New, Under review pending review, patch is in the maintainer’s queue for128 review; the two states are used interchangeably (depending on129 the exact co-maintainer handling patchwork at the time)130Accepted patch was applied to the appropriate networking tree, this is131 usually set automatically by the pw-bot132Needs ACK waiting for an ack from an area expert or testing133Changes requested patch has not passed the review, new revision is expected134 with appropriate code and commit message changes135Rejected patch has been rejected and new revision is not expected136Not applicable patch is expected to be applied outside of the networking137 subsystem138Awaiting upstream patch should be reviewed and handled by appropriate139 sub-maintainer, who will send it on to the networking trees;140 patches set to ``Awaiting upstream`` in netdev's patchwork141 will usually remain in this state, whether the sub-maintainer142 requested changes, accepted or rejected the patch143Deferred patch needs to be reposted later, usually due to dependency144 or because it was posted for a closed tree145Superseded new version of the patch was posted, usually set by the146 pw-bot147RFC not to be applied, usually not in maintainer’s review queue,148 pw-bot can automatically set patches to this state based149 on subject tags150================== =============================================================151 152Patches are indexed by the ``Message-ID`` header of the emails153which carried them so if you have trouble finding your patch append154the value of ``Message-ID`` to the URL above.155 156Updating patch status157~~~~~~~~~~~~~~~~~~~~~158 159Contributors and reviewers do not have the permissions to update patch160state directly in patchwork. Patchwork doesn't expose much information161about the history of the state of patches, therefore having multiple162people update the state leads to confusion.163 164Instead of delegating patchwork permissions netdev uses a simple mail165bot which looks for special commands/lines within the emails sent to166the mailing list. For example to mark a series as Changes Requested167one needs to send the following line anywhere in the email thread::168 169 pw-bot: changes-requested170 171As a result the bot will set the entire series to Changes Requested.172This may be useful when author discovers a bug in their own series173and wants to prevent it from getting applied.174 175The use of the bot is entirely optional, if in doubt ignore its existence176completely. Maintainers will classify and update the state of the patches177themselves. No email should ever be sent to the list with the main purpose178of communicating with the bot, the bot commands should be seen as metadata.179 180The use of the bot is restricted to authors of the patches (the ``From:``181header on patch submission and command must match!), maintainers of182the modified code according to the MAINTAINERS file (again, ``From:``183must match the MAINTAINERS entry) and a handful of senior reviewers.184 185Bot records its activity here:186 187 https://netdev.bots.linux.dev/pw-bot.html188 189Review timelines190~~~~~~~~~~~~~~~~191 192Generally speaking, the patches get triaged quickly (in less than19348h). But be patient, if your patch is active in patchwork (i.e. it's194listed on the project's patch list) the chances it was missed are close to zero.195 196The high volume of development on netdev makes reviewers move on197from discussions relatively quickly. New comments and replies198are very unlikely to arrive after a week of silence. If a patch199is no longer active in patchwork and the thread went idle for more200than a week - clarify the next steps and/or post the next version.201 202For RFC postings specifically, if nobody responded in a week - reviewers203either missed the posting or have no strong opinions. If the code is ready,204repost as a PATCH.205 206Emails saying just "ping" or "bump" are considered rude. If you can't figure207out the status of the patch from patchwork or where the discussion has208landed - describe your best guess and ask if it's correct. For example::209 210 I don't understand what the next steps are. Person X seems to be unhappy211 with A, should I do B and repost the patches?212 213.. _Changes requested:214 215Changes requested216~~~~~~~~~~~~~~~~~217 218Patches :ref:`marked<patch_status>` as ``Changes Requested`` need219to be revised. The new version should come with a change log,220preferably including links to previous postings, for example::221 222 [PATCH net-next v3] net: make cows go moo223 224 Even users who don't drink milk appreciate hearing the cows go "moo".225 226 The amount of mooing will depend on packet rate so should match227 the diurnal cycle quite well.228 229 Signed-off-by: Joe Defarmer <joe@barn.org>230 ---231 v3:232 - add a note about time-of-day mooing fluctuation to the commit message233 v2: https://lore.kernel.org/netdev/123themessageid@barn.org/234 - fix missing argument in kernel doc for netif_is_bovine()235 - fix memory leak in netdev_register_cow()236 v1: https://lore.kernel.org/netdev/456getstheclicks@barn.org/237 238The commit message should be revised to answer any questions reviewers239had to ask in previous discussions. Occasionally the update of240the commit message will be the only change in the new version.241 242Partial resends243~~~~~~~~~~~~~~~244 245Please always resend the entire patch series and make sure you do number your246patches such that it is clear this is the latest and greatest set of patches247that can be applied. Do not try to resend just the patches which changed.248 249Handling misapplied patches250~~~~~~~~~~~~~~~~~~~~~~~~~~~251 252Occasionally a patch series gets applied before receiving critical feedback,253or the wrong version of a series gets applied.254 255Making the patch disappear once it is pushed out is not possible, the commit256history in netdev trees is immutable.257Please send incremental versions on top of what has been merged in order to fix258the patches the way they would look like if your latest patch series was to be259merged.260 261In cases where full revert is needed the revert has to be submitted262as a patch to the list with a commit message explaining the technical263problems with the reverted commit. Reverts should be used as a last resort,264when original change is completely wrong; incremental fixes are preferred.265 266Stable tree267~~~~~~~~~~~268 269While it used to be the case that netdev submissions were not supposed270to carry explicit ``CC: stable@vger.kernel.org`` tags that is no longer271the case today. Please follow the standard stable rules in272:ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`,273and make sure you include appropriate Fixes tags!274 275Security fixes276~~~~~~~~~~~~~~277 278Do not email netdev maintainers directly if you think you discovered279a bug that might have possible security implications.280The current netdev maintainer has consistently requested that281people use the mailing lists and not reach out directly. If you aren't282OK with that, then perhaps consider mailing security@kernel.org or283reading about http://oss-security.openwall.org/wiki/mailing-lists/distros284as possible alternative mechanisms.285 286 287Co-posting changes to user space components288~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~289 290User space code exercising kernel features should be posted291alongside kernel patches. This gives reviewers a chance to see292how any new interface is used and how well it works.293 294When user space tools reside in the kernel repo itself all changes295should generally come as one series. If series becomes too large296or the user space project is not reviewed on netdev include a link297to a public repo where user space patches can be seen.298 299In case user space tooling lives in a separate repository but is300reviewed on netdev (e.g. patches to ``iproute2`` tools) kernel and301user space patches should form separate series (threads) when posted302to the mailing list, e.g.::303 304 [PATCH net-next 0/3] net: some feature cover letter305 └─ [PATCH net-next 1/3] net: some feature prep306 └─ [PATCH net-next 2/3] net: some feature do it307 └─ [PATCH net-next 3/3] selftest: net: some feature308 309 [PATCH iproute2-next] ip: add support for some feature310 311Posting as one thread is discouraged because it confuses patchwork312(as of patchwork 2.2.2).313 314Preparing changes315-----------------316 317Attention to detail is important. Re-read your own work as if you were the318reviewer. You can start with using ``checkpatch.pl``, perhaps even with319the ``--strict`` flag. But do not be mindlessly robotic in doing so.320If your change is a bug fix, make sure your commit log indicates the321end-user visible symptom, the underlying reason as to why it happens,322and then if necessary, explain why the fix proposed is the best way to323get things done. Don't mangle whitespace, and as is common, don't324mis-indent function arguments that span multiple lines. If it is your325first patch, mail it to yourself so you can test apply it to an326unpatched tree to confirm infrastructure didn't mangle it.327 328Finally, go back and read329:ref:`Documentation/process/submitting-patches.rst <submittingpatches>`330to be sure you are not repeating some common mistake documented there.331 332Indicating target tree333~~~~~~~~~~~~~~~~~~~~~~334 335To help maintainers and CI bots you should explicitly mark which tree336your patch is targeting. Assuming that you use git, use the prefix337flag::338 339 git format-patch --subject-prefix='PATCH net-next' start..finish340 341Use ``net`` instead of ``net-next`` (always lower case) in the above for342bug-fix ``net`` content.343 344Dividing work into patches345~~~~~~~~~~~~~~~~~~~~~~~~~~346 347Put yourself in the shoes of the reviewer. Each patch is read separately348and therefore should constitute a comprehensible step towards your stated349goal.350 351Avoid sending series longer than 15 patches. Larger series takes longer352to review as reviewers will defer looking at it until they find a large353chunk of time. A small series can be reviewed in a short time, so Maintainers354just do it. As a result, a sequence of smaller series gets merged quicker and355with better review coverage. Re-posting large series also increases the mailing356list traffic.357 358.. _rcs:359 360Local variable ordering ("reverse xmas tree", "RCS")361~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~362 363Netdev has a convention for ordering local variables in functions.364Order the variable declaration lines longest to shortest, e.g.::365 366 struct scatterlist *sg;367 struct sk_buff *skb;368 int err, i;369 370If there are dependencies between the variables preventing the ordering371move the initialization out of line.372 373Format precedence374~~~~~~~~~~~~~~~~~375 376When working in existing code which uses nonstandard formatting make377your code follow the most recent guidelines, so that eventually all code378in the domain of netdev is in the preferred format.379 380Using device-managed and cleanup.h constructs381~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~382 383Netdev remains skeptical about promises of all "auto-cleanup" APIs,384including even ``devm_`` helpers, historically. They are not the preferred385style of implementation, merely an acceptable one.386 387Use of ``guard()`` is discouraged within any function longer than 20 lines,388``scoped_guard()`` is considered more readable. Using normal lock/unlock is389still (weakly) preferred.390 391Low level cleanup constructs (such as ``__free()``) can be used when building392APIs and helpers, especially scoped iterators. However, direct use of393``__free()`` within networking core and drivers is discouraged.394Similar guidance applies to declaring variables mid-function.395 396Clean-up patches397~~~~~~~~~~~~~~~~398 399Netdev discourages patches which perform simple clean-ups, which are not in400the context of other work. For example:401 402* Addressing ``checkpatch.pl`` warnings403* Addressing :ref:`Local variable ordering<rcs>` issues404* Conversions to device-managed APIs (``devm_`` helpers)405 406This is because it is felt that the churn that such changes produce comes407at a greater cost than the value of such clean-ups.408 409Conversely, spelling and grammar fixes are not discouraged.410 411Resending after review412~~~~~~~~~~~~~~~~~~~~~~413 414Allow at least 24 hours to pass between postings. This will ensure reviewers415from all geographical locations have a chance to chime in. Do not wait416too long (weeks) between postings either as it will make it harder for reviewers417to recall all the context.418 419Make sure you address all the feedback in your new posting. Do not post a new420version of the code if the discussion about the previous version is still421ongoing, unless directly instructed by a reviewer.422 423The new version of patches should be posted as a separate thread,424not as a reply to the previous posting. Change log should include a link425to the previous posting (see :ref:`Changes requested`).426 427Testing428-------429 430Expected level of testing431~~~~~~~~~~~~~~~~~~~~~~~~~432 433At the very minimum your changes must survive an ``allyesconfig`` and an434``allmodconfig`` build with ``W=1`` set without new warnings or failures.435 436Ideally you will have done run-time testing specific to your change,437and the patch series contains a set of kernel selftest for438``tools/testing/selftests/net`` or using the KUnit framework.439 440You are expected to test your changes on top of the relevant networking441tree (``net`` or ``net-next``) and not e.g. a stable tree or ``linux-next``.442 443patchwork checks444~~~~~~~~~~~~~~~~445 446Checks in patchwork are mostly simple wrappers around existing kernel447scripts, the sources are available at:448 449https://github.com/linux-netdev/nipa/tree/master/tests450 451**Do not** post your patches just to run them through the checks.452You must ensure that your patches are ready by testing them locally453before posting to the mailing list. The patchwork build bot instance454gets overloaded very easily and netdev@vger really doesn't need more455traffic if we can help it.456 457netdevsim458~~~~~~~~~459 460``netdevsim`` is a test driver which can be used to exercise driver461configuration APIs without requiring capable hardware.462Mock-ups and tests based on ``netdevsim`` are strongly encouraged when463adding new APIs, but ``netdevsim`` in itself is **not** considered464a use case/user. You must also implement the new APIs in a real driver.465 466We give no guarantees that ``netdevsim`` won't change in the future467in a way which would break what would normally be considered uAPI.468 469``netdevsim`` is reserved for use by upstream tests only, so any470new ``netdevsim`` features must be accompanied by selftests under471``tools/testing/selftests/``.472 473Reviewer guidance474-----------------475 476Reviewing other people's patches on the list is highly encouraged,477regardless of the level of expertise. For general guidance and478helpful tips please see :ref:`development_advancedtopics_reviews`.479 480It's safe to assume that netdev maintainers know the community and the level481of expertise of the reviewers. The reviewers should not be concerned about482their comments impeding or derailing the patch flow.483 484Less experienced reviewers are highly encouraged to do more in-depth485review of submissions and not focus exclusively on trivial or subjective486matters like code formatting, tags etc.487 488Testimonials / feedback489-----------------------490 491Some companies use peer feedback in employee performance reviews.492Please feel free to request feedback from netdev maintainers,493especially if you spend significant amount of time reviewing code494and go out of your way to improve shared infrastructure.495 496The feedback must be requested by you, the contributor, and will always497be shared with you (even if you request for it to be submitted to your498manager).499