Commit Graph

9739 Commits

Author SHA1 Message Date
Santosh Shukla
cf408c2247 eal: auto detect IOVA mode
iova autodetection depends on rte_bus_scan result. Result of bus scan will
have updated device_list and each device in that list has its '.kdev' state
updated. That kdrv state used to detect iova mapping mode for that device.

_device_parse() has dependency on rt_bus_scan so,
Below calls moved up in the eal initialization order:
	- eal_option_device_parse
	- rte_bus_scan

And based on the result of rte_bus_scan_iommu_class - select iova
mapping mode.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 20:39:07 +02:00
Santosh Shukla
93878cf025 eal: introduce helper API for IOVA mode
Introducing rte_eal_iova_mode() helper API. This API
used by non-eal library for detecting iova mode.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 20:39:07 +02:00
Santosh Shukla
39bef5cb98 bus: get IOMMU class
API(rte_bus_get_iommu_class) helps to automatically detect and select
appropriate iova mapping scheme for iommu capable device on that bus.

Algorithm for iova scheme selection for bus:
0. Iterate through bus_list.
1. Collect each bus iova mode value and update into 'mode' var.
2. Mode selection scheme is:
if mode == 0 then iova mode is _pa,
if mode == 1 then iova mode is _pa,
if mode == 2 then iova mode is _va,
if mode == 3 then iova mode ia _pa.

So mode !=2  will be default iova mode (_pa).

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 20:39:07 +02:00
Santosh Shukla
815c7deaed pci: get IOMMU class on Linux
Get iommu class of PCI device on the bus and returns preferred iova
mapping mode for that bus.

Patch also introduces RTE_PCI_DRV_IOVA_AS_VA drv flag.
Flag used when driver needs to operate in iova=va mode.

Algorithm for iova scheme selection for PCI bus:
0. If no device bound then return with RTE_IOVA_DC mapping mode,
else goto 1).
1. Look for device attached to vfio kdrv and has .drv_flag set
to RTE_PCI_DRV_IOVA_AS_VA.
2. Look for any device attached to UIO class of driver.
3. Check for vfio-noiommu mode enabled.

If 2) & 3) is false and 1) is true then select
mapping scheme as RTE_IOVA_VA. Otherwise use default
mapping scheme (RTE_IOVA_PA).

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 20:39:03 +02:00
Santosh Shukla
a4f0a2dbe5 pci: get IOMMU class
Introducing rte_pci_get_iommu_class API which helps to get iommu class
of PCI device on the bus and returns preferred iova mapping mode for
PCI bus.

Patch also adds rte_pci_get_iommu_class definition for:
- bsdapp: api returns default iova mode.
- linuxapp: Has stub implementation, Followup patch has complete
  implementation.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
2017-10-06 20:35:37 +02:00
Santosh Shukla
aadc3eb002 pci: export match function
Export rte_pci_match() function as it needed in the followup patch.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 20:32:35 +02:00
Thomas Monjalon
d4af27d9d0 drivers/dpaa: remove duplicate includes
Fixes: 866c306ff0 ("mempool/dpaa: support NXP DPAA mempool")
Fixes: 37f9b54bd3 ("net/dpaa: support Tx and Rx queue setup")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 19:10:19 +02:00
Adrien Mazarguil
5d3a35ff06 ethdev: fix port id type in flow API
As for the testpmd flow command which uses uint16_t since the beginning by
chance, switch to portid_t for consistency.

Fixes: 14ab03825b1d ("ethdev: increase port id range")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-10-06 18:38:55 +02:00
Zhiyong Yang
65638a6d2f mbuf: increase port initialization value
In order to support more than 256 virtual ports, the field "port"
in rte_mbuf has been increased to 16 bits. The initialization/reset
value of the field "port" should be changed from 0xff to 0xffff
accordingly.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-06 18:24:03 +02:00
Zhiyong Yang
f8244c6399 ethdev: increase port id range
Extend port_id definition from uint8_t to uint16_t in lib and drivers
data structures, specifically rte_eth_dev_data. Modify the APIs,
drivers and app using port_id at the same time.

Fix some checkpatch issues from the original code and remove some
unnecessary cast operations.

release_17_11 and deprecation docs have been updated in this patch.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 18:23:25 +02:00
Zhiyong Yang
2db978d04b net/bonding: remove old ABI
There are two bonding APIs using ABI versioning, and both have
port_id as parameter. Since we are already breaking ABI, no need
to keep older versions of APIs.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 18:21:53 +02:00
Shreyansh Jain
1eb3ba846c bus/fslmc: add devices in sorted order
Before this patch, the devices discovered from VFIO layer were
being added in the device list in the order received from directory
scan. This causes an issue in case devices are reordered.

