Commit Graph

3004 Commits

Author SHA1 Message Date
Adrien Mazarguil
0a2ae70319 net/mlx4: fix Rx interrupts management
This commit addresses various issues that may lead to undefined behavior
when configuring Rx interrupts.

While failure to create a Rx queue completion channel in rxq_setup()
prevents that queue from being created, existing queues still have theirs.
Since the error handler disables dev_conf.intr_conf.rxq as well, subsequent
calls to rxq_setup() create Rx queues without interrupts. This leads to a
scenario where not all Rx queues support interrupts; missing checks on the
presence of completion channels may crash the application.

Considering that the PMD is not supposed to disable user-provided
configuration parameters (dev_conf.intr_conf.rxq), and that these can
change for subsequent rxq_setup() calls anyway, properly supporting a mixed
mode where not all Rx queues have interrupts enabled is a better approach.

To do so with a minimum set of changes, priv_intr_efd_enable() and
priv_create_intr_vec() are first refactored as a single
priv_rx_intr_vec_enable() function (same for their "disable" counterparts).
Since they had to be used together, there was no point in keeping them
separate.

Remaining changes:

- Always clean up before reconfiguring interrupts to avoid memory leaks.
- Always clean up when closing the device.
- Use malloc()/free() instead of their rte_*() counterparts since there is
  no need to store the vector in huge pages-backed memory.
- Allow more Rx queues than the size of the event file descriptor array as
  long as Rx interrupts are not requested on all of them.
- Properly clean up interrupt handle when disabling Rx interrupts (nb_efd
  and intr_vec reset to 0).
- Check completion channel presence while toggling Rx interrupts on a given
  queue.

Fixes: 9f05a4b818 ("net/mlx4: support user space Rx interrupt event")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Moti Haimovsky <motih@mellanox.com>
2017-07-06 15:00:56 +02:00
Adrien Mazarguil
3c560ec3ea net/mlx4: fix Rx interrupts with multiple ports
Several Ethernet device structures are allocated on top of a common PCI
device for mlx4 adapters with multiple ports. These inherit a common
interrupt handle from their parent PCI device, which prevents Rx interrupts
from working properly on all ports as their configuration is overwritten.

Use a local interrupt handle to address this issue.

Fixes: 9f05a4b818 ("net/mlx4: support user space Rx interrupt event")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Moti Haimovsky <motih@mellanox.com>
2017-07-06 15:00:56 +02:00
Adrien Mazarguil
1a3e40d5a4 net/mlx4: fix typos from prior commit
Fixes: 9f05a4b818 ("net/mlx4: support user space Rx interrupt event")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Moti Haimovsky <motih@mellanox.com>
2017-07-06 15:00:56 +02:00
Andrey Chilikin
edeab742ed net/i40e: get information about DDP profile
This patch adds ability to request information about dynamic device
personalization (DDP) profile.

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-07-06 15:00:56 +02:00
Pascal Mazon
f503d26948 net/tap: support flow API isolated mode
With this patch, it is possible to enable or disable the isolate
feature anytime, even immediately after a probe while the tap has not
been configured yet. It will do its job as soon as the netdevice gets
created.

A specific implicit flow rule is created with the lowest priority (all
other flow rules will be evaluated before), at the end of the list. If
isolated mode is enabled, the associated action will be to drop the
packet. Otherwise, the action would be passthrough.

In case of a remote netdevice, implicit rules on it will be removed in
isolated mode, to ensure only actual flow rules redirect packets to the
tap.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-07-06 15:00:56 +02:00
Nélio Laranjeiro
51d5f8ec95 net/mlx5: implement isolated mode from flow API
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2017-07-06 15:00:56 +02:00
Nélio Laranjeiro
6eddd9d65b net/mlx5: fix creation of drop flows
Drop flows being created when the port is stop should not access to the
drop table hash queues as it is invalid.

Fixes: 028761059a ("net/mlx5: use an RSS drop queue")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2017-07-06 15:00:56 +02:00
Rahul Lakkireddy
a5fce96703 net/cxgbe: fix alignment for data offset in mbuf
Fixup alignment for data offset when refilling mbufs.

Fixes: edd04c6196 ("net/cxgbe: update Rx path for Chelsio T6")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2017-07-06 15:00:56 +02:00
Matej Vido
24d0f5aa6b net/szedata2: use macro from common library
Macro for alignment is defined in the common library.
Use macro from the common library in own macro definition.

Signed-off-by: Matej Vido <vido@cesnet.cz>
2017-07-06 15:00:56 +02:00
Matej Vido
791aa7f4a4 net/szedata2: remove unused macro
Fixes: 2f3193cf0f ("pci: inherit common driver in PCI driver")

