Markus Theil [Mon, 22 May 2017 10:17:50 +0000 (12:17 +0200)]
net/igb: fix add/delete of flex filters
Before this patch, flex_filter->index was always zero when it was read
and used after rte_zmalloc. The corresponding code was therefore moved
into the add and delete parts of the if/else statement.
Fixes: 231d43909a31 ("igb: migrate flex filter to new API") Cc: stable@dpdk.org Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
John Daley [Wed, 17 May 2017 22:38:10 +0000 (15:38 -0700)]
net/enic: flow API debug
Added a debug function to print enic filters and actions when
rte_validate_flow is called. Compiled in CONFIG_RTE_LIBRTE_ENIC_DEBUG_FLOW
is enabled and log level is INFO.
Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
John Daley [Wed, 17 May 2017 22:38:09 +0000 (15:38 -0700)]
net/enic: flow API for Legacy NICs
5-tuple exact Flow support for 1200 series adapters. This allows:
Attributes: ingress
Items: ipv4, ipv6, udp, tcp (must exactly match src/dst IP
addresses and ports and all must be specified).
Actions: queue and void
Selectors: 'is'
Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
John Daley [Wed, 17 May 2017 22:38:08 +0000 (15:38 -0700)]
net/enic: flow API for NICs with advanced filters disabled
Flow support for 1300 series adapters with the 'Advanced Filter'
mode disabled via the UCS management interface. This allows:
Attributes: ingress
Items: Outer eth, ipv4, ipv6, udp, sctp, tcp, vxlan. Inner eth, ipv4,
ipv6, udp, tcp.
Actions: queue and void
Selectors: 'is', 'spec' and 'mask'. 'last' is not supported
With advanced filters disabled, an IPv4 or IPv6 item must be specified
in the pattern.
Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
John Daley [Wed, 17 May 2017 22:38:06 +0000 (15:38 -0700)]
net/enic: flow API for NICs with advanced filters enabled
Flow support for 1300 series adapters with the 'Advanced Filter'
mode enabled via the UCS management interface. This enables:
Attributes: ingress
Items: Outer eth, ipv4, ipv6, udp, sctp, tcp, vxlan. Inner eth, ipv4,
ipv6, udp, tcp.
Actions: queue, and void
Selectors: 'is', 'spec' and 'mask'. 'last' is not supported
Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
John Daley [Wed, 17 May 2017 22:38:04 +0000 (15:38 -0700)]
net/enic/base: bring NIC interface functions up to date
Update the base functions for the Cisco VIC. These files are mostly
common with other VIC drivers so are left alone is as much as possible.
Includes in a new filter/action interface which is needed for Generic
Flow API PMD support. Update FDIR code to use the new interface.
Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
John Miller [Tue, 16 May 2017 16:14:15 +0000 (12:14 -0400)]
net/ark: fix buffer not null terminated
Coverity issue: 144512
Coverity issue: 144513 Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen") Cc: stable@dpdk.org Signed-off-by: John Miller <john.miller@atomicrules.com>
Pascal Mazon [Fri, 12 May 2017 13:01:39 +0000 (15:01 +0200)]
net/tap: create netdevice during probing
This has three main benefits:
- tun_alloc is now generic again for any queue,
- mtu no longer needs to be handled in tap_setup_queue(),
- an actual netdevice is created as soon as the device is probed.
On top of it, code in eth_dev_tap_create() has been reworked to have a
more logical behavior; initialization can now fail if a remote is
requested but cannot be set up.
Support for a fixed MAC address for testing with the last octet
incrementing by one for each interface defined with the new 'mac=fixed'
string on the --vdev option. The default option is still to randomize
the MAC address for each tap interface.
Signed-off-by: Keith Wiles <keith.wiles@intel.com> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com> Acked-by: Keith Wiles <keith.wiles@intel.com>
Jerin Jacob [Mon, 1 May 2017 06:40:18 +0000 (12:10 +0530)]
net/thunderx: add compile-time checks
The thunderx PMD is sensitive to the layout of the mbuf on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Bruce Richardson [Fri, 28 Apr 2017 16:21:15 +0000 (17:21 +0100)]
net/fm10k: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Bruce Richardson [Fri, 28 Apr 2017 16:21:14 +0000 (17:21 +0100)]
net/i40e: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Bruce Richardson [Fri, 28 Apr 2017 16:21:12 +0000 (17:21 +0100)]
net/ixgbe: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Ilya Maximets [Thu, 18 May 2017 12:19:40 +0000 (15:19 +0300)]
ethdev: keep port id unchanged if obtaining by name failed
Currently, 'rte_eth_dev_get_port_by_name' changes transmitted
'port_id' unconditionally. This is undocumented and misleading
behaviour as user may expect unchanged value in case of error.
Otherwise, there is no sense having both return value and
a pointer in the function.
Fixes: 9c5b8d8b9feb ("ethdev: clean port id retrieval when attaching") Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
David Marchand [Sat, 20 May 2017 13:12:37 +0000 (15:12 +0200)]
drivers/net: fix vfio kmod dependency
vfio is the kernel framework used by the vfio-pci kernel driver.
DPDK drivers do not rely solely on vfio, but rather on vfio-pci to gain
access to pci resources.
Fixes: 0880c40113ef ("drivers: advertise kmod dependencies in pmdinfo") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Tonghao Zhang [Fri, 12 May 2017 06:03:43 +0000 (23:03 -0700)]
memzone: check NUMA id when reserving a zone
If the socket_id is invalid (e.g. -2, -3), the
memzone_reserve_aligned_thread_unsafe should return the
EINVAL and not ENOMEM. To avoid it, we should check the
socket_id before calling malloc_heap_alloc.
Signed-off-by: Tonghao Zhang <nic@opencloud.tech> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Sangjin Han [Fri, 2 Jun 2017 05:07:46 +0000 (05:07 +0000)]
lpm: fix build with gcc -O0 option
When rte_lpm.h is used on x86, -O0 option (no optimization at all)
given to gcc causes a compile error like this:
error: the last argument must be an 8-bit immediate
i24 = _mm_srli_si128(i24, sizeof(uint64_t));
-O0 option is useful for debugging and code coverage measurement, but
this error prevents DPDK programs from building. This patch replaces
"sizeof(uint64_t)" with a constant literal "8" to work around the issue.
The issue occurs on gcc/g++ versions from 4.8 to 5.
Signed-off-by: Sangjin Han <sangjin@eecs.berkeley.edu> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Fixing the below error by returning from the function early
when count == 0.
Issue flagged by GCC 7.1.1
examples/vhost/virtio_net.c:370:38: error: ‘desc_indexes[0]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
rte_prefetch0(&vr->desc[desc_indexes[0]]);
Fixes: ca059fa5e290 ("examples/vhost: demonstrate the new generic APIs") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Jerin Jacob [Fri, 2 Jun 2017 11:20:30 +0000 (16:50 +0530)]
examples/qos_sched: suppress gcc 7.1.1 warning
This one is more of a compiler issue as application
checks the app_parse_opt_vals() return value.
Since this code is in slow path, adding a memset
to fix following "maybe-uninitialized" warning.
qos_sched/args.c: In function ‘app_parse_args’:
examples/qos_sched/args.c:254:32: error: ‘vals[0]’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
pconf->rx_port = (uint8_t)vals[0];
~~~~^~~
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
John McNamara [Thu, 11 May 2017 14:09:40 +0000 (15:09 +0100)]
doc: change line length limit in contributors guide
The DPDK documentation guidelines state that lines should be wrapped as
follows:
* The recommended style for the DPDK documentation is to put sentences on
separate lines. This allows for easier reviewing of patches. ...
* Long sentences should be wrapped at 120 characters +/- 10 characters.
They should be wrapped at words.
Pablo de Lara [Fri, 28 Apr 2017 18:06:44 +0000 (19:06 +0100)]
doc: announce crypto structures rework
The current crypto operation and symmetric crypto operation
structures will be reworked for correctness and improvement,
reducing also their sizes, to fit into less cache lines,
as stated in the following RFC:
http://dpdk.org/dev/patchwork/patch/24011/
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tomasz Kulasek [Thu, 4 May 2017 15:37:23 +0000 (17:37 +0200)]
doc: announce API changes for crypto sessions
API changes are planned for 17.08 to made sessions agnostic to the
underlaying devices, removing coupling with crypto PMDs, so a single
session can be used on multiple devices.
It requires to change "struct rte_cryptodev_sym_session" to store more
than one private data for devices, as well as remove redundant dev_id
and dev_type.
doc: announce crypto device type enumeration removal
Refer to RFC patch - cryptodev: remove crypto device type enumeration
It is planned to remove device type enumeration rte_cryptodev_type from
library to remove the coupling between crypto PMD and the librte_cryptodev.
In this case following stuctures will be changed: rte_cryptodev_session,
rte_cryptodev_sym_session, rte_cryptodev_info, rte_cryptodev.
It is planned to change the function rte_cryptodev_count_devtype().
The function prototype doesn’t clearly show the operation.
>From next release 17.08 the dev_type will be changed to driver_id.
So the function name will change to rte_cryptodev_device_count_by_driver().
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
The following PMD names definitions will be moved to the individual PMDs
to remove the coupling between crypto PMDs and the librte_cryptodev:
CRYPTODEV_NAME_NULL_PMD
CRYPTODEV_NAME_AESNI_MB_PMD
CRYPTODEV_NAME_AESNI_GCM_PMD
CRYPTODEV_NAME_OPENSSL_PMD
CRYPTODEV_NAME_QAT_SYM_PMD
CRYPTODEV_NAME_SNOW3G_PMD
CRYPTODEV_NAME_KASUMI_PMD
CRYPTODEV_NAME_ZUC_PMD
CRYPTODEV_NAME_ARMV8_PMD
CRYPTODEV_NAME_SCHEDULER_PMD
CRYPTODEV_NAME_DPAA2_SEC_PMD
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Shahaf Shuler [Mon, 1 May 2017 06:58:12 +0000 (09:58 +0300)]
doc: announce ABI change for Tx offload
This is an ABI change notice for DPDK 17.08 in ethdev
about changes in rte_eth_txmode structure.
Currently Tx offloads are enabled by default, and can be disabled
using ETH_TXQ_FLAGS_NO* flags. This behaviour is not consistent with
the Rx side where the Rx offloads are disabled by default and enabled
according to bit field in rte_eth_rxmode structure.
The proposal is to disable the Tx offloads by default, and provide
a way for the application to enable them in rte_eth_txmode structure.
Besides of making the Tx configuration API more consistent for
applications, PMDs will be able to provide a better out of the
box performance.
Finally, as part of the work, the ETH_TXQ_FLAGS_NO* will
be superseded as well.
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Gaetan Rivet [Wed, 10 May 2017 15:46:10 +0000 (17:46 +0200)]
doc: announce ABI change for device parameters
The PCI and virtual bus are planned to be moved to the generic
drivers/bus directory in v17.08. For this change to be possible, the EAL
must be made completely independent.
The rte_devargs structure currently holds device representation internal
to those two busses. It must be made generic before this work can be
completed.
Instead of using either a driver name for a vdev or a PCI address for a
PCI device, a devargs structure will have to be able to describe any
possible device on all busses, without introducing dependencies on
any bus-specific device representation. This will break the ABI for this
structure.
Additionally, an evolution will occur regarding the device parsing
from the command-line. A user must be able to set which bus will handle
which device, and this setting is integral to the definition of a
device.
The format has not yet been formally defined, but a proposition will
follow soon for a new command line parameter format for all devices.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: David Marchand <david.marchand@6wind.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Coverity reported that an argument for sizeof was used improperly.
We should allocate memory for value size that pointer points to,
instead of pointer size itself.
Coverity issue: 144523, 144521 Fixes: 7ac16a3660c0 ("app/proc-info: support xstats by ID and by name") Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Gregory Etelson [Wed, 10 May 2017 15:13:10 +0000 (17:13 +0200)]
mbuf: fix bulk allocation when debug enabled
The debug assertions when allocating a raw mbuf are not correct since
commit 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool"),
which triggers a panic when using this function in debug mode
Change the expected number of segments to 1 instead of 0, and
factorize these sanity checks.
Fixes: 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool") Signed-off-by: Gregory Etelson <gregory@weka.io> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Rasesh Mody [Sun, 7 May 2017 22:53:12 +0000 (15:53 -0700)]
net/qede: fix RSS table entries for 100G adapter
With the change in base APIs the logic for 100G handling needs to be
adjusted to pass cid values instead for queue ids. The current API
works assuming its queue id.
Fixes: 69d7ba88f1a1 ("net/qede/base: use L2-handles for RSS configuration") Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Yongseok Koh [Tue, 9 May 2017 20:49:31 +0000 (13:49 -0700)]
net/mlx5: change error-prone code on Tx path
In the main loop of mlx5_tx_burst(), pointers/indexes are advanced at the
beginning. Therefore, those should be rolled back if checking resource
availability fails and breaks the loop. And some of them are even
redundant.
Yongseok Koh [Tue, 9 May 2017 20:49:30 +0000 (13:49 -0700)]
net/mlx5: fix index handling for Tx ring
In case of resource deficiency on Tx, mlx5_tx_burst() breaks the loop
without rolling back consumed resources (txq->wqes[] and txq->elts[]). This
can make application crash because unposted mbufs can be freed while
processing completions. Other Tx functions don't have this issue.
Wei Dai [Wed, 10 May 2017 07:00:02 +0000 (15:00 +0800)]
net/ixgbe: fix calling null function of VF
hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not
be called directly. It had better be replaced by calling
ixgbe_get_media_type( ) to avoid crash.
Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated") Signed-off-by: Wei Dai <wei.dai@intel.com> Acked-by: Laurent Hardy <laurent.hardy@6wind.com>
Coverity reported that an argument for sizeof was used improperly.
We should allocate memory for value size that pointer points to,
instead of pointer size itself.
Coverity issue: 144522 Fixes: 79c913a42f0e ("ethdev: retrieve xstats by ID") Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Jerin Jacob [Tue, 9 May 2017 09:45:41 +0000 (15:15 +0530)]
hash: add switch fall-through comments for arm64
This fixes compiler warnings with GCC 7 for arm64 build. Fixes: da8dcc27f644 ("hash: use armv8-a CRC32 instructions") Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tiwei Bie [Sun, 7 May 2017 13:33:34 +0000 (13:33 +0000)]
eal/bsd: fix read on PCI configuration space
Some drivers (such as virtio) may need to read more than 4 bytes
data from PCI configuration space via rte_eal_pci_read_config().
But it will return with an error on FreeBSD when the expected
data length is bigger than the size of pi.pi_data whose type is
u_int32_t. This patch removes this limitation.
Fixes: 632b2d1deeed ("eal: provide functions to access PCI config") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Jianfeng Tan [Fri, 5 May 2017 16:10:13 +0000 (16:10 +0000)]
xen: fix physical address availability in dom0
When physical NICs are binded to igb_uio/uio-pci-generic, they cannot
be used in DPDK app in Xen dom0.
Due to (1) a restriction that phys addresses should be availabe is added
by commit cdc242f260e7 ("eal/linux: support running as unprivileged user"),
(2) and previous implementation of the test to check if phys addresses are
available (using a variable on the stack) just works for non-Xen
environment. Actually, for Xen dom0, the physical addresses are always
available if the memory is initialized successfully..
To fix it, we add an precheck to bypass the physical address availability
test.
Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user") Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Alejandro Lucero [Wed, 10 May 2017 08:54:23 +0000 (09:54 +0100)]
vfio: fix index for tracking devices in a group
Previous fix for properly handling devices from the same VFIO group
introduced another bug where the file descriptor of a kernel vfio
group is used as the index for tracking number of devices of a vfio
group struct handled by dpdk vfio code. Instead of the file
descriptor itself, the vfio group object that file descriptor is
registered with has to be used.
This patch introduces specific functions for incrementing or
decrementing the device counter for a specific vfio group using the
vfio file descriptor as a parameter. Note the code is not optimized
as the vfio group is found sequentially going through the vfio group
array but this should not be a problem as this is not related to
packet handling at all.
Fixes: a9c349e3a100 ("vfio: fix device unplug when several devices per group") Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com> Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>