dpdk.git
5 years agonet/mlx5: add getting IB ports number for multiport IB
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:37 +0000 (13:15 +0000)]
net/mlx5: add getting IB ports number for multiport IB

There is the routine mlx5_nl_portnum() added to get
the number of ports of multiport Infiniband device.
It is assumed the Uplink/VF representors are attached
on these ports.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: modify get ifindex routine for multiport IB
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:36 +0000 (13:15 +0000)]
net/mlx5: modify get ifindex routine for multiport IB

There is the routine mlx5_nl_ifindex() returning the
network interface index associated with Infiniband device.
We are going to support multiport IB devices, now function
takes the IB port as argument and returns ifindex associated
with tuple <IB device, IB port>

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add representor recognition on Linux 5.x
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:35 +0000 (13:15 +0000)]
net/mlx5: add representor recognition on Linux 5.x

The master device and VF representors were distinguished by
presence of port name, master device did not have one. The new Linux
kernels starting from 5.0 provide the port name for master device
and the implemented representor recognizing method does not work.
The new recognizing method is based on querying the VF number,
has been created on the base of the device.

The IFLA_NUM_VF attribute is returned by kernel if IFLA_EXT_MASK
attribute is specified in the Netlink request message.

Also the presence check of device symlink in device sysfs folder
is added to distinguish representors with sysfs based method.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agovhost/crypto: fix parens
Fan Zhang [Mon, 25 Mar 2019 14:37:31 +0000 (14:37 +0000)]
vhost/crypto: fix parens

Coverity issue: 277214, 277220, 277233, 277236
Fixes: cd1e8f03abf0 ("vhost/crypto: fix packet copy in chaining mode")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: define avail and used flags as constants
Tiwei Bie [Mon, 25 Mar 2019 05:27:16 +0000 (13:27 +0800)]
net/virtio: define avail and used flags as constants

We are consistently passing 1 as the argument in the data path,
so there is no need to define avail/used flags as function-like
macros anymore. This patch changes the avail and used flags to
constants. And a frequently used combination is also introduced.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio-user: fix multi-process support
Tiwei Bie [Mon, 25 Mar 2019 04:12:15 +0000 (12:12 +0800)]
net/virtio-user: fix multi-process support

This patch fixes the multi-process support for virtio-user.
Currently virtio-user just provides some limited secondary
process supports. Only some basic operations can be done in
secondary process on virtio-user port, e.g. getting port stats.
Actions which will trigger the communication with vhost backend
can't be done in secondary process for now, as the fds are
not synced between processes. The processing of server mode
devargs is also moved into virtio_user_dev_init().

Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Fixes: ee27edbe0c10 ("drivers/net: share vdev data to secondary process")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix duplicate naming of include guard
Andrius Sirvys [Thu, 21 Mar 2019 10:09:53 +0000 (10:09 +0000)]
net/virtio: fix duplicate naming of include guard

"The macro name '_VHOST_NET_USER_H' of this include guard is used
in 2 different header files."

lib/librte_vhost/vhost_user.h has the same include guard.
Renamed the include guard in vhost.h to differentiate.

Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")
Cc: stable@dpdk.org
Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/nfp: support setting link up/down
Pablo Cascón [Wed, 27 Mar 2019 10:27:39 +0000 (10:27 +0000)]
net/nfp: support setting link up/down

Add functions to set the link state up or down.

Signed-off-by: Pablo Cascón <pablo.cascon@netronome.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/fm10k: fix VLAN strip offload flag
Xiao Wang [Wed, 27 Mar 2019 05:09:03 +0000 (13:09 +0800)]
net/fm10k: fix VLAN strip offload flag

Since the VLAN header is stripped from mbuf data, PKT_RX_VLAN_STRIPPED
should be set in offload flag.

Fixes: 6b59a3bc82b1 ("fm10k: fix VLAN in Rx mbuf")
Fixes: 7092be8437bd ("fm10k: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/failsafe: support secondary process
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:27 +0000 (16:05 +0000)]
net/failsafe: support secondary process

Add implementation for probe in secondary.

Failsafe will attempt to attach all the sub-devices in
secondary process.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: replace sub-device pointer with port id
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:27 +0000 (16:05 +0000)]
net/failsafe: replace sub-device pointer with port id

In multiprocess context, the pointer to sub-device is shared between
processes. Previously, it was a pointer to per process eth_dev so
it's needed to replace this dependency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: change back-reference from sub-device
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:26 +0000 (16:05 +0000)]
net/failsafe: change back-reference from sub-device

In multiprocess context, the sub-device structure is shared
between processes. The reference to the failsafe device was
a per process pointer. It's changed to port id which is the
same for all processes.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: replace local device with shared data
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:25 +0000 (16:05 +0000)]
net/failsafe: replace local device with shared data