Signed-off-by: Matej Vido <vido@cesnet.cz>
2017-07-06 15:00:56 +02:00
Qi Zhang
ee4427e0fe net/ixgbe: support packet type parsing in SSE Rx
Hardware PTYPE in Rx desc will be parsed to fill mbuf's packet_type.

Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-06 15:00:56 +02:00
Shachar Beiser
4329cb8111 net/mlx5: implement drop action in hardware classifier
The current drop action is implemented as a queue tail drop,
requiring to instantiate multiple WQs to maintain high drop rate.
This commit, implements the drop action in hardware classifier.
This enables to reduce the amount of contexts needed for the drop,
without affecting the drop rate.

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-07-06 15:00:56 +02:00
Stephen Hemminger
463ced957c pci: increase domain storage to 32 bits
In some environments, the PCI domain can be larger than 16 bits.
For example, a PCI device passed through in Azure gets a synthetic domain
id  which is internally generated based on GUID. The PCI standard does
not restrict domain to be 16 bits.

This change breaks ABI for API's that expose PCI address structure.

The printf format for PCI remains unchanged, so that on most
systems (with only 16 bit domain) the output format is unchanged
and is 4 characters wide.  For example: 0000:00:01.0
Only on sysetms with higher bits will the domain take up more
space; example: 12000:00:01.0

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-06 01:28:02 +02:00
Ferruh Yigit
4be4659a93 drivers/net: use device name from device structure
Device name resides in two different locations, in rte_device->name and
in ethernet device private data.

For now, the copy in the ethernet device private data is required for
multi process support, the name is the how secondary process finds about
primary process device.

But for drivers there is no reason to use the copy in the ethernet
device private data.

This patch updates PMDs to use only rte_device->name.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-06 00:17:02 +02:00
Bruce Richardson
5ea4d4688d net/ixgbe: remove fallback code for x86 non-SSE4
Since SSE4 is now part of minimum requirements for DPDK on x86, we no
longer need this fallback code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
80477544fd net/i40e: remove checks for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we no longer
need these checks.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
50f0b41f23 net/enic: replace check for SSE4 with check for x86
Since SSE4 is now minimum requirement for x86 platforms we can replace the
check for SSE4 with a check for x86

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Ashwin Sekhar T K
8059c1867f net/thunderx: fix build with clang
Replaced usage of %a0 in inline assembly with [%x0]

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-03 22:28:03 +02:00
Olivier Matz
fed524ce53 eal: introduce integer log2 function
At some places, the log2() function is used despite this function
works on float. This introduces a dependency to the math lib but
most of the time it is not required because we want an integer log2.

Add a new helper to do this job and fix nfp driver.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-07-03 10:44:12 +02:00
Bernard Iremonger
d6af1a13d7 ethdev: add return values to callback process API
Change the rte_eth_dev_callback_process function to return int,
and add a void *ret_param parameter.
The new parameter is used by ixgbe and i40e instead of abusing
the user data of the callback.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2017-07-01 17:19:55 +02:00
Pablo de Lara
8cbb35e5cf net/bonding: remove socket id check
Socket id parsed from the user was checked
if it was in the range of available sockets.
This check is unnecessary, as the socket specified
might not have memory anyway, so it will fail
at memory allocation.

Therefore, the best solution is to remove this check.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-22 17:46:09 +02:00
Tiwei Bie
5bdd24e451 net/virtio: zero the whole memory zone
Zero the whole memory zone instead of the first few bytes.

Fixes: c1f86306a0 ("virtio: add new driver")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-06-16 14:04:25 +02:00
Zhihong Wang
29150b70ab vhost: support Rx queue count request
This patch implements the ops rx_queue_count for vhost PMD by adding
a helper function rte_vhost_rx_queue_count in vhost lib.

The ops rx_queue_count gets vhost RX queue avail count and helps to
understand the queue fill level.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-06-16 14:04:25 +02:00
Jerin Jacob
98a7ea332b fix typos using codespell utility
Fixing typos across dpdk source code using codespell utility.
Skipped the ethdev driver's base code fixes to keep the base
code intact.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-06-14 23:54:13 +02:00
Adrien Mazarguil
323f811a4a ethdev: add isolated mode to flow API
Isolated mode can be requested by applications on individual ports to avoid
ingress traffic outside of the flow rules they define.

Besides making ingress more deterministic, it allows PMDs to safely reuse
resources otherwise assigned to handle the remaining traffic, such as
global RSS configuration settings, VLAN filters, MAC address entries,
legacy filter API rules and so on in order to expand the set of possible
flow rule types.

