dpdk.git
6 years agoapp/testpmd: fix buffer leak in TM command
Nithin Dabilpuram [Thu, 5 Jul 2018 05:45:46 +0000 (11:15 +0530)]
app/testpmd: fix buffer leak in TM command

Free the buffer allocated for shared_shaper_id array in
case of configuration without shared shapers.

Fixes: 996cb153af06 ("app/testpmd: add commands for TM nodes and hierarchy commit")

Signed-off-by: Nithin Dabilpuram <nithin.dabilpuram@caviumnetworks.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoapp/testpmd: remove logically dead code
Kevin Laatz [Tue, 17 Jul 2018 10:34:05 +0000 (11:34 +0100)]
app/testpmd: remove logically dead code

Remove logically dead code, tm_port_rate cannot be greater than
UINT32_MAX.

Coverity issue: 302846
Fixes: 0ad778b398c6 ("app/testpmd: rework softnic forward mode")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoservice: improve checks of coremasks
Harry van Haaren [Thu, 26 Jul 2018 16:31:59 +0000 (17:31 +0100)]
service: improve checks of coremasks

This commit improves the error checking performed on the
core masks (or lists) of the service cores, in particular
with respect to the data-plane (RTE) cores of DPDK.

With this commit, invalid configurations are detected at
runtime, and warning messages are printed to inform the user.

For example specifying the coremask as 0xf, and the service
coremask as 0xff00 is invalid as not all service-cores are
contained within the coremask. A warning is now printed to
inform the user.

Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
6 years agoapp/eventdev: use proper teardown sequence
Pavan Nikhilesh [Tue, 24 Jul 2018 12:14:50 +0000 (17:44 +0530)]
app/eventdev: use proper teardown sequence

Use proper teardown sequence when SIGINT is caught to prevent
eventdev from going into undefined state.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoevent/octeontx: remove unnecessary port start and stop
Pavan Nikhilesh [Thu, 19 Jul 2018 11:47:47 +0000 (17:17 +0530)]
event/octeontx: remove unnecessary port start and stop

Modifying port state is not necessary when starting/stopping Rx adapter
as it is same as starting/stopping ethdev.

Fixes: 45a914c5bd71 ("event/octeontx: support event Rx adapter")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoevent/octeontx: prefetch mbuf instead of wqe
Pavan Nikhilesh [Tue, 17 Jul 2018 14:33:45 +0000 (20:03 +0530)]
event/octeontx: prefetch mbuf instead of wqe

Prefetch mbuf pointer instead of wqe when SSO receives pkt from PKI.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
6 years agoapp/eventdev: fix order test service init
Pavan Nikhilesh [Fri, 13 Jul 2018 08:51:14 +0000 (14:21 +0530)]
app/eventdev: fix order test service init

Previous modification to evt_service_setup() broke order_queue/atq
tests.

Fixes: b0333c55dfa5 ("app/eventdev: add service core configuration")
Cc: stable@dpdk.org
Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoexamples/ip_pipeline: add example script for RSS
Cristian Dumitrescu [Thu, 26 Jul 2018 13:38:04 +0000 (14:38 +0100)]
examples/ip_pipeline: add example script for RSS

Add example script to demonstrate Receive Side Scaling (RSS).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agonet/softnic: add command for default tmgr hierarchy
Cristian Dumitrescu [Wed, 25 Jul 2018 17:10:07 +0000 (18:10 +0100)]
net/softnic: add command for default tmgr hierarchy

Add support for creating default Traffic Manager (TMGR) hierarchy through
firmware CLI script.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for tmgr hierarchy commit
Cristian Dumitrescu [Wed, 25 Jul 2018 17:10:06 +0000 (18:10 +0100)]
net/softnic: add command for tmgr hierarchy commit

Add support for Traffic Manager (TMGR) hierarchy commit through
firmware CLI script.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for tmgr node addition
Cristian Dumitrescu [Wed, 25 Jul 2018 17:10:05 +0000 (18:10 +0100)]
net/softnic: add command for tmgr node addition

Add support for adding Traffic Manager (TMGR) hierarchy node through
firmware CLI script.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for tmgr shared shaper
Cristian Dumitrescu [Wed, 25 Jul 2018 17:10:04 +0000 (18:10 +0100)]
net/softnic: add command for tmgr shared shaper

Add support to create Traffic Manager (TMGR) shared shaper through
firmware CLI script.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for tmgr shaper profile
Cristian Dumitrescu [Wed, 25 Jul 2018 17:10:03 +0000 (18:10 +0100)]
net/softnic: add command for tmgr shaper profile

Add support to create Traffic Manager (TMGR) shaper profile
through firmware CLI script.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for tmgr create
Cristian Dumitrescu [Wed, 25 Jul 2018 17:10:02 +0000 (18:10 +0100)]
net/softnic: add command for tmgr create

Add support to create Traffic Manager (TMGR) object through firmware
CLI script.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoexamples/ip_pipeline: add help command
Kevin Laatz [Fri, 20 Jul 2018 15:54:27 +0000 (16:54 +0100)]
examples/ip_pipeline: add help command

Add a help to the existing application cli. This will enable users to
display the usage help with descriptions within the cli.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoring: fix sign conversion warning
Andy Green [Mon, 28 May 2018 09:03:43 +0000 (17:03 +0800)]
ring: fix sign conversion warning

On gcc 5.4.0 / native aarch64 from Ubuntu 16.04:

