18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci.. _netdev-FAQ:
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci==========
68c2ecf20Sopenharmony_cinetdev FAQ
78c2ecf20Sopenharmony_ci==========
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciQ: What is netdev?
108c2ecf20Sopenharmony_ci------------------
118c2ecf20Sopenharmony_ciA: It is a mailing list for all network-related Linux stuff.  This
128c2ecf20Sopenharmony_ciincludes anything found under net/ (i.e. core code like IPv6) and
138c2ecf20Sopenharmony_cidrivers/net (i.e. hardware specific drivers) in the Linux source tree.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciNote that some subsystems (e.g. wireless drivers) which have a high
168c2ecf20Sopenharmony_civolume of traffic have their own specific mailing lists.
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciThe netdev list is managed (like many other Linux mailing lists) through
198c2ecf20Sopenharmony_ciVGER (http://vger.kernel.org/) and archives can be found below:
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci-  http://marc.info/?l=linux-netdev
228c2ecf20Sopenharmony_ci-  http://www.spinics.net/lists/netdev/
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciAside from subsystems like that mentioned above, all network-related
258c2ecf20Sopenharmony_ciLinux development (i.e. RFC, review, comments, etc.) takes place on
268c2ecf20Sopenharmony_cinetdev.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciQ: How do the changes posted to netdev make their way into Linux?
298c2ecf20Sopenharmony_ci-----------------------------------------------------------------
308c2ecf20Sopenharmony_ciA: There are always two trees (git repositories) in play.  Both are
318c2ecf20Sopenharmony_cidriven by David Miller, the main network maintainer.  There is the
328c2ecf20Sopenharmony_ci``net`` tree, and the ``net-next`` tree.  As you can probably guess from
338c2ecf20Sopenharmony_cithe names, the ``net`` tree is for fixes to existing code already in the
348c2ecf20Sopenharmony_cimainline tree from Linus, and ``net-next`` is where the new code goes
358c2ecf20Sopenharmony_cifor the future release.  You can find the trees here:
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
388c2ecf20Sopenharmony_ci- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciQ: How often do changes from these trees make it to the mainline Linus tree?
418c2ecf20Sopenharmony_ci----------------------------------------------------------------------------
428c2ecf20Sopenharmony_ciA: To understand this, you need to know a bit of background information on
438c2ecf20Sopenharmony_cithe cadence of Linux development.  Each new release starts off with a
448c2ecf20Sopenharmony_citwo week "merge window" where the main maintainers feed their new stuff
458c2ecf20Sopenharmony_cito Linus for merging into the mainline tree.  After the two weeks, the
468c2ecf20Sopenharmony_cimerge window is closed, and it is called/tagged ``-rc1``.  No new
478c2ecf20Sopenharmony_cifeatures get mainlined after this -- only fixes to the rc1 content are
488c2ecf20Sopenharmony_ciexpected.  After roughly a week of collecting fixes to the rc1 content,
498c2ecf20Sopenharmony_circ2 is released.  This repeats on a roughly weekly basis until rc7
508c2ecf20Sopenharmony_ci(typically; sometimes rc6 if things are quiet, or rc8 if things are in a
518c2ecf20Sopenharmony_cistate of churn), and a week after the last vX.Y-rcN was done, the
528c2ecf20Sopenharmony_ciofficial vX.Y is released.
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciRelating that to netdev: At the beginning of the 2-week merge window,
558c2ecf20Sopenharmony_cithe ``net-next`` tree will be closed - no new changes/features.  The
568c2ecf20Sopenharmony_ciaccumulated new content of the past ~10 weeks will be passed onto
578c2ecf20Sopenharmony_cimainline/Linus via a pull request for vX.Y -- at the same time, the
588c2ecf20Sopenharmony_ci``net`` tree will start accumulating fixes for this pulled content
598c2ecf20Sopenharmony_cirelating to vX.Y
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciAn announcement indicating when ``net-next`` has been closed is usually
628c2ecf20Sopenharmony_cisent to netdev, but knowing the above, you can predict that in advance.
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciIMPORTANT: Do not send new ``net-next`` content to netdev during the
658c2ecf20Sopenharmony_ciperiod during which ``net-next`` tree is closed.
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ciShortly after the two weeks have passed (and vX.Y-rc1 is released), the
688c2ecf20Sopenharmony_citree for ``net-next`` reopens to collect content for the next (vX.Y+1)
698c2ecf20Sopenharmony_cirelease.
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciIf you aren't subscribed to netdev and/or are simply unsure if
728c2ecf20Sopenharmony_ci``net-next`` has re-opened yet, simply check the ``net-next`` git
738c2ecf20Sopenharmony_cirepository link above for any new networking-related commits.  You may
748c2ecf20Sopenharmony_cialso check the following website for the current status:
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci  http://vger.kernel.org/~davem/net-next.html
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciThe ``net`` tree continues to collect fixes for the vX.Y content, and is
798c2ecf20Sopenharmony_cifed back to Linus at regular (~weekly) intervals.  Meaning that the
808c2ecf20Sopenharmony_cifocus for ``net`` is on stabilization and bug fixes.
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ciFinally, the vX.Y gets released, and the whole cycle starts over.
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ciQ: So where are we now in this cycle?
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ciLoad the mainline (Linus) page here:
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ciand note the top of the "tags" section.  If it is rc1, it is early in
918c2ecf20Sopenharmony_cithe dev cycle.  If it was tagged rc7 a week ago, then a release is
928c2ecf20Sopenharmony_ciprobably imminent.
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ciQ: How do I indicate which tree (net vs. net-next) my patch should be in?
958c2ecf20Sopenharmony_ci-------------------------------------------------------------------------
968c2ecf20Sopenharmony_ciA: Firstly, think whether you have a bug fix or new "next-like" content.
978c2ecf20Sopenharmony_ciThen once decided, assuming that you use git, use the prefix flag, i.e.
988c2ecf20Sopenharmony_ci::
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci  git format-patch --subject-prefix='PATCH net-next' start..finish
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ciUse ``net`` instead of ``net-next`` (always lower case) in the above for
1038c2ecf20Sopenharmony_cibug-fix ``net`` content.  If you don't use git, then note the only magic
1048c2ecf20Sopenharmony_ciin the above is just the subject text of the outgoing e-mail, and you
1058c2ecf20Sopenharmony_cican manually change it yourself with whatever MUA you are comfortable
1068c2ecf20Sopenharmony_ciwith.
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ciQ: I sent a patch and I'm wondering what happened to it?
1098c2ecf20Sopenharmony_ci--------------------------------------------------------
1108c2ecf20Sopenharmony_ciQ: How can I tell whether it got merged?
1118c2ecf20Sopenharmony_ciA: Start by looking at the main patchworks queue for netdev:
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci  https://patchwork.kernel.org/project/netdevbpf/list/
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ciThe "State" field will tell you exactly where things are at with your
1168c2ecf20Sopenharmony_cipatch.
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ciQ: The above only says "Under Review".  How can I find out more?
1198c2ecf20Sopenharmony_ci----------------------------------------------------------------
1208c2ecf20Sopenharmony_ciA: Generally speaking, the patches get triaged quickly (in less than
1218c2ecf20Sopenharmony_ci48h).  So be patient.  Asking the maintainer for status updates on your
1228c2ecf20Sopenharmony_cipatch is a good way to ensure your patch is ignored or pushed to the
1238c2ecf20Sopenharmony_cibottom of the priority list.
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ciQ: I submitted multiple versions of the patch series
1268c2ecf20Sopenharmony_ci----------------------------------------------------
1278c2ecf20Sopenharmony_ciQ: should I directly update patchwork for the previous versions of these
1288c2ecf20Sopenharmony_cipatch series?
1298c2ecf20Sopenharmony_ciA: No, please don't interfere with the patch status on patchwork, leave
1308c2ecf20Sopenharmony_ciit to the maintainer to figure out what is the most recent and current
1318c2ecf20Sopenharmony_civersion that should be applied. If there is any doubt, the maintainer
1328c2ecf20Sopenharmony_ciwill reply and ask what should be done.
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ciQ: I made changes to only a few patches in a patch series should I resend only those changed?
1358c2ecf20Sopenharmony_ci---------------------------------------------------------------------------------------------
1368c2ecf20Sopenharmony_ciA: No, please resend the entire patch series and make sure you do number your
1378c2ecf20Sopenharmony_cipatches such that it is clear this is the latest and greatest set of patches
1388c2ecf20Sopenharmony_cithat can be applied.
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ciQ: 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?
1418c2ecf20Sopenharmony_ci-------------------------------------------------------------------------------------------------------------------------------------------
1428c2ecf20Sopenharmony_ciA: There is no revert possible, once it is pushed out, it stays like that.
1438c2ecf20Sopenharmony_ciPlease send incremental versions on top of what has been merged in order to fix
1448c2ecf20Sopenharmony_cithe patches the way they would look like if your latest patch series was to be
1458c2ecf20Sopenharmony_cimerged.
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ciQ: Are there special rules regarding stable submissions on netdev?
1488c2ecf20Sopenharmony_ci---------------------------------------------------------------
1498c2ecf20Sopenharmony_ciWhile it used to be the case that netdev submissions were not supposed
1508c2ecf20Sopenharmony_cito carry explicit ``CC: stable@vger.kernel.org`` tags that is no longer
1518c2ecf20Sopenharmony_cithe case today. Please follow the standard stable rules in
1528c2ecf20Sopenharmony_ci:ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`,
1538c2ecf20Sopenharmony_ciand make sure you include appropriate Fixes tags!
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ciQ: Is the comment style convention different for the networking content?
1568c2ecf20Sopenharmony_ci------------------------------------------------------------------------
1578c2ecf20Sopenharmony_ciA: Yes, in a largely trivial way.  Instead of this::
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci  /*
1608c2ecf20Sopenharmony_ci   * foobar blah blah blah
1618c2ecf20Sopenharmony_ci   * another line of text
1628c2ecf20Sopenharmony_ci   */
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ciit is requested that you make it look like this::
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci  /* foobar blah blah blah
1678c2ecf20Sopenharmony_ci   * another line of text
1688c2ecf20Sopenharmony_ci   */
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ciQ: I am working in existing code that has the former comment style and not the latter.
1718c2ecf20Sopenharmony_ci--------------------------------------------------------------------------------------
1728c2ecf20Sopenharmony_ciQ: Should I submit new code in the former style or the latter?
1738c2ecf20Sopenharmony_ciA: Make it the latter style, so that eventually all code in the domain
1748c2ecf20Sopenharmony_ciof netdev is of this format.
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ciQ: I found a bug that might have possible security implications or similar.
1778c2ecf20Sopenharmony_ci---------------------------------------------------------------------------
1788c2ecf20Sopenharmony_ciQ: Should I mail the main netdev maintainer off-list?**
1798c2ecf20Sopenharmony_ciA: No. The current netdev maintainer has consistently requested that
1808c2ecf20Sopenharmony_cipeople use the mailing lists and not reach out directly.  If you aren't
1818c2ecf20Sopenharmony_ciOK with that, then perhaps consider mailing security@kernel.org or
1828c2ecf20Sopenharmony_cireading about http://oss-security.openwall.org/wiki/mailing-lists/distros
1838c2ecf20Sopenharmony_cias possible alternative mechanisms.
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ciQ: What level of testing is expected before I submit my change?
1868c2ecf20Sopenharmony_ci---------------------------------------------------------------
1878c2ecf20Sopenharmony_ciA: If your changes are against ``net-next``, the expectation is that you
1888c2ecf20Sopenharmony_cihave tested by layering your changes on top of ``net-next``.  Ideally
1898c2ecf20Sopenharmony_ciyou will have done run-time testing specific to your change, but at a
1908c2ecf20Sopenharmony_ciminimum, your changes should survive an ``allyesconfig`` and an
1918c2ecf20Sopenharmony_ci``allmodconfig`` build without new warnings or failures.
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ciQ: How do I post corresponding changes to user space components?
1948c2ecf20Sopenharmony_ci----------------------------------------------------------------
1958c2ecf20Sopenharmony_ciA: User space code exercising kernel features should be posted
1968c2ecf20Sopenharmony_cialongside kernel patches. This gives reviewers a chance to see
1978c2ecf20Sopenharmony_cihow any new interface is used and how well it works.
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ciWhen user space tools reside in the kernel repo itself all changes
2008c2ecf20Sopenharmony_cishould generally come as one series. If series becomes too large
2018c2ecf20Sopenharmony_cior the user space project is not reviewed on netdev include a link
2028c2ecf20Sopenharmony_cito a public repo where user space patches can be seen.
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ciIn case user space tooling lives in a separate repository but is
2058c2ecf20Sopenharmony_cireviewed on netdev  (e.g. patches to `iproute2` tools) kernel and
2068c2ecf20Sopenharmony_ciuser space patches should form separate series (threads) when posted
2078c2ecf20Sopenharmony_cito the mailing list, e.g.::
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci  [PATCH net-next 0/3] net: some feature cover letter
2108c2ecf20Sopenharmony_ci   └─ [PATCH net-next 1/3] net: some feature prep
2118c2ecf20Sopenharmony_ci   └─ [PATCH net-next 2/3] net: some feature do it
2128c2ecf20Sopenharmony_ci   └─ [PATCH net-next 3/3] selftest: net: some feature
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci  [PATCH iproute2-next] ip: add support for some feature
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ciPosting as one thread is discouraged because it confuses patchwork
2178c2ecf20Sopenharmony_ci(as of patchwork 2.2.2).
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ciQ: Any other tips to help ensure my net/net-next patch gets OK'd?
2208c2ecf20Sopenharmony_ci-----------------------------------------------------------------
2218c2ecf20Sopenharmony_ciA: Attention to detail.  Re-read your own work as if you were the
2228c2ecf20Sopenharmony_cireviewer.  You can start with using ``checkpatch.pl``, perhaps even with
2238c2ecf20Sopenharmony_cithe ``--strict`` flag.  But do not be mindlessly robotic in doing so.
2248c2ecf20Sopenharmony_ciIf your change is a bug fix, make sure your commit log indicates the
2258c2ecf20Sopenharmony_ciend-user visible symptom, the underlying reason as to why it happens,
2268c2ecf20Sopenharmony_ciand then if necessary, explain why the fix proposed is the best way to
2278c2ecf20Sopenharmony_ciget things done.  Don't mangle whitespace, and as is common, don't
2288c2ecf20Sopenharmony_cimis-indent function arguments that span multiple lines.  If it is your
2298c2ecf20Sopenharmony_cifirst patch, mail it to yourself so you can test apply it to an
2308c2ecf20Sopenharmony_ciunpatched tree to confirm infrastructure didn't mangle it.
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ciFinally, go back and read
2338c2ecf20Sopenharmony_ci:ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
2348c2ecf20Sopenharmony_cito be sure you are not repeating some common mistake documented there.
235