The vhost feature negotiation only happens at virtio reset stage, say
when a virtio-net device is firstly initiated, or when DPDK virtio PMD
initiates. That means, if vhost APP restarts after the negotiation and
reconnects, the feature negotiation process will not be triggered again,
meaning the info is lost. To make reconnect work, QEMU simply saves
the negotiated features before the restart and restores it afterwards.
Therefore, the vhost supported features must be exactly the same before
and after the restart. For example, if TSO is disabled and then enabled,
nothing will work and undefined issues might happen.
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
icc version 16.0.2, compile error:
examples/l2fwd-ivshmem/host/host.c(157):
error #3656: variable "total_vm_packets_dropped"
may be used before its value is set
total_vm_packets_dropped += ctrl->vm_ports[portid].stats.dropped;
^
Fixes: 6aa4972491 ("examples/l2fwd-ivshmem: import sample application")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Function create_mp_ring_vdev() for failure cases exits without
freeing the created rte rings, because of this, pdump tool cannot be
rerun successfully. Added rte ring cleanup logic upon failures.
Fixes: caa7028276 ("app/pdump: add tool for packet capturing")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
i40e driver was removing elements when iterating tailq lists
with TAILQ_FOREACH macro, which is not safe.
It is especially visible since the memory is zeroed on free
(commit ea0bddbd14).
Instead, TAILQ_FOREACH_SAFE macro is used when removing/freeing
these elements.
Fixes: 4861cde461 ("i40e: new poll mode driver")
Fixes: 440499cf53 ("net/i40e: support floating VEB")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Removing/freeing elements elements within a TAILQ_FOREACH loop is not safe.
FreeBSD defines TAILQ_FOREACH_SAFE macro, which permits
these operations safely.
This patch defines this macro for Linux systems, where it is not defined.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
In rte_mem_virt2phy: Value returned from a function and indicating the
number of bytes was ignored. This could cause a wrong pfn (page frame
number) mask read from pagemap file.
When read returns less than the number of sizeof(uint64_t) bytes,
function rte_mem_virt2phy returns error.
Coverity issue: 13212
Fixes: 40b966a211 ("ivshmem: library changes for mmaping using ivshmem")
Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
John Mcnamara and I were discussing enhancing the validate_abi script to
build the dpdk tree faster with multiple jobs.
Theres no reason not to do it, so this implements that requirement.
It uses a DPDK_MAKE_JOBS variable that can be set by the user to limit
the job count. By default the job count is set to the number of online
cpus.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
In TM, the read size should be lesser than the write size to improve
performance.
This enables the TM ports to push maximum packets to the output port.
This fix changes the burst_read value from 64 to 24 in default_tm_params.
Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
IP Pipeline application with the configuration for Flow Classification
IPV6 did not instantiate.
Parse error in section "PIPELINE1": entry "dma_src_mask" too long
The dma_src_mask check in pipeline_passthrough_parse_args() is wrong.
This fix increases the length of dma_src_mask by 1 for NULL termination
and corrected the validation of dma_src_mask length.
This fix is also propagated to pipeline_fc_parse_args() for key_mask_str
validation.
Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Error while executing action flow bulk command
pipeline> p 1 action flow bulk ./config/action.txt
Command "action flow bulk" failed
pipeline>
The flow action entries are added successfully.
But the return value is not computed correctly.
Due to this, the error message appears on CLI.
The return value is computed with rsp->n_flows after rsp pointer is freed.
This fix computes the return value before rsp pointer is freed.
Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
pthread_detach() function was returning 0 even when not calling
lthread_detach(), due to missing braces in conditional
(extra indentation was applied, giving a hint this is the correct fix).
Fixes: 433ba6228f ("examples/performance-thread: add pthread_shim app")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: John McNamara <john.mcnamara@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
We find significant perfermance drop introduced by below commit,
when vhost example is started with --mergeable 0 and inside vm,
kernel virtio-net driver is used to do ip based forwarding.
The commit, 859b480d5a ("vhost: add guest offload setting"), adds
support for VIRTIO_NET_F_GUEST_TSO4 and VIRTIO_NET_F_GUEST_TSO6,
in vhost lib. But inside vhost example, the way to disable tso only
excludes the direction from virtio to vhost, but not the opposite
direction. When mergeable is disabled, it triggers big_packets path
of virtio-net driver to prepare to receive possible big packets with
size of 64K. Because mergeable is off, for each entry of avail ring,
virtio driver uses 19 desc chained together, with one desc pointing
to header, other 18 desc pointing to 4K-sized pages. But QEMU only
creates 256 desc entries for each vq, which results in that only 13
packets can be received. VM kernel can quickly handle those packets
and go to sleep (HLT).
As QEMU has no option to set the desc entries of a vq, so here,
we disable VIRTIO_NET_F_GUEST_TSO4 and VIRTIO_NET_F_GUEST_TSO6
with VIRTIO_NET_F_HOST_TSO4 and VIRTIO_NET_F_HOST_TSO6 when we
disable tso of vhost example, to avoid VM kernel virtio driver
go into big_packets path.
Fixes: 9fd72e3cbd ("examples/vhost: add virtio offload")
Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
The usual device sequence is configure, queue setup and start.
Crypto device should be started before use.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The usual device sequence is configure, queue setup and start.
Crypto device should be started before use.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
GCC 4.5.x does not handle well initializing anonymous union and/or
structs.
To make the compiler happy we name those anonymous union/struct.
Fixes: 906257e965 ("examples/ipsec-secgw: support IPv6")
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
When parsing the parameters for virtual device initialization,
rte_kvargs structure was being freed only if there was an error,
not when parsing was successful.
Coverity issue: 124568
Fixes: f3e764fa2f ("cryptodev: uninline parameter parsing")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
The commit cb6696d220 ("drivers: update registration macro usage")
changes the name from virtio-user to virtio_user, because hyphen
cannot be used in a C symbol name. However, this commit does not
update the strings in docs and source code, which could lead to
failure to start this device as per the docs.
This patch updates related strings in the docs and source code.
Fixes: cb6696d220 ("drivers: update registration macro usage")
Reported-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Sometimes app just wants to update the RSS hash function and no RSS key
update is needed, but fm10k pmd will return EINVAL for this case.
If the rss_key is NULL, we don't need to check the rss_key_len.
Fixes: 57033cdf8f ("fm10k: add PF RSS")
Reported-by: Xueqin Lin <xueqin.lin@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Rx loop inside _recv_raw_pkts_vec() ignores nb_pkts argument and always
tries to receive RTE_I40E_VPMD_RX_BURST (32) packets. This is a violation
of rte_eth_rx_burst() API and can lead to memory corruption (out-of-bounds
writes to struct rte_mbuf **rx_pkts) if nb_pkts is less than 32.
Fix this by actually using nb_pkts inside the loop.
Fixes: 9ed94e5bb0 ("i40e: add vector Rx")
Signed-off-by: Sergey Dyasly <s.dyasly@samsung.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Adam Bynes <adambynes@outlook.com>
The configure function enicpmd_dev_configure() was not paying attention
to the rxmode VLAN strip bit. Set the VLAN strip mode according to the bit.
Fixes: fefed3d1e6 ("enic: new driver")
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: David Harton <dharton@cisco.com>
Tested-by: David Harton <dharton@cisco.com>
Initialize the mbuf data offset to RTE_PKTMBUF_HEADROOM as the
enic takes ownership of them. If allocated mbufs had some offset
other than RTE_PKTMBUF_HEADROOM, the application would read mbuf
data starting at the wrong place and misinterpret the packet.
Fixes: 856d7ba7ed ("net/enic: support scattered Rx")
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
drivers/net/ena/base/ena_com.c(346):
error #3656: variable "dev_node" may be used before its value is set
ENA_MEM_ALLOC_COHERENT_NODE(ena_dev->dmadev,
^
drivers/net/ena/base/ena_com.c(399):
error #3656: variable "prev_node" may be used before its value is set
ENA_MEM_ALLOC_COHERENT_NODE(ena_dev->dmadev,
^
Fixes: 3d3edc265f ("net/ena: make coherent memory allocation NUMA-aware")
Reported-by: Eoin Breen <eoin.breen@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jan Medala <jan@semihalf.com>
The rxq/txq for the queue_release callback could be NULL, say when
rte_eth_dev_configure() fails that the queue is not setup at all.
Do a simple NULL check would fix the crash issue.
Fixes: 01ad44fd37 ("net/virtio: split Rx/Tx queue")
Reported-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
The support of virtio-user changed the way the mbuf dma address is
retrieved, using a physical address in case of virtio-pci and a virtual
address in case of virtio-user.
This change introduced some possible memory corruption in packets,
replacing:
m->buf_physaddr + RTE_PKTMBUF_HEADROOM
by:
m->buf_physaddr + m->data_off (through a macro)
This patch fixes this issue, restoring the original behavior.
By the way, it also rework the macros, adding a "VIRTIO_" prefix and
API comments.
Fixes: f24f8f9fee ("net/virtio: allow virtual address to fill vring descriptors")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Currently while calling of 'rte_vhost_driver_unregister()' connection
to QEMU will not be closed. This leads to inability to register driver
again and reconnect to same virtual machine.
This scenario is reproducible with OVS. While executing of the following
command vhost port will be re-created (will be executed
'rte_vhost_driver_register()' followed by 'rte_vhost_driver_unregister()')
network will be broken and QEMU possibly will crash:
ovs-vsctl set Interface vhost1 ofport_request=15
Fix this by closing all established connections on driver unregister and
removing of pending connections from reconnection list.
Fixes: 64ab701c3d ("vhost: add vhost-user client mode")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
If something abnormal happened to QEMU, 'connect()' can block calling
thread (e.g. main thread of OVS) forever or for a really long time.
This can break whole application or block the reconnection thread.
Example with OVS:
ovs_rcu(urcu2)|WARN|blocked 512000 ms waiting for main to quiesce
(gdb) bt
#0 connect () from /lib64/libpthread.so.0
#1 vhost_user_create_client (vsocket=0xa816e0)
#2 rte_vhost_driver_register
#3 netdev_dpdk_vhost_user_construct
#4 netdev_open (name=0xa664b0 "vhost1")
[...]
#11 main
Fix that by setting non-blocking mode for client sockets for connection.
Fixes: 64ab701c3d ("vhost: add vhost-user client mode")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
After doing a driver callout to fill in the driver specific
parts of struct rte_eth_stats, rte_eth_stats_get() overwrites
the rx_nombuf member regardless of whether the driver itself
has assigned a value. Any driver-assigned value should take
priority.
Fixes: af75078fec ("first public release")
Signed-off-by: Remy Horton <remy.horton@intel.com>
The autotest lists, requirements and distribution needs a big rework
to reduce the amount of cores and memory required.
The root cause is not addressed yet.
This patch just increase some memory allocation for some greedy tests
which often fail because of memory fragmentation:
LPM6 and reentrancy tests in groups 3 and 6 respectively.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
The unavailable tests are filtered out by autotest by looking for
the symbols in the binary:
PCI autotest: Skipped [Not Available] [00m 00s]
Malloc autotest: Success [00m 00s]
It results to skip everything if the binary has no symbol (stripped):
PCI autotest: Skipped [Not Available] [00m 00s]
Malloc autotest: Skipped [Not Available] [00m 00s]
This case is handled by getting back to the old behaviour if the binary
has no symbol information:
PCI autotest: Fail [Not found] [00m 00s]
Malloc autotest: Success [00m 00s]
Fixes: d553c8f2b1 ("app/test: filter out unavailable tests")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
test_mempool func not using pointer variable 'mp_ext' and incorrectly
freed. So removing ptr var. Now freeing mp_stack var.
Fixes: ea151eb48a ("app/test: migrate custom mempool handler to stack handler")
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
rte_ring_create expects the size of the ring to
be a power of 2. REFCNT_RING_SIZE value is not
power of 2 in-case if RTE_MAX_LCORE == 96.
Fix it by aligning the size to next power of 2 value.
Fixes: af75078f ("first public release")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Consumer queue dequeuing must be guaranteed to be done fully before
the tail is updated. This is not guaranteed with a read barrier,
changed to a write barrier just before tail update which in practice
guarantees correct order of reads and writes.
Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
The new mempool handler interface forgets to register the free() function
of the ops. Introduced in this patch:
Fixes: 449c49b93a ("mempool: support handler operations")
Signed-off-by: Zoltan Kiss <zoltan.kiss@schaman.hu>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
A recent patch brought up an issue about the size of the 'name' fields:
85cf0079 mem: avoid memzone/mempool/ring name truncation
These relations should be observed:
1. Each ring creates a memzone with a prefixed name:
RTE_RING_NAMESIZE <= RTE_MEMZONE_NAMESIZE - strlen(RTE_RING_MZ_PREFIX)
2. There are some mempool handlers which create a ring with a prefixed
name:
RTE_MEMPOOL_NAMESIZE <= RTE_RING_NAMESIZE - strlen(RTE_MEMPOOL_MZ_PREFIX)
3. A mempool can create up to RTE_MAX_MEMZONE pre and postfixed memzones:
sprintf(postfix, "_%d", RTE_MAX_MEMZONE)
RTE_MEMPOOL_NAMESIZE <= RTE_MEMZONE_NAMESIZE -
strlen(RTE_MEMPOOL_MZ_PREFIX) - strlen(postfix)
Setting all of them to 32 hides this restriction from the application.
This patch decreases the mempool and ring string size to accommodate for
these prefixes, but it doesn't apply the 3rd constraint. Applications
relying on these constants need to be recompiled, otherwise they'll run
into ENAMETOOLONG issues.
The size of the arrays are kept 32 for ABI compatibility, it can be
decreased next time the ABI changes.
Signed-off-by: Zoltan Kiss <zoltan.kiss@schaman.hu>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
(strlen(name) == sizeof(mz->name) - 1) is a valid case, change the
condition to reflect that.
Move it earlier to avoid lookup with invalid name.
Change errno to ENAMETOOLONG.
Fixes: 85cf0079 ("mem: avoid memzone/mempool/ring name truncation")
Signed-off-by: Zoltan Kiss <zoltan.kiss@schaman.hu>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
On weak memory order architecture like POWER, rte_smp_wmb/rte_smp_rmb
need to use CPU instructions, not compiler barrier. This patch fixes
this. Also, to improve performance on PPC64, use light weight sync
instruction instead of sync instruction.
Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
The sed syntax of '0,/regexp/' is GNU specific and fails with
non GNU sed in FreeBSD.
To solve the issue we can use awk instead to remove duplicates.
The awk script basically keeps the last config value, while
maintaining order and comments from original config file.
Fixes: b2063f104d ("mk: filter duplicate configuration entries")
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
There is an error when linking static EAL library with an application:
eal_alarm.c:(.text+0xd7): undefined reference to `clock_gettime'
eal_alarm.c:(.text+0x20f): undefined reference to `clock_gettime'
eal_timer.c:(.text+0x108): undefined reference to `clock_gettime'
eal_timer.c:(.text+0x146): undefined reference to `clock_gettime'
The function clock_gettime() is in librt for old glibc.
Fixes: 281948b475 ("mk: fix missing librt dependencies")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Yongjie Gu <yongjiex.gu@intel.com>
The correct mailing list dev@dpdk.org, not dev@dpkg.org.
Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>