Commit Graph

10370 Commits

Author SHA1 Message Date
Tomasz Duszynski
4816fb37ce crypto/mrvl: fix enabling debug logs
Using non-existent configuration option for enabling debug
messages will actually never enable them.

Fixes: 8a61c83af2 ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-25 18:10:40 +02:00
Tomasz Duszynski
238fba5b97 crypto/mrvl: fix driver name in debug log
Since CRYPTODEV_NAME_MRVL_CRYPTO_PMD is undefined RTE_STR() expands
it to "CRYPTODEV_NAME_MRVL_CRYPTO_PMD" instead of "crypto_mrvl".

This patch fixes that by using proper name definition in debug logs.

Fixes: 8a61c83af2 ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-25 18:10:40 +02:00
Tomasz Duszynski
3417350e7f examples/ipsec-secgw: fix IP version check
Since new_ip and ip4 are overlapping buffers copying ip4 over new_ip
using memmove() might overwrite memory at ip4. This could happen if
following condition holds:

ip_hdr_len > sizeof(struct esp_hdr) + sa->iv_len

Thus using ip4 to check ip version is wrong as it might not contain
proper value.

Fixes: f159e70b09 ("examples/ipsec-secgw: support transport mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Reviewed-by: Aviad Yehezkel <aviadye@mellanox.com>
2017-10-25 18:10:32 +02:00
Alok Makhariya
9b0b95a48c crypto/dpaa2_sec: add check for segmented buffer
The code would crash for segmented buffer if no check.

Fixes: 8d1f3a5d75 ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:10:15 +02:00
Alok Makhariya
cf6f70eea4 crypto/dpaa_sec: add check for segmented buffer
The code would crash in case of segmented buffer if no check

Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:10:15 +02:00
Alok Makhariya
6d93f7cff0 crypto/dpaa2_sec: remove ICV memset on decryption side
Since the packet lengths are modified, it is not required to
explicitly reset the ICV.

Fixes: 13273250ee ("crypto/dpaa2_sec: support AES-GCM and CTR")
Fixes: 8d1f3a5d75 ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:10:02 +02:00
Alok Makhariya
74658bda33 crypto/dpaa_sec: remove ICV memset on decryption side
Since the packet lengths are modified, it is not required to
explicitly reset the ICV.

Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
2017-10-25 18:09:26 +02:00
Thomas Monjalon
91230d0cff test: fix build without flow classify
The unit test for flow classify should be disabled
if the library is disabled in the configuration.

Fixes: 9c9befea4f ("test: add flow classify unit tests")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2017-10-26 00:37:50 +02:00
Thomas Monjalon
a266b3133d doc: remove trailing commas in API index
Fixes: c711ccb309 ("ivshmem: remove library and its EAL integration")
Fixes: e8009a077d ("doc: group classification libraries in doxygen index")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-10-26 00:00:01 +02:00
Harry van Haaren
b17b952ec3 service: allow to disable core check
This commit adds a new function to disable the runtime mapped
service-cores check. This allows an application to take responsibility
of running unmapped services.

This feature is useful in cases like unit tests, where the application
code (or unit test in this case) requires accurate control over when
the service function is called to ensure correct behaviour, and when
an application has an advanced use-case and wishes to manage services
manually.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
2017-10-25 17:05:38 +02:00
Harry van Haaren
e9139a32f6 service: add function to run on app lcore
This commit adds a new function which allows an application lcore
(aka; *not* a dedicated service-lcore) to run a service. This
function is required to allow applications to gradually port
functionality to using services, while still being able to run
ordinary application functions.

This requirement became clear when a patch to the existing
eventdev/pipeline sample app was modified to use a service-core
for scheduling - and that same core should be capable of running
the "worker()" function from the application too.

This patch refactors the existing running code into a smaller
"service_run" function, which can be called by the dedicated
service-core loop, and the newly added function.

[1] http://dpdk.org/ml/archives/dev/2017-October/079876.html

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
2017-10-25 17:04:52 +02:00
Pavan Nikhilesh
45a914c5bd event/octeontx: support event Rx adapter
Add Rx adapter queue add and delete API for both generic eth_devices as
well as HW backed eth_octeontx which supports direct event injection to
event device.
The HW injected event needs to be converted into mbuf, previously this
was done in eth_octeontx during rx_burst now it is moved to
event_octeontx as events from Rx adapter are dequeued directly from
event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
2017-10-25 14:03:43 +02:00
Pavan Nikhilesh
d0d6549860 net/octeontx: support event Rx adapter
Add functions to modify and delete qos responsible for mapping eth queues
to event queues used for configuring event Rx adapter.
The mbox functions have been moved from octeontx_pkivf.c to
octeontx_pkivf.h to allow event_octeontx to access them.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
49ccbfb634 event/dpaa2: improve error handling and logs
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
120843bda5 event/dpaa2: support event Rx adapter
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
18fe5c1cf5 drivers: add net as dependency for event drivers
With the introduction of eventdev-ethdev RX adapter support in event
device, some of the event device will have dependency on their respective
ethernet drivers. This patch adds the net as a dependency for eventdevs.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
b677d4c6d2 net/dpaa2: add API for event Rx adapter
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
e6c9c22aa0 event/dpaa2: add queue parameter in processing callback
For event dequeues for ethernet queues, a dpaa2_queue structure is
required to get the configuration for that ethernet queue. Based on
this configuration the rte_event is to be filled at the ingress side.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Nikhil Rao
9ae1826502 eventdev: add service id get to map file
Add rte_event_eth_rx_adapter_service_id_get to map file. Also order
function names alphabetically.

Fixes: 9c38b704d2 ("eventdev: add eth Rx adapter implementation")

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
2017-10-25 14:03:43 +02:00
Harry van Haaren
8747b23929 event/sw: fix get of single xstat value
This commit allows the xstats_get() API to return just a single
value based on its ID. Previously, the "ret_n_lt_stats" value
set to 1 ensured a check to take place that the array was larger
than the available xstats.

The xstats_get() API allows retriving of individual stats - hence
this check should be removed - by setting "ret_n_lt_stats" to zero.

Fixes: c1ad03df7a ("event/sw: support xstats")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-10-25 14:03:43 +02:00
Gage Eads
6cf8620263 event/sw: allow forward and release when out of credits
When forwarding or releasing events, the operation would fail if the port
has 0 inflight credits and cannot acquire more, or the inflight count
exceeds the port's new event threshold.

This patch fixes that by counting the number of new events in the burst,
and applying the credit and new event threshold checks accordingly.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-10-25 14:03:43 +02:00
Pavan Nikhilesh
824e81f433 eventdev: use new event enqueue in Rx adapter
When event Rx adapter uses software based packet transfer, event op is
always RTE_EVENT_OP_NEW.
By using rte_event_enqueue_new_burst API the underlying event devices
driver can use it as a hint to optimize enqueue operation if possible.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
2017-10-25 14:03:43 +02:00
Gaetan Rivet
96d9dd74cd bus: skip useless iterations in find function
The starting point is known. The iterator can be directly set to it.

The function rte_bus_find can easily be used with a comparison function
always returning True. This would make it a regular bus iterator.

Users doing so would however accomplish such iteration in

   O(N * N/2) = O(N^2)

Which can be avoided.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-25 13:12:36 +02:00
Jacek Piasecki
681459bf9c examples/vhost_scsi: fix product id string termination
Use snprintf instead strncpy to get safe null string termination.
There was possible to get not terminated string after strncpy operation.

Coverity issue: 158631
Fixes: db75c7af19 ("examples/vhost_scsi: introduce a new sample app")
Cc: stable@dpdk.org

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2017-10-25 12:16:51 +02:00
Tomasz Duszynski
1e02d735c1 examples/kni: check PCI info not NULL before reading
Since virtual devices, i.e mrvl net pmd, do not touch pci_dev
dereferencing it will cause segmentation fault as by default
it's set to NULL in rte_eth_dev_info_get().

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-25 00:03:20 +02:00
Jasvinder Singh
96b5077cfa examples/qos_sched: fix uninitialized config
Fix problem with uninitialized rx/tx deferred_start flags of the struct
rte_eth_rxconf/txconf by initializing with 0 value (deferred start of
the rx/tx queues is turned off). This setting allows device rx/tx
queues to start with rte_eth_dev_start().

Coverity issue: 194999, 195009
Fixes: de3cfa2c98 ("sched: initial import")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2017-10-24 23:58:14 +02:00
David Hunt
4c897d23d0 examples/vm_power_manager: add turbo commands to help text
Fixes: d191f08533 ("examples/vm_power_manager: add per-core turbo CLI")

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2017-10-24 23:50:55 +02:00
David Hunt
e4f66da347 examples/vm_power_manager: fix response time
A delay in the loop waiting for the virtio-serial commands in the
vm_power_manager app was causing a lag in the response time. This was
set to 1 second, and has now been changed to 1ms.

Fixes: f14791a812 ("examples/vm_power_mgr: add policy to channels")

Signed-off-by: David Hunt <david.hunt@intel.com>
2017-10-24 23:48:27 +02:00
Ferruh Yigit
f73b38e924 igb_uio: remove device reset in open
Remove device reset during application start, the reset for application
exit still there.

Reset in open removed because of following comments:
1- Device reset not completed when VF driver loaded, which cause VF PMD
   initialization error.
   Adding delay can solve the issue but will increase driver load time.

2- Reset will be issues all devices unconditionally, not very efficient
   way.

Fixes: b58eedfc7d ("igb_uio: issue FLR during open and release of device file")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Harish Patil <harish.patil@cavium.com>
Tested-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
Tested-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-24 22:34:44 +01:00
Harry van Haaren
cbdd342060 examples/service_cores: add new sample application
This commit adds a new sample app, which showcases the value
of running services. In particular it allows the application
to dynamically schedule services to service-cores.

The sample app itself registers a number of dummy services,
and applies different profiles to them at runtime. Note that
this sample application does not forward any traffic - it
demonstrates advanced usage of the service cores API.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-10-24 23:01:01 +02:00
Bernard Iremonger
9c9befea4f test: add flow classify unit tests
Add flow_classify_autotest program.

Set up IPv4 ACL field definitions.
Create table_acl for use by librte_flow_classify API's.
Create an mbuf pool for use by rte_flow_classify_query.

For each of the librte_flow_classify API's:
test with invalid parameters
test with invalid patterns
test with invalid actions
test with valid parameters

Initialise ipv4 udp traffic for use by the udp test for
rte_flow_classifier_run.

Initialise ipv4 tcp traffic for use by the tcp test for
rte_flow_classifier_run.

Initialise ipv4 sctp traffic for use by the sctp test for
rte_flow_classifier_run.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2017-10-24 22:26:54 +02:00
Bernard Iremonger
41f72ec940 test: add packet burst generator functions
add initialize_tcp_header function
add initialize_stcp_header function
add initialize_ipv4_header_proto function
add generate_packet_burst_proto function

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2017-10-24 22:26:54 +02:00
Bernard Iremonger
bab16ddaf2 examples/flow_classify: add sample application
The flow_classify sample application exercises the following
librte_flow_classify API's:

rte_flow_classifier_create
rte_flow_classifier_query
rte_flow_classify_table_create
rte_flow_classify_table_entry_add
rte_flow_classify_table_entry_delete

It sets up the IPv4 ACL field definitions.
It creates table_acl and adds and deletes rules using the
librte_table API.

It uses a file of IPv4 five tuple rules for input.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2017-10-24 22:26:54 +02:00
Ferruh Yigit
be41ac2a33 flow_classify: introduce flow classify library
The following APIs's are implemented in the
librte_flow_classify library:

rte_flow_classifier_create
rte_flow_classifier_free
rte_flow_classifier_query
rte_flow_classify_table_create
rte_flow_classify_table_entry_add
rte_flow_classify_table_entry_delete

The following librte_table API's are used:
f_create to create a table.
f_add to add a rule to the table.
f_del to delete a rule from the table.
f_free to free a table
f_lookup to match packets with the rules.

The library supports counting of IPv4 five tupple packets only,
ie IPv4 UDP, TCP and SCTP packets.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2017-10-24 22:26:54 +02:00
Igor Ryzhov
490424e6c9 lpm6: set errno on creation error
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-24 21:35:53 +02:00
Igor Ryzhov
fa8ecf6634 lpm: set errno on creation error
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-24 21:35:53 +02:00
Zhiyong Yang
f1216c1eca net/virtio: fix Tx packet length stats
In the function virtqueue_enqueue_xmit(), when can_push is true,
vtnet_hdr_size is added to pkt_len by calling rte_pktmbuf_prepend.
which is wrong for pkt stats, virtio header length should be subtracted
before calling stats function.

Fixes: 58169a9c81 ("net/virtio: support Tx checksum offload")
Cc: stable@dpdk.org

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:31:48 +02:00
Tiwei Bie
1d8161ba02 vhost: fix dequeue offload support
When offload is enabled, vhost needs to access the first mbuf
to get the packet info, e.g. TCP header. So we couldn't delay
the data copy in this case.

Fixes: e5c494a7a2 ("vhost: batch small guest memory copies")

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:31:23 +02:00
Sebastian Basierski
2fd826a301 net/virtio: check error on setting non block flag
Report an error message if the flag O_NONBLOCK setting fails,
then return from function.

Coverity issue: 143439
Fixes: ef53b60300 ("net/virtio-user: support LSC")
Cc: stable@dpdk.org

Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:29:47 +02:00
Zhiyong Yang
3a643acd4f doc: add virtio LSC note
Virtio PMD already has supported link status change(lsc), but VM which
must be created by qemu 2.7.0 and above can support it when vhost
user disconnects, since the capability to detect vhost user disconnection
is introduced in qemu 2.7.0. The patch updates doc to let user know that.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:28:42 +02:00
Tiwei Bie
d8227497ec net/virtio: flush Rx queues on start
After starting a device, the driver shouldn't deliver the
packets that already existed before the device is started
to applications. Otherwise it will lead to incorrect packet
collection for port state. This patch fixes this issue by
flushing the Rx queues when starting the device.

Fixes: a85786dc81 ("virtio: fix states handling during initialization")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:26:57 +02:00
Maxime Coquelin
5cd690e4fd vhost: fix vring addresses not translated
Commit 3ea7052f4b ("vhost: postpone rings addresses translation")
moves rings addresses translation at either vring kick or enable
time, depending on whether protocol features are enabled or not.
This is done not interpret ring information as long as the vring
is not fully initialized.

The problem is that with old QEMU versions, like v2.5, the ring
is enabled before addresses are sent, so addresses are never
translated.

This patch fixes the issue by doing the translation in
VHOST_USER_SET_VRING_ADDR handling if ring is already enabled.

Fixes: 3ea7052f4b ("vhost: postpone rings addresses translation")

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:26:10 +02:00
Cristian Dumitrescu
8b05d0be6a table: update library version
Updated map file to current API and bumped up ABI version.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:38:31 +02:00
Cristian Dumitrescu
4b08cd8927 table: update copyright
Removed incorrect white spaces and updated year in copyrigh headers.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:11:32 +02:00
Cristian Dumitrescu
9285f42303 table: apply cosmetic enhancements to API
Consolidated hash tables into functional groups.
Minor changes in comments.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:10:27 +02:00
Cristian Dumitrescu
71afef2c14 apps: add mask-based hash functions
Introduce mask-based hash functions in hash_func.h.

Propagate their usage in test/test, test/test-pipeline and
examples/ip_pipeline.

Remove the non-mask-based hash function prototype from API (which
was previously used as build workaround).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:10:08 +02:00
Cristian Dumitrescu
ec35c73ec6 table: rework cuckoo hash table
Rework for the cuckoo hash table to use the unified parameter
structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:09:53 +02:00
Cristian Dumitrescu
ea31510376 table: rework 32-byte key hash tables
Rework for the 32-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:09:28 +02:00
Cristian Dumitrescu
fc972a1305 table: rework 16-byte key hash tables
Rework for the 16-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:09:12 +02:00
Cristian Dumitrescu
36842d0aee table: rework 8-byte key hash tables
Rework for the 8-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-24 13:08:54 +02:00