This patch makes all the devices inserted in the device list in
sorted order according to their name.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-06 03:26:58 +02:00
Hemant Agrawal
04dfa63404 bus/fslmc: improve debug log messages
enable the printing of objects during debuging.
use RTE_LOG to avoid function name printing for object name.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:26:44 +02:00
Hemant Agrawal
2bfea039a4 net/dpaa2: improve debug messaging
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
21ce788c83 net/dpaa2: checksum support as per user config
Instead of enabling the RX checksum by default, make it
enable only with user ethernet configuration

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
acb95928e7 net/dpaa2: log that VLAN extend offload not supported
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
790ec226e9 net/dpaa2: fix the Tx handling of non HW pool bufs
The current code is sending 8 packet in each internal loop.
In some of the conditions, mbuf is being allocated or freed.
In case of error, the code is returning without taking care of
such buffer. It is better to send already prepared buffer and err
for the current failure only.

Fixes: 9e5f3e6d36 ("net/dpaa2: handle non-hardware backed buffer pool")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
1d6329b2fc net/dpaa2: support extra stats
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
63d5c3b00c net/dpaa2: support RSS hash update and get
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
638233dc29 net/dpaa2: remove RSS restriction with num of queues
DPAA2 HW does not have such restrictions.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
bd4d941926 net/dpaa2: increase the dist param to 64 bit
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
dc3039d270 net/dpaa2: improve error and logs for flow distribution
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
aa8c595aca net/dpaa2: check physical link state on up cmd
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
a2e53a11fe bus/fslmc: enable link status interrupt
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
c5acbb5ea2 net/dpaa2: support link status event
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
01d0df35e7 bus/fslmc: cleanup the dpaa2 interrupt support
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
2facdbae87 bus/fslmc: support check of dpbp presence
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
d47f0292b8 net/dpaa2: support congestion overhead
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:17 +02:00
Ashish Jain
c2e1975429 bus/fslmc: support LX2160 platform
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
2017-10-06 03:24:17 +02:00
Ashish Jain
5fab875e1b config/dpaa2: change max lcores to 16
To support new LX2 series

Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
2017-10-06 03:24:17 +02:00
Hemant Agrawal
d95bdc093b bus/fslmc: clean the QBMAN support code
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:16 +02:00
Hemant Agrawal
4ab87e3881 bus/fslmc: cleanup compat file
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:16 +02:00
Hemant Agrawal
69293c7762 bus/fslmc: remove unused funcs and align names in QBMAN
name alignment for check command and result functions
putting them as separate functions instead of changing the original
functions.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:24:16 +02:00
Haiying Wang
f739d6f8f2 bus/fslmc: enhance the QBMAN CENA mode
Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:23:57 +02:00
Haiying Wang
07d862ea1e bus/fslmc: support up to 32 frames in one volatile dequeue
QMan5.0 supports up to 32 frames in one volatile dequeue
command. For the older Qman versions which only support
up to 16 frames, the highest bit in NUMF will be ignored.

Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:23:02 +02:00
Haiying Wang
43f7ff9de4 bus/fslmc: add QBMAN API to do enqueue with multiple frames
Clean it up and update the prototype.

Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:21:57 +02:00
Hemant Agrawal
cb3bfcbb21 bus/fslmc: remove the export for QBMAN version
This func is not required to be used outside of the qbman driver.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:21:06 +02:00
Haiying Wang
8b87090577 bus/fslmc: replace word copy with memcpy in QBMAN
The word_copy is not as efficient as expected, so remove it from
this driver.