In multiprocess context, the private structure is shared between
processes. The back reference from private to generic data was using
a pointer to a per process eth_dev. It's now changed to a reference of
the shared data.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/mlx5: add missing return value check
Ali Alnubani [Thu, 21 Mar 2019 09:07:26 +0000 (09:07 +0000)]
net/mlx5: add missing return value check

This patch fixes the build failure with message:
  drivers/net/mlx5/mlx5_ethdev.c: In function ‘mlx5_sysfs_switch_info’:
  drivers/net/mlx5/mlx5_ethdev.c:1381:3:
    error: ignoring return value of ‘fscanf’, declared with attribute
           warn_unused_result [-Werror=unused-result]
  fscanf(file, "%s", port_name);
    ^

Which reproduces on Ubuntu 16.04 LTS with
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609.

Fixes: b2f3a3810125 ("net/mlx5: support new representor naming format")

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Dekel Peled <dekelp@mellanox.com>
5 years agonet/bnxt: fix Rx VLAN offload flags
Stephen Hemminger [Mon, 25 Mar 2019 21:27:54 +0000 (14:27 -0700)]
net/bnxt: fix Rx VLAN offload flags

The bnxt driver is not correctly setting the receive VLAN offload
flags.  When VLAN is offloaded the driver must set the
PKT_RX_VLAN_STRIPPED flag.

Actually, several drivers have the same bug, only most of the
Intel drivers look right. Any driver that sets vlan_tci is probably
stripping the tag, and should be setting RX_VLAN_STRIPPED.

To quote rte_mbuf.h:

/**
 * The RX packet is a 802.1q VLAN packet, and the tci has been
 * saved in in mbuf->vlan_tci.
 * If the flag PKT_RX_VLAN_STRIPPED is also present, the VLAN
 * header has been stripped from mbuf data, else it is still
 * present.
 */

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/i40e: log when provided RSS key is not valid
Wei Zhao [Tue, 26 Mar 2019 08:35:24 +0000 (16:35 +0800)]
net/i40e: log when provided RSS key is not valid

A log message is required when provided RSS key is
not valid so that driver will use the default RSS key.

Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: enable RSS when device init
Qiming Yang [Mon, 25 Mar 2019 09:01:02 +0000 (17:01 +0800)]
net/ice: enable RSS when device init

This patch enabled RSS for UPD/TCP/SCTP+IPV4/IPV6 packets.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: add safe mode
Qiming Yang [Mon, 25 Mar 2019 09:01:01 +0000 (17:01 +0800)]
net/ice: add safe mode

If E810 download package failed, driver need to go to safe mode.
In the safe mode, some advanced features will not be supported.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: load OS default package
Qiming Yang [Mon, 25 Mar 2019 09:01:00 +0000 (17:01 +0800)]
net/ice: load OS default package

This patch enables package downloading to the device. The package is
to be in the /lib/firmware/intel/ice/ddp directory and named ice.pkg.
The package is shared by the kernel driver and the DPDK PMD.

There is no per device package be supported so far, all the
devices can only download the same package. This limitation will
be removed in the future.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoethdev: fix a typo
Rami Rosen [Fri, 22 Mar 2019 15:17:53 +0000 (17:17 +0200)]
ethdev: fix a typo

This patch fixes a trivial typo in rte_ethdev.h.
retieve=>retrieve

Fixes: 80a1deb4c77a ("ethdev: add API to retrieve queue information")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: display/clear forwarding stats on demand
David Marchand [Mon, 25 Mar 2019 08:51:46 +0000 (09:51 +0100)]
app/testpmd: display/clear forwarding stats on demand

Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.

To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: remove useless casts on statistics
David Marchand [Mon, 25 Mar 2019 08:51:45 +0000 (09:51 +0100)]
app/testpmd: remove useless casts on statistics

Caught by code review while investigating the fwd stats display code.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: extend forwarding statistics to 64 bits
David Marchand [Mon, 25 Mar 2019 08:51:44 +0000 (09:51 +0100)]
app/testpmd: extend forwarding statistics to 64 bits

fwd engine statistics are stored as unsigned int (32bits) and can wrap
quite quickly.
Example: sending 7mpps for 614s gives us 4298000000 packets =>
0x1002e4680 larger than 32bits.

testpmd reports forwarding stats as:
RX-packets: 3500381        TX-packets: 3500010        TX-dropped: 371

While the port and accumulated stats are reported as 64bits:
RX-packets: 4298467677     RX-dropped: 0             RX-total: 4298467677
TX-packets: 4298467306     TX-dropped: 371           TX-total: 4298467677

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: add missing newline when showing statistics
David Marchand [Mon, 25 Mar 2019 08:51:43 +0000 (09:51 +0100)]
app/testpmd: add missing newline when showing statistics

Having the standard stats and the rx burst stats on the same line gives a
really long line and is not consistent with the rest.

Before:
iofwd engine
  RX-packets: 121811360      TX-packets: 121811392      TX-dropped: 0               RX-bursts : 3806605 [100% of 32 pkts]
  TX-bursts : 3806606 [100% of 32 pkts]

