Commit Graph

10370 Commits

Author SHA1 Message Date
Gaetan Rivet
3df742a917 net/bonding: use local prefix namespace
The current name conflicts with the librte_pci naming convention.
Additionally, it is easier to use gdb when having prefixed even private
functions.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
da5c269bd7 pci: use EAL exposed configuration
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
64d19ecc06 pci: do not expose IOVA mode getter
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
a80f004592 pci: do not expose match function
This function is private to the PCI bus.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
ea978e7c22 pci: do not expose private functions
make the functions

   + rte_pci_detach
   + rte_pci_probe
   + rte_pci_probe_one
   + rte_pci_scan

private as there is no point in using them outside of the rte_bus
framework.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
eb12440a0e pci: use new address parsing function
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
102afb4067 pci: use new address comparison function
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
1a2d1f62d7 pci: make specialized parsing functions private
Do not expose the minute implementations of PCI parsing.
This leaves only the all-purpose rte_pci_addr_parse, which is simpler to
use.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
aba747fe19 pci: introduce PCI address parsing function
A new single function that is able to parse all currently supported
format:

   * Domain-Bus-Device-Function
   *        Bus-Device-Function

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
7a25c9e3c8 pci: deprecate misnamed functions
Rename misnamed functions and describe the change in a deprecation
notice.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
c742e8d311 pci: avoid over-complicated macro
Using a macro helps writing the code to the detriment of the reader
in this case. This is backward. Write once, read many.

The few LOCs gained is not worth the opacity of the implementation.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
cbf10af6de pci: avoid inlining functions
Parsing operations should not happen in performance critical sections.
Headers should not propose implementations unless duly required.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
7e434f300d vfio: move PCI related symbols
These symbols are only relevant to PCI operations.
Move them to a private PCI-related header, allowing to remove the
dependency of the PCI subsystem upon private eal_vfio.h.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
deff7fee91 vfio: check PCI dependency in PCI scan
PCI sometimes requires vfio to be enabled.
Move the check from EAL init to PCI bus scan.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
308eb10706 vfio: remove useless PCI headers
PCI headers are not necessary and are making this module dependent on
the PCI subsystem.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
279b581c89 vfio: expose functions
The following symbols are used by vfio implementations within the PCI bus.
They need to be publicly available for the PCI bus to be outside the
EAL.

  + vfio_enable;
  + vfio_is_enabled;
  + vfio_noiommu_is_enabled;
  + vfio_release_device;
  + vfio_setup_device;

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
821f86e0f4 eal: expose internal config elements
Some internal configuration elements set by the user on the command line
are necessary outside the EAL, when the PCI bus is detached.

Expose:
  + rte_eal_create_uio_dev
  + rte_eal_has_pci
  + rte_eal_vfio_intr_mode

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
701b6f4909 mem: expose function for physical address use
This function was previously private to the EAL layer.
Other subsystems requires it, such as the PCI bus.

In order not to force other components to include stdbool, which is
incompatible with several NIC drivers, the return type has
been changed from bool to int.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
2a46c2a2f2 eal/x86: include common header
The macro RTE_SET_USED is defined in rte_common.h

This header is included through eal_private.h, which includes in turn
rte_pci.h

Once the PCI subsystem is out of the EAL, this will break the
compilation (seen on FreeBSD).

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
b27a200d03 eal: include stdint in private header
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
0af0c40d41 bus: include debug header
This header is included through rte_pci.h, which will be removed once
the PCI bus is moved out of the EAL.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
9aa8a1823f ethdev: remove useless PCI dependency
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Ferruh Yigit
65d3ba3264 eal: fix build with glibc < 2.12
build error:
  CC rte_cycles.o
  cc1: warnings being treated as errors
  ...dpdk/lib/librte_eal/common/arch/x86/rte_cycles.c: In function
  ‘rdmsr’:
  ...dpdk/lib/librte_eal/common/arch/x86/rte_cycles.c:67:2: error:
  implicit declaration of function ‘pread’
  ...dpdk/lib/librte_eal/common/arch/x86/rte_cycles.c:67:2: error:
  nested extern declaration of ‘pread’

