Commit Graph

16497 Commits

Author SHA1 Message Date
Qi Zhang
aa1cd410fa net/ice/base: add flow module
Add the module that implemented flow abstraction that base on
flexible pipeline.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-01-18 09:47:26 +01:00
Qi Zhang
51d04e4933 net/ice/base: add flexible pipeline module
The flexible pipeline module provide the infrastructure for ice's
flexible packet processing feature.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-01-18 09:47:26 +01:00
Qi Zhang
8dfe55a29d net/ice/base: add some helper macros
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-01-18 09:47:26 +01:00
Qi Zhang
894cfceb88 net/ice/base: add package download related data structure
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-01-18 09:47:26 +01:00
Qi Zhang
e844d501df net/ice/base: support resource allocation
Added API ice_alloc_hw_res and ice_free_hw_res.
Added resource type macro.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-01-18 09:47:26 +01:00
Qi Zhang
71a685136b net/ice/base: clean up
Remove some unnecessary code.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2019-01-18 09:47:26 +01:00
Ivan Malov
7f7bdb5987 net/sfc: fix datapath name references in logs
Rx and Tx datapath references were mixed up in a couple
of log statements and commentary blocks in the original
commit. Correct datapath name references in said places.

Fixes: f28ede500c ("net/sfc: support multi-process")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-18 09:47:26 +01:00
Andrew Rybchenko
24f8a95917 net/sfc: fix VF error/missed stats mapping
VADAPTER_RX_OVERFLOW means Rx statistics overflow, not a missed
packet because of overflow.

VADAPTER_RX_BAD_PACKETS accumulates a number of error conditions,
but mainly impossibility to deliver because of no descriptors
available, so it is better to classify it as imissed.

Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-18 09:47:26 +01:00
Yongseok Koh
2014a7fbae net/mlx5: fix deprecated library API for Rx padding
In rdma-core library IBV_WQ_FLAG_RX_END_PADDING is renamed to
IBV_WQ_FLAGS_PCI_WRITE_END_PADDING. Way to query the capability is also
changed.

Fixes: 43e9d9794c ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Reviewed-by: Erez Ferber <erezf@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-01-18 09:47:26 +01:00
Yongseok Koh
78c7a16daa net/mlx5: fix Rx packet padding
Rx packet padding is supposed to be set by an environment variable -
MLX5_PMD_ENABLE_PADDING, but it has been missing for some time by mistake.
Rather than using such a variable, a PMD parameter (rxq_pkt_pad_en) is
added instead.

Fixes: a1366b1a2b ("net/mlx5: add reference counter on DPDK Rx queues")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Reviewed-by: Erez Ferber <erezf@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-01-18 09:47:26 +01:00
Zhirun Yan
76469c0631 net/i40e: support request any number of queues
Before this patch, VF must request a specific queues(1/2/4/8/16) with
DPDK PF. This patch align the number of requested queues to next power
of 2. So VF can request any number queues from 1 to 16.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-01-18 09:47:26 +01:00
Yanglong Wu
1d4b2b4966 net/i40e: fix VF overwrite PF RSS LUT for X722
i40e_aq_set_rss_lut should set register according
to the vsi->type. if not, VF may overwrite the rigister
of PF.
Note, only X722 is impacted, since flag I40E_FLAG_RSS_AQ_CAPABLE
is only enabled on X722.