csum engine
  RX-packets: 5467488        TX-packets: 5467520        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
  RX-bursts : 170859 [100% of 32 pkts]
  TX-bursts : 170860 [100% of 32 pkts]

After:
iofwd engine
  RX-packets: 259770560      TX-packets: 259770592      TX-dropped: 0
  RX-bursts : 8117830 [100% of 32 pkts]
  TX-bursts : 8117831 [100% of 32 pkts]

csum engine
  RX-packets: 7834016        TX-packets: 7834048        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
  RX-bursts : 244813 [100% of 32 pkts]
  TX-bursts : 244814 [100% of 32 pkts]

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/vdev_netvsc: fix device cast
Stephen Hemminger [Wed, 13 Mar 2019 02:12:53 +0000 (19:12 -0700)]
net/vdev_netvsc: fix device cast

The return value from bus->find_device is a rte_device
which is not safe to cast to a rte_vdev_device structure.
It doesn't really matter since only being checked for NULL
but static checkers might find a bug here.

Fixes: 56252de779a6 ("net/vdev_netvsc: add automatic probing")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/ice/base: rework on bit ops
Qi Zhang [Mon, 25 Mar 2019 05:44:52 +0000 (13:44 +0800)]
net/ice/base: rework on bit ops

Move all bit ops related functions from ice_osdep.h into ice_bitops.h.
Also remove the limitation that bitmap can only be 64 bits in
ice_set_bit and ice_clear_bit.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: revert workaround for resource allocation
Qi Zhang [Mon, 25 Mar 2019 05:44:51 +0000 (13:44 +0800)]
net/ice/base: revert workaround for resource allocation

Revert the workaround for allocating TCAM and FV entries to align
with latest firmware.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: increase protocol offset size
Qi Zhang [Mon, 25 Mar 2019 05:44:50 +0000 (13:44 +0800)]
net/ice/base: increase protocol offset size

OS package's format is changed, field vector's protocol offset size is
changed from 8 bit to 16 bit. So base code also need to align to this,
or PMD will not be able to load OS package correctly.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix minor issues
Qi Zhang [Mon, 25 Mar 2019 05:44:49 +0000 (13:44 +0800)]
net/ice/base: fix minor issues

1. clean flow entry's action structure after remove it.
2. initialized priority when add a new flow entry
3. remove RSS configuration before deleting the flow profile.

Fixes: aa1cd410fa64 ("net/ice/base: add flow module")
Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix duplicate resource allocations
Qi Zhang [Mon, 25 Mar 2019 05:44:48 +0000 (13:44 +0800)]
net/ice/base: fix duplicate resource allocations

This patch ensure that TCAM allocations made by a newly added VSIG
that has the same characteristic list of an existing VSIG are removed.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: change profile priority for RSS reply
Qi Zhang [Mon, 25 Mar 2019 05:44:47 +0000 (13:44 +0800)]
net/ice/base: change profile priority for RSS reply

1. Add call to replay RSS configurations
2. Add RSS configurations to end of list and not the head to avoid
inversion on replay.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: support FDIR
Qi Zhang [Mon, 25 Mar 2019 05:44:46 +0000 (13:44 +0800)]
net/ice/base: support FDIR

Add flow director related support base code.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: support DCB
Qi Zhang [Mon, 25 Mar 2019 05:44:45 +0000 (13:44 +0800)]
net/ice/base: support DCB

Add module to support DCB related features.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: change profile id reference counting
Qi Zhang [Mon, 25 Mar 2019 05:44:44 +0000 (13:44 +0800)]
net/ice/base: change profile id reference counting

Improved the profile reference counting, by moving it from being
based on how many TCAM entries using the profile to how many
profile map entries are using the profile.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add function to check FW recovery mode
Qi Zhang [Mon, 25 Mar 2019 05:44:43 +0000 (13:44 +0800)]
net/ice/base: add function to check FW recovery mode

Code added to check the FW recovery mode. This function will be
used by the drivers during init to check whether the FW is in
recovery mode or not. If FW is in recovery mode then the drivers
need to run in a recovery mode where it can allow only limited
operations. Link should be down, allow only certain AQ commands
etc.

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: return config error without queue to disable
Qi Zhang [Mon, 25 Mar 2019 05:44:42 +0000 (13:44 +0800)]
net/ice/base: return config error without queue to disable

If there is no queue to disable, return appropriate configuration error
earlier without acquiring the lock.

Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix unreachable code usage
Qi Zhang [Mon, 25 Mar 2019 05:44:41 +0000 (13:44 +0800)]
net/ice/base: fix unreachable code usage

Klocwork points out some code is unreachable in
ice_get_itr_intrl_gran and ice_ptg_find_ptype.
The patch removed the unreachable code and resolved the static
analysis reported issues.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")
Fixes: 453d087ccaff ("net/ice/base: add common functions")

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: update copyright time
Qi Zhang [Mon, 25 Mar 2019 05:44:40 +0000 (13:44 +0800)]
net/ice/base: update copyright time