To minimize code complexity, PMDs implementing this mode may provide
partial (or even no) support for flow rules when not enabled (e.g. no
priorities, no RSS action). Applications written to use the flow API are
therefore encouraged to enable it.

Once effective, leaving isolated mode may not be possible depending on PMD
implementation.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-14 23:33:00 +02:00
Ferruh Yigit
aee3d4d6d5 net/mlx5: fix build with gcc 7.1
build error:
.../dpdk/drivers/net/mlx5/mlx5_fdir.c:
  In function ‘fdir_filter_to_flow_desc’:
.../dpdk/drivers/net/mlx5/mlx5_fdir.c:146:18:
 error: this statement may fall through [-Werror=implicit-fallthrough=]
   desc->dst_port = fdir_filter->input.flow.udp4_flow.dst_port;
   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../dpdk/drivers/net/mlx5/mlx5_fdir.c:147:2: note: here
  case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
  ^~~~

Fixed by adding fallthrough comment to the code.

Fixes: 76f5c99e68 ("mlx5: support flow director")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-06-14 22:54:31 +02:00
Ferruh Yigit
a45962823d net/enic: fix build with gcc 7.1
build error:

.../dpdk/drivers/net/enic/base/vnic_dev.c:
  In function ‘vnic_dev_get_mac_addr’:
.../dpdk/drivers/net/enic/base/vnic_dev.c:470:12:
  error: ‘a0’ is used uninitialized in this function
  [-Werror=uninitialized]
  args[0] = *a0;
            ^~~
...dpdk/drivers/net/enic/base/vnic_dev.c:
  In function ‘vnic_dev_classifier’:
...dpdk/drivers/net/enic/base/vnic_dev.c:471:12:
  error: ‘a1’ may be used uninitialized in this function
  [-Werror=maybe-uninitialized]
  args[1] = *a1;
            ^~~
Fixed by providing initial values.

Fixes: 9913fbb91d ("enic/base: common code")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-06-14 22:54:31 +02:00
Ferruh Yigit
92c0b132f2 net/i40e: fix memset size
This causes build error with gcc 7.1.1 :

...dpdk/drivers/net/i40e/i40e_flow.c:2357:2:
error: ‘memset’ used with length equal to number of elements without
       multiplication by element size [-Werror=memset-elt-size]
  memset(off_arr, 0, I40E_MAX_FLXPLD_FIED);
  ^~~~~~

...dpdk/drivers/net/i40e/i40e_flow.c:2358:2:
error: ‘memset’ used with length equal to number of elements without
       multiplication by element size [-Werror=memset-elt-size]
  memset(len_arr, 0, I40E_MAX_FLXPLD_FIED);
  ^~~~~~

Fixed by providing correct size to memset.

Fixes: 6ced3dd72f ("net/i40e: support flexible payload parsing for FDIR")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-06-14 22:54:23 +02:00
Jerin Jacob
6110b1c65b net/thunderx: manage PCI device mapping for SQS VFs
Since the commit e84ad157b7 ("pci: unmap resources if probe fails"),
EAL unmaps the PCI device if ethdev probe returns positive or
negative value.

nicvf thunderx PMD needs special treatment for Secondary queue set(SQS)
PCIe VF devices, where, it expects to not unmap or free the memory
without registering the ethdev subsystem.

Enable the same behavior by using RTE_PCI_DRV_KEEP_MAPPED_RES
PCI driver flag.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-06-12 16:57:22 +01:00
Ferruh Yigit
740feaf349 ethdev: remove driver name from device private data
rte_driver->name has the driver name and all physical and virtual
devices has access to it.

Previously it was not possible for virtual ethernet devices to access
rte_driver->name field (because eth_dev used to keep only pci_dev),
and it was required to save driver name in the device private struct.

After re-works on bus and vdev, it is possible for all bus types to
access rte_driver.

It is able to remove the driver name from ethdev device private data and
use eth_dev->device->driver->name.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Jan Blunck <jblunck@infradead.org>
2017-06-12 16:27:44 +01:00
Ferruh Yigit
96cb195211 net/ring: use EAL APIs in PMD specific API
When ring PMD created via PMD specific API instead of EAL abstraction
it is missing the virtual device creation done by EAL vdev.

And this makes eth_dev unusable exact same as other PMDs used, because
of some missing fields, like rte_device->name.

Now API calls EAL APIs to create ring PMDs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-12 16:27:44 +01:00
Ferruh Yigit
a6992e9610 net/ring: set ethernet device field
The eth_dev->device link was missing for ring PMD, adding it.

