Yipeng Wang [Fri, 28 Sep 2018 14:11:05 +0000 (07:11 -0700)]
test/hash: fix bucket size in perf test
The bucket size was changed from 4 to 8 but the corresponding
perf test was not changed accordingly.
In the test, the bucket size and number of buckets are used
to map to the underneath rte_hash structure. They are used
to test performance of two conditions: keys in primary
buckets only and keys in both primary and secondary buckets.
Although there is no functional issue with bucket size set
to 4, it mismatches the underneath rte_hash structure,
which may affect code readability and future extension.
Fixes: 58017c98ed53 ("hash: add vectorized comparison") Cc: stable@dpdk.org Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
latency: fix timestamp marking and latency calculation
Latency calculation logic is not correct for the case where
packets gets dropped before TX. As for the dropped packets,
the timestamp is not cleared, and such packets still gets
counted for latency calculation in next runs, that will result
in inaccurate latency measurement.
So fix this issue as below,
Before setting timestamp in mbuf, check mbuf don't have
any prior valid time stamp flag set and after marking
the timestamp, set mbuf flags to indicate timestamp is
valid.
Before calculating timestamp check mbuf flags are set to
indicate timestamp is valid.
With the above logic it is guaranteed that correct timestamps
have been used.
Fixes: 5cd3cac9ed ("latency: added new library for latency stats") Cc: stable@dpdk.org Reported-by: Bao-Long Tran <longtb5@viettel.com.vn> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Tested-by: Bao-Long Tran <longtb5@viettel.com.vn> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Keith Wiles [Fri, 5 Oct 2018 14:48:25 +0000 (09:48 -0500)]
eal: add macro for attribute weak
eal: add shorthand __rte_weak macro
qat: update code to use __rte_weak macro
avf: update code to use __rte_weak macro
fm10k: update code to use __rte_weak macro
i40e: update code to use __rte_weak macro
ixgbe: update code to use __rte_weak macro
mlx5: update code to use __rte_weak macro
virtio: update code to use __rte_weak macro
acl: update code to use __rte_weak macro
bpf: update code to use __rte_weak macro
Signed-off-by: Keith Wiles <keith.wiles@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
eal/linux: eliminate cast of HPET thread signature
The cast of hpet_msb_inc is causing a warning in some compilations.
Yet the cast is unnecessary, the function is used only one place
just use the correct signature.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Jeff Guo [Thu, 18 Oct 2018 06:27:15 +0000 (14:27 +0800)]
igb_uio: fix unexpected removal for hot-unplug
When a device is hot-unplugged, pci_remove will be invoked unexpectedly
before pci_release, it will caused kernel hung issue which will throw the
error info of "Trying to free already-free IRQ XXX". And on the other hand,
if pci_remove before pci_release, the interrupt will not got chance to be
disabled. So this patch aim to fix this issue by adding pci_release call
in pci_remove, it will gurranty that all pci clean up will be done before
pci removal.
Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Shreyansh Jain [Wed, 24 Oct 2018 05:33:41 +0000 (05:33 +0000)]
raw/skeleton: fix memory leak on test failure
In skeleton_rawdev unit tests, a malloc'd memory was leaking in case
the next sequential test fails. This fix moves the free of the
malloc'd memory above the failing test.
Shreyansh Jain [Wed, 17 Oct 2018 10:10:34 +0000 (10:10 +0000)]
common/dpaax: reduce log level
DPAAX is a library used by various NXP drivers. In case of non-NXP
environment, this start spewing message about unavailability of
necessary environment.
This patch reduces the log level for certain messages as well as
reduces overall log-level. As a library, these message are not
necessarily relevant at higher log level, either.
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Shreyansh Jain [Wed, 24 Oct 2018 05:44:09 +0000 (05:44 +0000)]
common/dpaax: fix nodes check
In case the memory for nodes cannot be allocated, there is no need
to check for the length. Also, `node_count` is an unsigned value
and cannot be less than 0.
Shreyansh Jain [Wed, 17 Oct 2018 09:05:57 +0000 (09:05 +0000)]
common/dpaax: fix uninitialized PA-VA table case
There is a possibility that either because of missing device tree entry
or lack of memory, the PA-VA table might not be available. But, the
table being transparent, the callers don't necessary check for its
initialization state. This is explicitly done during update and
translation call.
In no-shconf mode the rte_mp_request_sync() wasn't initializing
the `reply` parameter, which contained e.g. a number of sent
requests. Callers of rte_mp_request_sync() might check that
param afterwards and might read potentially unitialized memory.
The no-shconf check that makes us return early (with rc = 0) was
placed before the `reply` initialization. Fix this by making the
`reply` initialization occur first.
Thomas Monjalon [Tue, 23 Oct 2018 16:01:40 +0000 (18:01 +0200)]
kvargs: fix processing a null list
In the doxygen description of rte_kvargs_process(), it is said:
If *kvlist* is NULL function does nothing.
It has been added by mistake here instead of rte_kvargs_free().
Anyway, null list should be correctly handled in both functions.
Comments are fixed in both functions and NULL handling is added
to rte_kvargs_process().
Fixes: c34af7424e09 ("kvargs: fix freeing behaviour for null") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Anatoly Burakov [Mon, 22 Oct 2018 12:57:03 +0000 (13:57 +0100)]
mem: fix resource leak
Segment preallocation code allocates an array of structures on the
heap but does not free the memory afterwards. Fix it by freeing it
at the end of the function, and changing control flow to always go
through that code path.
Dan Gora [Wed, 17 Oct 2018 00:22:44 +0000 (21:22 -0300)]
test: fix build of external memory test
There was a compilation error in test_external_mem.c:
CC test_external_mem.o
test_external_mem.c: In function ‘test_external_mem’:
test_external_mem.c:375:2: error: ‘for’ loop initial declarations are
only allowed in C99 mode
for (int i = 0; i < n_pages; i++) {
^
test_external_mem.c:375:2: note: use option -std=c99 or -std=gnu99 to
compile your code
Fixes: b270daa43b3d ("test: support external memory") Signed-off-by: Dan Gora <dg@adax.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Qi Zhang [Mon, 22 Oct 2018 06:15:16 +0000 (14:15 +0800)]
eal: fix bus name read for removal in multi-process
A crash may appear when removing some PCI devices because
dev->devargs is not always initialized. So use dev->bus instead of
dev->devargs->bus when building devargs string to remove a device.
Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Qi Zhang [Mon, 22 Oct 2018 05:47:11 +0000 (13:47 +0800)]
bus/vdev: fix uninitialized device bus
Device bus should be initialized after bus scan.
While it does not happened when scan vdev from secondary process,
that cause segment fault at rte_dev_probe when call dev->bus->xxx.
Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: stable@dpdk.org Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Anatoly Burakov [Fri, 5 Oct 2018 08:29:44 +0000 (09:29 +0100)]
mem: improve segment list preallocation
Current code to preallocate segment lists is trying to do
everything in one go, and thus ends up being convoluted,
hard to understand, and, most importantly, does not scale beyond
initial assumptions about number of NUMA nodes and number of
page sizes, and therefore has issues on some configurations.
Instead of fixing these issues in the existing code, simply
rewrite it to be slightly less clever but much more logical, and
provide ample comments to explain exactly what is going on.
We cannot use the same approach for 32-bit code because the
limitations of the target dictate current socket-centric
approach rather than type-centric approach we use on 64-bit
target, so 32-bit code is left unmodified. FreeBSD doesn't
support NUMA so there's no complexity involved there, and thus
its code is much more readable and not worth changing.
Anatoly Burakov [Thu, 4 Oct 2018 10:20:39 +0000 (11:20 +0100)]
eal: improve musl compatibility of thread log
Musl complains about pthread id being of wrong size, because on
musl, pthread_t is a struct pointer, not an unsigned int. Fix the
printing code by casting pthread id to unsigned pointer type and
adjusting the format specifier to be of appropriate size.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Anatoly Burakov [Thu, 4 Oct 2018 10:20:38 +0000 (11:20 +0100)]
eal: improve musl compatibility of string functions
Musl wraps various string functions such as strlcpy in order to
harden them. However, the fortify wrappers are included without
including the actual string functions being wrapped, which
throws missing definition compile errors. Fix by including
string.h in string functions header.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Anatoly Burakov [Thu, 4 Oct 2018 10:20:33 +0000 (11:20 +0100)]
mk: build with _GNU_SOURCE defined by default
We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and driver's and application's makefile,
fix it by simply defining _GNU_SOURCE by default for all
builds.
Remove all usages of _GNU_SOURCE in source files and makefiles,
and also fixup a couple of instances of using __USE_GNU instead
of _GNU_SOURCE.
Thomas Monjalon [Wed, 17 Oct 2018 23:42:52 +0000 (01:42 +0200)]
devargs: fix freeing during device removal
After calling unplug function of a bus, the device is expected
to be freed. It is too late for getting devargs to remove.
Anyway, the buses which implement unplug are already freeing
the devargs, except the PCI bus.
So the call to rte_devargs_remove() is removed from EAL and
added in PCI.
Fixes: 2effa126fbd8 ("devargs: simplify parameters of removal function") Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Raslan Darawsheh [Wed, 17 Oct 2018 15:22:11 +0000 (18:22 +0300)]
app/testpmd: set packet dump based on verbosity level
when changing verbosity level it will configure rx/tx callbacks to dump
packets based on the verbosity value as following:
1- dump only received packets:
testpmd> set verbose 1
2- dump only sent packets:
testpmd> set verbose 2
3- dump sent and received packets:
testpmd> set verbose (any number > 2)
4- disable dump
testpmd> set verbose 0
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Phil Yang [Wed, 17 Oct 2018 01:36:30 +0000 (09:36 +0800)]
app/testpmd: fix physical port socket initialization
Once the lcore list setting excluded the socket which physical device
attached, it will cause failure. Meanwhile, it will disable Testpmd
cross NUMA scenario.
Fixes: dbfb8ec7094c ("app/testpmd: optimize mbuf pool allocation") Cc: stable@dpdk.org Signed-off-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Shahaf Shuler [Tue, 16 Oct 2018 06:05:17 +0000 (09:05 +0300)]
net/mlx5: fix build on Arm
On some ARM environment, the below compilation error will be seen
dpdk/drivers/net/mlx5/mlx5_flow_dv.c: In function
'flow_dv_translate_item_nvgre':
/tmp/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:785:22: error: pointer targets
in initialization differ in signedness [-Werror=pointer-sign]
const char *tni_v = nvgre_v->tni;
The reason for this error is that nvgre_v->tni is defined as byte array
in size of 3B. However the code in the function iterate till the 4B in
order to copy/set also the subsequent field after it (flow_id)
Fixing by pointing to this struct from a different pointer.
Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items") Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Ori Kam <orika@mellanox.com>
Postcopy live-migration feature requires the application to
not populate the guest memory. As the vhost library cannot
prevent the application to that (e.g. preventing the
application to call mlockall()), the feature is disabled by
default.
The application should only enable the feature if it does not
force the guest memory to be populated.
In case the user passes the RTE_VHOST_USER_POSTCOPY_SUPPORT
flag at registration but the feature was not compiled,
registration fails.
For the same reason, postcopy and dequeue zero copy features
are not compatible, so don't advertize postcopy support if
dequeue zero copy is requested.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Fri, 12 Oct 2018 12:40:42 +0000 (14:40 +0200)]
vhost: avoid useless VhostUserMemory copy
The VHOST_USER_SET_MEM_TABLE payload is copied when handled,
whereas it could directly be referenced.
This is not very important, but next, we'll need to update the
payload and send it back to Qemu.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Ilya Maximets <i.maximets@samsung.com>
Maxime Coquelin [Fri, 12 Oct 2018 12:40:34 +0000 (14:40 +0200)]
vhost: define postcopy protocol flag
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Maxime Coquelin [Fri, 12 Oct 2018 12:40:32 +0000 (14:40 +0200)]
vhost: fix payload size of reply
QEMU doesn't expect any payload for the reply of
VHOST_USER_SET_LOG_BASE request, so don't send any.
Note that the Vhost-user specification isn't clear about
it and would need to be fixed.
Maxime Coquelin [Fri, 12 Oct 2018 12:40:31 +0000 (14:40 +0200)]
vhost: clarify reply-ack in case a reply was already sent
For messages that require a reply, a second ack should not be
sent when reply-ack protocol feature is negotiated, even if
the corresponding flag is set in the message.
The code is compliant with the spec but it isn't clear it is,
so this patch adds a comment to make it explicit.
Maxime Coquelin [Fri, 12 Oct 2018 12:40:30 +0000 (14:40 +0200)]
vhost: fix return code of messages requiring replies
VHOST_USER_GET_PROTOCOL_FEATURES, VHOST_USER_GET_VRING_BASE
and VHOST_USER_SET_LOG_BASE require replies, so their handlers
should return VH_RESULT_REPLY, not VH_RESULT_OK.
Fixes: 0bff510b5ea6 ("vhost: unify message handling function signature") Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Maxime Coquelin [Fri, 12 Oct 2018 12:40:29 +0000 (14:40 +0200)]
vhost: fix messages results handling
Return of message handling has now changed to an enum that can
take non-negative value that is not zero in case a reply is
needed. But the code checking the variable afterwards has not
been updated, leading to success messages handling being
treated as errors.
External post and pre callbacks return type needs also to be
changed to the new enum, so that its handling is consistent.
This is done in this patch alongside with the convertion of
its only user, vhost-crypto backend.
Fixes: 0bff510b5ea6 ("vhost: unify message handling function signature") Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tiwei Bie [Thu, 11 Oct 2018 14:22:34 +0000 (22:22 +0800)]
vhost: fix notification for packed ring
The notification can't be disabled in packed ring when
application tries to disable notification, because the
device event flags field is overwritten by an unexpected
value. This patch fixes this issue.
Fixes: b1cce26af1dc ("vhost: add notification for packed ring") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
The corresponding rte_flow_item_eth must be present in
rte_flow pattern
Only support modify outer layer MAC address
The example testpmd command is:
flow create 0 transfer ingress
pattern eth / ipv4 / udp dst is 7000 / end
actions set_mac_dst mac_addr dd:00:aa:11:bb:33 /
set_mac_src mac_addr bb:00:cc:11:aa:22 /
port_id id 1 / end
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Alejandro Lucero [Mon, 15 Oct 2018 14:11:02 +0000 (15:11 +0100)]
ethdev: add field for device data per process
Primary and secondary processes share a per-device private data. With
current design it is not possible to have data per-device per-process.
This is required for handling properly the CPP interface inside the NFP
PMD with multiprocess support.
There is also at least another PMD driver, tap, with similar
requirements for per-process device data.
Xiaoyun Li [Mon, 15 Oct 2018 04:36:34 +0000 (00:36 -0400)]
doc: add ixgbe known issue with legacy interrrupt
When using uio_pci_generic module or using legacy interrupt mode of
igb_uio or vfio, X550 cannot get interrupts. Because the Interrupt
Status bit is not implemented, then the irq cannot be handled correctly
and cannot report the event fd to DPDK apps.
Add this hw limitation and details into ixgbe known issue.
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Rahul Lakkireddy [Mon, 15 Oct 2018 14:05:13 +0000 (19:35 +0530)]
net/cxgbe: add action to swap MAC addresses
Implement RTE_FLOW_ACTION_TYPE_MAC_SWAP to offload flows with
action to swap the source and destination MAC addresses in the
outermost Ethernet header.
Phil Yang [Fri, 12 Oct 2018 09:34:55 +0000 (17:34 +0800)]
app/testpmd: fix vdev socket initialization
The cmdline settings of port-numa-config and rxring-numa-config have
been flushed by the following init_config. If we don't configure the
port-numa-config, the virtual device will allocate the device ports to
socket 0. It will cause failure when the socket 0 is unavailable.
Now that logging of initialization is controlled by dynamic debug
level, remove the #ifdef for RTE_LIBRTE_QEDE_DEBUG_INIT since that
config option does not exist in common_base and is not documented.