Update copyright time to 2019.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix minor issues
Qi Zhang [Mon, 25 Mar 2019 05:44:39 +0000 (13:44 +0800)]
net/ice/base: fix minor issues

1. Fix some problems with filling the HW tables.
2. Fix a logic error in ice_rem_prof_from_list.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: remove local VSIG allocations
Qi Zhang [Mon, 25 Mar 2019 05:44:38 +0000 (13:44 +0800)]
net/ice/base: remove local VSIG allocations

If allocating a VSI to a VSIG fails the local allocations made for VSIG
profiles and change-lists will not be removed. Adding calls to free
these entries on error in VSIG management calls.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: do not write TCAM entries back
Qi Zhang [Mon, 25 Mar 2019 05:44:37 +0000 (13:44 +0800)]
net/ice/base: do not write TCAM entries back

Profile TCAM entry removal is handled by the firmware when
freeing the resource, so the driver does not need to write these
default entries back with an update Package action.

This patch removes writing of the TCAM entry using Update Package
command when removing it, since the entry has already been freed
by firmware.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add RSS key related macro and structures
Qi Zhang [Mon, 25 Mar 2019 05:44:36 +0000 (13:44 +0800)]
net/ice/base: add RSS key related macro and structures

Add define for 52 byte RSS hash key size, and add struct
ice_aqc_get_set_rss_keys comments regarding setting 40 bytes and
52 byte hash key.

Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: enhance get link status command
Qi Zhang [Mon, 25 Mar 2019 05:44:35 +0000 (13:44 +0800)]
net/ice/base: enhance get link status command

Extend the functionality of the admin queue command by including
additional status and ID bits to improve link topology configuration.

Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: ensure only valid bits are set
Qi Zhang [Mon, 25 Mar 2019 05:44:34 +0000 (13:44 +0800)]
net/ice/base: ensure only valid bits are set

In the ice_aq_set_phy_cfg AQ command, the 16.4 bit is reserved.
This patch will make sure that this bit will never be set to 1.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: enable VSI queue context
Qi Zhang [Mon, 25 Mar 2019 05:44:33 +0000 (13:44 +0800)]
net/ice/base: enable VSI queue context

The patch added to retrieve the queue context and update the queue
handle for lan queues.

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: clean code
Qi Zhang [Mon, 25 Mar 2019 05:44:32 +0000 (13:44 +0800)]
net/ice/base: clean code

Change below function as static and also relocated code line
to align with kernel driver.

ice_aq_move_sched_elems
ice_sched_get_agg_node
ice_sched_set_node_bw_lmt
ice_sched_cfg_node_bw_alloc
ice_sched_add_agg_cfg
ice_sched_rm_agg_cfg
ice_sched_move_vsi_to_agg
ice_sched_del_rl_profile
ice_sched_rm_unused_rl_prof

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: update macros
Qi Zhang [Mon, 25 Mar 2019 05:44:31 +0000 (13:44 +0800)]
net/ice/base: update macros

Update macros for metadata and package flags.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix minor issues
Qi Zhang [Mon, 25 Mar 2019 05:44:30 +0000 (13:44 +0800)]
net/ice/base: fix minor issues

1. ICE_SW_LKUP_LAST need to be handled correctly in
ice_aq_alloc_free_vsi_list and ice_update_vsi_list_rule
2. ICE_SW_LKUP_ETHERTYPE_MAC need to be handled correctly in
ice_update_vsi_lkup_fltr
3. free package segment pointer during ice_deinit_hw

Fixes: c7dd15931183 ("net/ice/base: add virtual switch code")
Fixes: 453d087ccaff ("net/ice/base: add common functions")

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add helper functions for flow management
Qi Zhang [Mon, 25 Mar 2019 05:44:29 +0000 (13:44 +0800)]
net/ice/base: add helper functions for flow management

1. ice_rem_all_sw_rules_info - remove all switch rules.
2. ice_reply_all_fltr - replay all filters stored in book keeping list.

These APIs will be used when switch rule feature is enabled.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add MAC filter with marker and counter
Qi Zhang [Mon, 25 Mar 2019 05:44:28 +0000 (13:44 +0800)]
net/ice/base: add MAC filter with marker and counter

1. ice_add_mac_with_sw_marker - add filter with software marker.
2. ice_add_mac_with_counter - add filter with counter enabled.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add functions to get VSI promiscuous mode
Qi Zhang [Mon, 25 Mar 2019 05:44:27 +0000 (13:44 +0800)]
net/ice/base: add functions to get VSI promiscuous mode

1. ice_get_vsi_promisc - get promiscuous mode of give VSI.
2. ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI.

PMD may use these APIs to check the real HW status, but not rely on
a software flag when something abnormal.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add functions for resource counter
Qi Zhang [Mon, 25 Mar 2019 05:44:26 +0000 (13:44 +0800)]
net/ice/base: add functions for resource counter