Fixes: d0a349409b ("i40e: support AQ based RSS config")
Cc: stable@dpdk.org

Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-01-18 09:47:26 +01:00
Naga Suresh Somarowthu
086eb64db3 test/pdump: add unit test for pdump library
Unit test cases are added for pdump library.
Primary process will act as server, forks a child secondary process.
Secondary process acts as client.
Server will do pdump init to serve any pdump client requests.
Server will create a vdev, send/receive packets continuously
in a separate thread.
Client will create virtual rings to receive the packet dump.
Client sends pdump enable/disable requests using either port/device id.
Packet flow direction can be tx/rx/tx&rx.
In Server, appropriate pdump callbacks are triggered,
when packets are transmitted/received.
Pdump packet is copied to client rings.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
2019-01-18 02:33:29 +01:00
Naga Suresh Somarowthu
1e3676a06e test/latency: add unit tests for latencystats library
Unit Test Cases added for latencystats library.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
2019-01-18 02:33:29 +01:00
Naga Suresh Somarowthu
fdeb30fa71 test/bitrate: add unit tests for bitrate library
Unit Test Cases for BitRate library.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
2019-01-18 02:33:29 +01:00
Naga Suresh Somarowthu
a52966cd48 test: add helpers using ring PMD Rx/Tx
Added ring pmd based packet rx/tx helper functions
for verifying Latency, Bitrate and pdump lib UTs.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-01-18 02:33:29 +01:00
Marko Kovacevic
c47eb6c711 test/compress: add varied buffer input/outputs
Added unit test to check if a SGL buffer
was added as an input and a Linear Buffer
as output and vice versa so we can test if the
application would process the different buffers
properly.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2019-01-18 01:05:37 +01:00
Marko Kovacevic
c1bbb613ce test/compress: add out of space test
This patch adds new out of space testcase to check
that the destination mbuf is smaller than required for
the output of compression to ensure the driver doesn't crash
and returns the valid error case.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2019-01-18 01:05:31 +01:00
Pablo de Lara
afe14ab9a7 test/compress: refactor main test function
Since the start of the compression tests,
the main test function, test_deflate_comp_decomp,
has increased its parameter with each new test added.

In order to make the code cleaner, and more scalable,
these parameters have been divided into two structures,
which are now passed as the sole arguments of the function.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2019-01-18 01:05:17 +01:00
Bernard Iremonger
59d7353b0d test/ipsec: fix test suite setup
Check for valid crypto_null device before continuing.
Use valid_dev instead of valid_devs[].
Replace valid_dev_count with valid_dev_found
Call create_crypto_session for one driver only.
Refactor code so that driver capabilities can be checked in
the testsuite_setup function.

Fixes: 05fe65eb66 ("test/ipsec: introduce functional test")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-18 00:30:19 +01:00
Bernard Iremonger
646f379068 test/ipsec: fix build on FreeBSD
Removed ip.h and in.h headers to fix unknown type errors
when compiling on BSD.

Fixes: 05fe65eb66 ("test/ipsec: introduce functional test")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Changqing Wu <changqingx.wu@intel.com>
2019-01-18 00:23:48 +01:00
David Marchand
dc0e5bb3db test: fix build when disabling IPsec library
Caught after pulling ipsec then compile in an existing build directory.

Fixes: 05fe65eb66 ("test/ipsec: introduce functional test")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-18 00:14:13 +01:00
Fan Zhang
19f4fa70e8 examples/fips_validation: fix session private mempool
This patch fixes the incorrect session private mempool passing
to cryptodev.

Fixes: 41d561cbdd ("examples/fips_validation: add power on self test")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2019-01-18 00:09:16 +01:00
Konstantin Ananyev
9d8293e622 examples/ip_fragmentation: fix MTU for i40e
Previous commit sets mtu to the same value as max_rx_pkt_len.
Though PMDs (at least Intel ones) consider MTU as
max_rx_pkt_len minus ether header, crc bytes, vlan tags.

Fixes: 73d2c1d3f3 ("examples/ip_fragmentation: support big packets")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-17 23:53:05 +01:00
Ferruh Yigit
2e06c56565 examples/kni: fix crash while handling userspace request
When KNI interface receives RTE_KNI_REQ_CFG_NETWORK_IF request, it
stap/start the physical device which as a result of stop() can free all
the mbufs in its queue.
Meanwhile sample application continues to read from KNI interface queues
and push into device queues. This simultaneous access may cause a crash,
crash log can be found at defect description.

