Skip to contentSkip to conversation

add a dpdk contributors guide

PATCH New John McNamara 3 participants 14 messages Oct 15, 2015 – Dec 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add a dpdk contributors guide

Add a document to explain the DPDK patch submission and review process.

This is based on the existing information on the http://dpdk.org/dev
webpage, on the Linux kernel patch submission guidelines, and on the existing day to day workflow on the mailing list.

This is a draft so feel free to chime in with additions and corrections.

John McNamara (1):
doc: add contributors guide

 doc/guides/contributing/index.rst   |   1 +
 doc/guides/contributing/patches.rst | 309 ++++++++++++++++++++++++++++++++++++
 2 files changed, 310 insertions(+)
 create mode 100644 doc/guides/contributing/patches.rst

--
1.8.1.4

#1 lore raw

PATCH 1/1 doc: add contributors guide

Add a document to explain the DPDK patch submission and review process.

---
 doc/guides/contributing/index.rst   |   1 +
 doc/guides/contributing/patches.rst | 309 ++++++++++++++++++++++++++++++++++++
 2 files changed, 310 insertions(+)
 create mode 100644 doc/guides/contributing/patches.rst
doc/guides/contributing/index.rst +1 -0
index 561427b..f49ca88 100644
@@ -9,3 +9,4 @@ Contributor's Guidelines
     design
     versioning
     documentation
+    patches
doc/guides/contributing/patches.rst new file +309 -0

309 lines not on this page · raw message

Signature · 1 line
1.8.1.4
#2 lore raw

Re: [PATCH] doc: add contributors guide

Hi John,

2015-10-15 17:51, John McNamara:

Quoted 1 line

Add a document to explain the DPDK patch submission and review process.

Thanks

doc/guides/contributing/patches.rst line 33

Quoted 5 lines
doc/guides/contributing/patches.rst new file +5 -0
+There are also DPDK mailing lists for:
+
+* users: `general usage questions <http://dpdk.org/ml/listinfo/users>`_.
+* announce: `release announcements <http://dpdk.org/ml/listinfo/announce>`_ (also forwarded to the dev list).
+* dts: `test suite reviews and discussions <http://dpdk.org/ml/listinfo/dts>`_.

I think these lists are not relevant for patch submission.

Quoted 1 line

+* test-reports: test reports <http://dpdk.org/ml/listinfo/test-report>_ (from continuous integration testing).

[...]

doc/guides/contributing/patches.rst line 49

Quoted 10 lines
doc/guides/contributing/patches.rst new file +10 -0
+Getting the Source Code
+-----------------------
+
+The source code can be cloned using either of the following::
+
+    git clone git://dpdk.org/dpdk
+
+    git clone http://dpdk.org/git/dpdk
+
+You can also `browse the source code <http://www.dpdk.org/browse/dpdk/tree/>`_ online.

The online browse doesn't help for patch contribution.

[...]

Quoted 1 line

+* If you add new files or directories you should add your name to the ``MAINTAINERS`` file.

yes

doc/guides/contributing/patches.rst line 65

Quoted 5 lines
doc/guides/contributing/patches.rst new file +5 -0
+* If your changes add new external functions then they should be added to the local ``version.map`` file.
+  See the :doc:`Guidelines for ABI policy and versioning </contributing/versioning>`.
+
+* Most changes will require an addition to the release notes in ``doc/guides/rel_notes/``.
+  See the :ref:`Release Notes section of the Documentation Guidelines <doc_guidelines>` for details.

s/Most/Important/ ?

doc/guides/contributing/patches.rst line 68

Quoted 2 lines
doc/guides/contributing/patches.rst new file +2 -0
+* Don’t break compilation between commits with forward dependencies.
+  Each commit should compile on its own to allow for ``git bisect`` and continuous integration testing.

no, please, don't break compilation :)

doc/guides/contributing/patches.rst line 72

Quoted 3 lines
doc/guides/contributing/patches.rst new file +3 -0
+* Add tests to the the ``app/test`` unit test framework where possible.
+
+* Add documentation, if required, in the form of Doxygen comments or a User Guide in RST format.