1. ice_alloc_res_cntr - allocate resource counter
2. ice_free_res_cntr - free resource counter
3. ice_alloc_vlan_res_counter - allocate vlan resource counter
4. ice_free_vlan_res_counter - free vlan resource counter

These APIs will be used when try to count the number of a flow be
hit.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add functions to get allocated resources
Qi Zhang [Mon, 25 Mar 2019 05:44:25 +0000 (13:44 +0800)]
net/ice/base: add functions to get allocated resources

1. ice_aq_get_res_alloc - get allocated resources.
2. ice_aq_get_res_descs - get allocated resource descriptors.

These APIs may help to PMD to enable some debug utilities to
dump the resource allocation status.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add functions for ethertype filter
Qi Zhang [Mon, 25 Mar 2019 05:44:24 +0000 (13:44 +0800)]
net/ice/base: add functions for ethertype filter

Add API ice_remove_eth_mac and ice_add_eth_mac to support
adding / removing ethertype (or MAC) based filter rules.

PMD driver can use these APIs to enable related rte_flow rule.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add VSI queue context framework
Qi Zhang [Mon, 25 Mar 2019 05:44:23 +0000 (13:44 +0800)]
net/ice/base: add VSI queue context framework

Added code to allocate VSI queue contexts to save the queue specific
information like bandwidth etc.

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add more APIs in switch module
Qi Zhang [Mon, 25 Mar 2019 05:44:22 +0000 (13:44 +0800)]
net/ice/base: add more APIs in switch module

Add below APIs in switch module

1. ice_aq_get_vsi_params -  get VSI context info
2. ice_aq_add_update_mir_rule - add/update mirror rule
3. ice_aq_delete_mir_rule - delete mirror rule
4. ice_aq_set_storm_ctrl - set storm control configuration
5. ice_aq_get_storm_ctrl - get storm control configuration

PMD can use these APIs to enable mirror rule and storm control
related features.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: declare functions as external
Qi Zhang [Mon, 25 Mar 2019 05:44:21 +0000 (13:44 +0800)]
net/ice/base: declare functions as external

Remove static of below functions and declare them as external
APIs.

ice_aq_add_vsi
ice_aq_free_vsi
ice_aq_update_vsi
ice_aq_add_lan_txq
ice_init_pkg

So far the purpose is just to sync with kernel driver.
They are reserved for future use.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: remove unnecessary code
Qi Zhang [Mon, 25 Mar 2019 05:44:20 +0000 (13:44 +0800)]
net/ice/base: remove unnecessary code

Remove unnecessary macro and data structure.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: allow package copy to be used after resets
Qi Zhang [Mon, 25 Mar 2019 05:44:19 +0000 (13:44 +0800)]
net/ice/base: allow package copy to be used after resets

For components that make a copy of an external pipeline package file
(i.e.  the Linux and FreeBSD drivers), save the size of the package
file along with the copy so that both can be used when calling
ice_init_pkg() after a CORER/GLOBR reset.
Also, do not free the copy of the package file in ice_init_pkg()
since it is needed afterward for subsequent resets.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add helper macros
Qi Zhang [Mon, 25 Mar 2019 05:44:18 +0000 (13:44 +0800)]
net/ice/base: add helper macros

1. Add macro ice_for_each_traffic_class to loop for each
traffic class.
2. Add macro MIN_T to wrap min with type conversion.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add two helper functions
Qi Zhang [Mon, 25 Mar 2019 05:44:17 +0000 (13:44 +0800)]
net/ice/base: add two helper functions

Add two helper functions in common module.
1. ice_aq_set_mac_cfg to help configure maximum frame size with AQ
command
2. ice_get_ctx help to extract context bits from a packet structure.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: improve comments
Qi Zhang [Mon, 25 Mar 2019 05:44:16 +0000 (13:44 +0800)]
net/ice/base: improve comments

Improve comments to follow naming rules.
Also the patch include some minor cleanup.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add switch resource allocation and free
Qi Zhang [Mon, 25 Mar 2019 05:44:15 +0000 (13:44 +0800)]
net/ice/base: add switch resource allocation and free

Add two APIs ice_alloc_sw and ice_free_sw to support
switch related resource allocation and free.

These APIs are required when we enable switch flow.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice: support vector AVX2 in Tx
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:51 +0000 (14:16 +0800)]
net/ice: support vector AVX2 in Tx

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support Rx scatter AVX2 vector
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:50 +0000 (14:16 +0800)]
net/ice: support Rx scatter AVX2 vector

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support Rx AVX2 vector
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:49 +0000 (14:16 +0800)]
net/ice: support Rx AVX2 vector

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support Tx SSE vector
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:48 +0000 (14:16 +0800)]
net/ice: support Tx SSE vector

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support Rx scatter SSE vector
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:47 +0000 (14:16 +0800)]
net/ice: support Rx scatter SSE vector

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support vector SSE in Rx
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:46 +0000 (14:16 +0800)]
net/ice: support vector SSE in Rx

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: add pointer for queue buffer release
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:45 +0000 (14:16 +0800)]
net/ice: add pointer for queue buffer release

