Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Tom Barbette

Le 25/05/2020 à 22:34, Thomas Monjalon a écrit :

25/05/2020 20:44, Morten Brørup:

From: Thomas Monjalon

25/05/2020 18:09, Burakov, Anatoly:

obviously, but i have a suspicion that we'll get more of it if we

lower

the barrier for entry (not the barrier for merge!). I think there is

a

way to lower the secondary skill level needed to contribute to DPDK
without lowering coding/merge standards with it.


That is exactly what I am asking for: Lowering the barrier and increasing the 
feeling of success for newcomers. (The barrier for merge is probably fine; I'll 
leave that discussion to the maintainers.)


I understand.



About the barrier for entry, maybe it is not obvious because I don't
communicate a lot about it, but please be aware that I (and other
maintainers I think) are doing a lot of changes in newcomer patches
to avoid asking them knowing the whole process from the beginning.
Then frequent contributors get educated on the way.


Great! I wish that every developer would think and behave this way.



I think the only real barrier we have is to sign the patch
with a real name and send an email to right list.
The ask for SoB real name is probably what started this thread
in Morten's mind. And the SoB requirement will *never* change.


The incorrect Signed-off-by might be the only hard barrier (which we cannot 
avoid). But that did not trigger me.

I was raising the discussion to bring attention to soft barriers for 
contributors. What triggered me was the request to split the patch into 
multiple patches; a kind of feedback I have seen before. For an experienced git 
user, this is probably very easy, but for a git newbie (like myself), it 
basically means starting all over and trying to figure out the right set of git 
commands to do this, which can be perceived as a difficult task requiring a lot 
of effort.


Yes I am aware about this difficulty.
It is basically knowing git-reset and git-add -p.
I agree a cookbook for this kind of thing is required.

I would like to do the split for newcomers,
but we need also to validate the explanations of each commit.
A solution in such case is to send the split so the newbie can just
fill what is missing.
This kind of workflow is really what we should look at improving.



Perhaps we could supplement the Contributor Guidelines with a set of cookbooks 
for different steps in the contribution process, so reviewers can be refer 
newcomers to the relevant of these as part of the feedback. Just like any 
professional customer support team has a set of canned answers ready for common 
customer issues. (Please note: I am not suggesting adding an AI/ML chat bot 
reviewer to the mailing list!)


OK



The amount of Contributor Guideline documentation is also a balance... it must 
be long enough to contain the relevant information to get going, but short 
enough for newcomers to bother reading it.


Yes, we need short intros and long explanations when really needed.
It is touching another issue: we lack some documentation love.





Maybe we could find something that allows to "git push" to the 
patchwork, where it kind of appears already as a github-like discussion? 
 It doesn't miss a lot to enable writing from the website directly 
(basically auto-email).


Personnaly I've put a lot of efforts to fix simple comments, be sure 
that I wrote "v2" here, sign-off there, cc-ed the right person, not mess 
my the format-patch versions, changed only the cover letter, ... Quite 
afraid of bothering that big mailing list for nothing.


I'm infrequent enough to have te re-learn every time basically. It would 
be much easier with a git push, a fast online review of the diff, as on 
github/gitlab, and done. Also, those allow online edits, and therefore 
allows "elders" to do small fixes directly in the "patch". Some fixes 
are not worth the discussion and the chain of mails. That's what I'm 
missing the most personnaly.


Tom



Re: [dpdk-dev] [dpdk-stable] [PATCH v2] test-pmd: fix memory leaks when mtr policer actions update fails

2020-05-26 Thread Thomas Monjalon
26/05/2020 04:04, wangyunjian:
> From: Thomas Monjalon [mailto:tho...@monjalon.net]
> > 25/05/2020 03:46, wangyunjian:
> > > From: Yunjian Wang 
> > >
> > > This patch fixes the Huawei internal coverity reported resource leak
> > > issue.
> > 
> > The problem is not seen in the community Coverity?
> 
> I don't know much about that.

Please, could you register and check here?
https://scan.coverity.com/projects/dpdk-data-plane-development-kit





Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Maxime Coquelin



On 5/26/20 9:06 AM, Tom Barbette wrote:
> Le 25/05/2020 à 22:34, Thomas Monjalon a écrit :
>> 25/05/2020 20:44, Morten Brørup:
>>> From: Thomas Monjalon
 25/05/2020 18:09, Burakov, Anatoly:
> obviously, but i have a suspicion that we'll get more of it if we
 lower
> the barrier for entry (not the barrier for merge!). I think there is
 a
> way to lower the secondary skill level needed to contribute to DPDK
> without lowering coding/merge standards with it.
>>>
>>> That is exactly what I am asking for: Lowering the barrier and
>>> increasing the feeling of success for newcomers. (The barrier for
>>> merge is probably fine; I'll leave that discussion to the maintainers.)
>>
>> I understand.
>>
>>
 About the barrier for entry, maybe it is not obvious because I don't
 communicate a lot about it, but please be aware that I (and other
 maintainers I think) are doing a lot of changes in newcomer patches
 to avoid asking them knowing the whole process from the beginning.
 Then frequent contributors get educated on the way.
>>>
>>> Great! I wish that every developer would think and behave this way.
>>>

 I think the only real barrier we have is to sign the patch
 with a real name and send an email to right list.
 The ask for SoB real name is probably what started this thread
 in Morten's mind. And the SoB requirement will *never* change.
>>>
>>> The incorrect Signed-off-by might be the only hard barrier (which we
>>> cannot avoid). But that did not trigger me.
>>>
>>> I was raising the discussion to bring attention to soft barriers for
>>> contributors. What triggered me was the request to split the patch
>>> into multiple patches; a kind of feedback I have seen before. For an
>>> experienced git user, this is probably very easy, but for a git
>>> newbie (like myself), it basically means starting all over and trying
>>> to figure out the right set of git commands to do this, which can be
>>> perceived as a difficult task requiring a lot of effort.
>>
>> Yes I am aware about this difficulty.
>> It is basically knowing git-reset and git-add -p.
>> I agree a cookbook for this kind of thing is required.
>>
>> I would like to do the split for newcomers,
>> but we need also to validate the explanations of each commit.
>> A solution in such case is to send the split so the newbie can just
>> fill what is missing.
>> This kind of workflow is really what we should look at improving.
>>
>>
>>> Perhaps we could supplement the Contributor Guidelines with a set of
>>> cookbooks for different steps in the contribution process, so
>>> reviewers can be refer newcomers to the relevant of these as part of
>>> the feedback. Just like any professional customer support team has a
>>> set of canned answers ready for common customer issues. (Please note:
>>> I am not suggesting adding an AI/ML chat bot reviewer to the mailing
>>> list!)
>>
>> OK
>>
>>
>>> The amount of Contributor Guideline documentation is also a
>>> balance... it must be long enough to contain the relevant information
>>> to get going, but short enough for newcomers to bother reading it.
>>
>> Yes, we need short intros and long explanations when really needed.
>> It is touching another issue: we lack some documentation love.
>>
>>
> 
> 
> Maybe we could find something that allows to "git push" to the
> patchwork, where it kind of appears already as a github-like discussion?
>  It doesn't miss a lot to enable writing from the website directly
> (basically auto-email).
> 
> Personnaly I've put a lot of efforts to fix simple comments, be sure
> that I wrote "v2" here, sign-off there, cc-ed the right person, not mess
> my the format-patch versions, changed only the cover letter, ... Quite
> afraid of bothering that big mailing list for nothing.

Maybe using git-publish would help here:
https://github.com/stefanha/git-publish

Using the simple git-puslish command, it manages revisions
automatically, open an editor for the cover letter, can run some scripts
to add proper maintainers, and hook available to run basic checks,
etc...

We could add a .gitpublish file to automate adding right maintainers
depending on the branch, etc...

For example, for Qemu the .gitpublish file looks like this:
https://github.com/qemu/qemu/blob/master/.gitpublish

> I'm infrequent enough to have te re-learn every time basically. It would
> be much easier with a git push, a fast online review of the diff, as on
> github/gitlab, and done. Also, those allow online edits, and therefore
> allows "elders" to do small fixes directly in the "patch". Some fixes
> are not worth the discussion and the chain of mails. That's what I'm
> missing the most personnaly.
> 
> Tom
> 



Re: [dpdk-dev] [PATCH] mbuf: document rule for new fields and flags

2020-05-26 Thread Jerin Jacob
On Tue, May 26, 2020 at 2:54 AM Thomas Monjalon  wrote:
>
> Since dynamic fields and flags were added in 19.11,
> the idea was to use them for new features, not only PMD-specific.
>
> The rule is made more explicit in doxygen, in the mbuf guide,
> and in the contribution design guidelines.
>
> For more information about the original design, see the presentation
> https://www.dpdk.org/wp-content/uploads/sites/35/2019/10/DynamicMbuf.pdf
>
> Signed-off-by: Thomas Monjalon 
> ---
>  doc/guides/contributing/design.rst | 13 +
>  doc/guides/prog_guide/mbuf_lib.rst | 23 +++
>  lib/librte_mbuf/rte_mbuf_core.h|  2 ++
>  3 files changed, 38 insertions(+)
>
> diff --git a/doc/guides/contributing/design.rst 
> b/doc/guides/contributing/design.rst
> index d3dd694b65..508115d5bd 100644
> --- a/doc/guides/contributing/design.rst
> +++ b/doc/guides/contributing/design.rst
> @@ -57,6 +57,19 @@ The following config options can be used:
>  * ``CONFIG_RTE_EXEC_ENV`` is a string that contains the name of the 
> executive environment.
>  * ``CONFIG_RTE_EXEC_ENV_FREEBSD`` or ``CONFIG_RTE_EXEC_ENV_LINUX`` are 
> defined only if we are building for this execution environment.
>
> +Mbuf features
> +-
> +
> +The ``rte_mbuf`` structure must be kept small (128 bytes).
> +
> +In order to add new features without wasting buffer space for unused 
> features,
> +some fields and flags can be registered dynamically in a shared area.

I think, instead of "can", it should be "must"

> +The "dynamic" mbuf area is the default choice for the new features.
> +
> +The "dynamic" area is eating the remaining space in mbuf,
> +and some existing "static" fields may need to become "dynamic".
> +
> +
>  Library Statistics
>  --
>
> diff --git a/doc/guides/prog_guide/mbuf_lib.rst 
> b/doc/guides/prog_guide/mbuf_lib.rst
> index 0d3223b081..c3dbfb9221 100644
> --- a/doc/guides/prog_guide/mbuf_lib.rst
> +++ b/doc/guides/prog_guide/mbuf_lib.rst
> @@ -207,6 +207,29 @@ The list of flags and their precise meaning is described 
> in the mbuf API
>  documentation (rte_mbuf.h). Also refer to the testpmd source code
>  (specifically the csumonly.c file) for details.
>
> +Dynamic fields and flags
> +
> +
> +The size of the mbuf is constrained and limited;
> +while the amount of metadata to save for each packet is quite unlimited.
> +The most basic networking information already find their place
> +in the existing mbuf fields and flags.
> +
> +If new features need to be added, the new fields and flags should fit

How about, instead of "should fit", must use the dynamic space.

> +in the "dynamic space", by registering some room in the mbuf structure:
> +
> +dynamic field
> +   named area in the mbuf structure,
> +   with a given size (at least 1 byte) and alignment constraint.
> +
> +dynamic flag
> +   named bit in the mbuf structure,
> +   stored in the field ``ol_flags``.
> +
> +The dynamic fields and flags are managed with the functions 
> ``rte_mbuf_dyn*``.
> +
> +It is not possible to unregister fields or flags.
> +
>  .. _direct_indirect_buffer:
>
>  Direct and Indirect Buffers
> diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h
> index b9a59c879c..22be41e520 100644
> --- a/lib/librte_mbuf/rte_mbuf_core.h
> +++ b/lib/librte_mbuf/rte_mbuf_core.h
> @@ -12,6 +12,8 @@
>   * packet offload flags and some related macros.
>   * For majority of DPDK entities, it is not recommended to include
>   * this file directly, use include  instead.
> + *
> + * New fields and flags should fit in the "dynamic space".

must use.

>   */
>
>  #include 
> --
> 2.26.2
>


Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-05-26 Thread Tom Barbette



Le 22/05/2020 à 20:43, PATRICK KEROULAS a écrit :

mlx5 part of libibverbs includes a ts-to-ns converter which takes the
instantaneous clock info. It's unused in dpdk so far. I've tested it in the
device/port init routine and the result looks reliable. Since this approach
looks very simple, compared to the time sync mechanism, I'm trying to
integrate.

The conversion should occur in the primary process (testpmd) I suppose.
1) The needed clock info derives from ethernet device. Is it possible to
access that struct from a rx callback?
2) how to attach the nanosecond to mbuf so that `pdump` catches it?
(workaround: copy `mbuf->udata64` in forwarded packets.)
3) any other idea?

The timestamp is carried in mbuf.
Then the conversion must be done by the ethdev caller (application or
any other upper layer).

What if the converter function needs a clock_info?
https://github.com/linux-rdma/rdma-core/blob/7af01c79e00555207dee6132d72e7bfc1bb5485e/providers/mlx5/mlx5dv.h#L1201
I'm affraid this info may change by the time the converter is called
by upper layer.

Indeed, the clock in the device is not an atomic one :)
We need to adjust the time conversion continuously.
I am not an expert of time synchronization, so I add more people Cc
who could help for having a precise timestamp.

Thanks Thomas.
Not sure this is a synchronization issue. We have dedicated processes
(linuxptp) to keep both NIC and sys clocks in sync with an external clock.
It is "just" a matter of unit conversion.

If it has to be performed in dpdk-pdump, I would need some help to
retrieve mlx5_clock_info from inside a secondary process. Looking at
mlx5_read_clock(), this info is extracted from ibv_context which looks
reachable in a primary process only (segfault, if I try in pdump).



I don't know about the integrated ts-to-ns, but we implemented a 
translation mechanism that mimics what NTP does in Linux to translate a 
given clock (TSC at first) to a wall time. You'll find more info at 
https://orbi.uliege.be/bitstream/2268/226257/1/thesis.pdf chapter 
3.4.1.  This is an often forgotten matter, as we saw in real switches 
that the time spent in time-related VDSO is enormous.


We wanted to do a very precise capture too, se we made that clock able 
to synchronize itself with the ConnectX 5 internal clock as a base 
instead of TSC. FYI the clock in CX5 si running at 800MHz, so pure 
nanosecond is impossible, but close enough. It is for that purpose that 
I proposed the rte_eth_read_clock() patch in DPDK. We need to be able to 
read the current clock (like rdtsc() instruction for TSC) to compute the 
frequency.


The "converter" code is there : 
https://github.com/tbarbette/fastclick/blob/master/elements/userlevel/tscclock.cc, 
the source is configurable (TSC, rte_eth_read_clock, GPS meinberg clock, 
...), the DPDK one is there : 
https://github.com/tbarbette/fastclick/blob/2ab021283b82d0b980551480c505ec8dced98e0a/elements/userlevel/dpdkdevclock.cc#L27 



One important thing is that the conversion factor must be changed from 
time to time to fix the drifiting. That is the reason why we can't just 
push a bunch of code to DPDK (and it's probably not as simple as using 
the ts-to-ns in mlx5) because you must have a timer, and use a RCU to 
update "atomically" a > 64bits struct. Though most of that is available 
now in DPDK but there will always be some setup (rcu barrier, timer 
init, ...).


In the end it's not hard science... It worked like a charm to do a 
campus trace capture on 100G hardware.




[dpdk-dev] DPDK-20.05 RC4 quick report

2020-05-26 Thread Peng, Yuan
DPDK-20.05 RC4 quick report

  *   Totally create ~400+ new test cases for DPDK20.05 new features.
  *   Totally run 9976 cases, execution percentage is 100%, pass rate is about 
99.5%, 2 new issues are found, no critical issues.
  *   Checked build and compile, no new issue found.
  *   Checked Basic NIC PMD(i40e, ixgbe, ice) PF & VF regression, new found 1 
PF issue.
  *   Checked virtio regression test, no new bug is found.
  *   Checked cryptodev and compressdev regression, no new issus found so far.
  *   Checked NIC performance, no new issue found so far.
  *   Checked ABI test, no new issue found so far.
  *   Checked 20.05 new features: 1 new issue found so far.

Thank you.
Yuan.



Re: [dpdk-dev] 【BUG REPORT】l3fwd-power can not exit by ctrl+c

2020-05-26 Thread Hunt, David

Hi Lijun,

On 26/5/2020 4:50 AM, oulijun wrote:

Hi,
   I have update the code into 20.05-rc2. However, the l3fwd-power 
startup fail.


[root@centos-C3 build]# l3fwd-power -w :7d:00.1  -c 0xc00 -n 4 
-- -P -p 0x01 --config '(0,0,27)' --parse-ptype




--snip--


POWER: Attempting to initialise ACPI cpufreq power management...
POWER: Power management governor of lcore 26 has been set to user 
space successfully

POWER: File not opened
POWER: Cannot get available frequencies of lcore 26
POWER: Attempting to initialise PSTAT power management...
POWER: Power management governor of lcore 26 has been set to 
performance successfully

POWER: Error opening '/dev/cpu/26/msr': No such file or directory
POWER: Cannot init for setting frequency for lcore 26



This was not happening in your previous logs, have you got the 'msr' 
kernel module loaded?



POWER: Attempting to initialise VM power management...
GUEST_CHANNEL: Opening channel 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' for lcore 26
GUEST_CHANNEL: Unable to to connect to 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' with error No 
such file or directory



I did not see any GUEST_CHANNEL notifications in the previous logs you 
provided,  has your setup changed in any way?


By the way, I can run the command you provided above (without the 
whitelist) without any errors on my system, and a single CTRL-C exits 
gracefully. I am not running in a VM.


Rgds,
Dave.



[dpdk-dev] [PATCH v5 0/4] generic rte atomic APIs deprecate proposal