In function '__rte_ring_do_dequeue':
rte_ring.h: 385:35: warning:
conversion to 'int' from 'unsigned int' may change
the sign of the result [-Wsign-conversion]
  n = __rte_ring_move_cons_head(r, is_sc, n, behavior,
                                   ^

Fixes: e8ed5056c8 ("ring: remove signed type flip-flopping")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoring: fix declaration after statement
Andy Green [Mon, 28 May 2018 09:03:38 +0000 (17:03 +0800)]
ring: fix declaration after statement

On gcc 5.4.0 / native aarch64 from Ubuntu 16.04:

In function '__rte_ring_move_prod_head':
rte_ring_c11_mem.h:69:3: warning:
ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
   const uint32_t cons_tail = r->cons.tail;
   ^

In function '__rte_ring_move_cons_head':
rte_ring_c11_mem.h:136:3: warning:
ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
   const uint32_t prod_tail = r->prod.tail;
   ^

Fixes: 39368ebfc6 ("ring: introduce C11 memory model barrier option")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomaintainers: update for szedata2 PMD
Matej Vido [Tue, 17 Jul 2018 13:52:18 +0000 (15:52 +0200)]
maintainers: update for szedata2 PMD

I will no longer be maintaining szedata2 PMD.
Jan will take over this role.

Signed-off-by: Matej Vido <matejvido@gmail.com>
Acked-by: Jan Remes <remes@netcope.com>
6 years agoapp/testpmd: revert softnic integration in CLI thread
Moti Haimovsky [Wed, 25 Jul 2018 15:30:09 +0000 (18:30 +0300)]
app/testpmd: revert softnic integration in CLI thread

This patch reverts the testpmd CLI prompt routine modifications done
in order to support softnic.
The reason of doing so is due to testpmd abnormal exit observed on
several setups caused by the softnic modifications to this routine,
for example: When running testpmd with tap interface
(testpmd
 -n 4 --vdev=net_tap0,iface=tap0,remote=eth1 -- --burst=64
 --mbcache=512 -i --nb-cores=7 --rxq=2 --txq=2 --txd=512
 --rxd=512 --port-topology=chained --forward-mode=rxonly)
testpmd crashes seconds after presenting its prompt with the following
error:
  testpmd> PANIC in prompt():
  CLI poll error (-1)

  Thread 1 "testpmd" received signal SIGABRT, Aborted.
  0x00007ffff668e0d0 in raise () from /lib64/libc.so.6
  (gdb) bt
  #0  0x00007ffff668e0d0 in raise () from /lib64/libc.so.6
  #1  0x00007ffff668f6b1 in abort () from /lib64/libc.so.6
  #2  0x0000000000468027 in __rte_panic ()
  #3  0x00000000004876ed in prompt ()
  #4  0x000000000046dffc in main ()

When running testpmd with bare-metal device
(testpmd -n 4 --socket-mem=1024,1024 -w 04:00.0  --
 --burst=64 --mbcache=512 -i --nb-cores=7
 --rxq=64 --txq=4 --txd=16 --rxd=16)
and pressing CTRL+D right after testpmd prompt is presented then
the program crashes while presenting the same messages as above.

Needless to say that this behavior is not observed when using the
previous CLI prompt routine.

Fixes: 0ad778b398c6 ("app/testpmd: rework softnic forward mode")

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agodrivers/net: fix crash in secondary process
Ferruh Yigit [Fri, 20 Jul 2018 14:54:23 +0000 (15:54 +0100)]
drivers/net: fix crash in secondary process

Calling rte_eth_dev_info_get() on secondary process cause a crash
because eth_dev->device is not set properly.

Fixes: ee27edbe0c10 ("drivers/net: share vdev data to secondary process")
Cc: stable@dpdk.org
Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agovhost: release locks on RARP packet failure
Tiwei Bie [Wed, 25 Jul 2018 14:18:11 +0000 (22:18 +0800)]
vhost: release locks on RARP packet failure

Fixes: eefac9536a90 ("vhost: postpone device creation until rings are mapped")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
6 years agovhost: fix overflow on shadow used ring
Tiwei Bie [Wed, 25 Jul 2018 13:51:37 +0000 (21:51 +0800)]
vhost: fix overflow on shadow used ring

The shadow used ring's size is the same as the vq's size,
so we shouldn't try more than "vq size" times. Besides,
the element pointed by avail->idx isn't available to the
device, so we will return error when try "vq size" times.

Fixes: 24e4844048e1 ("vhost: unify Rx mergeable and non-mergeable paths")
Fixes: a922401f35cc ("vhost: add Rx support for packed ring")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
6 years agovhost: fix return value on dequeue path
Jiayu Hu [Wed, 25 Jul 2018 08:21:42 +0000 (16:21 +0800)]
vhost: fix return value on dequeue path

This patch fixes the incorrect return value for rte_vhost_dequeue_burst()
when virtqueue is not enabled or virtqueue address translation fails.

Fixes: 62250c1d0978 ("vhost: extract split ring handling from Rx and Tx functions")

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
6 years agonet/mlx5: fix linkage of glue lib with gcc 4.7.2
Yaroslav Brustinov [Thu, 19 Jul 2018 10:00:22 +0000 (13:00 +0300)]
net/mlx5: fix linkage of glue lib with gcc 4.7.2

addressing a gcc 4.7.2 bug that cannot be reproduced with latter
versions:

"bin/ld: Warning: alignment 8 of symbol `mlx5_glue' in
src/dpdk/drivers/net/mlx5/mlx5_glue.c.21.o is smaller than 16 in
src/dpdk/drivers/net/mlx5/mlx5_rxq.c.21.o"

Fix it be forcing the alignment of the glue lib.

Fixes: 0e83b8e536c1 ("net/mlx5: move rdma-core calls to separate file")
Cc: stable@dpdk.org
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: fix invalid network interface index
Adrien Mazarguil [Wed, 25 Jul 2018 11:24:33 +0000 (13:24 +0200)]
net/mlx5: fix invalid network interface index

Network interface indices being unsigned, an invalid index or error is
normally expressed through a zero value (see if_nametoindex()).

mlx5_ifindex() has a signed return type for negative values in case of
error. Since mlx5_nl.c does not check for errors, these may be fed back as
invalid interfaces indices to subsequent system calls. This usage would
have been correct if mlx5_ifindex() returned a zero value instead.

This patch makes mlx5_ifindex() unsigned for convenience.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix count query when flow has not counter
Nelio Laranjeiro [Wed, 25 Jul 2018 08:46:14 +0000 (10:46 +0200)]
net/mlx5: fix count query when flow has not counter

Querying a counters on a flow without counter is ending with a
segmentation fault.

Fixes: 60bd8c9747e8 ("net/mlx5: add count flow action")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix queue rollback when starting device
Yongseok Koh [Mon, 23 Jul 2018 20:57:04 +0000 (13:57 -0700)]
net/mlx5: fix queue rollback when starting device

mlx5_rxq_start() and mlx5_rxq_stop() must be strictly paired because
internal reference counter is increased or decreased inside. Also,
mlx5_rxq_get() must be paired with mlx5_rxq_release().

Fixes: 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")
Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues")
Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix endless loop when clearing flow flags
Yongseok Koh [Mon, 23 Jul 2018 18:27:44 +0000 (11:27 -0700)]
net/mlx5: fix endless loop when clearing flow flags

If one of (*priv->rxqs)[] is null, the for loop can iterate infinitely as
idx can't be increased.

Fixes: cd24d526395e ("net/mlx5: add mark/flag flow action")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix route Netlink message overflow
Nelio Laranjeiro [Tue, 24 Jul 2018 06:50:27 +0000 (08:50 +0200)]
net/mlx5: fix route Netlink message overflow

Route Netlink message socket is wrongly initialized by registering to
the route link group.  This causes the socket to receive all link
message related to routes whereas the PMD do not expect to receive such
information.  In some situation it ends by filling the socket at a point
that any new message cannot be exchanged.
As the PMD is not expected to process such broadcast messages, the
parameter in the nl_group in the function is also remove.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org
Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: fix assert for Tx completion queue count
Yongseok Koh [Mon, 23 Jul 2018 18:00:10 +0000 (11:00 -0700)]
net/mlx5: fix assert for Tx completion queue count

There should be at least one Tx CQE remained if Tx WQ and txq->elts[] have
available slots to send a packet because the size of Tx CQ is exactly
calculated from the size of other resources. As it is guaranteed, it is
checked by an assertion.

max_elts is checked after the assertion for Tx CQ. If no slot is available
in txq->elts[], the assertion would be wrong.

Fixes: 2eefbec531c7 ("net/mlx5: add missing sanity checks for Tx completion queue")
Fixes: 6ce84bd88919 ("net/mlx5: add enhanced multi-packet send for ConnectX-5")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Xueming Li <xuemingl@mellanox.com>
6 years agonet/mlx5: fix representors detection
Nelio Laranjeiro [Tue, 24 Jul 2018 08:36:45 +0000 (10:36 +0200)]
net/mlx5: fix representors detection

On systems where the required Netlink commands are not supported but
Mellanox OFED is installed, representors information must be retrieved
through sysfs.

Fixes: 26c08b979d26 ("net/mlx5: add port representor awareness")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: fix TCI mask filter
Nelio Laranjeiro [Mon, 23 Jul 2018 07:18:40 +0000 (09:18 +0200)]
net/mlx5: fix TCI mask filter

In mlx5_traffic_enable() the TCI mask for the VLAN is wrong causing the
sub flow engine to reject the rule.

Fixes: 272733b5ebfd ("net/mlx5: use flow to enable unicast traffic")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
6 years agonet/mlx5: fix build with old kernels
Moti Haimovsky [Sun, 15 Jul 2018 17:31:39 +0000 (20:31 +0300)]
net/mlx5: fix build with old kernels

This commit fixes compilation errors due to missing definitions
found when compiling mlx5 PMD from DPDK 17.11-LTS on Ubuntu 12.4
with kernel 3.15.

Fixes: 75ef62a94301 ("net/mlx5: fix link speed capability information")
Fixes: 5bfc9fc112dd ("net/mlx5: use static assert for compile-time sanity checks")
Cc: stable@dpdk.org
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: add port ID pattern item to switch flow rules
Adrien Mazarguil [Fri, 13 Jul 2018 09:40:47 +0000 (11:40 +0200)]
net/mlx5: add port ID pattern item to switch flow rules

This enables flow rules to match traffic coming from a different DPDK port
ID associated with the device (PORT_ID pattern item), mainly for the
convenience of applications that want to deal with a single port ID for all
flow rules associated with some physical device.

Testpmd example:

- Creating a flow rule on port ID 1 to consume all traffic from port ID 0
  and direct it to port ID 2:

  flow create 1 ingress transfer pattern port_id id is 0 / end actions
     port_id id 2 / end

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add VLAN item and actions to switch flow rules
Adrien Mazarguil [Fri, 13 Jul 2018 09:40:45 +0000 (11:40 +0200)]
net/mlx5: add VLAN item and actions to switch flow rules

This enables flow rules to explicitly match VLAN traffic (VLAN pattern
item) and perform various operations on VLAN headers at the switch level
(OF_POP_VLAN, OF_PUSH_VLAN, OF_SET_VLAN_VID and OF_SET_VLAN_PCP actions).

Testpmd examples:

- Directing all VLAN traffic received on port ID 1 to port ID 0:

  flow create 1 ingress transfer pattern eth / vlan / end actions
     port_id id 0 / end

- Adding a VLAN header to IPv6 traffic received on port ID 1 and directing
  it to port ID 0:

  flow create 1 ingress transfer pattern eth / ipv6 / end actions
     of_push_vlan ethertype 0x8100 / of_set_vlan_vid vlan_vid 42 /
     port_id id 0 / end

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add L2-L4 pattern items to switch flow rules
Adrien Mazarguil [Fri, 13 Jul 2018 09:40:43 +0000 (11:40 +0200)]
net/mlx5: add L2-L4 pattern items to switch flow rules

This enables flow rules to explicitly match supported combinations of
Ethernet, IPv4, IPv6, TCP and UDP headers at the switch level.

Testpmd example:

- Dropping TCPv4 traffic with a specific destination on port ID 2:

  flow create 2 ingress transfer pattern eth / ipv4 / tcp dst is 42 / end
     actions drop / end

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add fate actions to switch flow rules
Adrien Mazarguil [Fri, 13 Jul 2018 09:40:41 +0000 (11:40 +0200)]
net/mlx5: add fate actions to switch flow rules

This patch enables creation of rte_flow rules that direct matching traffic
to a different port (e.g. another VF representor) or drop it directly at
the switch level (PORT_ID and DROP actions).

Testpmd examples:

- Directing all traffic to port ID 0:

  flow create 1 ingress transfer pattern end actions port_id id 0 / end

- Dropping all traffic normally received by port ID 1:

  flow create 1 ingress transfer pattern end actions drop / end

Note the presence of the transfer attribute, which requests them to be
applied at the switch level. All traffic is matched due to empty pattern.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add framework for switch flow rules
Adrien Mazarguil [Fri, 13 Jul 2018 09:40:39 +0000 (11:40 +0200)]
net/mlx5: add framework for switch flow rules

Because mlx5 switch flow rules are configured through Netlink (TC
interface) and have little in common with Verbs, this patch adds a separate
parser function to handle them.

- mlx5_nl_flow_transpose() converts a rte_flow rule to its TC equivalent
  and stores the result in a buffer.

- mlx5_nl_flow_brand() gives a unique handle to a flow rule buffer.

- mlx5_nl_flow_create() instantiates a flow rule on the device based on
  such a buffer.

- mlx5_nl_flow_destroy() performs the reverse operation.

These functions are called by the existing implementation when encountering
flow rules which must be offloaded to the switch (currently relying on the
transfer attribute).

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: lay groundwork for switch offloads
Adrien Mazarguil [Fri, 13 Jul 2018 09:40:37 +0000 (11:40 +0200)]
net/mlx5: lay groundwork for switch offloads

With mlx5, unlike normal flow rules implemented through Verbs for traffic
emitted and received by the application, those targeting different logical
ports of the device (VF representors for instance) are offloaded at the
switch level and must be configured through Netlink (TC interface).

This patch adds preliminary support to manage such flow rules through the
flow API (rte_flow).

Instead of rewriting tons of Netlink helpers and as previously suggested by
Stephen [1], this patch introduces a new dependency to libmnl [2]
(LGPL-2.1) when compiling mlx5.

[1] https://mails.dpdk.org/archives/dev/2018-March/092676.html
[2] https://netfilter.org/projects/libmnl/

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/softnic: fix memory illegal access after free
Jasvinder Singh [Fri, 20 Jul 2018 11:05:36 +0000 (12:05 +0100)]
net/softnic: fix memory illegal access after free

While deleting the elements from the linked list, TAILQ_FOREACH causes
read from the freed pointer. Fixes the issue by using TAILQ_FOREACH_SAFE
instead.

Coverity issue: 302867
Fixes: bef50bcb1c47 ("net/softnic: implement start and stop")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agonet/bonding: fix invalid port id
Radu Nicolau [Wed, 18 Jul 2018 11:12:01 +0000 (12:12 +0100)]
net/bonding: fix invalid port id

Setting up the bonding options before calling rte_eth_dev_probing_finish
triggers an invalid port id error because of port state not set, or set
unused

Fixes: fbe90cdd776c ("ethdev: add probing finish function")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
6 years agonet/ixgbe: fix missing null check on detach
Qi Zhang [Mon, 16 Jul 2018 12:47:04 +0000 (20:47 +0800)]
net/ixgbe: fix missing null check on detach

Add missing NULL point check inside ixgbe_pf_host_uninit, or it may cause
segment fault when detaching a device.

Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
6 years agonet/ixgbe: remove redundant queue id checks
Ferruh Yigit [Wed, 18 Jul 2018 12:35:22 +0000 (13:35 +0100)]
net/ixgbe: remove redundant queue id checks

remove queue id checks from dev_ops
ixgbe_dev_[rx/tx]_queue_[start/stop]

queue id checks already done by ethdev APIs that are calling these
dev_ops

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/fm10k: remove redundant queue id checks
Ferruh Yigit [Wed, 18 Jul 2018 12:35:24 +0000 (13:35 +0100)]
net/fm10k: remove redundant queue id checks

remove queue id checks from dev_ops
fm10k_dev_[rx/tx]_queue_[start/stop]

queue id checks already done by ethdev APIs that are calling these
dev_ops

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: remove redundant queue id checks
Ferruh Yigit [Wed, 18 Jul 2018 12:35:23 +0000 (13:35 +0100)]
net/i40e: remove redundant queue id checks

remove queue id checks from dev_ops
i40e_dev_[rx/tx]_queue_[start/stop]
i40evf_dev_[rx/tx]_queue_[start/stop]

queue id checks already done by ethdev APIs that are calling these
dev_ops

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/sfc: handle unknown L3 packet class in EF10 event parser
Andrew Rybchenko [Wed, 18 Jul 2018 07:43:13 +0000 (08:43 +0100)]
net/sfc: handle unknown L3 packet class in EF10 event parser

Fix debug build assertion if unknown L3 packet is received.

Fixes: 638bddc99faa ("net/sfc: implement EF10 native Rx datapath")
Fixes: c121f00836ca ("net/sfc: move EF10 Rx event parser to shared header")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: fix assert in set multicast address list
Andrew Rybchenko [Wed, 18 Jul 2018 07:40:06 +0000 (08:40 +0100)]
net/sfc: fix assert in set multicast address list

Return value equal to zero means success and really expected.

Fixes: 0fa0070e4391 ("net/sfc: support multicast addresses list controls")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/thunderx: support Rx VLAN offload
Rakesh Kudurumalla [Wed, 18 Jul 2018 15:05:02 +0000 (20:35 +0530)]
net/thunderx: support Rx VLAN offload

This feature is used to offload stripping of VLAN header from received
packets and update vlan_tci field in mbuf when
DEV_RX_OFFLOAD_VLAN_STRIP & ETH_VLAN_STRIP_MASK flag is set.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@caviumnetworks.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agonet/thunderx: enable Rx checksum offload
Pavan Nikhilesh [Wed, 18 Jul 2018 15:05:01 +0000 (20:35 +0530)]
net/thunderx: enable Rx checksum offload

Add L3/L4 Rx checksum offload and update capabilities.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoethdev: improve description for port name API
Jasvinder Singh [Tue, 17 Jul 2018 18:32:55 +0000 (19:32 +0100)]
ethdev: improve description for port name API

Improve description of api used to get port name from port id or
vice-versa.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/pcap: set queue started and stopped
Gage Eads [Wed, 18 Jul 2018 16:30:45 +0000 (11:30 -0500)]
net/pcap: set queue started and stopped

Set the rx and tx queue state appropriately when the queues or device are
started or stopped. This enables usage of the ethdev rx/tx queue start/stop
functions with the PCAP PMD.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/tap: set queue started and stopped
Gage Eads [Mon, 9 Jul 2018 20:20:49 +0000 (15:20 -0500)]
net/tap: set queue started and stopped

Set the rx and tx queue state appropriately when the queues or device
are started or stopped.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
6 years agovhost: fix buffer length calculation
Tiwei Bie [Tue, 17 Jul 2018 13:10:35 +0000 (21:10 +0800)]
vhost: fix buffer length calculation

Fixes: fd68b4739d2c ("vhost: use buffer vectors in dequeue path")

Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Zhihong Wang <zhihong.wang@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
6 years agonet/sfc: prepare to support Rx datapath without checksum
Andrew Rybchenko [Sun, 15 Jul 2018 09:56:15 +0000 (10:56 +0100)]
net/sfc: prepare to support Rx datapath without checksum

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: fix Rx queue offloads reporting in queue info
Andrew Rybchenko [Sun, 15 Jul 2018 09:56:14 +0000 (10:56 +0100)]
net/sfc: fix Rx queue offloads reporting in queue info

CRC_STRIP offload is always enabled, but lost here.

It is more robust to use device level offloads directly to
compose returned value.

Fixes: ff6a1197c3b1 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: move Rx checksum offload check to device level
Andrew Rybchenko [Sun, 15 Jul 2018 09:56:13 +0000 (10:56 +0100)]
net/sfc: move Rx checksum offload check to device level

Rx checksum offloads are on device level and should be checked and
enforced on device level.

Avoid logging of Rx checksum offloads enforced for each Rx queue.

Fixes: ff6a1197c3b1 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/enic: pick the right Rx handler after changing MTU
Hyong Youb Kim [Wed, 18 Jul 2018 02:02:16 +0000 (19:02 -0700)]
net/enic: pick the right Rx handler after changing MTU

enic_set_mtu always reverts to the default Rx handler after changing
MTU. Try to use the simpler, non-scatter handler in this case as well.

Fixes: 35e2cb6a1795 ("net/enic: add simple Rx handler")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/sfc: fallback to filter with zero vid
Igor Romanov [Sat, 14 Jul 2018 07:38:59 +0000 (08:38 +0100)]
net/sfc: fallback to filter with zero vid

Fallback to filter with VLAN=0 if match without VLAN is not supported
Strictly speaking it is not 100% equivalent, but good tradeoff -
untagged and priority only tagged frames will match.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: fix filter exceptions logic
Igor Romanov [Sat, 14 Jul 2018 07:38:23 +0000 (08:38 +0100)]
net/sfc: fix filter exceptions logic

Now exception logic handles these cases:

When FW variant does not support filters with transport ports, but
IP protocol filters are supported, TCP/UDP protocol filters may be
used. When FW variant does not support filters with IPv4/6 addresses
or IP protocol, but filters with EtherType are supported, IPv4 and
IPv6 EtherTypes may be used

Fixes: 096dba799b4a ("net/sfc: avoid creation of ineffective flow rules")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/qede: move SPDX tags to source files
Rasesh Mody [Sat, 14 Jul 2018 01:34:27 +0000 (18:34 -0700)]
net/qede: move SPDX tags to source files

We were using LICENSE.qede_pmd to reference inclusion of SPDX licensing
tag from all the source file. Remove the LICENSE.qede_pmd file and
directly include SPDX tags in source files.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agodoc: update enic guide and features
Hyong Youb Kim [Wed, 18 Jul 2018 02:15:30 +0000 (19:15 -0700)]
doc: update enic guide and features

Make a few updates in preparation for 18.08.
- Use SPDX
- Add 1400 series VIC adapters to supported models
- Describe the VXLAN port number
- Expand the description for ig-vlan-rewrite
- Add inner RSS and checksum to the features

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agoapp/testpmd: fix little performance drop
Xiaoyun Li [Thu, 12 Jul 2018 07:55:46 +0000 (15:55 +0800)]
app/testpmd: fix little performance drop

There is about 3% perf drop. And it is because of a bitrate
calculation in the datapath. So improve it by maintaining an array
of port indexes in testpmd, which is updated with ethdev events.

Fixes: 8728ccf37615 ("fix ethdev ports enumeration")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/thunderx: avoid sq door bell write on zero packet
Kiran Kumar [Wed, 11 Jul 2018 08:24:36 +0000 (13:54 +0530)]
net/thunderx: avoid sq door bell write on zero packet

Avoid sq door bell write on zero packet case to reduce additional
traffic on register bus.

Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")
Cc: stable@dpdk.org
Signed-off-by: Kiran Kumar <kkokkilagadda@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agonet/cxgbe: fix init failure due to new flash parts
Rahul Lakkireddy [Mon, 9 Jul 2018 15:43:23 +0000 (21:13 +0530)]
net/cxgbe: fix init failure due to new flash parts

Add decode logic for new flash parts shipped with new Chelsio NICs
to fix initialization failure on these NICs.

Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: update release notes for flow API support
Rahul Lakkireddy [Fri, 6 Jul 2018 14:42:50 +0000 (20:12 +0530)]
net/cxgbe: update release notes for flow API support

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agoapp/testpmd: add NVGRE encap/decap
Nelio Laranjeiro [Fri, 6 Jul 2018 06:43:06 +0000 (08:43 +0200)]
app/testpmd: add NVGRE encap/decap

Due to the complex NVGRE_ENCAP flow action and based on the fact testpmd
does not allocate memory, this patch adds a new command in testpmd to
initialise a global structure containing the necessary information to
make the outer layer of the packet.  This same global structure will
then be used by the flow command line in testpmd when the action
nvgre_encap will be parsed, at this point, the conversion into such
action becomes trivial.

This global structure is only used for the encap action.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Tested-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
6 years agoapp/testpmd: add VXLAN encap/decap
Nelio Laranjeiro [Fri, 6 Jul 2018 06:43:05 +0000 (08:43 +0200)]
app/testpmd: add VXLAN encap/decap

Due to the complex VXLAN_ENCAP flow action and based on the fact testpmd
does not allocate memory, this patch adds a new command in testpmd to
initialise a global structure containing the necessary information to
make the outer layer of the packet.  This same global structure will
then be used by the flow command line in testpmd when the action
vxlan_encap will be parsed, at this point, the conversion into such
action becomes trivial.

This global structure is only used for the encap action.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Tested-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
6 years agoethdev: fix queue statistics mapping documentation
Jerin Jacob [Fri, 29 Jun 2018 09:44:43 +0000 (15:14 +0530)]
ethdev: fix queue statistics mapping documentation

The RTE_MAX_ETHPORT_QUEUE_STATS_MAPS does not exists, change
to the correct definition(RTE_ETHDEV_QUEUE_STAT_CNTRS)

Fixes: 5de201df8927 ("ethdev: add stats per queue")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/i40e: fix check of flow director programming status
Wei Zhao [Fri, 13 Jul 2018 03:16:33 +0000 (11:16 +0800)]
net/i40e: fix check of flow director programming status

In i40e FDIR PMD code for checking programming status
function i40e_check_fdir_programming_status(), the initial value
of return value ret should be set to -1 not 0, because if DD bit of
I40E_RX_DESC_STATUS_DD is not write back, this function will return
0 to upper function, this give an error info to upper function, the
fact for this is it is time out for DD write back and it should return
-1.

Fixes: 05999aab4ca6 ("i40e: add or delete flow director")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix link speed
Xiaoyun Li [Tue, 10 Jul 2018 09:30:54 +0000 (17:30 +0800)]
net/i40e: fix link speed

When link needs to go up, I40E_AQ_PHY_AN_ENABLED is always be set in DPDK.
So all speeds are always set. This causes speed config never works.

This patch fixes this issue and only allows to set available speeds. If
link needs to go up and speed setting is not supported, it will print
warning and set default available speeds. And when link needs to go down,
link speed field should be set to non-zero to avoid link down issue when
binding back to kernel driver.

Fixes: ca7e599d4506 ("net/i40e: fix link management")
Fixes: 1bb8f661168d ("net/i40e: fix link down and negotiation")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix Tx queue setup after stop
Shaopeng He [Tue, 10 Jul 2018 10:37:27 +0000 (06:37 -0400)]
net/i40e: fix Tx queue setup after stop

Currently, i40e_dev_tx_queue_setup_runtime checks simple tx and treats
mbuf fast free offloading as No-simple, which is classified as simple tx
in i40e_set_tx_function_flag. This inconsistent behavior causes tx queue
setup fail after queue was stopped. This patch fixes this bug.

Fixes: 399421100e08 ("net/i40e: fix missing mbuf fast free offload")
Cc: stable@dpdk.org
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix setting TPID with AQ command
Beilei Xing [Thu, 5 Jul 2018 07:03:08 +0000 (15:03 +0800)]
net/i40e: fix setting TPID with AQ command

TPID can be set by set_switch_config AdminQ command on
new FW release. But find fail to set 0x88A8 on some NICs.
According to the datasheet, Switch Tag value should not
be identical to either the First Tag or Second Tag values.
So set something other than common Ethertype for internal
switching.

Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register setting")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix packet type parsing with DDP
Beilei Xing [Thu, 5 Jul 2018 01:36:29 +0000 (09:36 +0800)]
net/i40e: fix packet type parsing with DDP

To parse packet type correctly, profile needs to be
loaded again to update tables in SW even if profile
has exited. But previously packet type parser will
be false after loading profile when profile already
exists.
This patch fixes the issue.

Fixes: 0585f5c3d264 ("net/i40e: fix DDP profile DEL operation")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Xueqin Lin <xueqin.lin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix PPPoL2TP packet type parsing
Beilei Xing [Thu, 5 Jul 2018 01:36:14 +0000 (09:36 +0800)]
net/i40e: fix PPPoL2TP packet type parsing

Since PPPoL2TP profile is updated, PPPoL2TP packet type
parser will be false with the current parser function.
This patch fixes the issue.

Fixes: 11556c915a08 ("net/i40e: improve packet type parser")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Xueqin Lin <xueqin.lin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agovfio: fix workaround of BAR mapping
Takeshi Yoshimura [Fri, 20 Jul 2018 08:13:47 +0000 (17:13 +0900)]
vfio: fix workaround of BAR mapping

Currently, VFIO will try to map around MSI-X table in the BARs. When
MSI-X table (page-aligned) size is equal to (page-aligned) size of BAR,
VFIO will just skip the BAR.

Recent kernel versions will allow VFIO to map the entire BAR containing
MSI-X tables (*), so instead of trying to map around the MSI-X vector
or skipping the BAR entirely if it's not possible, we can now try
mapping the entire BAR first. If mapping the entire BAR doesn't
succeed, fall back to the old behavior of mapping around MSI-X table or
skipping the BAR.

(*): "vfio-pci: Allow mapping MSIX BAR",
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
commit/?id=a32295c612c57990d17fb0f41e7134394b2f35f6

Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables")

Signed-off-by: Takeshi Yoshimura <t.yoshimura8869@gmail.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agomem: revert reversed allocation
Anatoly Burakov [Tue, 24 Jul 2018 12:21:40 +0000 (13:21 +0100)]
mem: revert reversed allocation

A few regressions with virtio/vhost have been discovered, due to the
strong dependency of virtio/vhost on the underlying memory layout.
Specifically, virtio/vhost share all memory pages starting from the
beginning of the segment, while the patch below made it so that the
memory is always allocated from the top of VA space, not from the
bottom.

Fixes: 179f916e88e4 ("mem: allocate in reverse to reduce fragmentation")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agodevtools: add compressdev tests to build test
Pablo de Lara [Thu, 19 Jul 2018 03:07:52 +0000 (04:07 +0100)]
devtools: add compressdev tests to build test

Compressdev tests depend on Zlib library,
so they can only be enabled if this is available.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agodevtools: remove already enabled nfp from build test
Pablo de Lara [Thu, 19 Jul 2018 03:03:31 +0000 (04:03 +0100)]
devtools: remove already enabled nfp from build test

NFP PMD does not have any external dependency.
It only requires Linux OS, so it is not needed
to be enabled in the test-build script.

Fixes: 80987c40fd28 ("config: enable nfp driver on Linux")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
6 years agoeal: fix error message for unsupported platforms
Bruce Richardson [Fri, 20 Jul 2018 14:13:10 +0000 (15:13 +0100)]
eal: fix error message for unsupported platforms

When building with meson on e.g. cygwin, the error message about an
unsupported platform referenced an unknown variable since
"host_machine" was missing an "_".

Fixes: 844514c73569 ("eal: build with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agokvargs: fix building with meson outside source tree
Bruce Richardson [Thu, 19 Jul 2018 14:26:48 +0000 (15:26 +0100)]
kvargs: fix building with meson outside source tree

When building DPDK with meson with the <builddir> being outside the source
directory, an error was generated as the path to the EAL headers was not
found. The path specified for the includes backed out unnecessarily far and
so broke when the build directory was not in the expected location of
just inside the source dir. Changing the path to be shorter, just going
down one level and then into EAL builds for both cases - where builddir is
in source directory, and also when it's outside it.

Fixes: 092ee516496d ("kvargs: build before EAL")

Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agobuild: remove duplicate checks for cflags
Bruce Richardson [Thu, 19 Jul 2018 14:22:06 +0000 (15:22 +0100)]
build: remove duplicate checks for cflags

There is no need to check for each library, driver and example whether
certain cflags are supported. Instead of checking inside the loop, do
so outside and reuse the value.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: improve error message for missing dependency
Bruce Richardson [Fri, 20 Jul 2018 13:28:25 +0000 (14:28 +0100)]
build: improve error message for missing dependency

When building a driver or library and a required internal dependency
is missing, the error message printed was:

    Tried to get unknown variable "shared_rte_<libname>".

However, a better way to handle this is to catch the missing variable
earlier and convert it into a proper message, informing the user
that the required dependency is missing, and most importantly, what
library or driver wanted that dependency.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: fix meson build on FreeBSD
Bruce Richardson [Fri, 20 Jul 2018 13:53:36 +0000 (14:53 +0100)]
build: fix meson build on FreeBSD

A number of drivers have dependencies on libraries which
are only built on Linux, and so they need to be disabled
on FreeBSD. Rather than basing the disabling on OS, in
each case we base the building of the library on the
presence of the required dependency.

Fixes: 50385c106021 ("net/ifc: add to meson build")
Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Fixes: 5936aa3a39b9 ("net/vhost: add to meson build")
Fixes: 3298fa4853b8 ("raw/dpaa2_cmdif: introduce DPAA2 command interface driver")
Fixes: b1ee472fed58 ("raw/dpaa2_qdma: introduce the DPAA2 QDMA driver")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agousertools: add octeontx zip device for binding
Sunila Sahu [Wed, 25 Jul 2018 17:04:56 +0000 (22:34 +0530)]
usertools: add octeontx zip device for binding

Add the cavium octeontx zip pci device details.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agodoc: add octeonx zip guide
Ashish Gupta [Wed, 25 Jul 2018 17:04:55 +0000 (22:34 +0530)]
doc: add octeonx zip guide

Add Octeontx ZIP PMD feature specification and user guide
with build and run instructions.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: support burst enqueue/dequeue
Ashish Gupta [Wed, 25 Jul 2018 17:04:54 +0000 (22:34 +0530)]
compress/octeontx: support burst enqueue/dequeue

Implement enqueue/dequeue APIs to perform compression/decompression
operations

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: create private xform
Ashish Gupta [Wed, 25 Jul 2018 17:04:53 +0000 (22:34 +0530)]
compress/octeontx: create private xform

Create non-shareable private xform for applications to
perform stateless compression/decompression.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: add device setup ops
Ashish Gupta [Wed, 25 Jul 2018 17:04:52 +0000 (22:34 +0530)]
compress/octeontx: add device setup ops

Add compression PMD device and queue pair setup ops.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: introduce octeontx zip PMD
Sunila Sahu [Wed, 25 Jul 2018 17:04:51 +0000 (22:34 +0530)]
compress/octeontx: introduce octeontx zip PMD

Octentx zipvf PMD provides hardware acceleration for
deflate and lzs compression and decompression operations
using Octeontx zip co-processor, which provide 8
virtualized zip devices.

This patch add basic initialization routine to register zip VFs
to compressdev library.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agoexamples/ipsec-secgw: fix bypass rule processing
Konstantin Ananyev [Tue, 5 Jun 2018 14:16:02 +0000 (15:16 +0100)]
examples/ipsec-secgw: fix bypass rule processing

For outbound ports BYPASS rule is erroneously treated as PROTECT one
with SA idx zero.

Fixes: 2a5106af132b ("examples/ipsec-secgw: fix corner case for SPI value")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agobaseband/turbo_sw: update for FlexRAN 1.6.0
Amr Mokhtar [Thu, 19 Jul 2018 13:03:53 +0000 (14:03 +0100)]
baseband/turbo_sw: update for FlexRAN 1.6.0

Update BBDEV Turbo SW driver download/build instructions for
FlexRAN 1.6.0 release

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agodoc: add crypto asymmetric feature list
Ashish Gupta [Mon, 23 Jul 2018 14:46:05 +0000 (20:16 +0530)]
doc: add crypto asymmetric feature list

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agocrypto/openssl: add DH and DSA asym operations
Sunila Sahu [Mon, 23 Jul 2018 14:46:04 +0000 (20:16 +0530)]
crypto/openssl: add DH and DSA asym operations

- Add dh key generation and shared compute
- Add dsa sign and verify operation

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agocrypto/openssl: add RSA and mod asym operations
Sunila Sahu [Mon, 23 Jul 2018 14:46:03 +0000 (20:16 +0530)]
crypto/openssl: add RSA and mod asym operations

- Add compat.h to make pmd compatible to openssl-1.1.0 and
  backward version
- Add rsa sign/verify/encrypt/decrypt and modular operation
  support

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agodoc: add zlib PMD guide
Shally Verma [Tue, 24 Jul 2018 15:05:36 +0000 (20:35 +0530)]
doc: add zlib PMD guide

Add zlib pmd feature support and user guide with
build and run instructions

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agocompress/zlib: support burst enqueue/dequeue
Sunila Sahu [Tue, 24 Jul 2018 15:05:35 +0000 (20:35 +0530)]
compress/zlib: support burst enqueue/dequeue

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agocompress/zlib: create private xform
Sunila Sahu [Tue, 24 Jul 2018 15:05:34 +0000 (20:35 +0530)]
compress/zlib: create private xform

Create non-shareable private xform for stateless
operation processing

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agocompress/zlib: add basic ops
Ashish Gupta [Tue, 24 Jul 2018 15:05:33 +0000 (20:35 +0530)]
compress/zlib: add basic ops

Implement device configure and queue pair
setup PMD ops

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agocompress/zlib: introduce zlib PMD
Ashish Gupta [Tue, 24 Jul 2018 15:05:32 +0000 (20:35 +0530)]
compress/zlib: introduce zlib PMD

Add initial PMD setup routines in compressdev
framework. ZLIB PMD appears as virtual compression
device. User would need to install zlib prior to
enabling this PMD.

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
6 years agocompress/isal: support chained mbufs
Lee Daly [Tue, 24 Jul 2018 11:19:23 +0000 (12:19 +0100)]
compress/isal: support chained mbufs

This patch adds chained mbuf support for input or output buffers
during compression/decompression operations.

Signed-off-by: Lee Daly <lee.daly@intel.com>
Reviewed-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>