Add function pointers of buffer releasing for RX and
TX queues, for vector functions will be added for RX
and TX.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: fix Tx function setting
Wenzhuo Lu [Tue, 26 Mar 2019 06:16:44 +0000 (14:16 +0800)]
net/ice: fix Tx function setting

The TX setting functions is not called.

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoapp/test: fix build with musl libc
Natanael Copa [Wed, 13 Mar 2019 17:06:50 +0000 (18:06 +0100)]
app/test: fix build with musl libc

Fix following build error with musl libc:

app/test/test_eal_flags.c:152:55: error:
'O_RDONLY' undeclared (first use in this function)
      fd = openat(dirfd(hugepage_dir), dirent->d_name, O_RDONLY);
                                                       ^~~~~~~~

Fixes: 45f1b6e8680a ("app: add new tests on eal flags")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
5 years agoapp/test: fix flags with meson
Natanael Copa [Wed, 13 Mar 2019 17:06:51 +0000 (18:06 +0100)]
app/test: fix flags with meson

in app/test/meson.build the default_cflag is never used so the
-D_GNU_SOURCE was never passed as intended.

Fixes the following build error with musl libc:

lib/librte_eal/common/include/rte_lcore.h:26:9: error:
unknown type name 'cpu_set_t'
 typedef cpu_set_t rte_cpuset_t;
         ^~~~~~~~~

The problem is that cpu_set_t is only defined when _GNU_SOURCE is set.

Fixes: 5d7b673d5fd6 ("mk: build with _GNU_SOURCE defined by default")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
5 years agonet/netvsc: fix include of fcntl.h
Natanael Copa [Wed, 13 Mar 2019 17:06:56 +0000 (18:06 +0100)]
net/netvsc: fix include of fcntl.h

Fix the following warning when building with musl libc:

In file included from ../drivers/net/netvsc/hn_vf.c:14:
/usr/include/sys/fcntl.h:1:2: warning: #warning redirecting
incorrect #include <sys/fcntl.h> to <fcntl.h> [-Wcpp]

Fixes: dc7680e8597c ("net/netvsc: support integrated VF")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
5 years agonet/nfp: fix build with musl libc
Natanael Copa [Wed, 13 Mar 2019 17:06:49 +0000 (18:06 +0100)]
net/nfp: fix build with musl libc

Fixes following build error on systems without execinfo.h:

drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c:19:10: fatal error:
execinfo.h: No such file or directory
 #include <execinfo.h>
          ^~~~~~~~~~~~

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agobus/fslmc: fix build with musl libc
Natanael Copa [Wed, 13 Mar 2019 17:06:47 +0000 (18:06 +0100)]
bus/fslmc: fix build with musl libc

This fixes the following compile error with musl libc:

drivers/bus/fslmc/qbman/include/compat.h:41:10: error:
'stdout' undeclared (first use in this function)
   fflush(stdout); \
          ^~~~~~

Fixes: 531b17a780dc ("bus/fslmc: add QBMAN driver to bus")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
5 years agobus/fslmc: remove unused include of error.h
Natanael Copa [Wed, 13 Mar 2019 17:06:48 +0000 (18:06 +0100)]
bus/fslmc: remove unused include of error.h

Fixes following build error with musl libc:

In file included from drivers/bus/fslmc/qbman/qbman_debug.c:6:
drivers/bus/fslmc/qbman/include/compat.h:21:10: fatal error:
error.h: No such file or directory
 #include <error.h>
          ^~~~~~~~~

Apparently it is not used anywere in qbman so simply remove the include.

Fixes: 531b17a780dc ("bus/fslmc: add QBMAN driver to bus")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
5 years agoeal/linux: remove thread ID from debug message
Natanael Copa [Wed, 13 Mar 2019 17:06:57 +0000 (18:06 +0100)]
eal/linux: remove thread ID from debug message

There is no guarantee that pthread_self() returns the thread ID or that
pthread_t is an integer. The thread ID is not that useful so simply
remove it.

This fixes the following warning when building with musl libc:

lib/librte_eal/linuxapp/eal/eal_dev.c: In function 'sigbus_handler':
lib/librte_eal/linuxapp/eal/eal_dev.c:70:3: warning:
cast from pointer to integer of different size [-Wpointer-to-int-cast]
   (int)pthread_self(), info->si_addr);
   ^

Fixes: 0fc54536b14a ("eal: add failure handling for hot-unplug")
Cc: stable@dpdk.org
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
5 years agodoc: announce deprecation of VFIO DMA map functions
Shahaf Shuler [Sun, 10 Mar 2019 08:28:03 +0000 (10:28 +0200)]
doc: announce deprecation of VFIO DMA map functions