from pread man page:
pread(), pwrite():
   _XOPEN_SOURCE >= 500
   || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L

For glibc < 2.12 _XOPEN_SOURCE >= 500 is required.

Adding _GNU_SOURCE define to the file which implies _XOPEN_SOURCE=700

Fixes: ad3516bb4a ("eal/x86: implement arch-specific TSC freq query")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-10-26 23:08:13 +02:00
Shreyansh Jain
a57bbb68d4 event/dpaa2: fix shared build
Fixes: cbc12b0a96 ("mk: do not generate LDLIBS from directory dependencies")
Fixes: b677d4c6d2 ("net/dpaa2: add API for event Rx adapter")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-26 23:04:54 +02:00
Shreyansh Jain
22f5f3cb6b crypto/dpaa_sec: fix shared build
Various symbols are being used by DPAA Crypto driver which were not exposed
from DPAA bus during initial version. This breaks the shared build.

This patch also adds the LDLIBS line required after (cbc12b0a9) patch.

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

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-26 22:50:53 +02:00
Radu Nicolau
6115b677bc crypto/dpaa2_sec: forbid build without security lib
Build fails when rte_security is disabled; make rte_security mandatory

Fixes: 0a23d4b6f4 ("crypto/dpaa2_sec: support protocol offload IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
2017-10-26 22:46:58 +02:00
Radu Nicolau
1b028d5e81 examples/ipsec-secgw: fix build without security lib
Build fails when rte_security is disabled; make rte_security mandatory

Fixes: ec17993a14 ("examples/ipsec-secgw: support security offload")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Tested-by: David Marchand <david.marchand@6wind.com>
2017-10-26 22:33:22 +02:00
Radu Nicolau
71864623ba net/ixgbe: fix build without security library
Fixes: 9a0752f498 ("net/ixgbe: enable inline IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Tested-by: David Marchand <david.marchand@6wind.com>
2017-10-26 22:30:28 +02:00
David Harton
289ba0c0f5 ethdev: allow returning error on VLAN offload ops
Some devices may not support or fail setting VLAN offload
configuration based on dynamic circumstances so the
vlan_offload_set_t vector is modified to return an int so
the caller can determine success or not.

rte_eth_dev_set_vlan_offload is updated to return the
value provided by the vector when called along with restoring
the original offload configs on failure.

Existing vlan_offload_set_t vectors are modified to return
an int.  Majority of cases return 0 but a few that actually
can fail now return their failure codes.

Finally, a vlan_offload_set_t vector is added to virtio
to facilitate dynamically turning VLAN strip on or off.

Signed-off-by: David Harton <dharton@cisco.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Tomasz Kulasek
6abd94d72a net/bonding: fix check slaves link properties
Result of slaves link properties validation is not used when new slave
is added.

This patch uses the value of link_properties_valid() to determinate if
slave can be used in the bonding. If function fails, error is returned
preventing to add slave with invalid link properties.

Coverity issue: 158661
Fixes: deba8a2f8b ("net/bonding: fix link properties management")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
5f64e6bfa1 net/mlx5: fix device stop with multiple regions
LIST macro are not safe when inside a LIST_FOREACH() a LIST_REMOVE() is
called to remove an entry, this behavior is undefined causing some entries
to disappear from the list.

Fixes: 6e78005a9b ("net/mlx5: add reference counter on DPDK Tx queues")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
Roger Melton
3ba62841c2 net/e1000: correct VLAN tag byte order for i35x LB packets
When copying VLAN tags from the RX descriptor to the vlan_tci field
in the mbuf header,  igb_rxtx.c:eth_igb_recv_pkts() and
eth_igb_recv_scattered_pkts() both assume that the VLAN tag is always
little endian.  While i350, i354 and /i350vf VLAN non-loopback
packets are stored little endian, VLAN tags in loopback packets (LB)
for those devices are big endian.

For i350, i354 and i350vf VLAN loopback packets, swap the tag when
copying from the RX descriptor to the mbuf header.  This will ensure
that the mbuf vlan_tci is always little endian.

Signed-off-by: Roger Melton <rmelton@cisco.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-10-26 02:33:01 +02:00
Yongseok Koh
fb870be5a8 net/mlx5: fix Tx doorbell memory barrier
Configuring UAR as IO-mapped makes maximum throughput decline by
noticeable amount. If UAR is configured as write-combining register,
a write memory barrier is needed on ringing a doorbell.

rte_wmb() is mostly effective when the size of a burst is comparatively
small. Revert the register back to write-combining and enforce a write
memory barrier instead, except for vectorized Tx burst routines.
Application can change it by setting MLX5_SHUT_UP_BF under its own
necessity.

Fixes: 9f9bebae55 ("net/mlx5: don't map doorbell register to write combining")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
2262eed752 net/mlx5: fix adjust priority for drop queue
Drop queue should also adjust their priority according the most specific
layer in the pattern they are matching to avoid dropping all the
traffic.

Fixes: 8086cf08b2 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Ferruh Yigit
f064b2cba0 net/octeontx: fix build for gcc < 4.6
-Ofast option supported starting from gcc4.6 [1], for older versions
using "-O3 -ffast-math" instead.

[1] build error:
  CC octeontx_rxtx.o
  cc1: error: invalid option argument ‘-Ofast’

Fixes: 9e747589bd ("net/octeontx: add packet transmit burst function")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-10-26 02:33:01 +02:00
Olivier Matz
380a7aab1a mbuf: rename deprecated VLAN flags
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Gaetan Rivet
51093e679b pci: propagate PMD removal error value for unplug
If a PCI device detach removal fails, returns the actual removal
operator error value.

Use this value within pci->unplug, as it may help applications solve an
issue with the feature or more accurately warn their users.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2017-10-26 02:33:01 +02:00
Gaetan Rivet
00a3d8104a ethdev: remove detachable device flag
This flag is not necessary at the ether layer anymore.
Buses are able to advertise their hotplug support. The ether layer can
rely upon this capability instead of a special flag.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2017-10-26 02:33:01 +02:00
Gaetan Rivet
02f01267de ethdev: do not rely on detachable flag in detach
This flag is deprecated and should not be used to check for the device
ability to be detached.

The rte_dev library call will fail with the relevant error code if
detaching this port is not possible.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
bb102e1368 net/bnxt: check VLANs from pool map only for VMDq
Fixes: 75cd6fb1d9 ("net/bnxt: fix the association of a MACVLAN per VNIC")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
8159471a3a net/bnxt: fix an unused value
return value stored in "rc" but it has been overwritten before use.

Coverity issue: 147216
Fixes: 7a5b087444 ("net/bnxt: support to add a VF MAC address")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
60fff858ad net/bnxt: fix a pointer deref before null check
Coverity issue: 158634
Fixes: daef48efe5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
faabf471da net/bnxt: fix a potential null pointer dereference
Coverity issue: 158634
Fixes: daef48efe5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
8ec40353d4 net/bnxt: fix a potential null pointer dereference
Coverity issue: 195046
Fixes: f7ecea911e ("net/bnxt: fix interrupt handler")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
90cdc91c12 net/bnxt: fix a potential null pointer dereference
Coverity issue: 195017
Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
e6bea83ee3 net/bnxt: fix a pointer deref before null check
Coverity issue: 195015
Fixes: b7435d660a ("net/bnxt: add ntuple filtering support")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
1498060ffb net/bnxt: fix a potential null pointer dereference
Fix a potential null pointer reported by Coverity.

Coverity issue: 195001
Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
9c7b024296 net/bnxt: fix a bit shift operation
We are left shifting more bits than we should be doing.
This patch fixes that.

Coverity issue: 127546
Fixes: 778b759ba1 ("net/bnxt: add MAC address")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
231bd2a2dd net/bnxt: fix redirecting traffic to a VF
The case to handle redirect a flow to a VF is not handled.
This patch fixes it.

Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
6eda9e550e net/bnxt: remove redundant code parsing pool map
This patch removes some redundant code from bnxt_mq_rx_configure().

Fixes: 75cd6fb1d9 ("net/bnxt: fix the association of a MACVLAN per VNIC")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00