2020-05-26 Thread Phil Yang
DPDK provides generic rte_atomic APIs to do several atomic operations.
These APIs are using the deprecated __sync built-ins and enforce full
memory barriers on aarch64. However, full barriers are not necessary
in many use cases. In order to address such use cases, C language offers
C11 atomic APIs. The C11 atomic APIs provide finer memory barrier control
by making use of the memory ordering parameter provided by the user.
Various patches submitted in the past [2] and the patches in this series
indicate significant performance gains on multiple aarch64 CPUs and no
performance loss on x86.

But the existing rte_atomic API implementations cannot be changed as the
APIs do not take the memory ordering parameter. The only choice available
is replacing the usage of the rte_atomic APIs with C11 atomic APIs. In
order to make this change, the following steps are proposed:

[1] deprecate rte_atomic APIs so that future patches do not use rte_atomic
APIs (a script is added to flag the usages).
[2] refactor the code that uses rte_atomic APIs to use c11 atomic APIs.

This patchset contains:
1) changes to programmer guide describing writing efficient code for aarch64.
2) the checkpatch script changes to flag rte_atomicNN_xxx API usage in patches.
3) wraps up __atomic_thread_fence with explicit memory ordering parameter.

v5:
1. Wraps up __atomic_thread_fence to support optimized code for
__ATOMIC_SEQ_CST memory order.
2. Flag __atomic_thread_fence with __ATOMIC_SEQ_CST in new patches.
3. Fix email address typo in patch 2/4.

v4:
1. add reader-writer concurrency case describing.
2. claim maintainership of c11 atomics code for each platforms.
3. flag rte_atomicNN_xxx in new patches for modules that have been converted to
c11 style.
4. flag __sync_xxx built-ins in new patches.
5. wraps up compiler atomic built-ins
6. move the changes of libraries which make use of c11 atomic APIs out of this
patchset.

v3:
add libatomic dependency for 32-bit clang

v2:
1. fix Clang '-Wincompatible-pointer-types' WARNING.
2. fix typos.


Phil Yang (4):
  doc: add generic atomic deprecation section
  maintainers: claim maintainers of c11 atomics code
  devtools: prevent use of rte atomic APIs in future patches
  eal/atomic: add wrapper for c11 atomic thread fence

 MAINTAINERS  |   4 +
 devtools/checkpatches.sh |  32 ++
 doc/guides/prog_guide/writing_efficient_code.rst | 139 ++-
 lib/librte_eal/arm/include/rte_atomic_32.h   |   6 +
 lib/librte_eal/arm/include/rte_atomic_64.h   |   6 +
 lib/librte_eal/include/generic/rte_atomic.h  |   6 +
 lib/librte_eal/ppc/include/rte_atomic.h  |   6 +
 lib/librte_eal/x86/include/rte_atomic.h  |  17 +++
 8 files changed, 215 insertions(+), 1 deletion(-)

-- 
2.7.4



[dpdk-dev] [PATCH v5 2/4] maintainers: claim maintainers of c11 atomics code

2020-05-26 Thread Phil Yang
Add the maintainership of c11 atomics code.

Signed-off-by: Phil Yang 
Reviewed-by: Honnappa Nagarahalli 
---
 MAINTAINERS | 4 
 1 file changed, 4 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index d2b2867..3528907 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -265,6 +265,10 @@ F: lib/librte_eal/include/rte_random.h
 F: lib/librte_eal/common/rte_random.c
 F: app/test/test_rand_perf.c
 
+C11 Code Maintainer
+M: Honnappa Nagarahalli 
+M: David Christensen 
+
 ARM v7
 M: Jan Viktorin 
 M: Ruifeng Wang 
-- 
2.7.4



[dpdk-dev] [PATCH v5 3/4] devtools: prevent use of rte atomic APIs in future patches

2020-05-26 Thread Phil Yang
In order to deprecate the rte_atomic APIs, prevent the patches from
using rte_atomic APIs in the converted modules and compilers __sync
built-ins in all modules.

The converted modules:
lib/librte_distributor
lib/librte_hash
lib/librte_kni
lib/librte_lpm
lib/librte_rcu
lib/librte_ring
lib/librte_stack
lib/librte_vhost
lib/librte_timer
lib/librte_ipsec
drivers/event/octeontx
drivers/event/octeontx2
drivers/event/opdl
drivers/net/bnx2x
drivers/net/hinic
drivers/net/hns3
drivers/net/memif
drivers/net/thunderx
drivers/net/virtio
examples/l2fwd-event

On x86 the __atomic_thread_fence(__ATOMIC_SEQ_CST) is quite expensive
for SMP case. Flag the new code which use SEQ_CST memory ordering in
__atomic_thread_fence API.