This is to generalize rte_device access from eth_dev.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-06-12 16:27:43 +01:00
Matej Vido
8c21057185 net/szedata2: add more supported firmwares
Add IBUF and OBUF offsets definitions for new firmwares.

Signed-off-by: Matej Vido <vido@cesnet.cz>
2017-06-12 15:21:22 +01:00
Matej Vido
18402f9f70 net/szedata2: move ibuf and obuf to specific header
Signed-off-by: Matej Vido <vido@cesnet.cz>
2017-06-12 15:21:22 +01:00
Matej Vido
54c2576268 net/szedata2: refactor ibuf and obuf address definition
This is to prepare for firmwares with multiple ibufs and obufs.
Ibufs and obufs are the modules in FPGA firmware implementing
the Ethernet port.
There is one ibuf+obuf per Ethernet port.
The cards and firmwares allow one physical port to be one Ethernet
port or split into more Ethernet ports, e.g. one 100GE physical
port can be one Ethernet port of 100GE or split into ten Ethernet
ports of 10GE.
All DMA queues in the device are shared between all Ethernet ports.
Offsets of ibufs and obufs are defined in array.
Functions which operate on ibufs and obufs iterate over this array.

Signed-off-by: Matej Vido <vido@cesnet.cz>
2017-06-12 15:21:21 +01:00
Matej Vido
393da2a338 net/szedata2: refactor ibuf and obuf read and write
Remove unused read and write functions.
Use rte_read*, rte_write* functions to access ibuf and obuf
address space.

Signed-off-by: Matej Vido <vido@cesnet.cz>
2017-06-12 15:21:21 +01:00
Matej Vido
963c128751 net/szedata2: refactor ibuf and obuf names
Prefix "cgmii" is removed because it is too specific.
There are different ibuf/obuf modules in different firmwares
but the address space definition is the same.
This patch makes the name general.

Signed-off-by: Matej Vido <vido@cesnet.cz>
2017-06-12 15:21:21 +01:00
Wei Zhao
6a4d050e28 net/igb: flush all the filter
This patch adds a function to flush all the fliter list
and filter rule on a port.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:40:28 +01:00
Wei Zhao
4be9e84ec8 net/igb: destroy consistent filter
This patch adds a function to destroy the flow fliter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:40:28 +01:00
Wei Zhao
22bb13410c net/igb: create consistent filter
This patch adds a function to create the flow directory filter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:40:27 +01:00
Wei Zhao
7cd77faf71 net/igb: parse flow API flex filter
check if the rule is a flex byte rule, and get the flex info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:40:20 +01:00
Wei Zhao
a13d9475a2 net/igb: parse flow API TCP SYN filter
check if the rule is a TCP SYN rule, and get the SYN info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:40:10 +01:00
Wei Zhao
a8600af437 net/igb: parse flow API ethertype filter
check if the rule is a ethertype rule, and get the ethertype info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:40:03 +01:00
Wei Zhao
c0688ef1ed net/igb: parse flow API n-tuple filter
Add rule validate function and check if the rule is a
n-tuple rule, and get the n-tuple info.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:38:45 +01:00
Wei Zhao
69fdf74d8b net/igb: restore flex type filter
Add support for restoring flex type filter in SW.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:34:42 +01:00
Wei Zhao
e2a2268b53 net/igb: restore ether type filter
Add support for restoring ether type filter in SW.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:34:28 +01:00
Wei Zhao
862bd41ece net/igb: restore n-tuple filter
Add support for restoring n-tuple filter in SW.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:34:12 +01:00
Wei Zhao
7db41ec827 net/igb: store and restore TCP SYN filter
Add support for storing and restoring TCP SYN filter in SW.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-06-12 11:33:38 +01:00
Shijith Thotton
f544804f4b net/liquidio: do not touch mbuf initialized fields
Avoid re-initializing of mbuf fields which are set while in pool.
Replaced lio_recv_buffer_alloc with rte_pktmbuf_alloc.

See commit 8f094a9ac5 ("mbuf: set mbuf fields while in pool").

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
2017-06-12 10:41:29 +01:00
Ajit Khaparde
bc8ee8572e net/bnxt: fix reporting of link status
This patch fixes incorrect reporting of link status

1) When link is down, set speed to zero. Otherwise a wrong non-zero
   speed will be displayed.

2) DAC cables can detect there is a signal, but it necessarily does not
   mean link is up. Code previously treated this as link up.

Fixes: 7bc8e9a227 ("net/bnxt: support async link notification")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:29 +01:00