Linux Networking Documentation
Total Page:16
File Type:pdf, Size:1020Kb
Linux Networking Documentation The kernel development community Jul 14, 2020 CONTENTS i ii Linux Networking Documentation Contents: CONTENTS 1 Linux Networking Documentation 2 CONTENTS CHAPTER ONE NETDEV FAQ 1.1 Q: What is netdev? A: It is a mailing list for all network-related Linux stuff. This includes anything found under net/ (i.e. core code like IPv6) and drivers/net (i.e. hardware specific drivers) in the Linux source tree. Note that some subsystems (e.g. wireless drivers) which have a high volume of traffic have their own specific mailing lists. The netdev list is managed (like many other Linux mailing lists) through VGER (http://vger.kernel.org/) and archives can be found below: • http://marc.info/?l=linux-netdev • http://www.spinics.net/lists/netdev/ Aside from subsystems like that mentioned above, all network-related Linux de- velopment (i.e. RFC, review, comments, etc.) takes place on netdev. 1.2 Q: How do the changes posted to netdev make their way into Linux? A: 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 3 Linux Networking Documentation 1.3 Q: How often do changes from these trees make it to the mainline Linus tree? A: 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 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 merge window is closed, and it is called/tagged -rc1. No new features get mainlined after this – only fixes to the rc1 content are expected. After roughly a week of collecting fixes to the rc1 content, rc2 is released. This repeats on a roughly weekly basis until rc7 (typically; sometimes rc6 if things are quiet, or rc8 if things are in a state of churn), and a week after the last vX.Y-rcN was done, the official vX.Y is released. Relating that to netdev: 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 re- quest for vX.Y – at the same time, the net tree will start accumulating fixes for this pulled content relating to vX.Y An announcement indicating when net-next has been closed is usually sent to netdev, but knowing the above, you can predict that in advance. IMPORTANT: Do not send new net-next content to netdev during the period dur- ing which net-next tree is closed. Shortly after the two weeks have passed (and vX.Y-rc1 is released), the tree for net-next reopens to collect content for the next (vX.Y+1) release. If you aren’t subscribed to netdev and/or are simply unsure if net-next has re-opened yet, simply check the net-next git repository link above for any new networking-related commits. You may also check the following website for the current status: http://vger.kernel.org/~davem/net-next.html The net tree continues to collect fixes for the vX.Y content, and is fed back to Linus at regular (~weekly) intervals. Meaning that the focus for net is on stabilization and bug fixes. Finally, the vX.Y gets released, and the whole cycle starts over. Q: So where are we now in this cycle? Load the mainline (Linus) page here: 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. 4 Chapter 1. netdev FAQ Linux Networking Documentation 1.4 Q: How do I indicate which tree (net vs. net-next) my patch should be in? A: Firstly, think whether you have a bug fix or new“next-like”content. Then once decided, assuming that you use git, use the prefix flag, i.e. git format-patch --subject-prefix='PATCH net-next' start..finish Use net instead of net-next (always lower case) in the above for bug-fix net con- tent. If you don’t use git, then note the only magic in the above is just the subject text of the outgoing e-mail, and you can manually change it yourself with whatever MUA you are comfortable with. 1.5 Q: I sent a patch and I’m wondering what happened to it? Q: How can I tell whether it got merged? A: Start by looking at the main patch- works queue for netdev: http://patchwork.ozlabs.org/project/netdev/list/ The “State”field will tell you exactly where things are at with your patch. 1.6 Q: The above only says “Under Review”. How can I find out more? A: Generally speaking, the patches get triaged quickly (in less than 48h). So be patient. Asking the maintainer for status updates on your patch is a good way to ensure your patch is ignored or pushed to the bottom of the priority list. 1.7 Q: I submitted multiple versions of the patch series Q: should I directly update patchwork for the previous versions of these patch series? A: No, please don’t interfere with the patch status on patchwork, leave 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 will reply and ask what should be done. 1.4. Q: How do I indicate which tree (net vs. net-next) my patch should5 be in? Linux Networking Documentation 1.8 Q: I made changes to only a few patches in a patch series should I resend only those changed? A: No, please 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 that can be applied. 1.9 Q: 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? A: 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 the patches the way they would look like if your latest patch series was to be merged. 1.10 Q: How can I tell what patches are queued up for backporting to the various stable releases? A: Normally Greg Kroah-Hartman collects stable commits himself, but for network- ing, Dave collects up patches he deems critical for the networking subsystem, and then hands them off to Greg. There is a patchworks queue that you can see here: http://patchwork.ozlabs.org/bundle/davem/stable/?state=* It contains the patches which Dave has selected, but not yet handed off to Greg. If Greg already has the patch, then it will be here: https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git A quick way to find whether the patch is in this stable-queue is to simply clonethe repo, and then git grep the mainline commit ID, e.g. stable-queue$ git grep -l 284041ef21fdf2e releases/3.0.84/ipv6-fix-possible-crashes-in-ip6_cork_release.patch releases/3.4.51/ipv6-fix-possible-crashes-in-ip6_cork_release.patch releases/3.9.8/ipv6-fix-possible-crashes-in-ip6_cork_release.patch stable/stable-queue$ 6 Chapter 1. netdev FAQ Linux Networking Documentation 1.11 Q: I see a network patch and I think it should be backported to stable. Q: Should I request it via [email protected] like the references in the kernel’s Documentation/process/stable-kernel-rules.rst file say? A: No, not for networking. Check the stable queues as per above first to see if it is already queued. Ifnot, then send a mail to netdev, listing the upstream commit ID and why you think it should be a stable candidate. Before you jump to go do the above, do note that the normal stable rules in Documentation/process/stable-kernel-rules.rst still apply. So you need to explic- itly indicate why it is a critical fix and exactly what users are impacted. In addition, you need to convince yourself that you really think it has been overlooked, vs. hav- ing been considered and rejected. Generally speaking, the longer it has had a chance to“soak”in mainline, the better the odds that it is an OK candidate for stable. So scrambling to request a commit be added the day after it appears should be avoided. 1.12 Q: I have created a network patch and I think it should be backported to stable. Q: Should I add a Cc: [email protected] like the references in the kernel’s Documentation/ directory say? A: No. See above answer. In short, if you think it really belongs in stable, then ensure you write a decent commit log that describes who gets impacted by the bug fix and how it manifests itself, and when the bugwas introduced.