As those should be replaced by rte_dev_dma_map and rte_dev_dma_unmap
APIs.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/mlx5: support PCI device DMA map and unmap
Shahaf Shuler [Sun, 10 Mar 2019 08:28:02 +0000 (10:28 +0200)]
net/mlx5: support PCI device DMA map and unmap

The implementation reuses the external memory registration work done by
commit[1].

Note about representors:

The current representor design will not work
with those map and unmap functions. The reason is that for representors
we have multiple IB devices share the same PCI function, so mapping will
happen only on one of the representors and not all of them.

While it is possible to implement such support, the IB representor
design is going to be changed during DPDK19.05. The new design will have
a single IB device for all representors, hence sharing of a single
memory region between all representors will be possible.

[1]
commit 7e43a32ee060
("net/mlx5: support externally allocated static memory")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: refactor external memory registration
Shahaf Shuler [Sun, 10 Mar 2019 08:28:01 +0000 (10:28 +0200)]
net/mlx5: refactor external memory registration

Move the memory region creation to a separate function to
prepare the ground for the reuse of it on the PCI driver map and unmap
functions.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agobus: introduce device level DMA memory mapping
Shahaf Shuler [Sun, 10 Mar 2019 08:28:00 +0000 (10:28 +0200)]
bus: introduce device level DMA memory mapping

The DPDK APIs expose 3 different modes to work with memory used for DMA:

1. Use the DPDK owned memory (backed by the DPDK provided hugepages).
This memory is allocated by the DPDK libraries, included in the DPDK
memory system (memseg lists) and automatically DMA mapped by the DPDK
layers.

2. Use memory allocated by the user and register to the DPDK memory
systems. Upon registration of memory, the DPDK layers will DMA map it
to all needed devices. After registration, allocation of this memory
will be done with rte_*malloc APIs.

3. Use memory allocated by the user and not registered to the DPDK memory
system. This is for users who wants to have tight control on this
memory (e.g. avoid the rte_malloc header).
The user should create a memory, register it through rte_extmem_register
API, and call DMA map function in order to register such memory to
the different devices.

The scope of the patch focus on #3 above.

Currently the only way to map external memory is through VFIO
(rte_vfio_dma_map). While VFIO is common, there are other vendors
which use different ways to map memory (e.g. Mellanox and NXP).

The work in this patch moves the DMA mapping to vendor agnostic APIs.
Device level DMA map and unmap APIs were added. Implementation of those
APIs was done currently only for PCI devices.

For PCI bus devices, the pci driver can expose its own map and unmap
functions to be used for the mapping. In case the driver doesn't provide
any, the memory will be mapped, if possible, to IOMMU through VFIO APIs.

Application usage with those APIs is quite simple:
* allocate memory
* call rte_extmem_register on the memory chunk.
* take a device, and query its rte_device.
* call the device specific mapping function for this device.

Future work will deprecate the rte_vfio_dma_map and rte_vfio_dma_unmap
APIs, leaving the rte device APIs as the preferred option for the user.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agovfio: skip DMA map failure if already mapped
Shahaf Shuler [Sun, 10 Mar 2019 08:27:59 +0000 (10:27 +0200)]
vfio: skip DMA map failure if already mapped

Currently vfio DMA map function will fail in case the same memory
segment is mapped twice.

This is too strict, as this is not an error to map the same memory
twice.

Instead, use the kernel return value to detect such state and have the
DMA function to return as successful.

For type1 mapping the kernel driver returns EEXISTS.
For spapr mapping EBUSY is returned since kernel 4.10.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agovfio: allow DMA map to the default container
Shahaf Shuler [Sun, 10 Mar 2019 08:27:58 +0000 (10:27 +0200)]
vfio: allow DMA map to the default container

Enable users the option to call rte_vfio_dma_map with request to map
to the default vfio fd.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoexamples: detect default build directory
Bruce Richardson [Wed, 27 Mar 2019 13:58:05 +0000 (13:58 +0000)]
examples: detect default build directory

Most examples have in their makefiles a default RTE_TARGET directory to be
used in case RTE_TARGET is not set. Rather than just using a hard-coded
default, we can instead detect what the build directory is relative to
RTE_SDK directory.