As a solution KNI sample application can do the proper synchronization,
and stop transfer between KNI interface and physical interface while
physical device stop/started.

Bugzilla ID: 116
Fixes: 3fc5ca2f63 ("kni: initial import")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Phil Yang <phil.yang@arm.com>
2019-01-17 23:44:21 +01:00
Jiayu Hu
5bd5f7b3ae doc: add GRO limitations in programmers guide
This patch adds GRO limitations in the programmer guide.

Fixes: 2c900d0905 ("doc: add GRO guide")
Cc: stable@dpdk.org

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-17 22:44:06 +01:00
Jiayu Hu
7ccc7a05d6 gro: check invalid TCP header length
When the TCP header length of input packets is invalid (i.e., less
than 20 bytes or greater than 60 bytes), check_seq_option() will
access illegal memory area when compare TCP Options, which may
cause a segmentation fault.

This patch adds missing invalid TCP header length check to avoid
illegal memory accesses.

Fixes: 0d2cbe59b7 ("lib/gro: support TCP/IPv4")
Fixes: 9e0b9d2ec0 ("gro: support VxLAN GRO")
Cc: stable@dpdk.org

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-17 22:38:54 +01:00
Reshma Pattan
35cb223ab7 app/pdump: fix vdev cleanup
Virtual devices added in pdump application
using rte_eal_hotplug_add should be removed explicitly
while exiting the pdump application, otherwise the
subsequent run of the pdump application will fail with the reason
that virtual devices with the same name already exists in primary.

Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-01-17 21:27:37 +01:00
Liang Ma
7c06d9258a power: fix file descriptor leak
Coverity issue: 328528
Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Reviewed-by: Lei Yao <lei.a.yao@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
2019-01-17 19:20:02 +01:00
Harry van Haaren
566b4d7a96 build: fix meson check for binutils 2.30
This commit reworks the checks for binutils 2.30 and how
the flags to disable AVX512F are passed to the compiler.

Previously the #define for including AVX512 code was set,
while the -mno-avx512f argument was given to the compiler.
This would cause gcc to correctly refuse to emit AVX512
instructions, but the rte_memcpy code that includes AVX512
optimizations was being added to the build.

The check for binutils check is now moved to x86 as it is
irrelevant for other architectures, and the -mno-avx512f
flag is passed to a march_opts array in meson. As the
-mno-avx512 flag is added earlier in the build, the code
in rte_memcpy is no longer attempted to be compiled.

This commit also adds a message print in the meson configure
stage to alert the user of the workaround being employed.

Fixes: a32ca9a4eb ("mk: fix scope of disabling AVX512F support")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-01-17 19:19:57 +01:00
Ilya Maximets
6406d70561 eal: fix clang build with intrinsics forced
This fixes x86_64-native-linuxapp-clang build with
CONFIG_RTE_FORCE_INTRINSICS=y:

    include/generic/rte_atomic.h:218:9: error:
        implicit declaration of function '__atomic_exchange_2'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

    include/generic/rte_atomic.h:501:9: error:
        implicit declaration of function '__atomic_exchange_4'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

    include/generic/rte_atomic.h:783:9: error:
        implicit declaration of function '__atomic_exchange_8'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

We didn't caught this issue previously on other platforms because
CONFIG_RTE_FORCE_INTRINSICS enabled by default only for armv8.

Fixes: 7bdccb9307 ("eal: fix ARM build with clang")
Cc: stable@dpdk.org

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
2019-01-17 18:39:55 +01:00
Anatoly Burakov
2383d8e909 eal: check string parameter lengths
When specifying parameters such as hugefile prefix from the
command-line, it is possibly to supply an empty string. This may
lead to various problems: for example, if hugefile prefix is
empty, the runtime config path construction may end up
looking like "/var/run/dpdk//_config", which will technically
work, but is wrong and places files in the wrong place.