s/required/relevant/ ?

Quoted 1 line

+The commits should be separated into logical patches in a patchset.

Yes

doc/guides/contributing/patches.rst line 78

Quoted 2 lines
doc/guides/contributing/patches.rst new file +2 -0
+In general commits should be separated based on their directory such as ``lib``, ``drivers``, ``scripts`` although
+some of these, such as ``drivers`` may require finer grained separation.

No. The directory is not so important.
It must be easy to review first.
If changes are not so big and do not require specific explanations, it's better to keep things together in the same patch.
A good way of thinking about patch split is to consider backports:
will it be easy to backport this change with its dependencies? will it be easy to backport this feature/fix without useless bloat?

Quoted 1 line

+The easiest way of determining this is to do a ``git log`` on changed or similar files.

Yes

doc/guides/contributing/patches.rst line 88

Quoted 8 lines
doc/guides/contributing/patches.rst new file +8 -0
+Example of a logical patchset separation::
+
+   [patch 1/6]    ethdev: add support for ieee1588 timestamping
+   [patch 2/6]    e1000: add support for ieee1588 timestamping
+   [patch 3/6]    ixgbe: add support for ieee1588 timestamping
+   [patch 4/6]    i40e: add support for ieee1588 timestamping
+   [patch 5/6]    app/testpmd: refactor ieee1588 forwarding
+   [patch 6/6]    doc: document ieee1588 forwarding mode

The doc must be committed with the API change (ethdev). Splitting driver implementations is useful only if they are really big or require some specific explanations in the commit message.

Quoted 1 line

+* The summary line should be lowercase.

The acronyms can be uppercase.

doc/guides/contributing/patches.rst line 115

Quoted 3 lines
doc/guides/contributing/patches.rst new file +3 -0
+  For example::
+
+     ixgbe: fix bug in xyz

After "fix", the word "bug" is useless.
It's better to briefly explain the impact of the bug, e.g. "fix RSS on 32-bit". So people interested in RSS or 32-bit will look at this fix.

Quoted 1 line

+ ixgbe: add refcount to foo struct

Generally, using the name of a struct, a variable or a file in the title reveals that you don't know how to explain your change simply. The implementation details may be explained in the long message. The title must help to catch the area and the impact of the change.

Quoted 1 line

+If you are submitting a RFC draft of a feature you can use ``[RFC]`` instead of ``[PATCH]``.

A RFC may be incomplete.
It helps to have feedbacks before doing more.

doc/guides/contributing/patches.rst line 134

Quoted 2 lines
doc/guides/contributing/patches.rst new file +2 -0
+* You must provide a body to the commit message after the subject/summary line.
+  Do not leave it blank.

When it is totally obvious, the Signed-off is enough.

doc/guides/contributing/patches.rst line 161

Quoted 4 lines
doc/guides/contributing/patches.rst new file +4 -0
+* When fixing a regression, it is a good idea to reference the id of the commit which introduced the bug.
+  You can generate the required text as follows::
+
+     git log -1 COMMIT_ID --abbrev=12 --format='Fixes: %h ("%s")'

git alias: fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")'

Quoted 1 line

+ Fixes: a4024448efa6 ("i40e: add ieee1588 timestamping")

Yes it will help the backports.

Quoted 1 line

+* When fixing an error or warning it is useful to add the error message or output.

The steps to reproduce the bugs are also required.

doc/guides/contributing/patches.rst line 174

Quoted 4 lines
doc/guides/contributing/patches.rst new file +4 -0
+* ``Reported-by:`` The reporter of the issue.
+* ``Tested-by:`` The tester of the change.
+* ``Reviewed-by:`` The reviewer of the change.
+* ``Suggested-by:`` The person who suggested the change.

Yes, and Acked-by:
When it is commented between 2 versions of the patch, it can be added in the new version if it is still relevant.

Quoted 1 line

+Cover letters are useful for explaining a patchset.

And it helps to have a correct threading of the patches.

doc/guides/contributing/patches.rst line 223