This fixes a potential issue for anyone who continues to build using
"make install T=x86_64-native-linuxapp-gcc" and skips setting RTE_TARGET
explicitly, instead relying on the fact that they were building in a
directory which corresponded to the example default path - which was
changed to "x86_64-native-linux-gcc" by commit 218c4e68c1d9 ("mk: use
linux and freebsd in config names").

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agokni: calculate MTU from mbuf size
Liron Himi [Tue, 26 Mar 2019 18:40:10 +0000 (20:40 +0200)]
kni: calculate MTU from mbuf size

- mbuf_size and mtu are now being calculated according
to the given mb-pool.

- max_mtu is now being set according to the given mtu

the above two changes provide the ability to work with jumbo frames

Signed-off-by: Liron Himi <lironh@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agomem: warn user when running without NUMA support
Anatoly Burakov [Fri, 29 Mar 2019 14:01:29 +0000 (14:01 +0000)]
mem: warn user when running without NUMA support

Running in non-legacy mode on a NUMA-enabled system without libnuma
is unsupported, so explicitly print out a warning when trying to
do so.

Running in legacy mode without libnuma is still supported whether or
not we are running with libnuma support enabled, so also fix init to
allow that scenario.

Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoci: fix arm64 config filename
David Marchand [Fri, 29 Mar 2019 15:55:38 +0000 (16:55 +0100)]
ci: fix arm64 config filename

The ARM64 config file has been renamed in the commit
ae2f2fee247a ("build: rename linuxapp to linux in meson cross files").

Fixes: 99889bd85228 ("ci: introduce Travis builds for GitHub repositories")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agopower: add some logs on requests
Lukasz Krakowiak [Thu, 28 Mar 2019 16:11:54 +0000 (17:11 +0100)]
power: add some logs on requests

Extend debugs on power instruction and cmd police destroy
requests.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
5 years agopower: update error handling
Lukasz Krakowiak [Thu, 28 Mar 2019 15:55:07 +0000 (16:55 +0100)]
power: update error handling

Update for handling negative returned status from functions
call.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agopower: fix frequency list buffer validation
Kevin Traynor [Wed, 6 Feb 2019 12:19:06 +0000 (12:19 +0000)]
power: fix frequency list buffer validation

The frequency list buffer was already validated in
power_acpi_cpufreq_freqs(), so the newly added check was redundant.
To keep consistency with power_pstate_cpufreq_freqs(), remove the
original check and update the log message.

Fixes: 2e6ccdb4e088 ("power: fix frequency list to handle null buffer")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
5 years agonet/dpaa2: support flow table flush
Hemant Agrawal [Tue, 26 Mar 2019 12:01:48 +0000 (12:01 +0000)]
net/dpaa2: support flow table flush

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/dpaa: delay fman device list to bus probe
Hemant Agrawal [Tue, 26 Mar 2019 12:01:46 +0000 (12:01 +0000)]
bus/dpaa: delay fman device list to bus probe

The fman device list need to be accessed across processes.
The hw device structures should be allocated with rte_calloc
instead of calloc. The rte_calloc is not available at the
time of bus scan, so better prepare the device list at probe.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agomempool/dpaa: allocate bp info for multiprocess
Akhil Goyal [Tue, 26 Mar 2019 12:01:45 +0000 (12:01 +0000)]
mempool/dpaa: allocate bp info for multiprocess

rte_dpaa_bpid_info shall be allocated with the hugepage memory
which can be shared across processes.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agobus/dpaa: save fq lookup table for secondary process
Akhil Goyal [Tue, 26 Mar 2019 12:01:44 +0000 (12:01 +0000)]
bus/dpaa: save fq lookup table for secondary process

A reference to qman_fq_lookup_table need to be saved in each
fq, so that it is retrieved while in running secondary process.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agobus/dpaa: fix Rx discard register mask
Shreyansh Jain [Fri, 22 Feb 2019 10:09:44 +0000 (10:09 +0000)]
bus/dpaa: fix Rx discard register mask

Current value of 'fmbm_rfsdm' register (0x010CE3F0) doesn't include
the bit to drop colored (red) packets. New value (0x010EE3F0) fixes
this.
Check with 'fmbm_rffc' register of fm_port_bmi_regs.

Fixes: 6d6b4f49a155 ("bus/dpaa: add FMAN hardware operations")
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agobus/fslmc: remove unneeded strdup
Stephen Hemminger [Tue, 12 Mar 2019 17:11:52 +0000 (10:11 -0700)]
bus/fslmc: remove unneeded strdup

The fslmc bus code was duplicating the device name and
doing extra initialization. The code can be simplified
to just use the device name directly.

Compile tested only; do not have this hardware.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: decrease log level for unsupported devices
Stephen Hemminger [Tue, 12 Mar 2019 17:11:51 +0000 (10:11 -0700)]
bus/fslmc: decrease log level for unsupported devices

When fslmc is built as part of a general distribution, the
bus code will log errors when other devices are present.

This could confuse users it is not an error.

Fixes: 50245be05d1a ("bus/fslmc: support device blacklisting")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
5 years agonet/netvsc: remove unnecessary format of MAC address
Stephen Hemminger [Fri, 8 Feb 2019 03:44:07 +0000 (19:44 -0800)]
net/netvsc: remove unnecessary format of MAC address

The ethernet address was being converted to a string but
the code using that is no longer present.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agobus/vmbus: refactor secondary mapping
Stephen Hemminger [Fri, 8 Feb 2019 03:44:06 +0000 (19:44 -0800)]
bus/vmbus: refactor secondary mapping

The secondary mapping function was duplicating the code
used to search the uio_resource list.

Skip the unwinding since map failure already makes device
unusable.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>