Signed-off-by: Haiying Wang <haiying.wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-06 03:20:40 +02:00
Olivier Matz
addaac42a0 app/test-crypto-perf: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC cperf_test_verify.o
cperf_test_verify.c: In function ‘cperf_verify_op’:
cperf_test_verify.c:382:5: error: ‘auth’ may be used uninitialized
                           in this function
                           [-Werror=maybe-uninitialized]
  if (auth == 1) {
     ^
cperf_test_verify.c:371:5: error: ‘cipher’ may be used uninitialized
                           in this function
			   [-Werror=maybe-uninitialized]
  if (cipher == 1) {
     ^
cperf_test_verify.c:384:11: error: ‘auth_offset’ may be used
			    uninitialized in this function
			    [-Werror=maybe-uninitialized]
    res += memcmp(data + auth_offset,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
      vector->digest.data,
      ~~~~~~~~~~~~~~~~~~~~
      options->digest_sz);
      ~~~~~~~~~~~~~~~~~~~
cperf_test_verify.c:377:11: error: ‘cipher_offset’ may be used
                            uninitialized in this function
                            [-Werror=maybe-uninitialized]
    res += memcmp(data + cipher_offset,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      vector->plaintext.data,
      ~~~~~~~~~~~~~~~~~~~~~~~
      options->test_buffer_size);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~

There is no default case in the switch statement, so if options->op_type
is an unknown value, the function will use uninitialized values. Fix it
by adding a default.

Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-10-06 02:49:50 +02:00
Olivier Matz
0afa5e393f app/test-crypto-perf: fix memory leak
data is allocated but never freed.

Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-10-06 02:49:50 +02:00
Olivier Matz
0e985314d5 metrics: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC rte_metrics.o
  rte_metrics.c: In function
  ‘rte_metrics_reg_names’: rte_metrics.c:153:22: error: ‘entry’
                           may be used uninitialized in this function
                           [-Werror=maybe-uninitialized]
    entry->idx_next_set = 0;
    ~~~~~~~~~~~~~~~~~~~~^~~

This is a false positive, gcc is not able to see that we always go in
the loop at least once, initializing entry.

Fix the warning by initializing entry to NULL.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-06 02:49:50 +02:00
Olivier Matz
1123f16eb3 cmdline: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC cmdline_parse.o
  cmdline_parse.c: In function ‘match_inst’:
  cmdline_parse.c:227:5: error: ‘token_p’ may be used uninitialized in
                         this function [-Werror=maybe-uninitialized]
    if (token_p) {
       ^

This is a false positive, gcc is not able to see that we always go in
the loop at least once, initializing token_p.

Fix the warning by initializing token_p to NULL.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-06 02:49:50 +02:00
Olivier Matz
84585f330f uio: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC eal_pci_uio.o
  eal_pci_uio.c: In function ‘pci_get_uio_de ’:
  eal_pci_uio.c:221:9: error: ‘uio_num’ may be used uninitialized in
                       this function [-Werror=maybe-uninitialized]
  return uio_num;
         ^~~~~~~

This is a false positive: gcc is not able to see that when e != NULL,
uio_num is always set. Fix the warning by initializing uio_num to -1,
and by the way, change the type to int.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-06 02:49:50 +02:00
Olivier Matz
f4b7699c88 net/qede: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC qede_rxtx.o
  qede_rxtx.c: In function ‘qede_start_queues’:
  qede_rxtx.c:797:9: error: ‘rc’ may be used uninitialized in this
                            function [-Werror=maybe-uninitialized]
    return rc;
           ^~

If there is no Rx or Tx queue, rc will not be initialized. Fix it
by initializing rc to -1.

Fixes: 4c4bdadfa9 ("net/qede: refactoring multi-queue implementation")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Harish Patil <harish.patil@cavium.com>
2017-10-06 02:49:50 +02:00
Olivier Matz
4a671fdea9 net/bnxt: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC rte_pmd_bnxt.o
  rte_pmd_bnxt.c: In function ‘rte_pmd_bnxt_set_all_queues_drop_en’:
  rte_pmd_bnxt.c:116:6: error: ‘rc’ may be used uninitialized in this
                        function [-Werror=maybe-uninitialized]
    int rc;
        ^~

This can happen if both bp->nr_vnics and bp->pf.active_vfs are 0.
Fix it by initializing rc to -EINVAL.

Fixes: 49947a13ba ("net/bnxt: support Tx loopback, set VF MAC and queues drop")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-06 02:49:50 +02:00
Yongseok Koh
fc048bd52c net/mlx5: fix overflow of Rx SW ring
If vectorized Rx burst is short of mbufs in replenishment, Rx SW ring can
overflow as the Rx burst handles 4 packets in a loop. This is because the
function fills SW ring and its mbufs first and checks validity of
each completion later. So, there should be some buffer slots at the tail of
the ring to protect mbufs which are already owned by application.

Fixes: 6cb559d67b ("net/mlx5: add vectorized Rx/Tx burst for x86")
Cc: stable@dpdk.org

Reported-by: Martin Weiser <martin.weiser@allegro-packets.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-06 02:49:50 +02:00
Matan Azrad
8073bc818c net/tap: allow RSS flow action
One of the main identified use cases for the tap PMD is to be used in
combination with the fail-safe PMD as a fallback for a physical device.

Fail-safe is very strict about making sure its current configuration is
properly applied to all slave devices, they get rejected otherwise in
order to maintain a consistent state.

The problem is that tap's RSS support is currently limited to the
default (non-Toeplitz) balancing performed by the kernel on all Rx
queues. While proper RSS support emulation in the tap PMD is a work in
progress, the lack of rte_flow counterpart prevents validation of the
above use case in the meantime.

Given that unlike most PMDs, tap is more about convenience than
performance, support for the RSS action can be temporarily faked with
a minimum amount of code and mostly correct behavior by treating it
like a QUEUE action. Traffic is directed to the first queue of the set.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-10-06 02:49:50 +02:00
Beilei Xing
fcc93dfc77 net/i40e: enable cloud filter for GTP-C and GTP-U
This patch sets TEID of GTP-C and GTP-U as filter type
by replacing existed filter types inner_mac and TUNNEL_KEY.
This configuration will be set when adding GTP-C or
GTP-U filter rules, and it will be invalid only by
NIC core reset.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:50 +02:00
Beilei Xing
47ba0398da net/i40e: add cloud filter parsing function for GTP
This patch adds i40e_flow_parse_gtp_filter parsing
function for GTP-C and GTP-U to support cloud filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:50 +02:00
Beilei Xing
15018d79f0 net/i40e: add FDIR support for GTP-C and GTP-U
This patch adds FDIR support for GTP-C and GTP-U. The
input set of GTP-C and GTP-U is TEID.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Reviewed-by: Seán Harte <seanbh@gmail.com>
2017-10-06 02:49:50 +02:00