To fix it, check lengths of such user-specified parameters for
hugefile prefix, as well as hugepage dir and user-specified
mbuf pool ops string.

Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-01-17 18:39:55 +01:00
David Marchand
7b55015e14 eal: fix out of bound access when no CPU available
In the unlikely case when the dpdk application is started with no cpu
available in the [0, RTE_MAX_LCORE - 1] range, the master_lcore is
automatically chosen as RTE_MAX_LCORE which triggers an out of bound
access.

Either you have a crash then, or the initialisation fails later when
trying to pin the master thread on it.
In my test, with RTE_MAX_LCORE == 2:

$ taskset -c 2 ./master/app/testpmd --no-huge -m 512 --log-level *:debug
[...]
EAL: pthread_setaffinity_np failed
PANIC in eal_thread_init_master():
cannot set affinity
7: [./master/app/testpmd() [0x47f629]]

Bugzilla ID: 19
Fixes: 2eba8d21f3 ("eal: restrict cores auto detection")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
2019-01-17 18:39:55 +01:00
Hari Kumar Vemula
b38693b612 eal: fix core number validation
When incorrect core value or range provided,
as part of -l command line option, a crash occurs.

Added valid range checks to fix the crash.

Added ut check for negative core values.
Added unit test case for invalid core number range.

Fixes: d888cb8b96 ("eal: add core list input format")
Cc: stable@dpdk.org

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2019-01-17 17:22:04 +01:00
Thomas Monjalon
05853e1784 version: 19.02-rc2
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2019-01-15 03:08:43 +01:00
Rami Rosen
10b4270fff examples/vhost: fix a typo
This minor patch fixes a typo in examples/vhost/main.c.

Fixes: d19533e86f ("examples/vhost: copy old vhost example")
Cc: stable@dpdk.org

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
2019-01-15 02:46:50 +01:00
Rami Rosen
c8516e3caa examples/tep_term: remove unused constant
The  definition of MAX_PRINT_BUFF in examples/tep_termination/main.c
is not necessary as it is not used. This cleanup patch removes it.

Fixes: a50245ede7 ("examples/tep_term: initialize VXLAN sample")
Cc: stable@dpdk.org

Signed-off-by: Rami Rosen <ramirose@gmail.com>
2019-01-15 02:40:41 +01:00
Noa Ezra
73d2c1d3f3 examples/ip_fragmentation: support big packets
In some vendors the RX and TX configuration must be the same, therefore
the MTU size need to be equal to max_rx_pkt_len.
The MTU is the largest size packet in bytes that can be sent on the
network, therefore before changing this parameter, the NIC could not
receive packets larger than 1500 bytes, which is the default MTU size.
In addition, scatter-gather need to be enabled in order to receive
frames bigger than mbuf size.

Signed-off-by: Noa Ezra <noae@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-15 02:40:41 +01:00
Dharmik Thakkar
7dbbdd3efa test/hash: fix perf result
Reset 'iter' and 'tbl_rw_test_param.found' on each iteration
to give correct result for lost and duplicated keys.

This patch also changes the default return value of the test to -1
when not enough resources are provided.

Fixes: 0eb3726ebc ("test/hash: add test for read/write concurrency")
Cc: stable@dpdk.org

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Yipeng Wang <yipeng1.wang@intel.com>
2019-01-15 02:40:41 +01:00
Yong Wang
5036034924 doc: fix a typo in power management guide
This patch fixes a typo in programmer's guide. It should be Frequency,
not Fequence.

Fixes: 450f079131 ("power: add traffic pattern aware power control")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
2019-01-15 02:40:41 +01:00
David Hunt
d38e6a6a45 examples/power: fix core id with JSON commands
This patch fixes a bug introduced in the 64-core limitation
enhancement where the core_id is inadvertently converted from
virtual to physical even though it may already be a physical
core_id.

We should be using the core_type field, and only converting via
hypervisor when core_type is set to CORE_TYPE_VIRTUAL

