xref: /dpdk/doc/guides/contributing/patches.rst (revision 3a99ac9d62b40d33e71ea95c7a5e30cbb1d551f4)
158abf6e7SJohn McNamara.. submitting_patches:
258abf6e7SJohn McNamara
358abf6e7SJohn McNamaraContributing Code to DPDK
458abf6e7SJohn McNamara=========================
558abf6e7SJohn McNamara
658abf6e7SJohn McNamaraThis document outlines the guidelines for submitting code to DPDK.
758abf6e7SJohn McNamara
858abf6e7SJohn McNamaraThe DPDK development process is modelled (loosely) on the Linux Kernel development model so it is worth reading the
958abf6e7SJohn McNamaraLinux kernel guide on submitting patches:
10f2b99889SYongseok Koh`How to Get Your Change Into the Linux Kernel <https://www.kernel.org/doc/html/latest/process/submitting-patches.html>`_.
1158abf6e7SJohn McNamaraThe rationale for many of the DPDK guidelines is explained in greater detail in the kernel guidelines.
1258abf6e7SJohn McNamara
1358abf6e7SJohn McNamara
1458abf6e7SJohn McNamaraThe DPDK Development Process
15f9de0667SJohn McNamara----------------------------
1658abf6e7SJohn McNamara
1758abf6e7SJohn McNamaraThe DPDK development process has the following features:
1858abf6e7SJohn McNamara
1958abf6e7SJohn McNamara* The code is hosted in a public git repository.
2058abf6e7SJohn McNamara* There is a mailing list where developers submit patches.
2158abf6e7SJohn McNamara* There are maintainers for hierarchical components.
2258abf6e7SJohn McNamara* Patches are reviewed publicly on the mailing list.
23579a5c98SFerruh Yigit* Successfully reviewed patches are merged to the repository.
24f9de0667SJohn McNamara* Patches should be sent to the target repository or sub-tree, see below.
25f9de0667SJohn McNamara* All sub-repositories are merged into main repository for ``-rc1`` and ``-rc2`` versions of the release.
26f9de0667SJohn McNamara* After the ``-rc2`` release all patches should target the main repository.
2758abf6e7SJohn McNamara
283d4f7206SJeff ShawThe mailing list for DPDK development is `dev@dpdk.org <http://dpdk.org/ml/archives/dev/>`_.
2958abf6e7SJohn McNamaraContributors will need to `register for the mailing list <http://dpdk.org/ml/listinfo/dev>`_ in order to submit patches.
3028d8abafSDeirdre O'ConnorIt is also worth registering for the DPDK `Patchwork <http://dpdk.org/dev/patchwork/project/dpdk/list/>`_
3158abf6e7SJohn McNamara
3258abf6e7SJohn McNamaraThe development process requires some familiarity with the ``git`` version control system.
3358abf6e7SJohn McNamaraRefer to the `Pro Git Book <http://www.git-scm.com/book/>`_ for further information.
3458abf6e7SJohn McNamara
35a4862c9eSHemant AgrawalSource License
36a4862c9eSHemant Agrawal--------------
37a4862c9eSHemant Agrawal
38a4862c9eSHemant AgrawalThe DPDK uses the Open Source BSD-3-Clause license for the core libraries and
39a4862c9eSHemant Agrawaldrivers. The kernel components are GPL-2.0 licensed. DPDK uses single line
40a4862c9eSHemant Agrawalreference to Unique License Identifiers in source files as defined by the Linux
41a4862c9eSHemant AgrawalFoundation's `SPDX project <http://spdx.org/>`_.
42a4862c9eSHemant Agrawal
43a4862c9eSHemant AgrawalDPDK uses first line of the file to be SPDX tag. In case of *#!* scripts, SPDX
44a4862c9eSHemant Agrawaltag can be placed in 2nd line of the file.
45a4862c9eSHemant Agrawal
46a4862c9eSHemant AgrawalFor example, to label a file as subject to the BSD-3-Clause license,
47a4862c9eSHemant Agrawalthe following text would be used:
48a4862c9eSHemant Agrawal
49a4862c9eSHemant Agrawal``SPDX-License-Identifier: BSD-3-Clause``
50a4862c9eSHemant Agrawal
51a4862c9eSHemant AgrawalTo label a file as dual-licensed with BSD-3-Clause and GPL-2.0 (e.g., for code
52a4862c9eSHemant Agrawalthat is shared between the kernel and userspace), the following text would be
53a4862c9eSHemant Agrawalused:
54a4862c9eSHemant Agrawal
55a4862c9eSHemant Agrawal``SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)``
56a4862c9eSHemant Agrawal
57a4862c9eSHemant AgrawalRefer to ``licenses/README`` for more details.
5858abf6e7SJohn McNamara
59f9de0667SJohn McNamaraMaintainers and Sub-trees
60f9de0667SJohn McNamara-------------------------
61f9de0667SJohn McNamara
62f9de0667SJohn McNamaraThe DPDK maintenance hierarchy is divided into a main repository ``dpdk`` and sub-repositories ``dpdk-next-*``.
63f9de0667SJohn McNamara
64f9de0667SJohn McNamaraThere are maintainers for the trees and for components within the tree.
65f9de0667SJohn McNamara
66f9de0667SJohn McNamaraTrees and maintainers are listed in the ``MAINTAINERS`` file. For example::
67f9de0667SJohn McNamara
68f9de0667SJohn McNamara    Crypto Drivers
69f9de0667SJohn McNamara    --------------
70f9de0667SJohn McNamara    M: Some Name <some.name@email.com>
71f9de0667SJohn McNamara    B: Another Name <another.name@email.com>
72f9de0667SJohn McNamara    T: git://dpdk.org/next/dpdk-next-crypto
73f9de0667SJohn McNamara
74f9de0667SJohn McNamara    Intel AES-NI GCM PMD
75f9de0667SJohn McNamara    M: Some One <some.one@email.com>
76f9de0667SJohn McNamara    F: drivers/crypto/aesni_gcm/
77f9de0667SJohn McNamara    F: doc/guides/cryptodevs/aesni_gcm.rst
78f9de0667SJohn McNamara
79f9de0667SJohn McNamaraWhere:
80f9de0667SJohn McNamara
81f9de0667SJohn McNamara* ``M`` is a tree or component maintainer.
82f9de0667SJohn McNamara* ``B`` is a tree backup maintainer.
83f9de0667SJohn McNamara* ``T`` is a repository tree.
84f9de0667SJohn McNamara* ``F`` is a maintained file or directory.
85f9de0667SJohn McNamara
86f9de0667SJohn McNamaraAdditional details are given in the ``MAINTAINERS`` file.
87f9de0667SJohn McNamara
88f9de0667SJohn McNamaraThe role of the component maintainers is to:
89f9de0667SJohn McNamara
90f9de0667SJohn McNamara* Review patches for the component or delegate the review.
91f9de0667SJohn McNamara  The review should be done, ideally, within 1 week of submission to the mailing list.
92f9de0667SJohn McNamara* Add an ``acked-by`` to patches, or patchsets, that are ready for committing to a tree.
93acd6dc98SThomas Monjalon* Reply to questions asked about the component.
94f9de0667SJohn McNamara
95f9de0667SJohn McNamaraComponent maintainers can be added or removed by submitting a patch to the ``MAINTAINERS`` file.
96f9de0667SJohn McNamaraMaintainers should have demonstrated a reasonable level of contributions or reviews to the component area.
97f9de0667SJohn McNamaraThe maintainer should be confirmed by an ``ack`` from an established contributor.
98f9de0667SJohn McNamaraThere can be more than one component maintainer if desired.
99f9de0667SJohn McNamara
100f9de0667SJohn McNamaraThe role of the tree maintainers is to:
101f9de0667SJohn McNamara
102f9de0667SJohn McNamara* Maintain the overall quality of their tree.
103f9de0667SJohn McNamara  This can entail additional review, compilation checks or other tests deemed necessary by the maintainer.
104f9de0667SJohn McNamara* Commit patches that have been reviewed by component maintainers and/or other contributors.
105f9de0667SJohn McNamara  The tree maintainer should determine if patches have been reviewed sufficiently.
106f9de0667SJohn McNamara* Ensure that patches are reviewed in a timely manner.
107f9de0667SJohn McNamara* Prepare the tree for integration.
108f9de0667SJohn McNamara* Ensure that there is a designated back-up maintainer and coordinate a handover for periods where the
109f9de0667SJohn McNamara  tree maintainer can't perform their role.
110f9de0667SJohn McNamara
111f9de0667SJohn McNamaraTree maintainers can be added or removed by submitting a patch to the ``MAINTAINERS`` file.
112f9de0667SJohn McNamaraThe proposer should justify the need for a new sub-tree and should have demonstrated a sufficient level of contributions in the area or to a similar area.
113f9de0667SJohn McNamaraThe maintainer should be confirmed by an ``ack`` from an existing tree maintainer.
114f9de0667SJohn McNamaraDisagreements on trees or maintainers can be brought to the Technical Board.
115f9de0667SJohn McNamara
116f9de0667SJohn McNamaraThe backup maintainer for the master tree should be selected from the existing sub-tree maintainers from the project.
117f9de0667SJohn McNamaraThe backup maintainer for a sub-tree should be selected from among the component maintainers within that sub-tree.
118f9de0667SJohn McNamara
119f9de0667SJohn McNamara
12058abf6e7SJohn McNamaraGetting the Source Code
12158abf6e7SJohn McNamara-----------------------
12258abf6e7SJohn McNamara
123579a5c98SFerruh YigitThe source code can be cloned using either of the following:
124579a5c98SFerruh Yigit
125579a5c98SFerruh Yigitmain repository::
12658abf6e7SJohn McNamara
12758abf6e7SJohn McNamara    git clone git://dpdk.org/dpdk
12858abf6e7SJohn McNamara    git clone http://dpdk.org/git/dpdk
12958abf6e7SJohn McNamara
130579a5c98SFerruh Yigitsub-repositories (`list <http://dpdk.org/browse/next>`_)::
131579a5c98SFerruh Yigit
132579a5c98SFerruh Yigit    git clone git://dpdk.org/next/dpdk-next-*
133579a5c98SFerruh Yigit    git clone http://dpdk.org/git/next/dpdk-next-*
13458abf6e7SJohn McNamara
13558abf6e7SJohn McNamaraMake your Changes
13658abf6e7SJohn McNamara-----------------
13758abf6e7SJohn McNamara
13858abf6e7SJohn McNamaraMake your planned changes in the cloned ``dpdk`` repo. Here are some guidelines and requirements:
13958abf6e7SJohn McNamara
14058abf6e7SJohn McNamara* Follow the :ref:`coding_style` guidelines.
14158abf6e7SJohn McNamara
14258abf6e7SJohn McNamara* If you add new files or directories you should add your name to the ``MAINTAINERS`` file.
14358abf6e7SJohn McNamara
14458abf6e7SJohn McNamara* New external functions should be added to the local ``version.map`` file.
14558abf6e7SJohn McNamara  See the :doc:`Guidelines for ABI policy and versioning </contributing/versioning>`.
14658abf6e7SJohn McNamara  New external functions should also be added in alphabetical order.
14758abf6e7SJohn McNamara
14858abf6e7SJohn McNamara* Important changes will require an addition to the release notes in ``doc/guides/rel_notes/``.
14958abf6e7SJohn McNamara  See the :ref:`Release Notes section of the Documentation Guidelines <doc_guidelines>` for details.
15058abf6e7SJohn McNamara
15158abf6e7SJohn McNamara* Test the compilation works with different targets, compilers and options, see :ref:`contrib_check_compilation`.
15258abf6e7SJohn McNamara
15358abf6e7SJohn McNamara* Don't break compilation between commits with forward dependencies in a patchset.
15458abf6e7SJohn McNamara  Each commit should compile on its own to allow for ``git bisect`` and continuous integration testing.
15558abf6e7SJohn McNamara
1568f87ba70SThierry Herbelot* Add tests to the ``app/test`` unit test framework where possible.
15758abf6e7SJohn McNamara
15858abf6e7SJohn McNamara* Add documentation, if relevant, in the form of Doxygen comments or a User Guide in RST format.
15958abf6e7SJohn McNamara  See the :ref:`Documentation Guidelines <doc_guidelines>`.
16058abf6e7SJohn McNamara
16158abf6e7SJohn McNamaraOnce the changes have been made you should commit them to your local repo.
16258abf6e7SJohn McNamara
16358abf6e7SJohn McNamaraFor small changes, that do not require specific explanations, it is better to keep things together in the
16458abf6e7SJohn McNamarasame patch.
16558abf6e7SJohn McNamaraLarger changes that require different explanations should be separated into logical patches in a patchset.
16658abf6e7SJohn McNamaraA good way of thinking about whether a patch should be split is to consider whether the change could be
16758abf6e7SJohn McNamaraapplied without dependencies as a backport.
16858abf6e7SJohn McNamara
16958abf6e7SJohn McNamaraAs a guide to how patches should be structured run ``git log`` on similar files.
17058abf6e7SJohn McNamara
17158abf6e7SJohn McNamara
17258abf6e7SJohn McNamaraCommit Messages: Subject Line
17358abf6e7SJohn McNamara-----------------------------
17458abf6e7SJohn McNamara
17558abf6e7SJohn McNamaraThe first, summary, line of the git commit message becomes the subject line of the patch email.
17658abf6e7SJohn McNamaraHere are some guidelines for the summary line:
17758abf6e7SJohn McNamara
17858abf6e7SJohn McNamara* The summary line must capture the area and the impact of the change.
17958abf6e7SJohn McNamara
18058abf6e7SJohn McNamara* The summary line should be around 50 characters.
18158abf6e7SJohn McNamara
18258abf6e7SJohn McNamara* The summary line should be lowercase apart from acronyms.
18358abf6e7SJohn McNamara
18458abf6e7SJohn McNamara* It should be prefixed with the component name (use git log to check existing components).
18558abf6e7SJohn McNamara  For example::
18658abf6e7SJohn McNamara
18758abf6e7SJohn McNamara     ixgbe: fix offload config option name
18858abf6e7SJohn McNamara
18958abf6e7SJohn McNamara     config: increase max queues per port
19058abf6e7SJohn McNamara
19158abf6e7SJohn McNamara* Use the imperative of the verb (like instructions to the code base).
19258abf6e7SJohn McNamara
19358abf6e7SJohn McNamara* Don't add a period/full stop to the subject line or you will end up two in the patch name: ``dpdk_description..patch``.
19458abf6e7SJohn McNamara
19558abf6e7SJohn McNamaraThe actual email subject line should be prefixed by ``[PATCH]`` and the version, if greater than v1,
19658abf6e7SJohn McNamarafor example: ``PATCH v2``.
19758abf6e7SJohn McNamaraThe is generally added by ``git send-email`` or ``git format-patch``, see below.
19858abf6e7SJohn McNamara
19958abf6e7SJohn McNamaraIf you are submitting an RFC draft of a feature you can use ``[RFC]`` instead of ``[PATCH]``.
20058abf6e7SJohn McNamaraAn RFC patch doesn't have to be complete.
20158abf6e7SJohn McNamaraIt is intended as a way of getting early feedback.
20258abf6e7SJohn McNamara
20358abf6e7SJohn McNamara
20458abf6e7SJohn McNamaraCommit Messages: Body
20558abf6e7SJohn McNamara---------------------
20658abf6e7SJohn McNamara
20758abf6e7SJohn McNamaraHere are some guidelines for the body of a commit message:
20858abf6e7SJohn McNamara
20958abf6e7SJohn McNamara* The body of the message should describe the issue being fixed or the feature being added.
21058abf6e7SJohn McNamara  It is important to provide enough information to allow a reviewer to understand the purpose of the patch.
21158abf6e7SJohn McNamara
21258abf6e7SJohn McNamara* When the change is obvious the body can be blank, apart from the signoff.
21358abf6e7SJohn McNamara
21458abf6e7SJohn McNamara* The commit message must end with a ``Signed-off-by:`` line which is added using::
21558abf6e7SJohn McNamara
21658abf6e7SJohn McNamara      git commit --signoff # or -s
21758abf6e7SJohn McNamara
21858abf6e7SJohn McNamara  The purpose of the signoff is explained in the
219f2b99889SYongseok Koh  `Developer's Certificate of Origin <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1>`_
22058abf6e7SJohn McNamara  section of the Linux kernel guidelines.
22158abf6e7SJohn McNamara
22258abf6e7SJohn McNamara  .. Note::
22358abf6e7SJohn McNamara
22458abf6e7SJohn McNamara     All developers must ensure that they have read and understood the
22558abf6e7SJohn McNamara     Developer's Certificate of Origin section of the documentation prior
22658abf6e7SJohn McNamara     to applying the signoff and submitting a patch.
22758abf6e7SJohn McNamara
22858abf6e7SJohn McNamara* The signoff must be a real name and not an alias or nickname.
22958abf6e7SJohn McNamara  More than one signoff is allowed.
23058abf6e7SJohn McNamara
23158abf6e7SJohn McNamara* The text of the commit message should be wrapped at 72 characters.
23258abf6e7SJohn McNamara
233f9ef083cSHarry van Haaren* When fixing a regression, it is required to reference the id of the commit
234f9ef083cSHarry van Haaren  which introduced the bug, and put the original author of that commit on CC.
235f9ef083cSHarry van Haaren  You can generate the required lines using the following git alias, which prints
236f9ef083cSHarry van Haaren  the commit SHA and the author of the original code::
23758abf6e7SJohn McNamara
238f9ef083cSHarry van Haaren     git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'"
23958abf6e7SJohn McNamara
240f9ef083cSHarry van Haaren  The output of ``git fixline <SHA>`` must then be added to the commit message::
24158abf6e7SJohn McNamara
242f9ef083cSHarry van Haaren     doc: fix some parameter description
24358abf6e7SJohn McNamara
244f9ef083cSHarry van Haaren     Update the docs, fixing description of some parameter.
24558abf6e7SJohn McNamara
246f9ef083cSHarry van Haaren     Fixes: abcdefgh1234 ("doc: add some parameter")
247f9ef083cSHarry van Haaren     Cc: author@example.com
24858abf6e7SJohn McNamara
24958abf6e7SJohn McNamara     Signed-off-by: Alex Smith <alex.smith@example.com>
25058abf6e7SJohn McNamara
25158abf6e7SJohn McNamara* When fixing an error or warning it is useful to add the error message and instructions on how to reproduce it.
25258abf6e7SJohn McNamara
25358abf6e7SJohn McNamara* Use correct capitalization, punctuation and spelling.
25458abf6e7SJohn McNamara
2554aeedc25SHarry van HaarenIn addition to the ``Signed-off-by:`` name the commit messages can also have
2564aeedc25SHarry van Haarentags for who reported, suggested, tested and reviewed the patch being
2574aeedc25SHarry van Haarenposted. Please refer to the `Tested, Acked and Reviewed by`_ section.
25858abf6e7SJohn McNamara
25958abf6e7SJohn McNamara
26058abf6e7SJohn McNamaraCreating Patches
26158abf6e7SJohn McNamara----------------
26258abf6e7SJohn McNamara
26358abf6e7SJohn McNamaraIt is possible to send patches directly from git but for new contributors it is recommended to generate the
26458abf6e7SJohn McNamarapatches with ``git format-patch`` and then when everything looks okay, and the patches have been checked, to
26558abf6e7SJohn McNamarasend them with ``git send-email``.
26658abf6e7SJohn McNamara
26758abf6e7SJohn McNamaraHere are some examples of using ``git format-patch`` to generate patches:
26858abf6e7SJohn McNamara
26958abf6e7SJohn McNamara.. code-block:: console
27058abf6e7SJohn McNamara
27158abf6e7SJohn McNamara   # Generate a patch from the last commit.
27258abf6e7SJohn McNamara   git format-patch -1
27358abf6e7SJohn McNamara
27458abf6e7SJohn McNamara   # Generate a patch from the last 3 commits.
27558abf6e7SJohn McNamara   git format-patch -3
27658abf6e7SJohn McNamara
27758abf6e7SJohn McNamara   # Generate the patches in a directory.
27858abf6e7SJohn McNamara   git format-patch -3 -o ~/patch/
27958abf6e7SJohn McNamara
28058abf6e7SJohn McNamara   # Add a cover letter to explain a patchset.
28158abf6e7SJohn McNamara   git format-patch -3 -o ~/patch/ --cover-letter
28258abf6e7SJohn McNamara
28358abf6e7SJohn McNamara   # Add a prefix with a version number.
28458abf6e7SJohn McNamara   git format-patch -3 -o ~/patch/ -v 2
28558abf6e7SJohn McNamara
28658abf6e7SJohn McNamara
28758abf6e7SJohn McNamaraCover letters are useful for explaining a patchset and help to generate a logical threading to the patches.
28858abf6e7SJohn McNamaraSmaller notes can be put inline in the patch after the ``---`` separator, for example::
28958abf6e7SJohn McNamara
29058abf6e7SJohn McNamara   Subject: [PATCH] fm10k/base: add FM10420 device ids
29158abf6e7SJohn McNamara
29258abf6e7SJohn McNamara   Add the device ID for Boulder Rapids and Atwood Channel to enable
29358abf6e7SJohn McNamara   drivers to support those devices.
29458abf6e7SJohn McNamara
29558abf6e7SJohn McNamara   Signed-off-by: Alex Smith <alex.smith@example.com>
29658abf6e7SJohn McNamara   ---
29758abf6e7SJohn McNamara
29858abf6e7SJohn McNamara   ADD NOTES HERE.
29958abf6e7SJohn McNamara
30058abf6e7SJohn McNamara    drivers/net/fm10k/base/fm10k_api.c  | 6 ++++++
30158abf6e7SJohn McNamara    drivers/net/fm10k/base/fm10k_type.h | 6 ++++++
30258abf6e7SJohn McNamara    2 files changed, 12 insertions(+)
30358abf6e7SJohn McNamara   ...
30458abf6e7SJohn McNamara
30558abf6e7SJohn McNamaraVersion 2 and later of a patchset should also include a short log of the changes so the reviewer knows what has changed.
30658abf6e7SJohn McNamaraThis can be added to the cover letter or the annotations.
30758abf6e7SJohn McNamaraFor example::
30858abf6e7SJohn McNamara
30958abf6e7SJohn McNamara   ---
31058abf6e7SJohn McNamara   v3:
31158abf6e7SJohn McNamara   * Fixed issued with version.map.
31258abf6e7SJohn McNamara
31358abf6e7SJohn McNamara   v2:
31458abf6e7SJohn McNamara   * Added i40e support.
31558abf6e7SJohn McNamara   * Renamed ethdev functions from rte_eth_ieee15888_*() to rte_eth_timesync_*()
31658abf6e7SJohn McNamara     since 802.1AS can be supported through the same interfaces.
31758abf6e7SJohn McNamara
31858abf6e7SJohn McNamara
31958abf6e7SJohn McNamara.. _contrib_checkpatch:
32058abf6e7SJohn McNamara
32158abf6e7SJohn McNamaraChecking the Patches
32258abf6e7SJohn McNamara--------------------
32358abf6e7SJohn McNamara
3249a98f50eSThomas MonjalonPatches should be checked for formatting and syntax issues using the ``checkpatches.sh`` script in the ``devtools``
32558abf6e7SJohn McNamaradirectory of the DPDK repo.
32658abf6e7SJohn McNamaraThis uses the Linux kernel development tool ``checkpatch.pl`` which  can be obtained by cloning, and periodically,
32758abf6e7SJohn McNamaraupdating the Linux kernel sources.
32858abf6e7SJohn McNamara
32958abf6e7SJohn McNamaraThe path to the original Linux script must be set in the environment variable ``DPDK_CHECKPATCH_PATH``.
33058abf6e7SJohn McNamaraThis, and any other configuration variables required by the development tools, are loaded from the following
33158abf6e7SJohn McNamarafiles, in order of preference::
33258abf6e7SJohn McNamara
33358abf6e7SJohn McNamara   .develconfig
33458abf6e7SJohn McNamara   ~/.config/dpdk/devel.config
33558abf6e7SJohn McNamara   /etc/dpdk/devel.config.
33658abf6e7SJohn McNamara
33758abf6e7SJohn McNamaraOnce the environment variable the script can be run as follows::
33858abf6e7SJohn McNamara
3399a98f50eSThomas Monjalon   devtools/checkpatches.sh ~/patch/
34058abf6e7SJohn McNamara
34158abf6e7SJohn McNamaraThe script usage is::
34258abf6e7SJohn McNamara
34358abf6e7SJohn McNamara   checkpatches.sh [-h] [-q] [-v] [patch1 [patch2] ...]]"
34458abf6e7SJohn McNamara
34558abf6e7SJohn McNamaraWhere:
34658abf6e7SJohn McNamara
34758abf6e7SJohn McNamara* ``-h``: help, usage.
34858abf6e7SJohn McNamara* ``-q``: quiet. Don't output anything for files without issues.
34958abf6e7SJohn McNamara* ``-v``: verbose.
35058abf6e7SJohn McNamara* ``patchX``: path to one or more patches.
35158abf6e7SJohn McNamara
352edbeb7d9SThomas MonjalonThen the git logs should be checked using the ``check-git-log.sh`` script.
353edbeb7d9SThomas Monjalon
354edbeb7d9SThomas MonjalonThe script usage is::
355edbeb7d9SThomas Monjalon
356edbeb7d9SThomas Monjalon   check-git-log.sh [range]
357edbeb7d9SThomas Monjalon
358edbeb7d9SThomas MonjalonWhere the range is a ``git log`` option.
359edbeb7d9SThomas Monjalon
36058abf6e7SJohn McNamara
36158abf6e7SJohn McNamara.. _contrib_check_compilation:
36258abf6e7SJohn McNamara
36358abf6e7SJohn McNamaraChecking Compilation
36458abf6e7SJohn McNamara--------------------
36558abf6e7SJohn McNamara
3668f87ba70SThierry HerbelotCompilation of patches and changes should be tested using the ``test-build.sh`` script in the ``devtools``
36758abf6e7SJohn McNamaradirectory of the DPDK repo::
36858abf6e7SJohn McNamara
3699a98f50eSThomas Monjalon  devtools/test-build.sh x86_64-native-linuxapp-gcc+next+shared
37058abf6e7SJohn McNamara
37158abf6e7SJohn McNamaraThe script usage is::
37258abf6e7SJohn McNamara
37358abf6e7SJohn McNamara   test-build.sh [-h] [-jX] [-s] [config1 [config2] ...]]
37458abf6e7SJohn McNamara
37558abf6e7SJohn McNamaraWhere:
37658abf6e7SJohn McNamara
37758abf6e7SJohn McNamara* ``-h``: help, usage.
37858abf6e7SJohn McNamara* ``-jX``: use X parallel jobs in "make".
37958abf6e7SJohn McNamara* ``-s``: short test with only first config and without examples/doc.
38058abf6e7SJohn McNamara* ``config``: default config name plus config switches delimited with a ``+`` sign.
38158abf6e7SJohn McNamara
38258abf6e7SJohn McNamaraExamples of configs are::
38358abf6e7SJohn McNamara
38458abf6e7SJohn McNamara   x86_64-native-linuxapp-gcc
385948fd64bSPanu Matilainen   x86_64-native-linuxapp-gcc+next+shared
386948fd64bSPanu Matilainen   x86_64-native-linuxapp-clang+shared
38758abf6e7SJohn McNamara
3881e46fadeSCian FerriterThe builds can be modified via the following environmental variables:
38958abf6e7SJohn McNamara
39058abf6e7SJohn McNamara* ``DPDK_BUILD_TEST_CONFIGS`` (target1+option1+option2 target2)
39158abf6e7SJohn McNamara* ``DPDK_DEP_CFLAGS``
39258abf6e7SJohn McNamara* ``DPDK_DEP_LDFLAGS``
39358abf6e7SJohn McNamara* ``DPDK_DEP_PCAP`` (y/[n])
39458abf6e7SJohn McNamara* ``DPDK_NOTIFY`` (notify-send)
39558abf6e7SJohn McNamara
39658abf6e7SJohn McNamaraThese can be set from the command line or in the config files shown above in the :ref:`contrib_checkpatch`.
39758abf6e7SJohn McNamara
39858abf6e7SJohn McNamaraThe recommended configurations and options to test compilation prior to submitting patches are::
39958abf6e7SJohn McNamara
40058abf6e7SJohn McNamara   x86_64-native-linuxapp-gcc+shared+next
401948fd64bSPanu Matilainen   x86_64-native-linuxapp-clang+shared
402948fd64bSPanu Matilainen   i686-native-linuxapp-gcc
40358abf6e7SJohn McNamara
40458abf6e7SJohn McNamara   export DPDK_DEP_ZLIB=y
40558abf6e7SJohn McNamara   export DPDK_DEP_PCAP=y
40658abf6e7SJohn McNamara   export DPDK_DEP_SSL=y
40758abf6e7SJohn McNamara
40858abf6e7SJohn McNamara
40958abf6e7SJohn McNamaraSending Patches
41058abf6e7SJohn McNamara---------------
41158abf6e7SJohn McNamara
41258abf6e7SJohn McNamaraPatches should be sent to the mailing list using ``git send-email``.
41358abf6e7SJohn McNamaraYou can configure an external SMTP with something like the following::
41458abf6e7SJohn McNamara
41558abf6e7SJohn McNamara   [sendemail]
41658abf6e7SJohn McNamara       smtpuser = name@domain.com
41758abf6e7SJohn McNamara       smtpserver = smtp.domain.com
41858abf6e7SJohn McNamara       smtpserverport = 465
41958abf6e7SJohn McNamara       smtpencryption = ssl
42058abf6e7SJohn McNamara
42158abf6e7SJohn McNamaraSee the `Git send-email <https://git-scm.com/docs/git-send-email>`_ documentation for more details.
42258abf6e7SJohn McNamara
42358abf6e7SJohn McNamaraThe patches should be sent to ``dev@dpdk.org``.
42458abf6e7SJohn McNamaraIf the patches are a change to existing files then you should send them TO the maintainer(s) and CC ``dev@dpdk.org``.
42558abf6e7SJohn McNamaraThe appropriate maintainer can be found in the ``MAINTAINERS`` file::
42658abf6e7SJohn McNamara
42758abf6e7SJohn McNamara   git send-email --to maintainer@some.org --cc dev@dpdk.org 000*.patch
42858abf6e7SJohn McNamara
4297a629106SFerruh YigitScript ``get-maintainer.sh`` can be used to select maintainers automatically::
4307a629106SFerruh Yigit
4317a629106SFerruh Yigit  git send-email --to-cmd ./devtools/get-maintainer.sh --cc dev@dpdk.org 000*.patch
4327a629106SFerruh Yigit
43358abf6e7SJohn McNamaraNew additions can be sent without a maintainer::
43458abf6e7SJohn McNamara
43558abf6e7SJohn McNamara   git send-email --to dev@dpdk.org 000*.patch
43658abf6e7SJohn McNamara
43758abf6e7SJohn McNamaraYou can test the emails by sending it to yourself or with the ``--dry-run`` option.
43858abf6e7SJohn McNamara
43958abf6e7SJohn McNamaraIf the patch is in relation to a previous email thread you can add it to the same thread using the Message ID::
44058abf6e7SJohn McNamara
44158abf6e7SJohn McNamara   git send-email --to dev@dpdk.org --in-reply-to <1234-foo@bar.com> 000*.patch
44258abf6e7SJohn McNamara
44358abf6e7SJohn McNamaraThe Message ID can be found in the raw text of emails or at the top of each Patchwork patch,
44458abf6e7SJohn McNamara`for example <http://dpdk.org/dev/patchwork/patch/7646/>`_.
44558abf6e7SJohn McNamaraShallow threading (``--thread --no-chain-reply-to``) is preferred for a patch series.
44658abf6e7SJohn McNamara
44758abf6e7SJohn McNamaraOnce submitted your patches will appear on the mailing list and in Patchwork.
44858abf6e7SJohn McNamara
44958abf6e7SJohn McNamaraExperienced committers may send patches directly with ``git send-email`` without the ``git format-patch`` step.
45058abf6e7SJohn McNamaraThe options ``--annotate`` and ``confirm = always`` are recommended for checking patches before sending.
45158abf6e7SJohn McNamara
45258abf6e7SJohn McNamara
45358abf6e7SJohn McNamaraThe Review Process
45458abf6e7SJohn McNamara------------------
45558abf6e7SJohn McNamara
4564aeedc25SHarry van HaarenPatches are reviewed by the community, relying on the experience and
4574aeedc25SHarry van Haarencollaboration of the members to double-check each other's work. There are a
4584aeedc25SHarry van Haarennumber of ways to indicate that you have checked a patch on the mailing list.
45958abf6e7SJohn McNamara
4604aeedc25SHarry van Haaren
4614aeedc25SHarry van HaarenTested, Acked and Reviewed by
4624aeedc25SHarry van Haaren~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4634aeedc25SHarry van Haaren
4644aeedc25SHarry van HaarenTo indicate that you have interacted with a patch on the mailing list you
4654aeedc25SHarry van Haarenshould respond to the patch in an email with one of the following tags:
4664aeedc25SHarry van Haaren
4674aeedc25SHarry van Haaren * Reviewed-by:
4684aeedc25SHarry van Haaren * Acked-by:
4694aeedc25SHarry van Haaren * Tested-by:
4704aeedc25SHarry van Haaren * Reported-by:
4714aeedc25SHarry van Haaren * Suggested-by:
4724aeedc25SHarry van Haaren
4734aeedc25SHarry van HaarenThe tag should be on a separate line as follows::
4744aeedc25SHarry van Haaren
4754aeedc25SHarry van Haaren   tag-here: Name Surname <email@address.com>
4764aeedc25SHarry van Haaren
4774aeedc25SHarry van HaarenEach of these tags has a specific meaning. In general, the DPDK community
4784aeedc25SHarry van Haarenfollows the kernel usage of the tags. A short summary of the meanings of each
4794aeedc25SHarry van Haarentag is given here for reference:
4804aeedc25SHarry van Haaren
4814aeedc25SHarry van Haaren.. _statement: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#reviewer-s-statement-of-oversight
4824aeedc25SHarry van Haaren
4834aeedc25SHarry van Haaren``Reviewed-by:`` is a strong statement_ that the patch is an appropriate state
4844aeedc25SHarry van Haarenfor merging without any remaining serious technical issues. Reviews from
4854aeedc25SHarry van Haarencommunity members who are known to understand the subject area and to perform
4864aeedc25SHarry van Haarenthorough reviews will increase the likelihood of the patch getting merged.
4874aeedc25SHarry van Haaren
4884aeedc25SHarry van Haaren``Acked-by:`` is a record that the person named was not directly involved in
4894aeedc25SHarry van Haarenthe preparation of the patch but wishes to signify and record their acceptance
4904aeedc25SHarry van Haarenand approval of it.
4914aeedc25SHarry van Haaren
4924aeedc25SHarry van Haaren``Tested-by:`` indicates that the patch has been successfully tested (in some
4934aeedc25SHarry van Haarenenvironment) by the person named.
4944aeedc25SHarry van Haaren
4954aeedc25SHarry van Haaren``Reported-by:`` is used to acknowledge person who found or reported the bug.
4964aeedc25SHarry van Haaren
4974aeedc25SHarry van Haaren``Suggested-by:`` indicates that the patch idea was suggested by the named
4984aeedc25SHarry van Haarenperson.
4994aeedc25SHarry van Haaren
5004aeedc25SHarry van Haaren
5014aeedc25SHarry van Haaren
5024aeedc25SHarry van HaarenSteps to getting your patch merged
5034aeedc25SHarry van Haaren~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5044aeedc25SHarry van Haaren
5054aeedc25SHarry van HaarenThe more work you put into the previous steps the easier it will be to get a
5064aeedc25SHarry van Haarenpatch accepted. The general cycle for patch review and acceptance is:
50758abf6e7SJohn McNamara
50858abf6e7SJohn McNamara#. Submit the patch.
50958abf6e7SJohn McNamara
51058abf6e7SJohn McNamara#. Check the automatic test reports in the coming hours.
51158abf6e7SJohn McNamara
51258abf6e7SJohn McNamara#. Wait for review comments. While you are waiting review some other patches.
51358abf6e7SJohn McNamara
51458abf6e7SJohn McNamara#. Fix the review comments and submit a ``v n+1`` patchset::
51558abf6e7SJohn McNamara
51658abf6e7SJohn McNamara      git format-patch -3 -v 2
51758abf6e7SJohn McNamara
51858abf6e7SJohn McNamara#. Update Patchwork to mark your previous patches as "Superseded".
51958abf6e7SJohn McNamara
52058abf6e7SJohn McNamara#. If the patch is deemed suitable for merging by the relevant maintainer(s) or other developers they will ``ack``
52158abf6e7SJohn McNamara   the patch with an email that includes something like::
52258abf6e7SJohn McNamara
52358abf6e7SJohn McNamara      Acked-by: Alex Smith <alex.smith@example.com>
52458abf6e7SJohn McNamara
52558abf6e7SJohn McNamara   **Note**: When acking patches please remove as much of the text of the patch email as possible.
52658abf6e7SJohn McNamara   It is generally best to delete everything after the ``Signed-off-by:`` line.
52758abf6e7SJohn McNamara
52858abf6e7SJohn McNamara#. Having the patch ``Reviewed-by:`` and/or ``Tested-by:`` will also help the patch to be accepted.
52958abf6e7SJohn McNamara
53058abf6e7SJohn McNamara#. If the patch isn't deemed suitable based on being out of scope or conflicting with existing functionality
53158abf6e7SJohn McNamara   it may receive a ``nack``.
53258abf6e7SJohn McNamara   In this case you will need to make a more convincing technical argument in favor of your patches.
53358abf6e7SJohn McNamara
53458abf6e7SJohn McNamara#. In addition a patch will not be accepted if it doesn't address comments from a previous version with fixes or
53558abf6e7SJohn McNamara   valid arguments.
53658abf6e7SJohn McNamara
5377968191bSBruce Richardson#. It is the responsibility of a maintainer to ensure that patches are reviewed and to provide an ``ack`` or
5387968191bSBruce Richardson   ``nack`` of those patches as appropriate.
5397968191bSBruce Richardson
5407968191bSBruce Richardson#. Once a patch has been acked by the relevant maintainer, reviewers may still comment on it for a further
5417968191bSBruce Richardson   two weeks. After that time, the patch should be merged into the relevant git tree for the next release.
5427968191bSBruce Richardson   Additional notes and restrictions:
5437968191bSBruce Richardson
5447968191bSBruce Richardson   * Patches should be acked by a maintainer at least two days before the release merge
5457968191bSBruce Richardson     deadline, in order to make that release.
5467968191bSBruce Richardson   * For patches acked with less than two weeks to go to the merge deadline, all additional
5477968191bSBruce Richardson     comments should be made no later than two days before the merge deadline.
5487968191bSBruce Richardson   * After the appropriate time for additional feedback has passed, if the patch has not yet
5497968191bSBruce Richardson     been merged to the relevant tree by the committer, it should be treated as though it had,
5507968191bSBruce Richardson     in that any additional changes needed to it must be addressed by a follow-on patch, rather
5517968191bSBruce Richardson     than rework of the original.
5527968191bSBruce Richardson   * Trivial patches may be merged sooner than described above at the tree committer's
5537968191bSBruce Richardson     discretion.
554*3a99ac9dSCiara Power
555*3a99ac9dSCiara PowerDPDK Maintainers
556*3a99ac9dSCiara Power----------------
557*3a99ac9dSCiara Power
558*3a99ac9dSCiara PowerThe following are the DPDK maintainers as listed in the ``MAINTAINERS`` file
559*3a99ac9dSCiara Powerin the DPDK root directory.
560*3a99ac9dSCiara Power
561*3a99ac9dSCiara Power.. literalinclude:: ../../../MAINTAINERS
562*3a99ac9dSCiara Power   :lines: 3-
563