Quoted 2 lines
doc/guides/contributing/patches.rst new file +2 -0
+Version 2 and later of a patchset should also include a short log of the changes so the reviewer knows what has changed.
+This can go either in the cover letter on the annotations.

s/on/or/

doc/guides/contributing/patches.rst line 246

Quoted 5 lines
doc/guides/contributing/patches.rst new file +5 -0
+The kernel guidelines that are tested by ``checkpatch`` don't match the DPDK Coding Style guidelines exactly but
+they provide a good indication of conformance.
+Warnings about not using kernel data types or about split strings can be ignored::
+
+   /path/checkpatch.pl --ignore PREFER_KERNEL_TYPES,SPLIT_STRING -q files*.patch

OK
I plan to suggest a script with more checkpatch configurations.

We should enforce using "make test" before sending.

doc/guides/contributing/patches.rst line 253

Quoted 2 lines
doc/guides/contributing/patches.rst new file +2 -0
+Patches should be sent to the mailing list using ``git send-email``.
+This will require a working and configured ``sendmail`` or similar application.

No, you can configure an external SMTP:
smtpuser = [email protected]
smtpserver = smtp.domain.com
smtpserverport = 465
smtpencryption = ssl

doc/guides/contributing/patches.rst line 263

Quoted 4 lines
doc/guides/contributing/patches.rst new file +4 -0
+If the patches are a change to existing files then you should CC the maintainer(s) of the changed files.
+The appropriate maintainer can be found in the ``MAINTAINERS`` file::
+
+   git send-email --to [email protected] --cc [email protected] 000*.patch

I would say to send --to the maintainers and -cc [email protected]. Some maintainers can have stronger filter if their name is in the "To" field.

doc/guides/contributing/patches.rst line 269

Quoted 3 lines
doc/guides/contributing/patches.rst new file +3 -0
+If the patch is in relation to a previous email thread you can add it to the same thread using the Message ID::
+
+   git send-email --to [email protected] --in-reply-to <[email protected]> 000*.patch

Yes please.
s/can/should/

Quoted 1 line

+Experienced commiters may send patches directly with ``git send-email`` without the ``git format-patch`` step.

The options --annotate and "confirm = always" are recommended to check before sending.

Quoted 1 line

+The more work you put into the previous steps the easier it will be to get a patch accepted.

Yes :)

Quoted 1 line

+#. Submit the patch.

Check the automatic test reports in the coming hours.

doc/guides/contributing/patches.rst line 298

Quoted 4 lines
doc/guides/contributing/patches.rst new file +3 -0
+#. Wait for review comments. While you are waiting review some other patches.
 
+#. If the patch is deemed suitable for merging by the relevant maintainer(s) or other developers they will ``ack``
+   the patch with an email that includes something like::

We don"t use Reviewed-by a lot.
My understanding is that "Acked-by" doesn't mean it has been fully reviewed and tested. But Reviewed-by is stronger without implying that we think it's the best solution. It's an interpretation. Should it be explained here?

doc/guides/contributing/patches.rst line 307

Quoted 3 lines
doc/guides/contributing/patches.rst new file +3 -0
+#. If the patch isn't deemed suitable based on being out of scope or conflicting with existing functionality
+   it may receive a ``nack``.
+   In this case you will need to make a more convincing technical argument in favor of your patches.

More generally, a patch should not be accepted if there are some comments not addressed by a new version or some strong arguments.

Quoted 1 line

+#. Acked patches will be merged in the next merge window.

Next or current?

#3 lore raw

Re: [PATCH] doc: add contributors guide

Quoted 18 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, October 15, 2015 10:37 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] doc: add contributors guide

Hi John,

2015-10-15 17:51, John McNamara:

Quoted 1 line

Add a document to explain the DPDK patch submission and review process.

Thanks

doc/guides/contributing/patches.rst

Quoted 3 lines
doc/guides/contributing/patches.rst new file +3 -0
+There are also DPDK mailing lists for:
+
+* users: `general usage questions

<http://dpdk.org/ml/listinfo/users>`_.

Quoted 6 lines
Quoted 1 line