Fixes: 5776b7a371 ("examples/power: allow VM to use lcores over 63")

Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Lei Yao <lei.a.yao@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
2019-01-15 02:40:41 +01:00
David Hunt
6ff7b996a8 examples/power: fix for p-state
The vm_power_manager starts by setting the environment to acpi
using rte_power_set_env(PM_ENV_ACPI_CPUFREQ). This causes a problem
starting vm_power_manager when the system is using the intel_pstate
driver. The env should be set to none, or not called at all, because
the library now auto-detects the environment to be either acpi or
intel_pstate. This patch sets the environment to none so that the
library can successfully auto-detect.

Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
2019-01-15 02:40:41 +01:00
David Hunt
f21bb93126 test/power: handle p-state mode
The cpufreq test breakes when the system is using the intel_pstate
driver for frequency management. The power library has recentyly been
updated to allow use of the intel_pstate driver, this patch fixes the
cpufreq test so that it can now use either acpi or pstate modes.
The library will auto-detect, and set the environment appropriately.

Fixes: ed7c51a6a6 ("app/test: vm power management")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
2019-01-15 02:40:41 +01:00
David Hunt
ad514edf71 power: fix frequency list return code
The power_pstate_cpufreq_freqs() function was returning -1 in an
unsigned int, causing buffer over-runs when the results were being
processed. This function should be returning zero for all error
conditions, similar to it's acpi relation, power_acpi_cpufreq_freqs().

Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
2019-01-15 02:40:41 +01:00
David Hunt
2e6ccdb4e0 power: fix frequency list to handle null buffer
This patch fixes a segfault in the case where a null buffer is passed
to the following functions:
   power_acpi_cpufreq_freqs()
   power_pstate_cpufreq_freqs()

Fixes: 445c6528b5 ("power: common interface for guest and host")

Signed-off-by: David Hunt <david.hunt@intel.com>
2019-01-15 02:40:41 +01:00
David Hunt
de394915df power: fix error handling on setting governor
In the power_set_governor_*() functions, we using fputs() on /sys
filesystem. However, we also need to call fflush() to ensure that
the write completes successfully. Otherwise the attempt to set the
power governor fails and the function returns as if it has
succeeded. This patch adds an fflush to ensure that the
write succeeds, otherwise returns an error.

Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
2019-01-15 02:40:40 +01:00
Konstantin Ananyev
423aa5e130 ipsec: fix build with gcc 6
gcc 6.2 and 6.4 fails to compile lib/librte_ipsec/sa.c
with the following errors:
lib/librte_ipsec/sa.c:
 In function inline_outb_tun_pkt_process:
 x86_64-native-linuxapp-gcc/include/rte_memcpy.h:337:2:
 error: array subscript is above array bounds [-Werror=array-bounds]
  rte_mov32((uint8_t *)dst + 1 * 32, (const uint8_t *)src + 1 * 32);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ...

It complains about the following lines of code:
esp_outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t
        ....
        /* update spi, seqn and iv */
        esph = (struct esp_hdr *)(ph + sa->hdr_len);
        iv = (uint64_t *)(esph + 1);
        rte_memcpy(iv, ivp, sa->iv_len);

While I believe it is a false positive,
it is too excessive to use rte_memcpy() here,
as IV length could be only 0/8/16 bytes.
So introduce small helper function to copy IV and use it
instead of rte_memcpy().

Fixes: 4d7ea3e145 ("ipsec: implement SA data-path API")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-01-15 02:40:40 +01:00
Gaetan Rivet
68c4768d36 eal: return error when option register fails
Make rte_option_register return a negative value when
an error occur.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2019-01-15 02:40:40 +01:00
Gaetan Rivet
e48839afff eal: improve option API documentation
Use doxygen to describe the main structure and describe a little more
why it exists.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2019-01-15 02:40:40 +01:00
Gaetan Rivet
d3bdefef22 eal: fix log level of error in option register
INFO is not correct when logging an error.

Fixes: 2395332798 ("eal: add option register infrastructure")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2019-01-15 02:40:40 +01:00