Signed-off-by: Phil Yang 
Reviewed-by: Ruifeng Wang 
Reviewed-by: Honnappa Nagarahalli 
---
 devtools/checkpatches.sh | 32 
 1 file changed, 32 insertions(+)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 158087f..5983f05 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -69,6 +69,38 @@ check_forbidden_additions() { # 
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
 
+   # refrain from new additions of 16/32/64 bits rte_atomic_xxx()
+   # multiple folders and expressions are separated by spaces
+   awk -v FOLDERS="lib/librte_distributor lib/librte_hash lib/librte_kni
+   lib/librte_lpm lib/librte_rcu lib/librte_ring
+   lib/librte_stack lib/librte_vhost drivers/event/octeontx
+   drivers/event/octeontx2 drivers/event/opdl
+   drivers/net/bnx2x drivers/net/hinic drivers/net/hns3
+   drivers/net/memif drivers/net/thunderx
+   drivers/net/virtio examples/l2fwd-event" \
+   -v EXPRESSIONS="rte_atomic[0-9][0-9]_.*\\\(" \
+   -v RET_ON_FAIL=1 \
+   -v MESSAGE='Use of rte_atomicNN_xxx APIs not allowed, use 
__atomic_xxx APIs' \
+   -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+   "$1" || res=1
+
+   # refrain from using compiler __sync built-ins
+   awk -v FOLDERS="lib drivers app examples" \
+   -v EXPRESSIONS="__sync_.*\\\(" \
+   -v RET_ON_FAIL=1 \
+   -v MESSAGE='Use of __sync_xxx built-ins not allowed, use 
__atomic_xxx APIs' \
+   -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+   "$1" || res=1
+
+   # refrain from using compiler __atomic_thread_fence(__ATOMIC_SEQ_CST)
+   # It should be avoided on x86 for SMP case.
+   awk -v FOLDERS="lib drivers app examples" \
+   -v EXPRESSIONS="__atomic_thread_fence\\\(__ATOMIC_SEQ_CST" \
+   -v RET_ON_FAIL=1 \
+   -v MESSAGE='Use of __atomic_thread_fence with SEQ_CST ordering 
is not allowed, use rte_atomic_thread_fence' \
+   -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+   "$1" || res=1
+
# svg figures must be included with wildcard extension
# because of png conversion for pdf docs
awk -v FOLDERS='doc' \
-- 
2.7.4



[dpdk-dev] [PATCH v5 1/4] doc: add generic atomic deprecation section

2020-05-26 Thread Phil Yang
Add deprecating the generic rte_atomic_xx APIs to c11 atomic built-ins
guide and examples.

Signed-off-by: Phil Yang 
Signed-off-by: Honnappa Nagarahalli 
---
 doc/guides/prog_guide/writing_efficient_code.rst | 139 ++-
 1 file changed, 138 insertions(+), 1 deletion(-)

diff --git a/doc/guides/prog_guide/writing_efficient_code.rst 
b/doc/guides/prog_guide/writing_efficient_code.rst
index 849f63e..3bd2601 100644
--- a/doc/guides/prog_guide/writing_efficient_code.rst
+++ b/doc/guides/prog_guide/writing_efficient_code.rst
@@ -167,7 +167,13 @@ but with the added cost of lower throughput.
 Locks and Atomic Operations
 ---
 
-Atomic operations imply a lock prefix before the instruction,
+This section describes some key considerations when using locks and atomic
+operations in the DPDK environment.
+
+Locks
+~
+
+On x86, atomic operations imply a lock prefix before the instruction,
 causing the processor's LOCK# signal to be asserted during execution of the 
following instruction.
 This has a big impact on performance in a multicore environment.
 
@@ -176,6 +182,137 @@ It can often be replaced by other solutions like 
per-lcore variables.
 Also, some locking techniques are more efficient than others.
 For instance, the Read-Copy-Update (RCU) algorithm can frequently replace 
simple rwlocks.
 
+Atomic Operations: Use C11 Atomic Built-ins
+~~~
+
+DPDK `generic rte_atomic 
`_
 operations are
+implemented by `__sync built-ins 
`_.
+These __sync built-ins result in full barriers on aarch64, which are 
unnecessary
+in many use cases. They can be replaced by `__atomic built-ins 
`_ that
+conform to the C11 memory model and provide finer memory order control.
+
+So replacing the rte_atomic operations with __atomic built-ins might improve
+performance for aarch64 machines. `More details 
`_.
+
+Some typical optimization cases are listed below:
+
+Atomicity
+^
+
+Some use cases require atomicity alone, the ordering of the memory operations
+does not matter. For example the packets statistics in the `vhost 
`_ example 
application.
+
+It just updates the number of transmitted packets, no subsequent logic depends
+on these counters. So the RELAXED memory ordering is sufficient:
+
+.. code-block:: c
+
+static __rte_always_inline void
+virtio_xmit(struct vhost_dev *dst_vdev, struct vhost_dev *src_vdev,
+struct rte_mbuf *m)
+{
+...
+...
+if (enable_stats) {
+__atomic_add_fetch(&dst_vdev->stats.rx_total_atomic, 1, 
__ATOMIC_RELAXED);
+__atomic_add_fetch(&dst_vdev->stats.rx_atomic, ret, 
__ATOMIC_RELAXED);
+...
+}
+}
+
+One-way Barrier
+^^^
+
+Some use cases allow for memory reordering in one way while requiring memory
+ordering in the other direction.
+
+For example, the memory operations before the `lock 
`_
 can move to the
+critical section, but the memory operations in the critical section cannot move
+above the lock. In this case, the full memory barrier in the CAS operation can
+be replaced to ACQUIRE. On the other hand, the memory operations after the
+`unlock 
`_
 can move to the critical section, but the memory operations in the
+critical section cannot move below the unlock. So the full barrier in the STORE
+operation can be replaced with RELEASE.
+
+Reader-Writer Concurrency
+^
+Lock-free reader-writer concurrency is one of the common use cases in DPDK.
+
+The payload or the data that the writer wants to communicate to the reader,
+can be written with RELAXED memory order. However, the guard variable should
+be written with RELEASE memory order. This ensures that the store to guard
+variable is observable only after the store to payload is observable.
+Refer to `rte_hash insert 
`_
 for an example.
+
+.. code-block:: c
+
+static inline int32_t
+rte_hash_cuckoo_insert_mw(const struct rte_hash *h,
+...
+int32_t *ret_val)
+{
+...
+...
+
+/* Insert new entry if there is room in the primary
+ * bucket.
+ */
+for (i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) {
+/* Check if slot is available */
+if (likely(prim_bkt->key_idx[i] == EMPTY_SLOT)) {
+ 

[dpdk-dev] [PATCH v5 4/4] eal/atomic: add wrapper for c11 atomic thread fence

2020-05-26 Thread Phil Yang
Provide a wrapper for __atomic_thread_fence built-in to support
optimized code for __ATOMIC_SEQ_CST memory order for x86 platforms.

Suggested-by: Honnappa Nagarahalli 
Signed-off-by: Phil Yang 
Reviewed-by: Ola Liljedahl 
---
 lib/librte_eal/arm/include/rte_atomic_32.h  |  6 ++
 lib/librte_eal/arm/include/rte_atomic_64.h  |  6 ++
 lib/librte_eal/include/generic/rte_atomic.h |  6 ++
 lib/librte_eal/ppc/include/rte_atomic.h |  6 ++
 lib/librte_eal/x86/include/rte_atomic.h | 17 +
 5 files changed, 41 insertions(+)

diff --git a/lib/librte_eal/arm/include/rte_atomic_32.h 
b/lib/librte_eal/arm/include/rte_atomic_32.h
index 7dc0d06..dbe7cc6 100644
--- a/lib/librte_eal/arm/include/rte_atomic_32.h
+++ b/lib/librte_eal/arm/include/rte_atomic_32.h
@@ -37,6 +37,12 @@ extern "C" {
 
 #define rte_cio_rmb() rte_rmb()
 
+static __rte_always_inline void
+rte_atomic_thread_fence(int mo)
+{
+   __atomic_thread_fence(mo);
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_eal/arm/include/rte_atomic_64.h 
b/lib/librte_eal/arm/include/rte_atomic_64.h
index 7b7099c..22ff8ec 100644
--- a/lib/librte_eal/arm/include/rte_atomic_64.h
+++ b/lib/librte_eal/arm/include/rte_atomic_64.h
@@ -41,6 +41,12 @@ extern "C" {
 
 #define rte_cio_rmb() asm volatile("dmb oshld" : : : "memory")
 
+static __rte_always_inline void
+rte_atomic_thread_fence(int mo)
+{
+   __atomic_thread_fence(mo);
+}
+
 /* 128 bit atomic operations 
-*/
 
 #if defined(__ARM_FEATURE_ATOMICS) || defined(RTE_ARM_FEATURE_ATOMICS)
diff --git a/lib/librte_eal/include/generic/rte_atomic.h 
b/lib/librte_eal/include/generic/rte_atomic.h
index e6ab15a..5b941db 100644
--- a/lib/librte_eal/include/generic/rte_atomic.h
+++ b/lib/librte_eal/include/generic/rte_atomic.h
@@ -158,6 +158,12 @@ static inline void rte_cio_rmb(void);
asm volatile ("" : : : "memory");   \
 } while(0)
 
+/**
+ * Synchronization fence between threads based on the specified
+ * memory order.
+ */
+static inline void rte_atomic_thread_fence(int mo);
+
 /*- 16 bit atomic operations 
-*/
 
 /**
diff --git a/lib/librte_eal/ppc/include/rte_atomic.h 
b/lib/librte_eal/ppc/include/rte_atomic.h
index 7e3e131..91c5f30 100644
--- a/lib/librte_eal/ppc/include/rte_atomic.h
+++ b/lib/librte_eal/ppc/include/rte_atomic.h
@@ -40,6 +40,12 @@ extern "C" {
 
 #define rte_cio_rmb() rte_rmb()
 
+static __rte_always_inline void
+rte_atomic_thread_fence(int mo)
+{
+   __atomic_thread_fence(mo);
+}
+
 /*- 16 bit atomic operations 
-*/
 /* To be compatible with Power7, use GCC built-in functions for 16 bit
  * operations */
diff --git a/lib/librte_eal/x86/include/rte_atomic.h 
b/lib/librte_eal/x86/include/rte_atomic.h
index b9dcd30..bd256e7 100644
--- a/lib/librte_eal/x86/include/rte_atomic.h
+++ b/lib/librte_eal/x86/include/rte_atomic.h
@@ -83,6 +83,23 @@ rte_smp_mb(void)
 
 #define rte_cio_rmb() rte_compiler_barrier()
 
+/**
+ * Synchronization fence between threads based on the specified
+ * memory order.
+ *
+ * On x86 the __atomic_thread_fence(__ATOMIC_SEQ_CST) generates
+ * full 'mfence' which is quite expensive. The optimized
+ * implementation of rte_smp_mb is used instead.
+ */
+static __rte_always_inline void
+rte_atomic_thread_fence(int mo)
+{
+   if (mo == __ATOMIC_SEQ_CST)
+   rte_smp_mb();
+   else
+   __atomic_thread_fence(mo);
+}
+
 /*- 16 bit atomic operations 
-*/
 
 #ifndef RTE_FORCE_INTRINSICS
-- 
2.7.4



Re: [dpdk-dev] 【BUG REPORT】l3fwd-power can not exit by ctrl+c

2020-05-26 Thread oulijun




在 2020/5/26 16:36, Hunt, David 写道:

Hi Lijun,

On 26/5/2020 4:50 AM, oulijun wrote:

Hi,
   I have update the code into 20.05-rc2. However, the l3fwd-power 
startup fail.


[root@centos-C3 build]# l3fwd-power -w :7d:00.1  -c 0xc00 -n 4 
-- -P -p 0x01 --config '(0,0,27)' --parse-ptype




--snip--


POWER: Attempting to initialise ACPI cpufreq power management...
POWER: Power management governor of lcore 26 has been set to user 
space successfully

POWER: File not opened
POWER: Cannot get available frequencies of lcore 26
POWER: Attempting to initialise PSTAT power management...
POWER: Power management governor of lcore 26 has been set to 
performance successfully

POWER: Error opening '/dev/cpu/26/msr': No such file or directory
POWER: Cannot init for setting frequency for lcore 26



This was not happening in your previous logs, have you got the 'msr' 
kernel module loaded?


Yes. But what I don't understand is that the dpdk version I use is 
different, and the kernel module is the same. the 20.05-rc0 is ok when 
startup and the 20.05-rc2 is not. I don't notice the msr module.

POWER: Attempting to initialise VM power management...
GUEST_CHANNEL: Opening channel 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' for lcore 26
GUEST_CHANNEL: Unable to to connect to 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' with error No 
such file or directory



I did not see any GUEST_CHANNEL notifications in the previous logs you 
provided,  has your setup changed in any way?


By the way, I can run the command you provided above (without the 
whitelist) without any errors on my system, and a single CTRL-C exits 
gracefully. I am not running in a VM.


I don't running vm. I want to test the 20.05-rc2 according to your 
advice. the kernel is the same.

Rgds,
Dave.


.





Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Burakov, Anatoly

On 26-May-20 8:31 AM, Maxime Coquelin wrote:



On 5/26/20 9:06 AM, Tom Barbette wrote:

Le 25/05/2020 à 22:34, Thomas Monjalon a écrit :

25/05/2020 20:44, Morten Brørup:

From: Thomas Monjalon

25/05/2020 18:09, Burakov, Anatoly:

obviously, but i have a suspicion that we'll get more of it if we

lower

the barrier for entry (not the barrier for merge!). I think there is

a

way to lower the secondary skill level needed to contribute to DPDK
without lowering coding/merge standards with it.


That is exactly what I am asking for: Lowering the barrier and
increasing the feeling of success for newcomers. (The barrier for
merge is probably fine; I'll leave that discussion to the maintainers.)


I understand.



About the barrier for entry, maybe it is not obvious because I don't
communicate a lot about it, but please be aware that I (and other
maintainers I think) are doing a lot of changes in newcomer patches
to avoid asking them knowing the whole process from the beginning.
Then frequent contributors get educated on the way.


Great! I wish that every developer would think and behave this way.



I think the only real barrier we have is to sign the patch
with a real name and send an email to right list.
The ask for SoB real name is probably what started this thread
in Morten's mind. And the SoB requirement will *never* change.


The incorrect Signed-off-by might be the only hard barrier (which we
cannot avoid). But that did not trigger me.

I was raising the discussion to bring attention to soft barriers for
contributors. What triggered me was the request to split the patch
into multiple patches; a kind of feedback I have seen before. For an
experienced git user, this is probably very easy, but for a git
newbie (like myself), it basically means starting all over and trying
to figure out the right set of git commands to do this, which can be
perceived as a difficult task requiring a lot of effort.


Yes I am aware about this difficulty.
It is basically knowing git-reset and git-add -p.
I agree a cookbook for this kind of thing is required.

I would like to do the split for newcomers,
but we need also to validate the explanations of each commit.
A solution in such case is to send the split so the newbie can just
fill what is missing.
This kind of workflow is really what we should look at improving.



Perhaps we could supplement the Contributor Guidelines with a set of
cookbooks for different steps in the contribution process, so
reviewers can be refer newcomers to the relevant of these as part of
the feedback. Just like any professional customer support team has a
set of canned answers ready for common customer issues. (Please note:
I am not suggesting adding an AI/ML chat bot reviewer to the mailing
list!)


OK



The amount of Contributor Guideline documentation is also a
balance... it must be long enough to contain the relevant information
to get going, but short enough for newcomers to bother reading it.


Yes, we need short intros and long explanations when really needed.
It is touching another issue: we lack some documentation love.





Maybe we could find something that allows to "git push" to the
patchwork, where it kind of appears already as a github-like discussion?
  It doesn't miss a lot to enable writing from the website directly
(basically auto-email).

Personnaly I've put a lot of efforts to fix simple comments, be sure
that I wrote "v2" here, sign-off there, cc-ed the right person, not mess
my the format-patch versions, changed only the cover letter, ... Quite
afraid of bothering that big mailing list for nothing.


Maybe using git-publish would help here:
https://github.com/stefanha/git-publish

Using the simple git-puslish command, it manages revisions
automatically, open an editor for the cover letter, can run some scripts
to add proper maintainers, and hook available to run basic checks,
etc...


Good to see that i've reinvented the wheel yet again, as this looks 
almost exactly like the set of scripts i wrote for myself to automate 
patch submission :D




We could add a .gitpublish file to automate adding right maintainers
depending on the branch, etc...

For example, for Qemu the .gitpublish file looks like this:
https://github.com/qemu/qemu/blob/master/.gitpublish


I'm infrequent enough to have te re-learn every time basically. It would
be much easier with a git push, a fast online review of the diff, as on
github/gitlab, and done. Also, those allow online edits, and therefore
allows "elders" to do small fixes directly in the "patch". Some fixes
are not worth the discussion and the chain of mails. That's what I'm
missing the most personnaly.

Tom






--
Thanks,
Anatoly


Re: [dpdk-dev] xdp_umem_configure(): Failed to create umem

2020-05-26 Thread Bruce Richardson
On Tue, May 26, 2020 at 11:27:10AM +0530, Deepak Gowda wrote:
> Hi All,
> 
> I'm fairly new to xdp, i'm trying to run the testpmd with af_xdp. I have
> checked all the prerequisites for af_xdp.
> I see testpmd exiting with the following error,
> ./testpmd -c 0x3 -n 4 --vdev net_af_xdp0,iface=tap0 -- -i
> EAL: Detected 8 lcore(s)
> EAL: Detected 1 NUMA nodes
> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
> EAL: Selected IOVA mode 'PA'
> EAL: Probing VFIO support...
> EAL: PCI device :00:03.0 on NUMA socket -1
> EAL:   Invalid NUMA socket, default to 0
> EAL:   probe driver: 1af4:1000 net_virtio
> EAL: PCI device :00:0a.0 on NUMA socket -1
> EAL:   Invalid NUMA socket, default to 0
> EAL:   probe driver: 1af4:1000 net_virtio
> Interactive-mode selected
> testpmd: create a new mbuf pool : n=155456, size=2176,
> socket=0
> testpmd: preferred mempool ops selected: ring_mp_mc
> 
> Warning! port-topology=paired and odd forward ports number, the last port
> will pair with itself.
> 
> Configuring Port 0 (socket 0)
> *xdp_umem_configure(): Failed to create umemeth_rx_queue_setup(): Failed to
> configure xdp socket*
> Fail to configure port 0 rx queues
> EAL: Error - exiting with code: 1
>   Cause: Start ports failed
> 
> Seems like xsk_umem__create() is failing, could this be a kernel issue?
> Before going further i wanted to confirm that my setup is fine and that
> there are no obvious mistakes, here is my setup details:
> debian buster kvm machine
> 4.19.0-9-amd64 kernel
> iface argument is a tap interface
> dpdk-stable-19.11.2
> 
While I can't comment on the specific root cause of the issue you are
seeing, 4.19 is quite an old kernel for working with AF_XDP, since numerous
improvements and enhancements e.g. zero-copy support, have gone into the
kernel since then. I would generally recommend using a 5.4 or newer kernel
if working with AF_XDP.

/Bruce


[dpdk-dev] [PATCH] lib/librte_net: fix bug for ipv4 checksum calculating

2020-05-26 Thread guohongzhi
0x is invalid for IPv4 checksum(RFC1624)

Fixes: 6006818cfb26 ("net: new checksum functions")

Reviewed-By: Morten Brørup 
Acked-by: Olivier Matz 

Signed-off-by: guohongzhi 
---
 lib/librte_net/rte_ip.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 1ceb7b7..ece2e43 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -267,7 +267,7 @@ rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr)
 {
uint16_t cksum;
cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
-   return (cksum == 0x) ? cksum : (uint16_t)~cksum;
+   return (uint16_t)~cksum;
 }
 
 /**
-- 
2.21.0.windows.1




Re: [dpdk-dev] 【BUG REPORT】l3fwd-power can not exit by ctrl+c

2020-05-26 Thread Burakov, Anatoly

On 26-May-20 4:50 AM, oulijun wrote:

Hi,
    I have update the code into 20.05-rc2. However, the l3fwd-power 
startup fail.


[root@centos-C3 build]# l3fwd-power -w :7d:00.1  -c 0xc00 -n 4 
-- -P -p 0x01 --config '(0,0,27)' --parse-ptype

EAL: Detected 128 lcore(s)
EAL: Detected 4 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-2048kB
EAL: No available hugepages reported in hugepages-32768kB
EAL: No available hugepages reported in hugepages-64kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL:   using IOMMU type 1 (Type 1)
EAL: Ignore mapping IO port bar(1)
EAL: Ignore mapping IO port bar(3)
EAL: Probe PCI driver: net_hns3 (19e5:a221) device: :7d:00.1 (socket 0)
No telemetry legacy support - No legacy callbacks, legacy socket not 
created

Promiscuous mode selected
soft parse-ptype is enabled
POWER: Env isn't set yet!
POWER: Attempting to initialise ACPI cpufreq power management...
POWER: Power management governor of lcore 26 has been set to user space 
successfully

POWER: File not opened
POWER: Cannot get available frequencies of lcore 26
POWER: Attempting to initialise PSTAT power management...
POWER: Power management governor of lcore 26 has been set to performance 
successfully

POWER: Error opening '/dev/cpu/26/msr': No such file or directory
POWER: Cannot init for setting frequency for lcore 26
POWER: Attempting to initialise VM power management...
GUEST_CHANNEL: Opening channel 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' for lcore 26
GUEST_CHANNEL: Unable to to connect to 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' with error No such 
file or directory

POWER: Unable to set Power Management Environment for lcore 26
POWER: Library initialization failed on core 26
EAL: Error - exiting with code: 1
   Cause: init_power_library failed

Thanks
Lijun Ou



Hi,

Previously, l3fwd-power was very lax in what it was allowing. Now, if it 
can't enable power management, it will not run, because it is more 
strict in what it allows.


As is shown in the log, it tries to initialize ACPI power management, 
but fails. Then, it tries to initialize pstate mode, and it appears that 
MSR driver is not loaded, so it doesn't work either. It also tries to 
check if a KVM channel exists, which doesn't, and that fails as well. 
So, no power management environment can be enabled, and the application 
fails to start.


In order to make it work, you should either boot in ACPI mode (kernel 
parameter: "intel_pstate=disable"), or load the MSR driver (root 
command: modprobe msr).


This more strict power library initialization was added because we saw 
people misusing l3fwd-power to attempt to run without power management 
environment being initialized (such as inside a VM while not having 
telemetry mode enabled), which it was not designed to do and which would 
be an invalid test.


--
Thanks,
Anatoly


Re: [dpdk-dev] [PATCH] lib/librte_net: fix bug for ipv4 checksum calculating

2020-05-26 Thread Morten Brørup
guohongzhi,

You must use your real name in the Signed-off-by line.

The signoff must be a real name and not an alias or nickname. For further 
details, please refer to: 
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1


Med venlig hilsen / kind regards
- Morten Brørup

> -Original Message-
> From: guohongzhi [mailto:guohongz...@huawei.com]
> Sent: Tuesday, May 26, 2020 11:17 AM
> To: dev@dpdk.org
> Cc: olivier.m...@6wind.com; Morten Brørup;
> konstantin.anan...@intel.com; jiayu...@intel.com;
> ferruh.yi...@intel.com; nicolas.chau...@intel.com;
> cristian.dumitre...@intel.com; zhoujing...@huawei.com;
> chenchan...@huawei.com; jerry.lili...@huawei.com;
> haifeng@huawei.com; guohongz...@huawei.com
> Subject: [PATCH] lib/librte_net: fix bug for ipv4 checksum calculating
> 
> 0x is invalid for IPv4 checksum(RFC1624)
> 
> Fixes: 6006818cfb26 ("net: new checksum functions")
> 
> Reviewed-By: Morten Brørup 
> Acked-by: Olivier Matz 
> 
> Signed-off-by: guohongzhi 
> ---
>  lib/librte_net/rte_ip.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
> index 1ceb7b7..ece2e43 100644
> --- a/lib/librte_net/rte_ip.h
> +++ b/lib/librte_net/rte_ip.h
> @@ -267,7 +267,7 @@ rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr)
>  {
>   uint16_t cksum;
>   cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
> - return (cksum == 0x) ? cksum : (uint16_t)~cksum;
> + return (uint16_t)~cksum;
>  }
> 
>  /**
> --
> 2.21.0.windows.1
> 
> 



Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDK contribution processes

2020-05-26 Thread Burakov, Anatoly

On 25-May-20 8:26 PM, Tom Barbette wrote:


Le 25/05/2020 à 19:50, Wiles, Keith a écrit :


On May 25, 2020, at 12:32 PM, Thomas Monjalon  
wrote:


25/05/2020 18:57, Wiles, Keith:
On May 25, 2020, at 11:28 AM, Thomas Monjalon  
wrote:

25/05/2020 18:09, Burakov, Anatoly:

On 25-May-20 5:04 PM, Maxime Coquelin wrote:

On 5/25/20 5:59 PM, Burakov, Anatoly wrote:

On 25-May-20 4:52 PM, Maxime Coquelin wrote:

On 5/25/20 5:35 PM, Jerin Jacob wrote:

On May 25, 2020 Thomas Monjalon wrote:

My concern about clarity is the history of the discussion.
When we post a new versions in GitHub, it's very hard to keep 
track

of the history.
As a maintainer, I need to see the history to understand what 
happened,

what we are waiting for, and what should be merged.

IMO, The complete history is available per pull request URL.
I think, Github also email notification mechanism those to 
prefer to see

comments in the email too.

In addition to that, Bugzilla, patchwork, CI stuff all 
integrated into

one place.
I am quite impressed with vscode community collaboration.
https://github.com/Microsoft/vscode/pulls

Out of curiosity, just checked the git history and I'm not that
impressed. For example last commit on the master branch:

https://github.com/microsoft/vscode/commit/2a4cecf3f2f72346d06990feeb7446b3915d6148 




Commit title: " Fix #98530 "
Commit message empty, no explanation on what the patch is doing.

Then, let's check the the issue it is pointed to:
https://github.com/microsoft/vscode/issues/98530

Issue is created 15 minutes before the patch is being merged. 
All that

done by the same contributor, without any review.

Just because they do it wrong doesn't mean we can't do it right 
:) This
says more about Microsoft's lack of process around VSCode than 
it does

about Github the tool.

True. I was just pointing out that is not the kind of process I 
would

personally want to adopt.

You won't find disagreement here, but this "process" is not due to 
the

tool. You can just as well allow Thomas to merge stuff without any
review because he has commit rights, no Github needed - and you 
would be

faced with the same problem.

So, i don't think Jerin was suggesting that we degrade our 
merge/commit

rules. Rather, the point was that (whatever you think of VSCode's
review/merge process) there are a lot of pull requests and there is
healthy community collaboration. I'm not saying we don't have that,

Yes, recent survey said the process was fine:
http://mails.dpdk.org/archives/announce/2019-June/000268.html
IMO the survey is not a great tool for these types of things. The 
tech board and others that fully understand the process should 
decide. From my experience using Github or Gitlab is much easy and a 
single tool to submit patches to a project. Anatoly and others 
stated it very well and we should convert IMO, as I have always 
stated in the past.


obviously, but i have a suspicion that we'll get more of it if we 
lower
the barrier for entry (not the barrier for merge!). I think there 
is a

way to lower the secondary skill level needed to contribute to DPDK
without lowering coding/merge standards with it.

About the barrier for entry, maybe it is not obvious because I don't
communicate a lot about it, but please be aware that I (and other
maintainers I think) are doing a lot of changes in newcomer patches
to avoid asking them knowing the whole process from the beginning.
Then frequent contributors get educated on the way.

I think the only real barrier we have is to sign the patch
with a real name and send an email to right list.
The ask for SoB real name is probably what started this thread
in Morten's mind. And the SoB requirement will *never* change.

Would it not free up your time and energies by have the tools
do most of the work. then you can focus on what matters the patch
and developing more features?
No, GitHub is not helping to track root cause and define what should 
be backported.

It does not help to track Coverity issues.
It does not add Acks automatically (but patchwork does).
It does not send a notification when enough review is done (judgement 
needed here).

It does not split patches when different bugs are fixed.
etc...

Thanks for reading my emails and I am trying to help DPDK as a whole.

All of these seem to be supported by GitHub or GitLab in one way or 
another, but other more versed in these tools can correct me.


- We use Coverity and other tools attached to GitLab and they seem to 
be doing the job. I agree we will always find issues and these tools 
are not a complete answer and no tool is today.
- Acks can be done via the merge rules (at least in GitLab FWIW not 
used GitHub much).
- cherry-picking a merge request into multiple commit or different 
merge request appear to be supported.
- Notifications are part of the process with merge rules if I 
understand your comment.


We need to drag DPDK kicking and screaming into the year 2020 :-)



Maybe we could find something that al

Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Burakov, Anatoly

On 25-May-20 7:44 PM, Morten Brørup wrote:

From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Thomas Monjalon
Sent: Monday, May 25, 2020 6:29 PM

25/05/2020 18:09, Burakov, Anatoly:

On 25-May-20 5:04 PM, Maxime Coquelin wrote:

On 5/25/20 5:59 PM, Burakov, Anatoly wrote:

On 25-May-20 4:52 PM, Maxime Coquelin wrote:

On 5/25/20 5:35 PM, Jerin Jacob wrote:

On May 25, 2020 Thomas Monjalon wrote:

My concern about clarity is the history of the discussion.
When we post a new versions in GitHub, it's very hard to keep

track

of the history.
As a maintainer, I need to see the history to understand what

happened,

what we are waiting for, and what should be merged.


IMO, The complete history is available per pull request URL.
I think, Github also email notification mechanism those to

prefer to see

comments in the email too.

In addition to that, Bugzilla, patchwork, CI stuff all

integrated into

one place.
I am quite impressed with vscode community collaboration.
https://github.com/Microsoft/vscode/pulls


Out of curiosity, just checked the git history and I'm not that
impressed. For example last commit on the master branch:



https://github.com/microsoft/vscode/commit/2a4cecf3f2f72346d06990feeb74
46b3915d6148



Commit title: " Fix #98530 "
Commit message empty, no explanation on what the patch is doing.

Then, let's check the the issue it is pointed to:
https://github.com/microsoft/vscode/issues/98530

Issue is created 15 minutes before the patch is being merged. All

that

done by the same contributor, without any review.



Just because they do it wrong doesn't mean we can't do it right :)

This

says more about Microsoft's lack of process around VSCode than it

does

about Github the tool.



True. I was just pointing out that is not the kind of process I

would

personally want to adopt.



You won't find disagreement here, but this "process" is not due to

the

tool. You can just as well allow Thomas to merge stuff without any
review because he has commit rights, no Github needed - and you would

be

faced with the same problem.

So, i don't think Jerin was suggesting that we degrade our

merge/commit

rules. Rather, the point was that (whatever you think of VSCode's
review/merge process) there are a lot of pull requests and there is
healthy community collaboration. I'm not saying we don't have that,


Yes, recent survey said the process was fine:
http://mails.dpdk.org/archives/announce/2019-June/000268.html



obviously, but i have a suspicion that we'll get more of it if we

lower

the barrier for entry (not the barrier for merge!). I think there is

a

way to lower the secondary skill level needed to contribute to DPDK
without lowering coding/merge standards with it.


That is exactly what I am asking for: Lowering the barrier and increasing the 
feeling of success for newcomers. (The barrier for merge is probably fine; I'll 
leave that discussion to the maintainers.)



About the barrier for entry, maybe it is not obvious because I don't
communicate a lot about it, but please be aware that I (and other
maintainers I think) are doing a lot of changes in newcomer patches
to avoid asking them knowing the whole process from the beginning.
Then frequent contributors get educated on the way.


Great! I wish that every developer would think and behave this way.


Part of the problem is, there are two different maintainers here: 
maintainers like myself, who maintain a certain area of the code, and 
maintainers like Thomas, who has *commit rights* and maintains the 
entire tree.


And therein lies the problem: Thomas (David, etc.) doesn't look at every 
area of the code, he relies on us to do it. However, *he* is doing the 
committing, and fixing up patches, etc. - so, i can't really say things 
like, "hey, your indentation's wrong here, but Thomas will fix it on 
apply" because that's me pushing more work onto Thomas, something i 
don't think i have the moral right to do :)


So, while Thomas is free to "fix on apply" at his own desire, i don't 
think we have to make this a habit.






I think the only real barrier we have is to sign the patch
with a real name and send an email to right list.
The ask for SoB real name is probably what started this thread
in Morten's mind. And the SoB requirement will *never* change.


The incorrect Signed-off-by might be the only hard barrier (which we cannot 
avoid). But that did not trigger me.

I was raising the discussion to bring attention to soft barriers for 
contributors. What triggered me was the request to split the patch into 
multiple patches; a kind of feedback I have seen before. For an experienced git 
user, this is probably very easy, but for a git newbie (like myself), it 
basically means starting all over and trying to figure out the right set of git 
commands to do this, which can be perceived as a difficult task requiring a lot 
of effort.

Perhaps we could supplement the Contributor Guidelines with a set of cookbooks 
for different s

[dpdk-dev] [PATCH] lib/librte_net: fix bug for ipv4 checksum calculating

2020-05-26 Thread guohongzhi
From: Hongzhi Guo 

0x is invalid for IPv4 checksum(RFC1624)

Fixes: 6006818cfb26 ("net: new checksum functions")
Cc: sta...@dpdk.org

Reviewed-By: Morten Brørup 
Acked-by: Olivier Matz 

Signed-off-by: Hongzhi Guo 
---
 lib/librte_net/rte_ip.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 1ceb7b7..ece2e43 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -267,7 +267,7 @@ rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr)
 {
uint16_t cksum;
cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
-   return (cksum == 0x) ? cksum : (uint16_t)~cksum;
+   return (uint16_t)~cksum;
 }
 
 /**
-- 
2.21.0.windows.1




Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Jerin Jacob
On Tue, May 26, 2020 at 3:13 PM Burakov, Anatoly
 wrote:
>
> On 25-May-20 7:44 PM, Morten Brørup wrote:
> >> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Thomas Monjalon
> >> Sent: Monday, May 25, 2020 6:29 PM
> >>
> >> 25/05/2020 18:09, Burakov, Anatoly:
> >>> On 25-May-20 5:04 PM, Maxime Coquelin wrote:
>  On 5/25/20 5:59 PM, Burakov, Anatoly wrote:
> > On 25-May-20 4:52 PM, Maxime Coquelin wrote:
> >> On 5/25/20 5:35 PM, Jerin Jacob wrote:
> >>> On May 25, 2020 Thomas Monjalon wrote:
>  My concern about clarity is the history of the discussion.
>  When we post a new versions in GitHub, it's very hard to keep
> >> track
>  of the history.
>  As a maintainer, I need to see the history to understand what
> >> happened,
>  what we are waiting for, and what should be merged.
> >>>
> >>> IMO, The complete history is available per pull request URL.
> >>> I think, Github also email notification mechanism those to
> >> prefer to see
> >>> comments in the email too.
> >>>
> >>> In addition to that, Bugzilla, patchwork, CI stuff all
> >> integrated into
> >>> one place.
> >>> I am quite impressed with vscode community collaboration.
> >>> https://github.com/Microsoft/vscode/pulls
> >>
> >> Out of curiosity, just checked the git history and I'm not that
> >> impressed. For example last commit on the master branch:
> >>
> >>
> >> https://github.com/microsoft/vscode/commit/2a4cecf3f2f72346d06990feeb74
> >> 46b3915d6148
> >>
> >>
> >> Commit title: " Fix #98530 "
> >> Commit message empty, no explanation on what the patch is doing.
> >>
> >> Then, let's check the the issue it is pointed to:
> >> https://github.com/microsoft/vscode/issues/98530
> >>
> >> Issue is created 15 minutes before the patch is being merged. All
> >> that
> >> done by the same contributor, without any review.
> >>
> >
> > Just because they do it wrong doesn't mean we can't do it right :)
> >> This
> > says more about Microsoft's lack of process around VSCode than it
> >> does
> > about Github the tool.
> >
> 
>  True. I was just pointing out that is not the kind of process I
> >> would
>  personally want to adopt.
> 
> >>>
> >>> You won't find disagreement here, but this "process" is not due to
> >> the
> >>> tool. You can just as well allow Thomas to merge stuff without any
> >>> review because he has commit rights, no Github needed - and you would
> >> be
> >>> faced with the same problem.
> >>>
> >>> So, i don't think Jerin was suggesting that we degrade our
> >> merge/commit
> >>> rules. Rather, the point was that (whatever you think of VSCode's
> >>> review/merge process) there are a lot of pull requests and there is
> >>> healthy community collaboration. I'm not saying we don't have that,
> >>
> >> Yes, recent survey said the process was fine:
> >>  http://mails.dpdk.org/archives/announce/2019-June/000268.html
> >>
> >>
> >>> obviously, but i have a suspicion that we'll get more of it if we
> >> lower
> >>> the barrier for entry (not the barrier for merge!). I think there is
> >> a
> >>> way to lower the secondary skill level needed to contribute to DPDK
> >>> without lowering coding/merge standards with it.
> >
> > That is exactly what I am asking for: Lowering the barrier and increasing 
> > the feeling of success for newcomers. (The barrier for merge is probably 
> > fine; I'll leave that discussion to the maintainers.)
> >
> >>
> >> About the barrier for entry, maybe it is not obvious because I don't
> >> communicate a lot about it, but please be aware that I (and other
> >> maintainers I think) are doing a lot of changes in newcomer patches
> >> to avoid asking them knowing the whole process from the beginning.
> >> Then frequent contributors get educated on the way.
> >
> > Great! I wish that every developer would think and behave this way.
>
> Part of the problem is, there are two different maintainers here:
> maintainers like myself, who maintain a certain area of the code, and
> maintainers like Thomas, who has *commit rights* and maintains the
> entire tree.

Yes. I had a similar thought when I said about the "fine-grained"
maintainership/ownership.
The patchwork does not reflect the fine-grained owner of this patch series.
IMO, patch review will speed up or improve if we give the
responsibility of the patch to
specific maintainer based on the MAINTAINERS file.

Github picks up the default owner as CODEOWNERS(The PRIMARY one
responsible for the file or section of the code)
 https://github.com/zephyrproject-rtos/zephyr/blob/master/CODEOWNERS.

The policy for merge permission( Can CODEOWNERS merge the patch) will
be specific to the project.
IMO, This scheme would enable CODEOWNERS are more responsible for the
code review and
we have need system where query what is pending the CODEOWERS.
This http://patches.dpdk.org/project/dpdk/ li

Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Thomas Monjalon
26/05/2020 12:16, Jerin Jacob:
> Burakov, Anatoly wrote:
> > On 25-May-20 7:44 PM, Morten Brørup wrote:
> > > From: Thomas Monjalon
> > >> About the barrier for entry, maybe it is not obvious because I don't
> > >> communicate a lot about it, but please be aware that I (and other
> > >> maintainers I think) are doing a lot of changes in newcomer patches
> > >> to avoid asking them knowing the whole process from the beginning.
> > >> Then frequent contributors get educated on the way.
> > >
> > > Great! I wish that every developer would think and behave this way.
> >
> > Part of the problem is, there are two different maintainers here:
> > maintainers like myself, who maintain a certain area of the code, and
> > maintainers like Thomas, who has *commit rights* and maintains the
> > entire tree.

Let's call these roles "component maintainer" and "tree maintainer".


> Yes. I had a similar thought when I said about the "fine-grained"
> maintainership/ownership.
> The patchwork does not reflect the fine-grained owner of this patch series.

Indeed, patchwork is about patch integration status.
The delegated person is the one responsible for merge, not review.

> IMO, patch review will speed up or improve if we give the
> responsibility of the patch to
> specific maintainer based on the MAINTAINERS file.

I partially disagree about being strict on review responsibility.
Reviews can and should be done by anyone in the community.
This is how we scale: avoid bottlenecks.
Reminder: multiple reviewers are better, and should be the standard.

The component maintainer responsibility is doing some reviews of course,
but the main responsibility is to make sure reviews are done.


> Github picks up the default owner as CODEOWNERS(The PRIMARY one
> responsible for the file or section of the code)
>  https://github.com/zephyrproject-rtos/zephyr/blob/master/CODEOWNERS.

The git-send-email option --cc-cmd devtools/get-maintainer.sh
does a good job at finding code owners.


> The policy for merge permission( Can CODEOWNERS merge the patch) will
> be specific to the project.
> IMO, This scheme would enable CODEOWNERS are more responsible for the
> code review and
> we have need system where query what is pending the CODEOWERS.
> This http://patches.dpdk.org/project/dpdk/ list does not depict the
> CODEOWERS in DPDK.

Not sure I understood your proposal. You would like one more column
in patchwork which is automatically filled with code owners?


> > And therein lies the problem: Thomas (David, etc.) doesn't look at every
> > area of the code, he relies on us to do it. However, *he* is doing the
> > committing, and fixing up patches, etc. - so, i can't really say things
> > like, "hey, your indentation's wrong here, but Thomas will fix it on
> > apply" because that's me pushing more work onto Thomas, something i
> > don't think i have the moral right to do :)

You can send a new version of the patch with the details fixed,
publicly readable, reviewable, and ready to be pushed.


> > So, while Thomas is free to "fix on apply" at his own desire, i don't
> > think we have to make this a habit.

Yes, it should be more or less an exception.

Bottom line, it is important to be transparent and predictable,
while keeping some flexibility.




Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Burakov, Anatoly

On 26-May-20 11:33 AM, Thomas Monjalon wrote:




And therein lies the problem: Thomas (David, etc.) doesn't look at every
area of the code, he relies on us to do it. However, *he* is doing the
committing, and fixing up patches, etc. - so, i can't really say things
like, "hey, your indentation's wrong here, but Thomas will fix it on
apply" because that's me pushing more work onto Thomas, something i
don't think i have the moral right to do :)


You can send a new version of the patch with the details fixed,
publicly readable, reviewable, and ready to be pushed.


To be completely honest, that's something that's never occurred to me, 
and it sounds like a great idea. The downside is that taking over 
someone else's patch and resubmitting it may be taken the wrong way :) 
(and could also lead to confusion e.g. regarding versioning)






So, while Thomas is free to "fix on apply" at his own desire, i don't
think we have to make this a habit.


Yes, it should be more or less an exception.

Bottom line, it is important to be transparent and predictable,
while keeping some flexibility.





--
Thanks,
Anatoly


Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Jerin Jacob
On Tue, May 26, 2020 at 4:04 PM Thomas Monjalon  wrote:
>
> 26/05/2020 12:16, Jerin Jacob:
> > Burakov, Anatoly wrote:
> > > On 25-May-20 7:44 PM, Morten Brørup wrote:
> > > > From: Thomas Monjalon
> > > >> About the barrier for entry, maybe it is not obvious because I don't
> > > >> communicate a lot about it, but please be aware that I (and other
> > > >> maintainers I think) are doing a lot of changes in newcomer patches
> > > >> to avoid asking them knowing the whole process from the beginning.
> > > >> Then frequent contributors get educated on the way.
> > > >
> > > > Great! I wish that every developer would think and behave this way.
> > >
> > > Part of the problem is, there are two different maintainers here:
> > > maintainers like myself, who maintain a certain area of the code, and
> > > maintainers like Thomas, who has *commit rights* and maintains the
> > > entire tree.
>
> Let's call these roles "component maintainer" and "tree maintainer".
>
>
> > Yes. I had a similar thought when I said about the "fine-grained"
> > maintainership/ownership.
> > The patchwork does not reflect the fine-grained owner of this patch series.
>
> Indeed, patchwork is about patch integration status.
> The delegated person is the one responsible for merge, not review.

Yes. That's the problem. Merge will happen after the review.
Who is the owner of the review? It should be
"component maintainer" and it needs to track somewhere to see
the status and know the trend for release.
That make more transparent and know the fate on the patch on early
stage.


>
> > IMO, patch review will speed up or improve if we give the
> > responsibility of the patch to
> > specific maintainer based on the MAINTAINERS file.
>
> I partially disagree about being strict on review responsibility.
> Reviews can and should be done by anyone in the community.
> This is how we scale: avoid bottlenecks.
> Reminder: multiple reviewers are better, and should be the standard.

Yes. No disagreement on that. Anyone free to review. None of the above proposed
the scheme is stopping it.

>
> The component maintainer responsibility is doing some reviews of course,
> but the main responsibility is to make sure reviews are done.
>
>
> > Github picks up the default owner as CODEOWNERS(The PRIMARY one
> > responsible for the file or section of the code)
> >  https://github.com/zephyrproject-rtos/zephyr/blob/master/CODEOWNERS.
>
> The git-send-email option --cc-cmd devtools/get-maintainer.sh
> does a good job at finding code owners.
>
>
> > The policy for merge permission( Can CODEOWNERS merge the patch) will
> > be specific to the project.
> > IMO, This scheme would enable CODEOWNERS are more responsible for the
> > code review and
> > we have need system where query what is pending the CODEOWERS.
> > This http://patches.dpdk.org/project/dpdk/ list does not depict the
> > CODEOWERS in DPDK.
>
> Not sure I understood your proposal. You would like one more column
> in patchwork which is automatically filled with code owners?

Yes and the patch's primary _review_ responsibly will be with code owners
and "tree maintainer" apply the patch in fixed time when gets ack from
primary code
owner and if there is no comment from "tree maintainers".


>
>
> > > And therein lies the problem: Thomas (David, etc.) doesn't look at every
> > > area of the code, he relies on us to do it. However, *he* is doing the
> > > committing, and fixing up patches, etc. - so, i can't really say things
> > > like, "hey, your indentation's wrong here, but Thomas will fix it on
> > > apply" because that's me pushing more work onto Thomas, something i
> > > don't think i have the moral right to do :)
>
> You can send a new version of the patch with the details fixed,
> publicly readable, reviewable, and ready to be pushed.
>
>
> > > So, while Thomas is free to "fix on apply" at his own desire, i don't
> > > think we have to make this a habit.
>
> Yes, it should be more or less an exception.
>
> Bottom line, it is important to be transparent and predictable,
> while keeping some flexibility.

I agree.

>
>


Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Thomas Monjalon
26/05/2020 12:52, Burakov, Anatoly:
> On 26-May-20 11:33 AM, Thomas Monjalon wrote:
> 
> >>> And therein lies the problem: Thomas (David, etc.) doesn't look at every
> >>> area of the code, he relies on us to do it. However, *he* is doing the
> >>> committing, and fixing up patches, etc. - so, i can't really say things
> >>> like, "hey, your indentation's wrong here, but Thomas will fix it on
> >>> apply" because that's me pushing more work onto Thomas, something i
> >>> don't think i have the moral right to do :)
> > 
> > You can send a new version of the patch with the details fixed,
> > publicly readable, reviewable, and ready to be pushed.
> 
> To be completely honest, that's something that's never occurred to me, 
> and it sounds like a great idea. The downside is that taking over 
> someone else's patch and resubmitting it may be taken the wrong way :) 
> (and could also lead to confusion e.g. regarding versioning)

It happens to me to continuing work started by someone else.
I keep original authorship, add my Signed-off-by, increment versioning,
and insert it in the original thread with --in-reply-to.





Re: [dpdk-dev] [PATCH] doc: plan splitting the ethdev ops struct

2020-05-26 Thread Thomas Monjalon
18/02/2020 06:07, Jerin Jacob:
> On Mon, Feb 17, 2020 at 9:08 PM Ferruh Yigit  wrote:
> >
> > For the ABI compatibility it is better to hide internal data structures
> > from the application as much as possible. But because of some inline
> > functions 'struct eth_dev_ops' can't be hidden completely.
> >
> > Plan is to split the 'struct eth_dev_ops' into two as ones used by
> > inline functions and ones not used, and hide the second part that not
> > used by inline functions completely to the application.
> 
> It is a good improvement.  IMO, If anything used in fast-path it
> should be in ``struct rte_eth_dev``
> and rest can completely be moved to internal. In this case, if
> `rte_eth_tx_descriptor_status`
> not used on fastpath, Maybe we don't need to maintain the inline
> status and move completely
> to .c file.
> 
> Those may be specifics of the work. In general, this change looks good to me.
> 
> Acked-by: Jerin Jacob 

This ack is missing from v3.
Jerin, please could you confirm on v3?





Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDK contribution processes

2020-05-26 Thread Wiles, Keith


> On May 25, 2020, at 2:26 PM, Tom Barbette  wrote:
> 
> 
> Le 25/05/2020 à 19:50, Wiles, Keith a écrit :
>> 
>>> On May 25, 2020, at 12:32 PM, Thomas Monjalon  wrote:
>>> 
>>> 25/05/2020 18:57, Wiles, Keith:
 On May 25, 2020, at 11:28 AM, Thomas Monjalon  wrote:
> 25/05/2020 18:09, Burakov, Anatoly:
>> On 25-May-20 5:04 PM, Maxime Coquelin wrote:
>>> On 5/25/20 5:59 PM, Burakov, Anatoly wrote:
 On 25-May-20 4:52 PM, Maxime Coquelin wrote:
> On 5/25/20 5:35 PM, Jerin Jacob wrote:
>> On May 25, 2020 Thomas Monjalon wrote:
>>> My concern about clarity is the history of the discussion.
>>> When we post a new versions in GitHub, it's very hard to keep track
>>> of the history.
>>> As a maintainer, I need to see the history to understand what 
>>> happened,
>>> what we are waiting for, and what should be merged.
>> IMO, The complete history is available per pull request URL.
>> I think, Github also email notification mechanism those to prefer to 
>> see
>> comments in the email too.
>> 
>> In addition to that, Bugzilla, patchwork, CI stuff all integrated 
>> into
>> one place.
>> I am quite impressed with vscode community collaboration.
>> https://github.com/Microsoft/vscode/pulls
> Out of curiosity, just checked the git history and I'm not that
> impressed. For example last commit on the master branch:
> 
> https://github.com/microsoft/vscode/commit/2a4cecf3f2f72346d06990feeb7446b3915d6148
> 
> 
> Commit title: " Fix #98530 "
> Commit message empty, no explanation on what the patch is doing.
> 
> Then, let's check the the issue it is pointed to:
> https://github.com/microsoft/vscode/issues/98530
> 
> Issue is created 15 minutes before the patch is being merged. All that
> done by the same contributor, without any review.
> 
 Just because they do it wrong doesn't mean we can't do it right :) This
 says more about Microsoft's lack of process around VSCode than it does
 about Github the tool.
 
>>> True. I was just pointing out that is not the kind of process I would
>>> personally want to adopt.
>>> 
>> You won't find disagreement here, but this "process" is not due to the
>> tool. You can just as well allow Thomas to merge stuff without any
>> review because he has commit rights, no Github needed - and you would be
>> faced with the same problem.
>> 
>> So, i don't think Jerin was suggesting that we degrade our merge/commit
>> rules. Rather, the point was that (whatever you think of VSCode's
>> review/merge process) there are a lot of pull requests and there is
>> healthy community collaboration. I'm not saying we don't have that,
> Yes, recent survey said the process was fine:
>   http://mails.dpdk.org/archives/announce/2019-June/000268.html
 IMO the survey is not a great tool for these types of things. The tech 
 board and others that fully understand the process should decide. From my 
 experience using Github or Gitlab is much easy and a single tool to submit 
 patches to a project. Anatoly and others stated it very well and we should 
 convert IMO, as I have always stated in the past.
> 
>> obviously, but i have a suspicion that we'll get more of it if we lower
>> the barrier for entry (not the barrier for merge!). I think there is a
>> way to lower the secondary skill level needed to contribute to DPDK
>> without lowering coding/merge standards with it.
> About the barrier for entry, maybe it is not obvious because I don't
> communicate a lot about it, but please be aware that I (and other
> maintainers I think) are doing a lot of changes in newcomer patches
> to avoid asking them knowing the whole process from the beginning.
> Then frequent contributors get educated on the way.
> 
> I think the only real barrier we have is to sign the patch
> with a real name and send an email to right list.
> The ask for SoB real name is probably what started this thread
> in Morten's mind. And the SoB requirement will *never* change.
 Would it not free up your time and energies by have the tools
 do most of the work. then you can focus on what matters the patch
 and developing more features?
>>> No, GitHub is not helping to track root cause and define what should be 
>>> backported.
>>> It does not help to track Coverity issues.
>>> It does not add Acks automatically (but patchwork does).
>>> It does not send a notification when enough review is done (judgement 
>>> needed here).
>>> It does not split patches when different bugs are fixed.
>>> etc...
>> Thanks for reading my emails and I am trying to help DPDK as a whole.
>> 
>> All of these seem to be suppo

Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDK contribution processes

2020-05-26 Thread Wiles, Keith


> On May 26, 2020, at 4:33 AM, Burakov, Anatoly  
> wrote:
> 
> On 25-May-20 8:26 PM, Tom Barbette wrote:
>> Le 25/05/2020 à 19:50, Wiles, Keith a écrit :
>>> 
 On May 25, 2020, at 12:32 PM, Thomas Monjalon  wrote:
 
 25/05/2020 18:57, Wiles, Keith:
> On May 25, 2020, at 11:28 AM, Thomas Monjalon  wrote:
>> 25/05/2020 18:09, Burakov, Anatoly:
>>> On 25-May-20 5:04 PM, Maxime Coquelin wrote:
 On 5/25/20 5:59 PM, Burakov, Anatoly wrote:
> On 25-May-20 4:52 PM, Maxime Coquelin wrote:
>> On 5/25/20 5:35 PM, Jerin Jacob wrote:
>>> On May 25, 2020 Thomas Monjalon wrote:
 My concern about clarity is the history of the discussion.
 When we post a new versions in GitHub, it's very hard to keep track
 of the history.
 As a maintainer, I need to see the history to understand what 
 happened,
 what we are waiting for, and what should be merged.
>>> IMO, The complete history is available per pull request URL.
>>> I think, Github also email notification mechanism those to prefer 
>>> to see
>>> comments in the email too.
>>> 
>>> In addition to that, Bugzilla, patchwork, CI stuff all integrated 
>>> into
>>> one place.
>>> I am quite impressed with vscode community collaboration.
>>> https://github.com/Microsoft/vscode/pulls
>> Out of curiosity, just checked the git history and I'm not that
>> impressed. For example last commit on the master branch:
>> 
>> https://github.com/microsoft/vscode/commit/2a4cecf3f2f72346d06990feeb7446b3915d6148
>>  
>> 
>> 
>> Commit title: " Fix #98530 "
>> Commit message empty, no explanation on what the patch is doing.
>> 
>> Then, let's check the the issue it is pointed to:
>> https://github.com/microsoft/vscode/issues/98530
>> 
>> Issue is created 15 minutes before the patch is being merged. All 
>> that
>> done by the same contributor, without any review.
>> 
> Just because they do it wrong doesn't mean we can't do it right :) 
> This
> says more about Microsoft's lack of process around VSCode than it does
> about Github the tool.
> 
 True. I was just pointing out that is not the kind of process I would
 personally want to adopt.
 
>>> You won't find disagreement here, but this "process" is not due to the
>>> tool. You can just as well allow Thomas to merge stuff without any
>>> review because he has commit rights, no Github needed - and you would be
>>> faced with the same problem.
>>> 
>>> So, i don't think Jerin was suggesting that we degrade our merge/commit
>>> rules. Rather, the point was that (whatever you think of VSCode's
>>> review/merge process) there are a lot of pull requests and there is
>>> healthy community collaboration. I'm not saying we don't have that,
>> Yes, recent survey said the process was fine:
>> http://mails.dpdk.org/archives/announce/2019-June/000268.html
> IMO the survey is not a great tool for these types of things. The tech 
> board and others that fully understand the process should decide. From my 
> experience using Github or Gitlab is much easy and a single tool to 
> submit patches to a project. Anatoly and others stated it very well and 
> we should convert IMO, as I have always stated in the past.
>> 
>>> obviously, but i have a suspicion that we'll get more of it if we lower
>>> the barrier for entry (not the barrier for merge!). I think there is a
>>> way to lower the secondary skill level needed to contribute to DPDK
>>> without lowering coding/merge standards with it.
>> About the barrier for entry, maybe it is not obvious because I don't
>> communicate a lot about it, but please be aware that I (and other
>> maintainers I think) are doing a lot of changes in newcomer patches
>> to avoid asking them knowing the whole process from the beginning.
>> Then frequent contributors get educated on the way.
>> 
>> I think the only real barrier we have is to sign the patch
>> with a real name and send an email to right list.
>> The ask for SoB real name is probably what started this thread
>> in Morten's mind. And the SoB requirement will *never* change.
> Would it not free up your time and energies by have the tools
> do most of the work. then you can focus on what matters the patch
> and developing more features?
 No, GitHub is not helping to track root cause and define what should be 
 backported.
 It does not help to track Coverity issues.
 It does not add Acks automatically (but patchwork does).
 It does not send a notification when enough review is done (judgement 
 needed here).
 

Re: [dpdk-dev] [PATCH 3/3] lib: remind experimental status in library headers

2020-05-26 Thread Eads, Gage



> -Original Message-
> From: David Marchand 
> Sent: Friday, May 22, 2020 1:59 AM
> To: dev@dpdk.org
> Cc: tho...@monjalon.net; techbo...@dpdk.org; sta...@dpdk.org; Chautru,
> Nicolas ; Ananyev, Konstantin
> ; Trahe, Fiona ;
> Ashish Gupta ; Medvedkin, Vladimir
> ; Iremonger, Bernard
> ; Honnappa Nagarahalli
> ; Eads, Gage ; Olivier
> Matz ; Laatz, Kevin 
> Subject: [PATCH 3/3] lib: remind experimental status in library headers
> 
> The following libraries are experimental, all of their functions can change or
> disappear:
> 
> - librte_bbdev
> - librte_bpf
> - librte_compressdev
> - librte_fib
> - librte_flow_classify
> - librte_ipsec
> - librte_rcu
> - librte_rib
> - librte_stack

Thanks David. The stack library was added a year ago and its interfaces have 
been stable since then, so I think it better to drop its experimental tag 
altogether.

If there's no opposition to that, I can submit that patch separately.

Thanks,
Gage


Re: [dpdk-dev] [PATCH v3] doc: plan splitting the ethdev ops struct

2020-05-26 Thread Thomas Monjalon
25/05/2020 11:11, Andrew Rybchenko:
> On 5/25/20 2:18 AM, Thomas Monjalon wrote:
> > 04/03/2020 10:57, Ferruh Yigit:
> >> For the ABI compatibility it is better to hide internal data structures
> >> from the application as much as possible. But because of some inline
> >> functions 'struct eth_dev_ops' can't be hidden completely.
> >>
> >> Plan is to split the 'struct eth_dev_ops' into two as ones used by
> >> inline functions and ones not used, and hide the second part that not
> >> used by inline functions completely to the application.
> >>
> >> Because of ABI break the work will be done in 20.11
> >>
> >> Signed-off-by: Ferruh Yigit 
> >> ---
> >> +* ethdev: Split the ``struct eth_dev_ops`` struct to hide it as much as 
> >> possible
> >> +  will be done in 20.11.
> >> +  Currently the ``struct eth_dev_ops`` struct is accessible by the 
> >> application
> >> +  because some inline functions, like ``rte_eth_tx_descriptor_status()``,
> >> +  access the struct directly.
> >> +  The struct will be separate in two, the ops used by inline functions 
> >> will be moved
> >> +  next to Rx/Tx burst functions, rest of the ``struct eth_dev_ops`` 
> >> struct will be
> >> +  moved to header file for drivers to hide it from applications.
> > Acked-by: Thomas Monjalon 
> 
> Acked-by: Andrew Rybchenko 

Acked-by: David Marchand 

Applied, thanks




Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Burakov, Anatoly

On 26-May-20 1:45 PM, Thomas Monjalon wrote:

26/05/2020 12:52, Burakov, Anatoly:

On 26-May-20 11:33 AM, Thomas Monjalon wrote:


And therein lies the problem: Thomas (David, etc.) doesn't look at every
area of the code, he relies on us to do it. However, *he* is doing the
committing, and fixing up patches, etc. - so, i can't really say things
like, "hey, your indentation's wrong here, but Thomas will fix it on
apply" because that's me pushing more work onto Thomas, something i
don't think i have the moral right to do :)


You can send a new version of the patch with the details fixed,
publicly readable, reviewable, and ready to be pushed.


To be completely honest, that's something that's never occurred to me,
and it sounds like a great idea. The downside is that taking over
someone else's patch and resubmitting it may be taken the wrong way :)
(and could also lead to confusion e.g. regarding versioning)


It happens to me to continuing work started by someone else.
I keep original authorship, add my Signed-off-by, increment versioning,
and insert it in the original thread with --in-reply-to.



No, confusion not on your side, but on the side of the person whose 
patch has been taken over :)


--
Thanks,
Anatoly


Re: [dpdk-dev] [dpdk-techboard] Consider improving the DPDKcontribution processes

2020-05-26 Thread Thomas Monjalon
26/05/2020 15:57, Burakov, Anatoly:
> On 26-May-20 1:45 PM, Thomas Monjalon wrote:
> > 26/05/2020 12:52, Burakov, Anatoly:
> >> On 26-May-20 11:33 AM, Thomas Monjalon wrote:
> >>
> > And therein lies the problem: Thomas (David, etc.) doesn't look at every
> > area of the code, he relies on us to do it. However, *he* is doing the
> > committing, and fixing up patches, etc. - so, i can't really say things
> > like, "hey, your indentation's wrong here, but Thomas will fix it on
> > apply" because that's me pushing more work onto Thomas, something i
> > don't think i have the moral right to do :)
> >>>
> >>> You can send a new version of the patch with the details fixed,
> >>> publicly readable, reviewable, and ready to be pushed.
> >>
> >> To be completely honest, that's something that's never occurred to me,
> >> and it sounds like a great idea. The downside is that taking over
> >> someone else's patch and resubmitting it may be taken the wrong way :)
> >> (and could also lead to confusion e.g. regarding versioning)
> > 
> > It happens to me to continuing work started by someone else.
> > I keep original authorship, add my Signed-off-by, increment versioning,
> > and insert it in the original thread with --in-reply-to.
> 
> No, confusion not on your side, but on the side of the person whose 
> patch has been taken over :)

I understood it correctly :)
This is what I call collaboration.
The best is to have good communication with its peers,
then workload sharing becomes a detail, in my opinion.




Re: [dpdk-dev] [dpdk-announce] release candidate 20.05-rc4

2020-05-26 Thread Thinh Tran

Hi-

IBM - DPDK on Power result

*Basic PF on Mallanox: No new errors or regressions were seen.
*Performance: no degradation compared to 20.02

System tested:
 - IBM Power9 Model 8335-101 CPU: 2.3 (pvr 004e 1203)
Tested NICs:
 - Mellanox Technologies MT28800 Family [ConnectX-5 Ex]
 - firmware version: 16.26.4012
 - MLNX_OFED_LINUX-4.7-3.2.9.1


Regards,
Thinh Tran

On 5/24/2020 7:09 PM, Thomas Monjalon wrote:

A new DPDK release candidate is ready for testing:
https://git.dpdk.org/dpdk/tag/?id=v20.05-rc4

There are 44 new patches in this snapshot.

Release notes:
http://doc.dpdk.org/guides/rel_notes/release_20_05.html
Some deprecation notices might be added if reviewed on time.

This is the last release candidate for DPDK 20.05.
After -rc4 there should be only doc updates.
Please share some release validation results
by replying to this message (at dev@dpdk.org).
If no critical issue is reported, 20.05 will be closed on Tuesday 26 May.

If you are preparing the next release cycle, please send your v1 patches
before the 20.08 proposal deadline, the Friday 12 June.
It is also time to build an estimated roadmap for the next cycles.

Thank you everyone




Re: [dpdk-dev] [PATCH v3] doc: announce the removal of RTE_KDRV_NONE based probe

2020-05-26 Thread Olivier Matz
On Mon, May 25, 2020 at 10:20:29AM +0200, Maxime Coquelin wrote:
> 
> 
> On 5/25/20 10:15 AM, jer...@marvell.com wrote:
> > From: Jerin Jacob 
> > 
> > In order to optimize the DPDK PCI enumeration management, RTE_KDRV_NONE
> > based device driver probing will be removed in v20.08.
> > The legacy virtio is the only consumer of RTE_KDRV_NONE based
> > device  driver probe scheme.
> > The legacy virtio support will be available through existing VFIO/UIO
> > based kernel driver scheme.
> > More details at http://patches.dpdk.org/patch/69351/
> > 
> > Cc: maxime.coque...@redhat.com
> > Cc: david.march...@redhat.com
> > Signed-off-by: Jerin Jacob 
> > ---
> >  doc/guides/rel_notes/deprecation.rst | 8 
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/doc/guides/rel_notes/deprecation.rst 
> > b/doc/guides/rel_notes/deprecation.rst
> > index 2d11bae93..c7fb368ff 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -132,3 +132,11 @@ Deprecation Notices
> >Python 2 support will be completely removed in 20.11.
> >In 20.08, explicit deprecation warnings will be displayed when running
> >scripts with Python 2.
> > +
> > +* pci: Remove ``RTE_KDRV_NONE`` based device driver probing.
> > +  In order to optimize the DPDK PCI enumeration management, 
> > ``RTE_KDRV_NONE``
> > +  based device driver probing will be removed in v20.08.
> > +  The legacy virtio is the only consumer of ``RTE_KDRV_NONE`` based device
> > +  driver probe scheme. The legacy virtio support will be available through
> > +  the existing VFIO/UIO based kernel driver scheme.
> > +  More details at http://patches.dpdk.org/patch/69351/
> > 
> 
> Acked-by: Maxime Coquelin 

Acked-by: Olivier Matz 


Re: [dpdk-dev] [PATCH v3] doc: announce the removal of RTE_KDRV_NONE based probe

2020-05-26 Thread Thomas Monjalon
26/05/2020 16:44, Olivier Matz:
> On Mon, May 25, 2020 at 10:20:29AM +0200, Maxime Coquelin wrote:
> > On 5/25/20 10:15 AM, jer...@marvell.com wrote:
> > > From: Jerin Jacob 
> > > 
> > > In order to optimize the DPDK PCI enumeration management, RTE_KDRV_NONE
> > > based device driver probing will be removed in v20.08.
> > > The legacy virtio is the only consumer of RTE_KDRV_NONE based
> > > device  driver probe scheme.
> > > The legacy virtio support will be available through existing VFIO/UIO
> > > based kernel driver scheme.
> > > More details at http://patches.dpdk.org/patch/69351/
[...]
> > > --- a/doc/guides/rel_notes/deprecation.rst
> > > +++ b/doc/guides/rel_notes/deprecation.rst
> > > +* pci: Remove ``RTE_KDRV_NONE`` based device driver probing.
> > > +  In order to optimize the DPDK PCI enumeration management, 
> > > ``RTE_KDRV_NONE``
> > > +  based device driver probing will be removed in v20.08.
> > > +  The legacy virtio is the only consumer of ``RTE_KDRV_NONE`` based 
> > > device
> > > +  driver probe scheme. The legacy virtio support will be available 
> > > through
> > > +  the existing VFIO/UIO based kernel driver scheme.
> > > +  More details at http://patches.dpdk.org/patch/69351/
> > > 
> > 
> > Acked-by: Maxime Coquelin 
> 
> Acked-by: Olivier Matz 

Acked-by: Thomas Monjalon 

Applied, thanks




Re: [dpdk-dev] [PATCH v1] doc: remove deprecation notice about old devargs changes

2020-05-26 Thread Thomas Monjalon
13/05/2020 12:42, Gaetan Rivet:
> When modifying the rte_devargs implementation, a deprecation notice was
> done for v18.11, regarding internal rte_devargs structure and exposed
> functions.
> 
> Most of the changes were part of v18.11, but the notice was not removed.
> 
> Signed-off-by: Gaetan Rivet 

Applied





Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-05-26 Thread Slava Ovsiienko
Hi, Patrick

ConnectX HW timestamp is the captured value of internal 64-bit counter running 
at the frequency,
reported in the device_frequency_khz field of struct 
mlx5_ifc_cmd_hca_cap_bits{}.
This structure is queried in mlx5_devx_cmd_query_hca_attr() routine.
So, with known frequency it is possible to recalculate timestamp ticks to 
desired units.

With best regards, Slava

> -Original Message-
> From: dev  On Behalf Of PATRICK KEROULAS
> Sent: Friday, May 22, 2020 21:43
> To: Thomas Monjalon 
> Cc: dev@dpdk.org; Vivien Didelot ; Shahaf
> Shuler ; Raslan Darawsheh
> ; Matan Azrad 
> Subject: Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to
> nanoseconds
> 
> > > > > mlx5 part of libibverbs includes a ts-to-ns converter which
> > > > > takes the instantaneous clock info. It's unused in dpdk so far.
> > > > > I've tested it in the device/port init routine and the result
> > > > > looks reliable. Since this approach looks very simple, compared
> > > > > to the time sync mechanism, I'm trying to integrate.
> > > > >
> > > > > The conversion should occur in the primary process (testpmd) I
> suppose.
> > > > > 1) The needed clock info derives from ethernet device. Is it possible 
> > > > > to
> > > > >access that struct from a rx callback?
> > > > > 2) how to attach the nanosecond to mbuf so that `pdump` catches it?
> > > > >(workaround: copy `mbuf->udata64` in forwarded packets.)
> > > > > 3) any other idea?
> > > >
> > > > The timestamp is carried in mbuf.
> > > > Then the conversion must be done by the ethdev caller (application
> > > > or any other upper layer).
> > >
> > > What if the converter function needs a clock_info?
> > > https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi
> > > thub.com%2Flinux-rdma%2Frdma-
> core%2Fblob%2F7af01c79e00555207dee6132d
> > >
> 72e7bfc1bb5485e%2Fproviders%2Fmlx5%2Fmlx5dv.h%23L1201&data=
> 02%7C
> > >
> 01%7Cviacheslavo%40mellanox.com%7C381f1c9dd36f4e18e9c908d7fe8001
> 3b%7
> > >
> Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C63725769806348887
> 6&s
> > >
> data=CNc%2B5dyFCeFRQn56S5NNzEfTCtnInm059wxwX5GX96E%3D&re
> served=0
> > > I'm affraid this info may change by the time the converter is called
> > > by upper layer.
> >
> > Indeed, the clock in the device is not an atomic one :) We need to
> > adjust the time conversion continuously.
> > I am not an expert of time synchronization, so I add more people Cc
> > who could help for having a precise timestamp.
> 
> Thanks Thomas.
> Not sure this is a synchronization issue. We have dedicated processes
> (linuxptp) to keep both NIC and sys clocks in sync with an external clock.
> It is "just" a matter of unit conversion.
> 
> If it has to be performed in dpdk-pdump, I would need some help to retrieve
> mlx5_clock_info from inside a secondary process. Looking at
> mlx5_read_clock(), this info is extracted from ibv_context which looks
> reachable in a primary process only (segfault, if I try in pdump).


Re: [dpdk-dev] [PATCH] mbuf: document rule for new fields and flags

2020-05-26 Thread Olivier Matz
Hi,

On Tue, May 26, 2020 at 01:09:37PM +0530, Jerin Jacob wrote:
> On Tue, May 26, 2020 at 2:54 AM Thomas Monjalon  wrote:
> >
> > Since dynamic fields and flags were added in 19.11,
> > the idea was to use them for new features, not only PMD-specific.
> >
> > The rule is made more explicit in doxygen, in the mbuf guide,
> > and in the contribution design guidelines.
> >
> > For more information about the original design, see the presentation
> > https://www.dpdk.org/wp-content/uploads/sites/35/2019/10/DynamicMbuf.pdf
> >
> > Signed-off-by: Thomas Monjalon 
> > ---
> >  doc/guides/contributing/design.rst | 13 +
> >  doc/guides/prog_guide/mbuf_lib.rst | 23 +++
> >  lib/librte_mbuf/rte_mbuf_core.h|  2 ++
> >  3 files changed, 38 insertions(+)
> >
> > diff --git a/doc/guides/contributing/design.rst 
> > b/doc/guides/contributing/design.rst
> > index d3dd694b65..508115d5bd 100644
> > --- a/doc/guides/contributing/design.rst
> > +++ b/doc/guides/contributing/design.rst
> > @@ -57,6 +57,19 @@ The following config options can be used:
> >  * ``CONFIG_RTE_EXEC_ENV`` is a string that contains the name of the 
> > executive environment.
> >  * ``CONFIG_RTE_EXEC_ENV_FREEBSD`` or ``CONFIG_RTE_EXEC_ENV_LINUX`` are 
> > defined only if we are building for this execution environment.
> >
> > +Mbuf features
> > +-
> > +
> > +The ``rte_mbuf`` structure must be kept small (128 bytes).
> > +
> > +In order to add new features without wasting buffer space for unused 
> > features,
> > +some fields and flags can be registered dynamically in a shared area.
> 
> I think, instead of "can", it should be "must"
>
> > +The "dynamic" mbuf area is the default choice for the new features.

In my opinion, Thomas' proposal is correct, with the next sentence
saying it is the default choice for new features.

Giving guidelines is a good thing (thanks Thomas for documenting it),
but I don't think we should be too strict: the door remains open for
technical debate and exceptions.


> > +
> > +The "dynamic" area is eating the remaining space in mbuf,
> > +and some existing "static" fields may need to become "dynamic".
> > +
> > +
> >  Library Statistics
> >  --
> >
> > diff --git a/doc/guides/prog_guide/mbuf_lib.rst 
> > b/doc/guides/prog_guide/mbuf_lib.rst
> > index 0d3223b081..c3dbfb9221 100644
> > --- a/doc/guides/prog_guide/mbuf_lib.rst
> > +++ b/doc/guides/prog_guide/mbuf_lib.rst
> > @@ -207,6 +207,29 @@ The list of flags and their precise meaning is 
> > described in the mbuf API
> >  documentation (rte_mbuf.h). Also refer to the testpmd source code
> >  (specifically the csumonly.c file) for details.
> >
> > +Dynamic fields and flags
> > +
> > +
> > +The size of the mbuf is constrained and limited;
> > +while the amount of metadata to save for each packet is quite unlimited.
> > +The most basic networking information already find their place
> > +in the existing mbuf fields and flags.
> > +
> > +If new features need to be added, the new fields and flags should fit
> 
> How about, instead of "should fit", must use the dynamic space.

Same comment here, I think Thomas's original sentence is fine.

> 
> > +in the "dynamic space", by registering some room in the mbuf structure:
> > +
> > +dynamic field
> > +   named area in the mbuf structure,
> > +   with a given size (at least 1 byte) and alignment constraint.
> > +
> > +dynamic flag
> > +   named bit in the mbuf structure,
> > +   stored in the field ``ol_flags``.
> > +
> > +The dynamic fields and flags are managed with the functions 
> > ``rte_mbuf_dyn*``.
> > +
> > +It is not possible to unregister fields or flags.
> > +
> >  .. _direct_indirect_buffer:
> >
> >  Direct and Indirect Buffers
> > diff --git a/lib/librte_mbuf/rte_mbuf_core.h 
> > b/lib/librte_mbuf/rte_mbuf_core.h
> > index b9a59c879c..22be41e520 100644
> > --- a/lib/librte_mbuf/rte_mbuf_core.h
> > +++ b/lib/librte_mbuf/rte_mbuf_core.h
> > @@ -12,6 +12,8 @@
> >   * packet offload flags and some related macros.
> >   * For majority of DPDK entities, it is not recommended to include
> >   * this file directly, use include  instead.
> > + *
> > + * New fields and flags should fit in the "dynamic space".
> 
> must use.

Same comment here.


Acked-by: Olivier Matz 


Re: [dpdk-dev] [PATCH] mbuf: document rule for new fields and flags

2020-05-26 Thread Jerin Jacob
On Tue, May 26, 2020 at 9:36 PM Olivier Matz  wrote:
>
> Hi,
>
> On Tue, May 26, 2020 at 01:09:37PM +0530, Jerin Jacob wrote:
> > On Tue, May 26, 2020 at 2:54 AM Thomas Monjalon  wrote:
> > >
> > > Since dynamic fields and flags were added in 19.11,
> > > the idea was to use them for new features, not only PMD-specific.
> > >
> > > The rule is made more explicit in doxygen, in the mbuf guide,
> > > and in the contribution design guidelines.
> > >
> > > For more information about the original design, see the presentation
> > > https://www.dpdk.org/wp-content/uploads/sites/35/2019/10/DynamicMbuf.pdf
> > >
> > > Signed-off-by: Thomas Monjalon 
> > > ---
> > >  doc/guides/contributing/design.rst | 13 +
> > >  doc/guides/prog_guide/mbuf_lib.rst | 23 +++
> > >  lib/librte_mbuf/rte_mbuf_core.h|  2 ++
> > >  3 files changed, 38 insertions(+)
> > >
> > > diff --git a/doc/guides/contributing/design.rst 
> > > b/doc/guides/contributing/design.rst
> > > index d3dd694b65..508115d5bd 100644
> > > --- a/doc/guides/contributing/design.rst
> > > +++ b/doc/guides/contributing/design.rst
> > > @@ -57,6 +57,19 @@ The following config options can be used:
> > >  * ``CONFIG_RTE_EXEC_ENV`` is a string that contains the name of the 
> > > executive environment.
> > >  * ``CONFIG_RTE_EXEC_ENV_FREEBSD`` or ``CONFIG_RTE_EXEC_ENV_LINUX`` are 
> > > defined only if we are building for this execution environment.
> > >
> > > +Mbuf features
> > > +-
> > > +
> > > +The ``rte_mbuf`` structure must be kept small (128 bytes).
> > > +
> > > +In order to add new features without wasting buffer space for unused 
> > > features,
> > > +some fields and flags can be registered dynamically in a shared area.
> >
> > I think, instead of "can", it should be "must"
> >
> > > +The "dynamic" mbuf area is the default choice for the new features.
>
> In my opinion, Thomas' proposal is correct, with the next sentence
> saying it is the default choice for new features.
>
> Giving guidelines is a good thing (thanks Thomas for documenting it),
> but I don't think we should be too strict: the door remains open for
> technical debate and exceptions.

If you are open for the exception then it must be mention in what case
the exception is allowed and what are the criteria of the exception?

For example,  Why did n't we choose the following patch as expectation
http://patches.dpdk.org/patch/68733/  even if only one bit used.

If we are not not defining the criteria, IMO, This patch serve no purpose than
the existing situation.

Do you think, any case where the dynamic scheme can not be used as a replacement
for static other than performance hit.


Re: [dpdk-dev] [PATCH] ethdev: add DBDF action to RTE Flow

2020-05-26 Thread David Marchand
Hello Jerin, Kiran,

On Thu, Mar 19, 2020 at 10:26 AM Thomas Monjalon  wrote:
> > > > We have the following use case.
> > > > We have 2 PF's pf0, pf1 and corresponding VF's pf0_vf0 , pf1_vf0. And
> > > > we have
> > > > 3 applications running.
> > > > 1st application on pf0 and pf1
> > > > 2nd application on pf0_vf0
> > > > 3rd application on pf1_vf0.
> > > > We want to direct the traffic matching condition1 from application 1
> > > > (traffic from both pf0 & pf1) needs to send to  application 2
> > > > (pf0_vf0) And matching condition2 from application 1 (traffic from
> > > > both pf0 & pf1) needs to send to application 3 (pf1_vf0).
> > > > To summarize, we need to send traffic from pf0 to pf1_vf0 and traffic
> > > > from pf1 to pf0_vf0. In this case This DBDF action will be useful.
> > > >
> > >
> > > It seems that what you are describing it the port action with 
> > > representors, or any
> > > other way you wish to implement it.
> >
> > Let's say we have a VF with kernel and we want to send the traffic to that 
> > VF, then we can't
> > Use port action. This will be useful in those scenarios.
>
> Sorry I don't understand.
> You mean the VF is managed by a kernel driver while the PF is managed by DPDK?
> So what prevents having a VF representor?

The discussion did not reach a conclusion.
Looking at patchwork, I can see it set to "Not Applicable".

Do you still expect some work on this subject?


Thanks.

-- 
David Marchand



Re: [dpdk-dev] [PATCH] ethdev: add DBDF action to RTE Flow

2020-05-26 Thread Jerin Jacob
On Tue, May 26, 2020 at 10:25 PM David Marchand
 wrote:
>
> Hello Jerin, Kiran,

Hello David,

>
> On Thu, Mar 19, 2020 at 10:26 AM Thomas Monjalon  wrote:
> > > > > We have the following use case.
> > > > > We have 2 PF's pf0, pf1 and corresponding VF's pf0_vf0 , pf1_vf0. And
> > > > > we have
> > > > > 3 applications running.
> > > > > 1st application on pf0 and pf1
> > > > > 2nd application on pf0_vf0
> > > > > 3rd application on pf1_vf0.
> > > > > We want to direct the traffic matching condition1 from application 1
> > > > > (traffic from both pf0 & pf1) needs to send to  application 2
> > > > > (pf0_vf0) And matching condition2 from application 1 (traffic from
> > > > > both pf0 & pf1) needs to send to application 3 (pf1_vf0).
> > > > > To summarize, we need to send traffic from pf0 to pf1_vf0 and traffic
> > > > > from pf1 to pf0_vf0. In this case This DBDF action will be useful.
> > > > >
> > > >
> > > > It seems that what you are describing it the port action with 
> > > > representors, or any
> > > > other way you wish to implement it.
> > >
> > > Let's say we have a VF with kernel and we want to send the traffic to 
> > > that VF, then we can't
> > > Use port action. This will be useful in those scenarios.
> >
> > Sorry I don't understand.
> > You mean the VF is managed by a kernel driver while the PF is managed by 
> > DPDK?
> > So what prevents having a VF representor?
>
> The discussion did not reach a conclusion.
> Looking at patchwork, I can see it set to "Not Applicable".
>
> Do you still expect some work on this subject?

No. We dont need API change, we can manage with VF representor.

>
>
> Thanks.
>
> --
> David Marchand
>


Re: [dpdk-dev] [PATCH] ethdev: add DBDF action to RTE Flow

2020-05-26 Thread David Marchand
On Tue, May 26, 2020 at 6:58 PM Jerin Jacob  wrote:
> > > > > It seems that what you are describing it the port action with 
> > > > > representors, or any
> > > > > other way you wish to implement it.
> > > >
> > > > Let's say we have a VF with kernel and we want to send the traffic to 
> > > > that VF, then we can't
> > > > Use port action. This will be useful in those scenarios.
> > >
> > > Sorry I don't understand.
> > > You mean the VF is managed by a kernel driver while the PF is managed by 
> > > DPDK?
> > > So what prevents having a VF representor?
> >
> > The discussion did not reach a conclusion.
> > Looking at patchwork, I can see it set to "Not Applicable".
> >
> > Do you still expect some work on this subject?
>
> No. We dont need API change, we can manage with VF representor.

Ok, thanks for confirming.

I will mark this patch as Rejected.
"Not Applicable" is used for patches not for dpdk:
- patches for pktgen which uses dev@dpdk.org mailing list,
- incorrect patches sent to dev@dpdk.org,
- patches for stable branches,


-- 
David Marchand



[dpdk-dev] [PATCH] rte_sched: correctly free allocated subport memory

2020-05-26 Thread Hrvoje Habjanic
In function rte_sched_subport_free (lib/librte_sched/rte_sched.c,
line 865), there is code to free all allocated stuff related to
scheduler subport. First there are some checks, and in the end,
rte_bitmap_free is called.

Now, rte_bitmap_free is a dummy function, and it just checks if
provided pointer to bitmap is valid or not. So, actual memory for
subport is not freed.

This patch fixes this by removing call to rte_bitmap_free, and
instead calling rte_free.

Signed-off-by: Hrvoje Habjanic 
---
 lib/librte_sched/rte_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index c0983ddda..f15a3b515 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -888,7 +888,7 @@ rte_sched_subport_free(struct rte_sched_port *port,
}
}
 
-   rte_bitmap_free(subport->bmp);
+   rte_free(subport);
 }
 
 void
-- 
2.17.1



Re: [dpdk-dev] [PATCH 20.08 1/9] app/test-bbdev: support python3 only

2020-05-26 Thread Chautru, Nicolas
Kilheeney, Louise  :
> Sent: Friday, May 22, 2020 6:23 AM
> To: dev@dpdk.org
> Cc: Kilheeney, Louise ; Chautru, Nicolas
> 
> Subject: [PATCH 20.08 1/9] app/test-bbdev: support python3 only
> 
> Changed script to explicitly use python3 only.
> 
> Cc: Nicolas Chautru 
> 
> Signed-off-by: Louise Kilheeney 
> ---
>  app/test-bbdev/test-bbdev.py | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py
> index 0194be046..50add4580 100755
> --- a/app/test-bbdev/test-bbdev.py
> +++ b/app/test-bbdev/test-bbdev.py
> @@ -1,5 +1,4 @@
> -#!/usr/bin/env python
> -
> +#!/usr/bin/env python3
>  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2017 Intel
> Corporation
> 
> @@ -12,7 +11,7 @@
>  from threading import Timer
> 
>  def kill(process):
> -print "ERROR: Test app timed out"
> +print ("ERROR: Test app timed out")
>  process.kill()
> 
>  if "RTE_SDK" in os.environ:
> @@ -66,7 +65,7 @@ def kill(process):
>  args = parser.parse_args()
> 
>  if not os.path.exists(args.testapp_path):
> -print "No such file: " + args.testapp_path
> +print ("No such file: " + args.testapp_path)
>  sys.exit(1)
> 
>  params = [args.testapp_path]
> --
> 2.17.1

I double checked locally, fine with me. Thanks. 

Acked-by: Nic Chautru



[dpdk-dev] [PATCH v2 1/7] ethdev: allow unknown link speed

2020-05-26 Thread Ivan Dyukov
From: Thomas Monjalon 

When querying the link information, the link status is
a mandatory major information.
Other boolean values are supposed to be accurate:
- duplex mode (half/full)
- negotiation (auto/fixed)

This API update is making explicit that the link speed information
is optional.
The value ETH_SPEED_NUM_NONE (0) was already part of the API.
The value ETH_SPEED_NUM_UNKNOWN (infinite) is added to cover
two different cases:
- speed is not known by the driver
- device is virtual

Suggested-by: Morten Brørup 
Suggested-by: Benoit Ganne 
Signed-off-by: Thomas Monjalon 
---
 lib/librte_ethdev/rte_ethdev.h | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index a49242bcd..2090af501 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -303,6 +303,7 @@ struct rte_eth_stats {
 #define ETH_SPEED_NUM_56G  56000 /**<  56 Gbps */
 #define ETH_SPEED_NUM_100G10 /**< 100 Gbps */
 #define ETH_SPEED_NUM_200G20 /**< 200 Gbps */
+#define ETH_SPEED_NUM_UNKNOWN UINT32_MAX /**< Unknown */
 
 /**
  * A structure used to retrieve link-level information of an Ethernet port.
@@ -2262,15 +2263,16 @@ int rte_eth_allmulticast_disable(uint16_t port_id);
 int rte_eth_allmulticast_get(uint16_t port_id);
 
 /**
- * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX
- * or FULL-DUPLEX) of the physical link of an Ethernet device. It might need
- * to wait up to 9 seconds in it.
+ * Retrieve the link status (up/down), the duplex mode (half/full),
+ * the negotiation (auto/fixed), and if available, the speed (Mbps).
+ *
+ * It might need to wait up to 9 seconds.
+ * @see rte_eth_link_get_nowait.
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param link
- *   A pointer to an *rte_eth_link* structure to be filled with
- *   the status, the speed and the mode of the Ethernet device link.
+ *   Link information written back.
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if the function is not supported in PMD driver.
@@ -2279,15 +2281,13 @@ int rte_eth_allmulticast_get(uint16_t port_id);
 int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link);
 
 /**
- * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX
- * or FULL-DUPLEX) of the physical link of an Ethernet device. It is a no-wait
- * version of rte_eth_link_get().
+ * Retrieve the link status (up/down), the duplex mode (half/full),
+ * the negotiation (auto/fixed), and if available, the speed (Mbps).
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param link
- *   A pointer to an *rte_eth_link* structure to be filled with
- *   the status, the speed and the mode of the Ethernet device link.
+ *   Link information written back.
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if the function is not supported in PMD driver.
-- 
2.17.1



[dpdk-dev] [PATCH v2 2/7] ethdev: add a link status text representation

2020-05-26 Thread Ivan Dyukov
This commit add function which treat link status structure
and format it to text representation.

Signed-off-by: Ivan Dyukov 
---
 lib/librte_ethdev/rte_ethdev.c | 39 ++
 lib/librte_ethdev/rte_ethdev.h | 31 +++
 2 files changed, 70 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 8e10a6fc3..8d75c2440 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2385,6 +2385,45 @@ rte_eth_link_get_nowait(uint16_t port_id, struct 
rte_eth_link *eth_link)
return 0;
 }
 
+void
+rte_eth_link_prepare_text(struct rte_eth_link *eth_link, uint32_t speed_unit,
+ struct rte_eth_link_text *link_text)
+{
+   uint32_t link_speed = 0;
+   /* prepare link speed */
+   if (eth_link->link_speed == ETH_SPEED_NUM_UNKNOWN)
+   memcpy(link_text->link_speed, "unknown", sizeof("unknown"));
+   else {
+   if (speed_unit == ETH_SPEED_UNIT_GBPS)
+   link_speed = eth_link->link_speed / 1000;
+   else
+   link_speed = eth_link->link_speed;
+   snprintf(link_text->link_speed, sizeof(link_text->link_speed),
+"%u", link_speed);
+   }
+   /* prepare link duplex */
+   if (eth_link->link_duplex == ETH_LINK_FULL_DUPLEX)
+   memcpy(link_text->link_duplex, "full-duplex",
+   sizeof("full-duplex"));
+   else
+   memcpy(link_text->link_duplex, "half-duplex",
+   sizeof("half-duplex"));
+   /* prepare autoneg */
+   if (eth_link->link_autoneg == ETH_LINK_AUTONEG)
+   memcpy(link_text->link_autoneg, "autoneg",
+   sizeof("autoneg"));
+   else
+   memcpy(link_text->link_autoneg, "fixed",
+   sizeof("fixed"));
+   /* prepare status */
+   if (eth_link->link_status == ETH_LINK_DOWN)
+   memcpy(link_text->link_status, "down",
+   sizeof("down"));
+   else
+   memcpy(link_text->link_status, "up",
+   sizeof("up"));
+}
+
 int
 rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 2090af501..53d2f0c78 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -316,6 +316,19 @@ struct rte_eth_link {
uint16_t link_status  : 1;  /**< ETH_LINK_[DOWN/UP] */
 } __rte_aligned(8);  /**< aligned for atomic64 read/write */
 
+/**
+ * Link speed units
+ */
+#define ETH_SPEED_UNIT_GBPS 0
+#define ETH_SPEED_UNIT_MBPS 1
+
+
+struct rte_eth_link_text {
+   char link_speed[14];  /** link speed */
+   char link_duplex[12];  /** full-duplex or half-duplex */
+   char link_autoneg[8];  /** autoneg or fixed */
+   char link_status[5];  /** down or up */
+};
 /* Utility constants */
 #define ETH_LINK_HALF_DUPLEX 0 /**< Half-duplex connection (see link_duplex). 
*/
 #define ETH_LINK_FULL_DUPLEX 1 /**< Full-duplex connection (see link_duplex). 
*/
@@ -2295,6 +2308,24 @@ int rte_eth_link_get(uint16_t port_id, struct 
rte_eth_link *link);
  */
 int rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link);
 
+/**
+ * Format link status to textual representation. speed_unit is used to convert
+ * link_speed to specified unit. Also this function threats a special
+ * ETH_SPEED_NUM_UNKNOWN value of link_speed and return 'UNKNOWN' speed
+ * in this case.
+ *
+ * @param link
+ *   Link status provided by rte_eth_link_get function
+ * @param speed_unit
+ *   Target units for the speed. Following values are available:
+ *- ETH_SPEED_UNIT_GBPS
+ *- ETH_SPEED_UNIT_MBPS
+ * @param link_text
+ *   A pointer to an *rte_eth_link_text* structure to be filled with
+ *   textual representation of device status
+ */
+void rte_eth_link_prepare_text(struct rte_eth_link *link, uint32_t speed_unit,
+   struct rte_eth_link_text *link_text);
 /**
  * Retrieve the general I/O statistics of an Ethernet device.
  *
-- 
2.17.1



[dpdk-dev] [PATCH v2 0/7] ethdev: allow unknown link speed

2020-05-26 Thread Ivan Dyukov
 app/proc-info/main.c  | 15 +--
 app/test-pipeline/init.c  | 11 ++-
 app/test-pmd/config.c | 20 
 app/test-pmd/testpmd.c| 10 ++
 app/test/test_pmd_perf.c  | 10 ++
 doc/guides/sample_app_ug/link_status_intr.rst |  6 --
 drivers/net/i40e/i40e_ethdev.c|  5 -
 drivers/net/i40e/i40e_ethdev_vf.c | 10 +-
 drivers/net/ice/ice_ethdev.c  |  5 -
 drivers/net/ixgbe/ixgbe_ethdev.c  |  6 +-
 lib/librte_ethdev/rte_ethdev.c| 39 
+++
 lib/librte_ethdev/rte_ethdev.h| 51 
+--
 12 files changed, 137 insertions(+), 51 deletions(-)


v2 changes:
* add function which format link status to textual representation
* update drivers for Intel nics with 'unknown' speed
TBD:
update examples in 'example' folder with new status printing mechanism
update remaining nic drivers with 'unknown' speed

v1 changes:
This is initial patchset which introduces UNKNOWN speed to dpdk
applications. Also it contains changes related to printf formating.
Patchset contains changes for app/ and doc/ folders.
examples/ folder will be provided later.




[dpdk-dev] [PATCH v2 7/7] net/ice: return unknown speed in status

2020-05-26 Thread Ivan Dyukov
rte_ethdev has declared new NUM_UNKNOWN speed which
could be used in case when no speed information is available and
link is up. NUM_NONE should be returned, if link is down.

Signed-off-by: Ivan Dyukov 
---
 drivers/net/ice/ice_ethdev.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index d5110c439..1c0c087ea 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3112,8 +3112,11 @@ ice_link_update(struct rte_eth_dev *dev, int 
wait_to_complete)
link.link_speed = ETH_SPEED_NUM_100G;
break;
case ICE_AQ_LINK_SPEED_UNKNOWN:
-   default:
PMD_DRV_LOG(ERR, "Unknown link speed");
+   link.link_speed = ETH_SPEED_NUM_UNKNOWN;
+   break;
+   default:
+   PMD_DRV_LOG(ERR, "None link speed");
link.link_speed = ETH_SPEED_NUM_NONE;
break;
}
-- 
2.17.1



[dpdk-dev] [PATCH v2 3/7] app: UNKNOWN link speed print format

2020-05-26 Thread Ivan Dyukov
Add usage of rte_eth_link_prepare_text function to example
applications

Signed-off-by: Ivan Dyukov 
---
 app/proc-info/main.c | 15 +--
 app/test-pipeline/init.c | 11 ++-
 app/test-pmd/config.c| 20 
 app/test-pmd/testpmd.c   | 10 ++
 app/test/test_pmd_perf.c | 10 ++
 5 files changed, 39 insertions(+), 27 deletions(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index abeca4aab..d8506cbb2 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -669,6 +669,7 @@ show_port(void)
RTE_ETH_FOREACH_DEV(i) {
uint16_t mtu = 0;
struct rte_eth_link link;
+   struct rte_eth_link_text link_text;
struct rte_eth_dev_info dev_info;
struct rte_eth_rxq_info queue_info;
struct rte_eth_rss_conf rss_conf;
@@ -685,12 +686,14 @@ show_port(void)
printf("Link get failed (port %u): %s\n",
   i, rte_strerror(-ret));
} else {
-   printf("\t  -- link speed %d duplex %d,"
-   " auto neg %d status %d\n",
-   link.link_speed,
-   link.link_duplex,
-   link.link_autoneg,
-   link.link_status);
+   rte_eth_link_prepare_text(&link,
+   ETH_SPEED_UNIT_MBPS, &link_text);
+   printf("\t  -- link speed: %s, duplex: %s,"
+   " auto neg: %s, status: %s\n",
+   link_text.link_speed,
+   link_text.link_duplex,
+   link_text.link_autoneg,
+   link_text.link_status);
}
printf("\t  -- promiscuous (%d)\n",
rte_eth_promiscuous_get(i));
diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
index 67d54ae05..920023825 100644
--- a/app/test-pipeline/init.c
+++ b/app/test-pipeline/init.c
@@ -160,6 +160,7 @@ app_ports_check_link(void)
 
for (i = 0; i < app.n_ports; i++) {
struct rte_eth_link link;
+   struct rte_eth_link_text link_text;
uint16_t port;
int ret;
 
@@ -173,12 +174,12 @@ app_ports_check_link(void)
all_ports_up = 0;
continue;
}
-
-   RTE_LOG(INFO, USER1, "Port %u (%u Gbps) %s\n",
+   rte_eth_link_prepare_text(&link,
+   ETH_SPEED_UNIT_GBPS, &link_text);
+   RTE_LOG(INFO, USER1, "Port %u (%s Gbps) %s\n",
port,
-   link.link_speed / 1000,
-   link.link_status ? "UP" : "DOWN");
-
+   link_text.link_speed,
+   link_text.link_status);
if (link.link_status == ETH_LINK_DOWN)
all_ports_up = 0;
}
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 5381207cc..722f57c12 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -552,6 +552,7 @@ port_infos_display(portid_t port_id)
struct rte_port *port;
struct rte_ether_addr mac_addr;
struct rte_eth_link link;
+   struct rte_eth_link_text link_text;
struct rte_eth_dev_info dev_info;
int vlan_offload;
struct rte_mempool * mp;
@@ -600,10 +601,10 @@ port_infos_display(portid_t port_id)
} else
printf("\nmemory allocation on the socket: %u",port->socket_id);
 
-   printf("\nLink status: %s\n", (link.link_status) ? ("up") : ("down"));
-   printf("Link speed: %u Mbps\n", (unsigned) link.link_speed);
-   printf("Link duplex: %s\n", (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
-  ("full-duplex") : ("half-duplex"));
+   rte_eth_link_prepare_text(&link, ETH_SPEED_UNIT_MBPS, &link_text);
+   printf("\nLink status: %s\n", link_text.link_status);
+   printf("Link speed: %s Mbps\n", link_text.link_speed);
+   printf("Link duplex: %s\n", link_text.link_duplex);
 
if (!rte_eth_dev_get_mtu(port_id, &mtu))
printf("MTU: %u\n", mtu);
@@ -724,6 +725,7 @@ port_summary_display(portid_t port_id)
 {
struct rte_ether_addr mac_addr;
struct rte_eth_link link;
+   struct rte_eth_link_text link_text;
struct rte_eth_dev_info dev_info;
char name[RTE_ETH_NAME_MAX_LEN];
int ret;
@@ -746,12 +748,14 @@ port_summary_display(portid_t port_id)
if (ret != 0)
return;
 
-   printf("%-4d %02X:%02X:%02X:%02X:%02X:%02X %-12s %-14s %-8s %uMbps\n",
+   rte_eth_link_prepare_text(&link, ETH_SPEED_UNIT_GBPS,
+

[dpdk-dev] [PATCH v2 5/7] net/ixgbe: return unknown speed in status

2020-05-26 Thread Ivan Dyukov
rte_ethdev has declared new NUM_UNKNOWN speed which
could be used in case when no speed information is available

Signed-off-by: Ivan Dyukov 
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index a4e5c539d..5b9b13058 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4311,11 +4311,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
switch (link_speed) {
default:
case IXGBE_LINK_SPEED_UNKNOWN:
-   if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
-   hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L)
-   link.link_speed = ETH_SPEED_NUM_10M;
-   else
-   link.link_speed = ETH_SPEED_NUM_100M;
+   link.link_speed = ETH_SPEED_NUM_UNKNOWN;
break;
 
case IXGBE_LINK_SPEED_100_FULL:
-- 
2.17.1



[dpdk-dev] [PATCH v2 4/7] doc: update sample app with unknown speed

2020-05-26 Thread Ivan Dyukov
Add usage of rte_eth_link_prepare_text function to example
applications

Signed-off-by: Ivan Dyukov 
---
 doc/guides/sample_app_ug/link_status_intr.rst | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/guides/sample_app_ug/link_status_intr.rst 
b/doc/guides/sample_app_ug/link_status_intr.rst
index 04c40f285..bdefcd17b 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -157,6 +157,7 @@ An example callback function that has been written as 
indicated below.
 lsi_event_callback(uint16_t port_id, enum rte_eth_event_type type, void 
*param)
 {
 struct rte_eth_link link;
+struct rte_eth_link_text link_text;
 int ret;
 
 RTE_SET_USED(param);
@@ -170,8 +171,9 @@ An example callback function that has been written as 
indicated below.
 printf("Failed to get port %d link status: %s\n\n",
port_id, rte_strerror(-ret));
 } else if (link.link_status) {
-printf("Port %d Link Up - speed %u Mbps - %s\n\n", port_id, 
(unsigned)link.link_speed,
-  (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") 
: ("half-duplex"));
+rte_eth_link_prepare_text(&link), ETH_SPEED_UNIT_MBPS, &link_text);
+printf("Port %d Link Up - speed %s Mbps - %s\n\n", port_id, 
link_text.link_speed,
+  link_text.link_duplex);
 } else
 printf("Port %d Link Down\n\n", port_id);
 }
-- 
2.17.1



[dpdk-dev] [PATCH v2 6/7] net/i40e: return unknown speed in status

2020-05-26 Thread Ivan Dyukov
rte_ethdev has declared new NUM_UNKNOWN speed which
could be used in case when no speed information is available and
link is up. NUM_NONE should be returned, if link is down.

Signed-off-by: Ivan Dyukov 
---
 drivers/net/i40e/i40e_ethdev.c|  5 -
 drivers/net/i40e/i40e_ethdev_vf.c | 10 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 749d85f54..d09b77674 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2889,7 +2889,10 @@ update_link_aq(struct i40e_hw *hw, struct rte_eth_link 
*link,
link->link_speed = ETH_SPEED_NUM_40G;
break;
default:
-   link->link_speed = ETH_SPEED_NUM_NONE;
+   if (link->link_status)
+   link->link_speed = ETH_SPEED_NUM_UNKNOWN;
+   else
+   link->link_speed = ETH_SPEED_NUM_NONE;
break;
}
 }
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c 
b/drivers/net/i40e/i40e_ethdev_vf.c
index bb5d28a44..1da185485 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2165,15 +2165,15 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
new_link.link_speed = ETH_SPEED_NUM_40G;
break;
default:
-   new_link.link_speed = ETH_SPEED_NUM_NONE;
+   if (vf->link_up)
+   new_link.link_speed = ETH_SPEED_NUM_UNKNOWN;
+   else
+   new_link.link_speed = ETH_SPEED_NUM_NONE;
break;
}
/* full duplex only */
new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
-   new_link.link_status = vf->link_up &&
-   new_link.link_speed != ETH_SPEED_NUM_NONE
-   ? ETH_LINK_UP
-   : ETH_LINK_DOWN;
+   new_link.link_status = vf->link_up ? ETH_LINK_UP : ETH_LINK_DOWN;
new_link.link_autoneg =
!(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED);
 
-- 
2.17.1



[dpdk-dev] [dpdk-announce] DPDK 20.05 released

2020-05-26 Thread Thomas Monjalon
A new release is available:
https://fast.dpdk.org/rel/dpdk-20.05.tar.xz

It was a quite big release cycle:
1304 commits from 189 authors
1983 files changed, 145825 insertions(+), 29147 deletions(-)

It is not planned (yet) to start a maintenance branch for 20.05.
This version, as previous one (20.02), is ABI-compatible with 19.11.

Below are some new features, grouped by category.
* General
- packet processing graph
- ring synchronisation modes for VMs and containers
- RCU API for deferred resource reclamation
- telemetry rework
- low overhead tracing framework
- GCC 10 support
* Networking
- flow aging API
- driver for Intel Foxville I225
* Cryptography
- ChaCha20-Poly1305 crypto algorithm
- event mode in the example application ipsec-secgw
* Baseband
- 5G driver for Intel FPGA-based N3000

More details in the release notes:
http://doc.dpdk.org/guides/rel_notes/release_20_05.html


There are 69 new contributors (including authors, reviewers and testers).
Welcome to Andrea Arcangeli, Asim Jamshed, Cheng Peng, Christos Ricudis,
Dave Burley, Dong Zhou, Dongsheng Rong, Eugeny Parshutin, Evan Swanson,
Fady Bader, Farah Smith, Guy Tzalik, Hailin Xu, Igor Russkikh, JP Lee,
Jakub Neruda, James Fox, Jianwei Mei, Jiawei Wang, Jun W Zhou,
Juraj Linkeš, Karra Satwik, Kishore Padmanabha, Lihong Ma, Lijian Zhang,
Linsi Yuan, Louise Kilheeney, Lukasz Wojciechowski, Mairtin o Loingsigh,
Martin Spinler, Matteo Croce, Michael Haeuptle, Mike Baucom,
Mit Matelske, Mohsin Shaikh, Muhammad Ahmad, Muhammad Bilal, Nannan Lu,
Narcisa Vasile, Niall Power, Peter Spreadborough, Przemyslaw Patynowski,
Qi Fu, Real Valiquette, Rohit Raj, Roland Qi, Sarosh Arif, Satheesh Paul,
Shahaji Bhosle, Sharon Haroni, Sivaprasad Tummala, Souvik Dey,
Steven Webster, Tal Shnaiderman, Tasnim Bashar, Vadim Podovinnikov,
Venky Venkatesh, Vijaya Mohan Guvva, Vu Pham, Wentao Cui, Xi Zhang, 
Xiaoxiao Zeng, Xinfeng Zhao, Yash Sharma, Yu Jiang, Zalfresso-Jundzillo,
Zhihong Peng, Zhimin Huang, and Zhiwei He.

Below is the number of patches per company (with authors count):
438 Intel (57)
194 Mellanox (24)
171 Marvell (21)
 89 Broadcom (12)
 75 Huawei (10)
 49 Red Hat (7)
 49 NXP (7)
 35 Microsoft (3)
 34 ARM (6)
 28 Semihalf (1)
 24 Samsung (2)
 22 OKTET Labs (2)
 11 Ericsson (1)
 11 AMD (3)
  9 Chelsio (1)
  8 BIFIT (1)
  6 Cisco (3)
  5 Solarflare (1)
  5 IBM (2)
  5 Emumba (3)
  5 6WIND (1)


The new features for 20.08 may be submitted during the next 17 days.
DPDK 20.08 should be released on early August, in a tight schedule:
http://core.dpdk.org/roadmap#dates

Thanks everyone, and happy birthday to our RTE_MAGIC!




[dpdk-dev] [PATCH] doc: fix API index

2020-05-26 Thread Thomas Monjalon
With Doxygen 1.8.18, a warning appears when tagging
the main markdown header with {#index}.
That's why the tag has been removed from the API index in DPDK 20.05.
Unfortunately it makes the index page classified as a standard
"related page" instead of being the "main page".

The tag {#mainpage} could be used instead of {#index}.
Another solution, chosen here, is to specify the main page file
in the Doxygen configuration with the variable USE_MDFILE_AS_MAINPAGE.

Fixes: 76fb8fc486f9 ("doc: fix build with doxygen 1.8.18")
Cc: sta...@dpdk.org

Signed-off-by: Thomas Monjalon 
---
 doc/api/doxy-api.conf.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 92122125ae..9b55b7500c 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -3,6 +3,7 @@
 
 PROJECT_NAME= DPDK
 PROJECT_NUMBER  = @VERSION@
+USE_MDFILE_AS_MAINPAGE  = @TOPDIR@/doc/api/doxy-api-index.md
 INPUT   = @TOPDIR@/doc/api/doxy-api-index.md \
   @TOPDIR@/drivers/bus/vdev \
   @TOPDIR@/drivers/crypto/scheduler \
-- 
2.26.2



Re: [dpdk-dev] [dpdk-stable] [PATCH v2] test-pmd: fix memory leaks when mtr policer actions update fails

2020-05-26 Thread wangyunjian
> -Original Message-
> From: Thomas Monjalon [mailto:tho...@monjalon.net]
> Sent: Tuesday, May 26, 2020 3:14 PM
> To: wangyunjian 
> Cc: dev@dpdk.org; sta...@dpdk.org; Lilijun (Jerry) ;
> xudingke ; cristian.dumitre...@intel.com;
> john.mcnam...@intel.com
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] test-pmd: fix memory leaks
> when mtr policer actions update fails
> 
> 26/05/2020 04:04, wangyunjian:
> > From: Thomas Monjalon [mailto:tho...@monjalon.net]
> > > 25/05/2020 03:46, wangyunjian:
> > > > From: Yunjian Wang 
> > > >
> > > > This patch fixes the Huawei internal coverity reported resource
> > > > leak issue.
> > >
> > > The problem is not seen in the community Coverity?
> >
> > I don't know much about that.
> 
> Please, could you register and check here?
> https://scan.coverity.com/projects/dpdk-data-plane-development-kit

OK, I have registered, but I do not find this issue in it.
Thanks,
Yunjian

> 
> 



Re: [dpdk-dev] 【BUG REPORT】l3fwd-power can not exit by ctrl+c

2020-05-26 Thread oulijun




在 2020/5/26 17:24, Burakov, Anatoly 写道:

On 26-May-20 4:50 AM, oulijun wrote:

Hi,
I have update the code into 20.05-rc2. However, the l3fwd-power 
startup fail.


[root@centos-C3 build]# l3fwd-power -w :7d:00.1  -c 0xc00 -n 4 
-- -P -p 0x01 --config '(0,0,27)' --parse-ptype

EAL: Detected 128 lcore(s)
EAL: Detected 4 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-2048kB
EAL: No available hugepages reported in hugepages-32768kB
EAL: No available hugepages reported in hugepages-64kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL:   using IOMMU type 1 (Type 1)
EAL: Ignore mapping IO port bar(1)
EAL: Ignore mapping IO port bar(3)
EAL: Probe PCI driver: net_hns3 (19e5:a221) device: :7d:00.1 
(socket 0)
No telemetry legacy support - No legacy callbacks, legacy socket not 
created

Promiscuous mode selected
soft parse-ptype is enabled
POWER: Env isn't set yet!
POWER: Attempting to initialise ACPI cpufreq power management...
POWER: Power management governor of lcore 26 has been set to user 
space successfully

POWER: File not opened
POWER: Cannot get available frequencies of lcore 26
POWER: Attempting to initialise PSTAT power management...
POWER: Power management governor of lcore 26 has been set to 
performance successfully

POWER: Error opening '/dev/cpu/26/msr': No such file or directory
POWER: Cannot init for setting frequency for lcore 26
POWER: Attempting to initialise VM power management...
GUEST_CHANNEL: Opening channel 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' for lcore 26
GUEST_CHANNEL: Unable to to connect to 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' with error No 
such file or directory

POWER: Unable to set Power Management Environment for lcore 26
POWER: Library initialization failed on core 26
EAL: Error - exiting with code: 1
   Cause: init_power_library failed

Thanks
Lijun Ou



Hi,

Previously, l3fwd-power was very lax in what it was allowing. Now, if it 
can't enable power management, it will not run, because it is more 
strict in what it allows.


As is shown in the log, it tries to initialize ACPI power management, 
but fails. Then, it tries to initialize pstate mode, and it appears that 
MSR driver is not loaded, so it doesn't work either. It also tries to 
check if a KVM channel exists, which doesn't, and that fails as well. 
So, no power management environment can be enabled, and the application 
fails to start.


In order to make it work, you should either boot in ACPI mode (kernel 
parameter: "intel_pstate=disable"), or load the MSR driver (root 
command: modprobe msr).


This more strict power library initialization was added because we saw 
people misusing l3fwd-power to attempt to run without power management 
environment being initialized (such as inside a VM while not having 
telemetry mode enabled), which it was not designed to do and which would 
be an invalid test.



thanks. I will try it



Re: [dpdk-dev] 【BUG REPORT】l3fwd-power can not exit by ctrl+c

2020-05-26 Thread oulijun




在 2020/5/26 16:36, Hunt, David 写道:

Hi Lijun,

On 26/5/2020 4:50 AM, oulijun wrote:

Hi,
   I have update the code into 20.05-rc2. However, the l3fwd-power 
startup fail.


[root@centos-C3 build]# l3fwd-power -w :7d:00.1  -c 0xc00 -n 4 
-- -P -p 0x01 --config '(0,0,27)' --parse-ptype




--snip--


POWER: Attempting to initialise ACPI cpufreq power management...
POWER: Power management governor of lcore 26 has been set to user 
space successfully

POWER: File not opened
POWER: Cannot get available frequencies of lcore 26
POWER: Attempting to initialise PSTAT power management...
POWER: Power management governor of lcore 26 has been set to 
performance successfully

POWER: Error opening '/dev/cpu/26/msr': No such file or directory
POWER: Cannot init for setting frequency for lcore 26



This was not happening in your previous logs, have you got the 'msr' 
kernel module loaded?



POWER: Attempting to initialise VM power management...
GUEST_CHANNEL: Opening channel 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' for lcore 26
GUEST_CHANNEL: Unable to to connect to 
'/dev/virtio-ports/virtio.serial.port.poweragent.26' with error No 
such file or directory



I did not see any GUEST_CHANNEL notifications in the previous logs you 
provided,  has your setup changed in any way?


By the way, I can run the command you provided above (without the 
whitelist) without any errors on my system, and a single CTRL-C exits 
gracefully. I am not running in a VM.


Rgds,
Dave.


Is your hardware system x86? My system is arm64


.





Re: [dpdk-dev] [PATCH 20.08 8/9] devtools: support python3 only

2020-05-26 Thread Ray Kinsella


yes - I noticed the rpm packaging has become very pedantic about this of late.

Ray K

On 22/05/2020 14:23, Louise Kilheeney wrote:
> Changed script to explicitly use python3 only.
> 
> Cc: Neil Horman 
> Cc: Ray Kinsella 
> 
> Signed-off-by: Louise Kilheeney 
> ---
>  devtools/update_version_map_abi.py | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/devtools/update_version_map_abi.py 
> b/devtools/update_version_map_abi.py
> index 616412a1c..58aa368f9 100755
> --- a/devtools/update_version_map_abi.py
> +++ b/devtools/update_version_map_abi.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2019 Intel Corporation
>  
> @@ -9,7 +9,6 @@
>  from the devtools/update-abi.sh utility.
>  """
>  
> -from __future__ import print_function
>  import argparse
>  import sys
>  import re
> 
Acked-by: Ray Kinsella 


Re: [dpdk-dev] [PATCH v5 03/11] eal: introduce memory management wrappers

2020-05-26 Thread Ray Kinsella


Are wrappers 100% are required.
Would it be simpler (and less invasive) to have a windows_compat.h that plugged 
this holes?
I am not sure on the standard approach here - so I will leave this to others. 

Outside of that - do these symbols really require experimental status.
Are they really likely to change?

Ray K

On 25/05/2020 01:37, Dmitry Kozlyuk wrote:
> Introduce OS-independent wrappers for memory management operations used
> across DPDK and specifically in common code of EAL:
> 
> * rte_mem_map()
> * rte_mem_unmap()
> * rte_get_page_size()
> * rte_mem_lock()
> 
> Windows uses different APIs for memory mapping and reservation, while
> Unices reserve memory by mapping it. Introduce EAL private functions to
> support memory reservation in common code:
> 
> * eal_mem_reserve()
> * eal_mem_free()
> * eal_mem_set_dump()
> 
> Wrappers follow POSIX semantics limited to DPDK tasks, but their
> signatures deliberately differ from POSIX ones to be more safe and
> expressive.
> 
> Signed-off-by: Dmitry Kozlyuk 
> ---
>  lib/librte_eal/common/eal_common_fbarray.c |  37 +++--
>  lib/librte_eal/common/eal_common_memory.c  |  60 +++-
>  lib/librte_eal/common/eal_private.h|  78 ++-
>  lib/librte_eal/freebsd/Makefile|   1 +
>  lib/librte_eal/include/rte_memory.h|  88 
>  lib/librte_eal/linux/Makefile  |   1 +
>  lib/librte_eal/linux/eal_memalloc.c|   5 +-
>  lib/librte_eal/rte_eal_version.map |   6 +
>  lib/librte_eal/unix/eal_unix_memory.c  | 152 +
>  lib/librte_eal/unix/meson.build|   1 +
>  10 files changed, 365 insertions(+), 64 deletions(-)
>  create mode 100644 lib/librte_eal/unix/eal_unix_memory.c
> 
> diff --git a/lib/librte_eal/common/eal_common_fbarray.c 
> b/lib/librte_eal/common/eal_common_fbarray.c
> index cfcab63e9..a41e8ce5f 100644
> --- a/lib/librte_eal/common/eal_common_fbarray.c
> +++ b/lib/librte_eal/common/eal_common_fbarray.c
> @@ -5,15 +5,15 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
>  #include 
>  
>  #include 
> -#include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  
> @@ -90,12 +90,9 @@ resize_and_map(int fd, void *addr, size_t len)
>   return -1;
>   }
>  
> - map_addr = mmap(addr, len, PROT_READ | PROT_WRITE,
> - MAP_SHARED | MAP_FIXED, fd, 0);
> + map_addr = rte_mem_map(addr, len, RTE_PROT_READ | RTE_PROT_WRITE,
> + RTE_MAP_SHARED | RTE_MAP_FORCE_ADDRESS, fd, 0);
>   if (map_addr != addr) {
> - RTE_LOG(ERR, EAL, "mmap() failed: %s\n", strerror(errno));
> - /* pass errno up the chain */
> - rte_errno = errno;
>   return -1;
>   }
>   return 0;
> @@ -733,7 +730,7 @@ rte_fbarray_init(struct rte_fbarray *arr, const char 
> *name, unsigned int len,
>   return -1;
>   }
>  
> - page_sz = sysconf(_SC_PAGESIZE);
> + page_sz = rte_get_page_size();
>   if (page_sz == (size_t)-1) {
>   free(ma);
>   return -1;
> @@ -754,9 +751,11 @@ rte_fbarray_init(struct rte_fbarray *arr, const char 
> *name, unsigned int len,
>  
>   if (internal_config.no_shconf) {
>   /* remap virtual area as writable */
> - void *new_data = mmap(data, mmap_len, PROT_READ | PROT_WRITE,
> - MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, fd, 0);
> - if (new_data == MAP_FAILED) {
> + static const int flags = RTE_MAP_FORCE_ADDRESS |
> + RTE_MAP_PRIVATE | RTE_MAP_ANONYMOUS;
> + void *new_data = rte_mem_map(data, mmap_len,
> + RTE_PROT_READ | RTE_PROT_WRITE, flags, fd, 0);
> + if (new_data == NULL) {
>   RTE_LOG(DEBUG, EAL, "%s(): couldn't remap anonymous 
> memory: %s\n",
>   __func__, strerror(errno));
>   goto fail;
> @@ -821,7 +820,7 @@ rte_fbarray_init(struct rte_fbarray *arr, const char 
> *name, unsigned int len,
>   return 0;
>  fail:
>   if (data)
> - munmap(data, mmap_len);
> + rte_mem_unmap(data, mmap_len);
>   if (fd >= 0)
>   close(fd);
>   free(ma);
> @@ -859,7 +858,7 @@ rte_fbarray_attach(struct rte_fbarray *arr)
>   return -1;
>   }
>  
> - page_sz = sysconf(_SC_PAGESIZE);
> + page_sz = rte_get_page_size();
>   if (page_sz == (size_t)-1) {
>   free(ma);
>   return -1;
> @@ -911,7 +910,7 @@ rte_fbarray_attach(struct rte_fbarray *arr)
>   return 0;
>  fail:
>   if (data)
> - munmap(data, mmap_len);
> + rte_mem_unmap(data, mmap_len);
>   if (fd >= 0)
>   close(fd);
>   free(ma);
> @@ -939,8 +938,7 @@ rte_fbarray_detach(struct rte_fbarray *arr)
>* really do anything about it, things will