+* announce: `release announcements

<http://dpdk.org/ml/listinfo/announce>`_ (also forwarded to the dev list).

Quoted 1 line

+* dts: `test suite reviews and discussions

<http://dpdk.org/ml/listinfo/dts>`_.

I think these lists are not relevant for patch submission.

Hi Thomas,

I've addressed your suggestions and will submit a v2.

I still have some uncertainty around the process for patch split and ack/nack/merge. If you have better suggestions let me know.

John.

#4 lore raw

PATCH v2 1/1 doc: add contributors guide

In reply to John McNamara

Add a document to explain the DPDK patch submission and review process.

---

v2:
* Fixes for mailing list comments.
* Fix for broken link target.

 doc/guides/contributing/documentation.rst |   2 +-
 doc/guides/contributing/index.rst         |   1 +
 doc/guides/contributing/patches.rst       | 327 ++++++++++++++++++++++++++++++
 3 files changed, 329 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/contributing/patches.rst
doc/guides/contributing/documentation.rst +1 -1
index 7c1eb41..0e37f01 100644
@@ -1,4 +1,4 @@
-.. doc_guidelines:
+.. _doc_guidelines:
 
 DPDK Documentation Guidelines
 =============================
doc/guides/contributing/index.rst +1 -0
index 561427b..f49ca88 100644
@@ -9,3 +9,4 @@ Contributor's Guidelines
     design
     versioning
     documentation
+    patches
doc/guides/contributing/patches.rst new file +327 -0

327 lines not on this page · raw message

Signature · 1 line
1.8.1.4
#5 lore raw

PATCH v3 1/1 doc: add contributors guide

In reply to John McNamara

Add a document to explain the DPDK patch submission and review process.

---
v3:
* Add recommendation to test build the shared and combined libraries.

v2:
* Fixes for mailing list comments.
* Fix for broken link target.

 doc/guides/contributing/documentation.rst |   2 +-
 doc/guides/contributing/index.rst         |   1 +
 doc/guides/contributing/patches.rst       | 349 ++++++++++++++++++++++++++++++
 3 files changed, 351 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/contributing/patches.rst
doc/guides/contributing/documentation.rst +1 -1
index 7c1eb41..0e37f01 100644
@@ -1,4 +1,4 @@
-.. doc_guidelines:
+.. _doc_guidelines:
 
 DPDK Documentation Guidelines
 =============================
doc/guides/contributing/index.rst +1 -0
index 561427b..f49ca88 100644
@@ -9,3 +9,4 @@ Contributor's Guidelines
     design
     versioning
     documentation
+    patches
doc/guides/contributing/patches.rst new file +349 -0

349 lines not on this page · raw message

Signature · 1 line
1.8.1.4
Acked-by on v3 1/1
#6 lore raw

Re: [PATCH v3] doc: add contributors guide

Quoted 7 lines

From: dev [mailto:[email protected]] On Behalf Of John McNamara Add a document to explain the DPDK patch submission and review process.

+* New external functions should be added to the local ``version.map`` file.

These should be listed alphabetically, perhaps add a note for that.

doc/guides/contributing/patches.rst line 112

Quoted 2 lines
doc/guides/contributing/patches.rst new file +2 -0
+     config: enable same drivers options for linux and bsd
+     ixgbe: fix rss in 32 bit

BSD and RSS should be uppercase

Quoted 1 line

+send them with ``git send-mail``.

<snip>

Quoted 1 line

+See the `Git send-mail

Typos, should be send-email

+ git alias: fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")'

That line didn't work here - I used the following to set up the alias:
git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h (\"%s\")'"

Doxygen isn't mentioned, when creating a new header file, it should get a new page in the API docs.

After improvements listed above,

#7 lore raw

PATCH v4 1/1 doc: add contributors guide

In reply to John McNamara

Add a document to explain the DPDK patch submission and review process.

---

v4:
* Fixes for mailing list comments.

v3:
* Add recommendation to test build the shared and combined libraries.

v2:
* Fixes for mailing list comments.
* Fix for broken link target.

 doc/guides/contributing/documentation.rst |   2 +-
 doc/guides/contributing/index.rst         |   1 +
 doc/guides/contributing/patches.rst       | 350 ++++++++++++++++++++++++++++++
 3 files changed, 352 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/contributing/patches.rst
doc/guides/contributing/documentation.rst +1 -1
index 7f5f061..c2d0461 100644
@@ -1,4 +1,4 @@
-.. doc_guidelines:
+.. _doc_guidelines:
 
 DPDK Documentation Guidelines
 =============================
doc/guides/contributing/index.rst +1 -0
index 561427b..f49ca88 100644
@@ -9,3 +9,4 @@ Contributor's Guidelines
     design
     versioning
     documentation
+    patches
doc/guides/contributing/patches.rst new file +350 -0

350 lines not on this page · raw message

Signature · 1 line
2.5.0
#8 lore raw

Re: [PATCH v4] doc: add contributors guide

Thanks for this very useful doc, John.

2015-11-20 12:46, John McNamara:

doc/guides/contributing/patches.rst line 70

Quoted 12 lines
doc/guides/contributing/patches.rst new file +12 -0
+* Run ``make install``, ``make examples`` and ``make test`` and build the shared and combined libraries
+  to ensure the changes haven't broken existing code:
+
+  .. code-block:: console
+
+     export RTE_TARGET=x86_64-native-linuxapp-gcc
+
+     make T=$RTE_TARGET install
+     make T=$RTE_TARGET install CONFIG_RTE_BUILD_SHARED_LIB=y \
+                                CONFIG_RTE_BUILD_COMBINE_LIBS=y
+     make T=$RTE_TARGET examples
+     make T=$RTE_TARGET test

These commands are superseded by a new syntax and may be replaced by the use of the script test-build.sh.

doc/guides/contributing/patches.rst line 113

Quoted 4 lines
doc/guides/contributing/patches.rst new file +4 -0
+* Use the imperative of the verb (like instructions to the code base).
+  For example::
+
+     ixgbe: fix compilarion in 32 bit

Typo.
This example is not needed (there is one above).

doc/guides/contributing/patches.rst line 253

Quoted 5 lines
doc/guides/contributing/patches.rst new file +5 -0
+The kernel guidelines tested by ``checkpatch`` don't match the DPDK Coding Style guidelines exactly but
+they provide a good indication of conformance.
+Warnings about kernel data types or about split strings can be ignored::
+
+   /path/checkpatch.pl --ignore PREFER_KERNEL_TYPES,SPLIT_STRING -q files*.patch

The script checkpatches.sh should be used. It includes a list of options to ignore.

doc/guides/contributing/patches.rst line 258

Quoted 4 lines
doc/guides/contributing/patches.rst new file +4 -0
+Ensure that the code compiles with ``gcc`` and ``clang``::
+
+   make T=x86_64-native-linuxapp-gcc   install
+   make T=x86_64-native-linuxapp-clang install

It may be done with
scripts/test-build.sh x86_64-native-linuxapp-gcc x86_64-native-linuxapp-clang
My preferred configs are:

	x86_64-native-linuxapp-gcc+shared+next
	x86_64-native-linuxapp-clang+shared+combined
	i686-native-linuxapp-gcc+combined

And these options are common:
export DPDK_DEP_ZLIB=y
export DPDK_DEP_PCAP=y
export DPDK_DEP_SSL=y

Quoted 12 lines
doc/guides/contributing/patches.rst new file +12 -0
+Confirm that the changes haven't broken any existing code by running ``make install``, ``make examples`` and
+``make test`` and building the shared and combined libraries:
+
+  .. code-block:: console
+
+     export RTE_TARGET=x86_64-native-linuxapp-gcc
+
+     make T=$RTE_TARGET install
+     make T=$RTE_TARGET install CONFIG_RTE_BUILD_SHARED_LIB=y \
+                                CONFIG_RTE_BUILD_COMBINE_LIBS=y
+     make T=$RTE_TARGET examples
+     make T=$RTE_TARGET test
#9 lore raw

Re: [PATCH v4] doc: add contributors guide

Quoted 10 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Sunday, December 13, 2015 10:35 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v4] doc: add contributors guide

Thanks for this very useful doc, John.

2015-11-20 12:46, John McNamara:

Quoted 16 lines

doc/guides/contributing/patches.rst line 70

Quoted 13 lines
doc/guides/contributing/patches.rst new file +13 -0
+* Run ``make install``, ``make examples`` and ``make test`` and build
+the shared and combined libraries
+  to ensure the changes haven't broken existing code:
+
+  .. code-block:: console
+
+     export RTE_TARGET=x86_64-native-linuxapp-gcc
+
+     make T=$RTE_TARGET install
+     make T=$RTE_TARGET install CONFIG_RTE_BUILD_SHARED_LIB=y \
+                                CONFIG_RTE_BUILD_COMBINE_LIBS=y
+     make T=$RTE_TARGET examples
+     make T=$RTE_TARGET test

These commands are superseded by a new syntax and may be replaced by the use of the script test-build.sh.

Hi,

I'll make these, and the other changes. I'll put the checkpatch and build testing in their own sections since they are referred to from more than one place and it will probably be useful to link to them directly.

John.

#10 lore raw

PATCH v2 1/1 doc: add contributors guide

In reply to John McNamara

Add a document to explain the DPDK patch submission and review process.

---

v2:
* Added references to new checkpatches.sh and test-build.sh scripts as per Thomas' suggestion on the mailing list.

 doc/guides/contributing/documentation.rst |   2 +-
 doc/guides/contributing/index.rst         |   1 +
 doc/guides/contributing/patches.rst       | 389 ++++++++++++++++++++++++++++++
 3 files changed, 391 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/contributing/patches.rst
doc/guides/contributing/documentation.rst +1 -1
index 6dfaaa8..ba5c4de 100644
@@ -1,4 +1,4 @@
-.. doc_guidelines:
+.. _doc_guidelines:
 
 DPDK Documentation Guidelines
 =============================
doc/guides/contributing/index.rst +1 -0
index 561427b..f49ca88 100644
@@ -9,3 +9,4 @@ Contributor's Guidelines
     design
     versioning
     documentation
+    patches
doc/guides/contributing/patches.rst new file +389 -0

389 lines not on this page · raw message

Signature · 1 line
2.5.0
#11 lore raw

Re: [PATCH v2] doc: add contributors guide

Quoted 9 lines

-----Original Message-----
From: Mcnamara, John
Sent: Monday, December 14, 2015 8:33 PM
To: [email protected]
Cc: [email protected]; Mcnamara, John
Subject: [PATCH v2] doc: add contributors guide

Quoted 5 lines

Add a document to explain the DPDK patch submission and review process.

---

Self nack. Wrong version number and annotations.

#12 lore raw

PATCH v5 1/1 doc: add contributors guide

In reply to John McNamara

Add a document to explain the DPDK patch submission and review process.

---

v5:
* Added references to new checkpatches.sh and test-build.sh scripts as per Thomas' suggestion on the mailing list.

v4:
* Fixes for mailing list comments.

v3:
* Add recommendation to test build the shared and combined libraries.

v2:
* Fixes for mailing list comments.
* Fix for broken link target.

 doc/guides/contributing/documentation.rst |   2 +-
 doc/guides/contributing/index.rst         |   1 +
 doc/guides/contributing/patches.rst       | 389 ++++++++++++++++++++++++++++++
 3 files changed, 391 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/contributing/patches.rst
doc/guides/contributing/documentation.rst +1 -1
index 6dfaaa8..ba5c4de 100644
@@ -1,4 +1,4 @@
-.. doc_guidelines:
+.. _doc_guidelines:
 
 DPDK Documentation Guidelines
 =============================
doc/guides/contributing/index.rst +1 -0
index 561427b..f49ca88 100644
@@ -9,3 +9,4 @@ Contributor's Guidelines
     design
     versioning
     documentation
+    patches
doc/guides/contributing/patches.rst new file +389 -0

389 lines not on this page · raw message

Signature · 1 line
2.5.0