dpdk.git
7 years agocrypto/zuc: do not append digest
Pablo de Lara [Tue, 5 Sep 2017 02:20:05 +0000 (03:20 +0100)]
crypto/zuc: do not append digest

When performing an authentication verification,
the PMD was using memory at the end of the input buffer,
to store temporarily the digest.
This operation requires the buffer to have enough
tailroom unnecessarily.
Instead, memory is allocated for each queue pair, to store
temporarily the digest generated by the driver, so it can
be compared with the one provided in the crypto operation,
without needing to touch the input buffer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/snow3g: do not append digest
Pablo de Lara [Tue, 5 Sep 2017 02:20:04 +0000 (03:20 +0100)]
crypto/snow3g: do not append digest

When performing an authentication verification,
the PMD was using memory at the end of the input buffer,
to store temporarily the digest.
This operation requires the buffer to have enough
tailroom unnecessarily.
Instead, memory is allocated for each queue pair, to store
temporarily the digest generated by the driver, so it can
be compared with the one provided in the crypto operation,
without needing to touch the input buffer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/kasumi: do not append digest
Pablo de Lara [Tue, 5 Sep 2017 02:20:03 +0000 (03:20 +0100)]
crypto/kasumi: do not append digest

When performing an authentication verification,
the PMD was using memory at the end of the input buffer,
to store temporarily the digest.
This operation requires the buffer to have enough
tailroom unnecessarily.
Instead, memory is allocated for each queue pair, to store
temporarily the digest generated by the driver, so it can
be compared with the one provided in the crypto operation,
without needing to touch the input buffer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/openssl: do not append digest
Pablo de Lara [Tue, 5 Sep 2017 02:20:02 +0000 (03:20 +0100)]
crypto/openssl: do not append digest

When performing an authentication verification,
the PMD was using memory at the end of the input buffer,
to store temporarily the digest.
This operation requires the buffer to have enough
tailroom unnecessarily.
Instead, memory is allocated for each queue pair, to store
temporarily the digest generated by the driver, so it can
be compared with the one provided in the crypto operation,
without needing to touch the input buffer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/armv8: do not append digest
Pablo de Lara [Tue, 5 Sep 2017 02:20:01 +0000 (03:20 +0100)]
crypto/armv8: do not append digest

When performing an authentication verification,
the PMD was using memory at the end of the input buffer,
to store temporarily the digest.
This operation requires the buffer to have enough
tailroom unnecessarily.
Instead, memory is allocated for each queue pair, to store
temporarily the digest generated by the driver, so it can
be compared with the one provided in the crypto operation,
without needing to touch the input buffer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/aesni_gcm: do not append digest
Pablo de Lara [Tue, 5 Sep 2017 02:20:00 +0000 (03:20 +0100)]
crypto/aesni_gcm: do not append digest

When performing an authentication verification,
the PMD was using memory at the end of the input buffer,
to store temporarily the digest.
This operation requires the buffer to have enough
tailroom unnecessarily.
Instead, memory is allocated for each queue pair, to store
temporarily the digest generated by the driver, so it can
be compared with the one provided in the crypto operation,
without needing to touch the input buffer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocryptodev: allocate driver structure statically
Pablo de Lara [Wed, 16 Aug 2017 02:41:51 +0000 (03:41 +0100)]
cryptodev: allocate driver structure statically

When register a crypto driver, a cryptodev driver
structure was being allocated, using malloc.
Since this call may fail, it is safer to allocate
this memory statically in each PMD, so driver registration
will never fail.

Coverity issue: 158645
Fixes: 7a364faef185 ("cryptodev: remove crypto device type enumeration")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agocrypto/aesni_gcm: fix zero data operation
Pablo de Lara [Mon, 14 Aug 2017 00:45:21 +0000 (01:45 +0100)]
crypto/aesni_gcm: fix zero data operation

When data length passed to the PMD was zero,
the PMD was trying to get more data from a non-existent
next segment.

Fixes: 9c2a5775c028 ("crypto/aesni_gcm: migrate from MB library to ISA-L")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agocrypto/openssl: update key and algo during session init
Akhil Goyal [Tue, 5 Sep 2017 05:57:49 +0000 (11:27 +0530)]
crypto/openssl: update key and algo during session init

Key and algo are added in the openssl ctx during
session initialization instead of adding it for
each packet, since it remains constant for that session,
improving the performance.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto/openssl: replace evp APIs with HMAC APIs
Akhil Goyal [Tue, 5 Sep 2017 05:57:48 +0000 (11:27 +0530)]
crypto/openssl: replace evp APIs with HMAC APIs

in case of HMAC the openssl APIs HMAC_XXX give
better performance for all HMAC cases as compared with
EVP_XXX

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoapp/crypto-perf: fix uninitialized errno value
Hemant Agrawal [Tue, 5 Sep 2017 06:17:01 +0000 (11:47 +0530)]
app/crypto-perf: fix uninitialized errno value

errno should be initialized to 0 before calling strtol

Fixes: f6cefe253cc8 ("app/crypto-perf: add range/list of sizes")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agoexamples/l2fwd-crypto: fix uninitialized errno value
Hemant Agrawal [Wed, 23 Aug 2017 12:24:03 +0000 (17:54 +0530)]
examples/l2fwd-crypto: fix uninitialized errno value

errno should be initialized to 0 before calling strtol

Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agomempool/dpaa2: improve error handling
Hemant Agrawal [Tue, 10 Oct 2017 14:12:03 +0000 (19:42 +0530)]
mempool/dpaa2: improve error handling

Reverting the config on encountering errors.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agomempool: remove get capability debug log
Hemant Agrawal [Tue, 10 Oct 2017 14:17:11 +0000 (19:47 +0530)]
mempool: remove get capability debug log

This is not required to be printed for every mempool call.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agoapp/testpmd: remove unnecessary cast
Zhiyong Yang [Wed, 11 Oct 2017 06:59:50 +0000 (14:59 +0800)]
app/testpmd: remove unnecessary cast

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/ixgbe: fix uninitialized variable
Yong Wang [Tue, 19 Sep 2017 03:17:24 +0000 (23:17 -0400)]
net/ixgbe: fix uninitialized variable

In func ixgbe_dev_link_update(), "link.link_autoneg" is used in func
call rte_ixgbe_dev_atomic_write_link_status(), but is uninitialized.

Fixes: 82113036e4e5 ("ethdev: redesign link speed config")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agoethdev: revert use port name from device structure
Ferruh Yigit [Fri, 22 Sep 2017 11:30:07 +0000 (12:30 +0100)]
ethdev: revert use port name from device structure

This reverts commit a1e7c17555e8f77d520ba5f06ed26c00e77a2bd1.

Original commit assumes there is 1:1 mapping between physical device and
ethdev port, so that device name can be used per port instead of ethdev
name field.

But one physical device may have multiple ethdev ports and each port
needs its own unique name.

One issue reported here:
http://dpdk.org/ml/archives/users/2017-September/002484.html

So reverting back the commit to continue using ethdev name field per
port.

Fixes: a1e7c17555e8 ("ethdev: use device name from device structure")
Cc: stable@dpdk.org
Reported-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
7 years agoapp/testpmd: add commands for RSS queue region
Wei Zhao [Wed, 11 Oct 2017 08:55:33 +0000 (16:55 +0800)]
app/testpmd: add commands for RSS queue region

This patch add a API configuration of queue region in rss.
It can parse the parameters of region index, queue number,
queue start index, user priority, traffic classes and so on.
According to commands from command line, it will call i40e
private API and start the process of set or flush queue region
configure. As this feature is specific for i40e, so private API
will be used. Aslo add a document for these new commands.
Queue region only support PF by now, so this document is
only for configuration of queue region on PF port.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
7 years agonet/i40e: support queue region set and flush
Wei Zhao [Wed, 11 Oct 2017 08:55:32 +0000 (16:55 +0800)]
net/i40e: support queue region set and flush

This feature enable queue regions configuration for RSS in PF,
so that different traffic classes or different packet
classification types can be separated to different queues in
different queue regions.This patch can set queue region range,
it include queue number in a region and the index of first queue.
This patch enable mapping between different priorities (UP) and
different traffic classes.It also enable mapping between a region
index and a sepcific flowtype(PCTYPE).It also provide the solution
of flush all configuration about queue region the above described.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
7 years agonet/liquidio: support promiscuous mode
Intiyaz Basha [Wed, 11 Oct 2017 07:47:47 +0000 (13:17 +0530)]
net/liquidio: support promiscuous mode

Signed-off-by: Intiyaz Basha <intiyaz.basha@caviumnetworks.com>
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
7 years agonet/ixgbe: fix VFIO interrupt mapping in VF
Wei Dai [Thu, 28 Sep 2017 02:28:33 +0000 (10:28 +0800)]
net/ixgbe: fix VFIO interrupt mapping in VF

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt
is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ).
In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in
eth_ixgbevf_dev_init( ) is not cleard, it will fail when calling
rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO
vectors. This patch clears the VFIO interrupt mappings before
setting both miscellaneous and Rx queue interrupt mappings again
to avoid failure.

Fixes: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Tested-by: Jianwei Ma <jianwei.ma@intel.com>
7 years agonet/ixgbe: fix Rx queue interrupt mapping in VF
Wei Dai [Wed, 20 Sep 2017 10:18:13 +0000 (18:18 +0800)]
net/ixgbe: fix Rx queue interrupt mapping in VF

When a VF port is bound to VFIO-PCI, miscellaneous interrupt is
mapped to MSI-X vector 0 and Rx queues interrupt are mapped to
other vectors in vfio_enable_msix( ). To simplify implementation,
all VFIO-PCI bound ixgbe VF Rx queue interrupts can be mapped in
vector 1. And as current igb_uio only support only one vector,
ixgbe VF PMD should use vector 0 for igb_uio and vector 1 for
VFIO-PCI. Without this patch, VF Rx queue interrupt is mapped
to vector 0 in register settings and mapped to VFIO vector 1
in vfio_enable_msix( ), and then all Rx queue interrupts will
be missed.

Fixes: b13bfab4cdbe ("eal: reserve VFIO vector zero for misc interrupt")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Tested-by: Jianwei Ma <jianwei.ma@intel.com>
7 years agodoc: update the SDK version for DPAA2
Hemant Agrawal [Tue, 10 Oct 2017 14:13:21 +0000 (19:43 +0530)]
doc: update the SDK version for DPAA2

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agodoc: minor corrections in DPAA NIC guide
Hemant Agrawal [Tue, 10 Oct 2017 14:13:20 +0000 (19:43 +0530)]
doc: minor corrections in DPAA NIC guide

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agoethdev: add return value to stats get dev op
Matan Azrad [Tue, 10 Oct 2017 20:20:18 +0000 (20:20 +0000)]
ethdev: add return value to stats get dev op

The stats_get dev op API doesn't include return value, so PMD cannot
return an error in case of failure at stats getting process time.

Since PCI devices can be removed and there is a time between the
physical removal to the RMV interrupt, the user may get invalid stats
without any indication.

This patch changes the stats_get API return value to be int instead of
void.

All the net PMDs stats_get dev ops are adjusted by this patch.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/bnxt: fix the association of a MACVLAN per VNIC
Ajit Khaparde [Tue, 10 Oct 2017 14:23:03 +0000 (09:23 -0500)]
net/bnxt: fix the association of a MACVLAN per VNIC

We were not associating a MAC+VLAN per VNIC filter correctly.
This patch fixes that. Also set the VLAN type appropriately.

Fixes: f92735db1e4c ("net/bnxt: add L2 filter alloc/init/free")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: support FDIR
Ajit Khaparde [Tue, 10 Oct 2017 14:23:02 +0000 (09:23 -0500)]
net/bnxt: support FDIR

This patch brings support for Flow Director.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: prevent programming a duplicate flow
Ajit Khaparde [Tue, 10 Oct 2017 14:23:01 +0000 (09:23 -0500)]
net/bnxt: prevent programming a duplicate flow

Match a flow against existing flows programmed in the HW
and prevent overlapping entries. Also change log level of
some logs to DEBUG.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: fix cleanup if a filter allocation fails
Ajit Khaparde [Tue, 10 Oct 2017 14:23:00 +0000 (09:23 -0500)]
net/bnxt: fix cleanup if a filter allocation fails

We are not checking if a filter allocation succeeded.
And we end up accessing a null pointer after that.
Also invalidate the fw_l2_filter_id to prevent unnecessary
HW access and hence HWRM command failures during exit.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/mlx5: flow counter support
Ori Kam [Tue, 10 Oct 2017 14:22:54 +0000 (16:22 +0200)]
net/mlx5: flow counter support

Example for setting rule for counting packets with dest
ip = 192.168.3.1 in testpmd:

testpmd: flow create 0 ingress pattern eth / ipv4 dst is 192.168.3.1
/ end actions queue index 0 / count / end

Reading the number of packets and bytes for the rule:

testpmd: flow query 0 0 count

Note: This feature is only supported starting Mellanox OFED 4.2

Signed-off-by: Ori Kam <orika@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add Rx HW timestamp
Raslan Darawsheh [Tue, 10 Oct 2017 14:37:07 +0000 (17:37 +0300)]
net/mlx5: add Rx HW timestamp

Expose Rx HW timestamp to packet mbufs.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agoapp/testpmd: add Rx HW timestamp
Raslan Darawsheh [Tue, 10 Oct 2017 14:37:06 +0000 (17:37 +0300)]
app/testpmd: add Rx HW timestamp

Add enabling/disabling Rx HW timestamp from
command line and parameter.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agoethdev: add Rx HW timestamp capability
Raslan Darawsheh [Tue, 10 Oct 2017 14:37:05 +0000 (17:37 +0300)]
ethdev: add Rx HW timestamp capability

Add a new offload capability flag for Rx HW
timestamp and enabling/disabling this via rte_eth_rxmode.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix deadlock due to buffered slots in Rx SW ring
Yongseok Koh [Tue, 10 Oct 2017 14:04:02 +0000 (07:04 -0700)]
net/mlx5: fix deadlock due to buffered slots in Rx SW ring

When replenishing Rx ring, there're always buffered slots reserved
between consumed entries and HW owned entries. These have to be filled
with fake mbufs to protect from possible overflow rather than
optimistically expecting successful replenishment which can cause
deadlock with small-sized queue.

Fixes: fc048bd52cb7 ("net/mlx5: fix overflow of Rx SW ring")
Cc: stable@dpdk.org
Reported-by: Martin Weiser <martin.weiser@allegro-packets.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Tested-by: Martin Weiser <martin.weiser@allegro-packets.com>
7 years agonet/i40e: fix uninitialized variable
Yong Wang [Tue, 10 Oct 2017 11:24:20 +0000 (07:24 -0400)]
net/i40e: fix uninitialized variable

In func i40evf_dev_link_update(), "new_link.link_autoneg" is used in
func call i40evf_dev_atomic_write_link_status(), but is uninitialized.

Fixes: 2a73125b7041 ("i40evf: fix link info update")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/enic: remove ancillary assignment
Aaron Conole [Tue, 26 Sep 2017 18:53:29 +0000 (14:53 -0400)]
net/enic: remove ancillary assignment

The assignment at initialization is overwritten immediately.  Drop the
assignment.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: John Daley <johndale@cisco.com>
7 years agonet/enic: remove unused code
Aaron Conole [Tue, 26 Sep 2017 18:53:28 +0000 (14:53 -0400)]
net/enic: remove unused code

The functions here aren't called anywhere in code, at least according to
both the compiler, and some greps.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: John Daley <johndale@cisco.com>
7 years agonet/enic: fix assignment
Aaron Conole [Tue, 26 Sep 2017 18:53:27 +0000 (14:53 -0400)]
net/enic: fix assignment

As it stands, the existing assignment to mbuf has no effect outside of
the function.  Prior to this change, the mbuf argument would contain
an invalid address, but it would not be null.  After this change, the
caller gets a null mbuf back.

Fixes: 947d860c821f ("enic: improve Rx performance")
Cc: stable@dpdk.org
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: John Daley <johndale@cisco.com>
7 years agonet/enic: update format string to match arg types
Aaron Conole [Tue, 26 Sep 2017 18:53:26 +0000 (14:53 -0400)]
net/enic: update format string to match arg types

The argument `index` (and unique_id) is unsigned, but the format
string type used was for signed types.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: John Daley <johndale@cisco.com>
7 years agonet/bonding: strengthen the judgment of LACP packets
Ganghui Zeng [Wed, 30 Aug 2017 03:46:14 +0000 (11:46 +0800)]
net/bonding: strengthen the judgment of LACP packets

When the NIC does not support VLAN Rx offload may be wrong, resulting in
LACP packets will not be processed.

Signed-off-by: Ganghui Zeng <zengganghui@huawei.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agoapp/testpmd: add traffic management forwarding mode
Jasvinder Singh [Tue, 10 Oct 2017 10:18:18 +0000 (11:18 +0100)]
app/testpmd: add traffic management forwarding mode

This commit extends the testpmd application with new forwarding engine
that demonstrates the use of ethdev traffic management APIs and softnic
PMD for QoS traffic management.

In this mode, 5-level hierarchical tree of the QoS scheduler is built
with the help of ethdev TM APIs such as shaper profile add/delete,
shared shaper add/update, node add/delete, hierarchy commit, etc.
The hierarchical tree has following nodes; root node(x1, level 0),
subport node(x1, level 1), pipe node(x4096, level 2),
tc node(x16348, level 3), queue node(x65536, level 4).

During runtime, each received packet is first classified by mapping the
packet fields information to 5-tuples (HQoS subport, pipe, traffic class,
queue within traffic class, and color) and storing it in the packet mbuf
sched field. After classification, each packet is sent to softnic port
which prioritizes the transmission of the received packets, and
accordingly sends them on to the output interface.

To enable traffic management mode, following testpmd command is used;

$ ./testpmd -c c -n 4 --vdev
'net_softnic0,hard_name=0000:06:00.1,soft_tm=on' -- -i
--forward-mode=tm

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
7 years agonet/softnic: add TM hierarchy related ops
Jasvinder Singh [Tue, 10 Oct 2017 10:18:17 +0000 (11:18 +0100)]
net/softnic: add TM hierarchy related ops

Implement ethdev TM hierarchy related APIs in SoftNIC PMD.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
7 years agonet/softnic: add TM capabilities ops
Jasvinder Singh [Tue, 10 Oct 2017 10:18:16 +0000 (11:18 +0100)]
net/softnic: add TM capabilities ops

Implement ethdev TM capability APIs in SoftNIC PMD.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
7 years agonet/softnic: support traffic management
Jasvinder Singh [Tue, 10 Oct 2017 10:18:15 +0000 (11:18 +0100)]
net/softnic: support traffic management

Add ethdev Traffic Management API support to SoftNIC PMD.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
7 years agonet/softnic: add softnic PMD
Jasvinder Singh [Tue, 10 Oct 2017 10:18:14 +0000 (11:18 +0100)]
net/softnic: add softnic PMD

Add SoftNIC PMD to provide SW fall-back for ethdev APIs.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
7 years agoethdev: add return code to stats reset function
David Harton [Wed, 20 Sep 2017 14:11:30 +0000 (10:11 -0400)]
ethdev: add return code to stats reset function

Some devices do not support reset of eth stats.  An application may
need to know not to clear shadow stats if the device cannot.

rte_eth_stats_reset is updated to provide a return code to share
whether the device supports reset or not.

Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoethdev: increase device internal name length
Stephen Hemminger [Wed, 27 Sep 2017 09:23:20 +0000 (10:23 +0100)]
ethdev: increase device internal name length

Allow sufficient space for UUID in string form (36+1).
Needed to use UUID with Hyper-V.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoethdev: fix a comment for config struct
Tonghao Zhang [Tue, 19 Sep 2017 05:24:30 +0000 (22:24 -0700)]
ethdev: fix a comment for config struct

We have change the type of rx_adv_conf, so change the comment for it.

Fixes: 4bdefaade6d1 ("ethdev: VMDQ enhancements")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agodoc: add mrvl NIC guide
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:44 +0000 (17:00 +0200)]
doc: add mrvl NIC guide

Add documentation for the MRVL NET PMD driver.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support basic stats
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:42 +0000 (17:00 +0200)]
net/mrvl: support basic stats

Add support for both per queue and overall basic statistics.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support packet type parsing
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:41 +0000 (17:00 +0200)]
net/mrvl: support packet type parsing

Add packet type parsing support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support CRC and L3/L4 offloads
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:40 +0000 (17:00 +0200)]
net/mrvl: support CRC and L3/L4 offloads

Add support for crc offload and l3/l4 checksum offloads.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support VLAN filtering
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:39 +0000 (17:00 +0200)]
net/mrvl: support VLAN filtering

Add support for vlan filtering.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support RSS hashing
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:38 +0000 (17:00 +0200)]
net/mrvl: support RSS hashing

Add support for rss hashing on rx.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support MAC filtering
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:37 +0000 (17:00 +0200)]
net/mrvl: support MAC filtering

Add support for unicast and multicast mac filters.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support for promiscuous and allmulticast
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:36 +0000 (17:00 +0200)]
net/mrvl: support for promiscuous and allmulticast

Add support for promiscuous and allmulticast modes.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support jumbo frame
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:35 +0000 (17:00 +0200)]
net/mrvl: support jumbo frame

Add jumbo frame support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: support updating MTU
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:34 +0000 (17:00 +0200)]
net/mrvl: support updating MTU

Add support for updating mtu.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add link speed capabilities
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:33 +0000 (17:00 +0200)]
net/mrvl: add link speed capabilities

Return supported link speed capabilities via rte_dev_info_get().

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add link update
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:32 +0000 (17:00 +0200)]
net/mrvl: add link update

Add support for retrieving physical link information i.e:
speed, duplex and link status.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add Rx/Tx support
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:31 +0000 (17:00 +0200)]
net/mrvl: add Rx/Tx support

Add rx/tx support.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mrvl: add net PMD skeleton
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:30 +0000 (17:00 +0200)]
net/mrvl: add net PMD skeleton

Add mrvl net pmd driver skeleton providing base for the further
development. Besides the basic functionality QoS configuration is
introduced as well.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agomk: link the whole cfgfile library
Tomasz Duszynski [Mon, 9 Oct 2017 15:00:29 +0000 (17:00 +0200)]
mk: link the whole cfgfile library

MRVL net pmd needs rte_cfgfile to parse QoS configuration file thus
librte_pmd_mrvl.a contains undefined symbols from librte_cfgfile.a.

As a result linking applications under app/ directory will fail
because librte_cfgfile.a comes before librte_pmd_mrvl.a during
the linking stage.

Linking the whole librte_cfgfile.a solves the issue.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/mlx5: add vectorized Rx/Tx burst for ARM
Yongseok Koh [Mon, 9 Oct 2017 18:47:00 +0000 (11:47 -0700)]
net/mlx5: add vectorized Rx/Tx burst for ARM

Brings vectorization through NEON instructions.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: fix configuration of Rx CQE compression
Yongseok Koh [Mon, 9 Oct 2017 18:46:59 +0000 (11:46 -0700)]
net/mlx5: fix configuration of Rx CQE compression

With the upstream rdma-core, to enable Rx CQE compression,
mlx5dv_create_cq() in Direct Verbs has to be used instead of regular
Verbs call (ibv_create_cq()). And if the size of CQE is 128 bytes,
compression is supported only by certain devices. Thus, it has to be
decided by checking the capability bits.

Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: match Rx completion entry size to cacheline
Yongseok Koh [Mon, 9 Oct 2017 18:46:58 +0000 (11:46 -0700)]
net/mlx5: match Rx completion entry size to cacheline

The size of Rx completion entry should match the size of a cacheline.
This is already reflected in struct mlx5_cqe by adding 64bytes padding
if a cacheline is 128bytes. Some ARM CPUs have 128bytes cacheline.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: separate shareable vector functions
Yongseok Koh [Mon, 9 Oct 2017 18:46:57 +0000 (11:46 -0700)]
net/mlx5: separate shareable vector functions

Considering more architecture (e.g. ARM and PowerPC) will be added for
vectorized Rx/Tx burst, all the shareable functions which don't use any
vector intrinsics need to be separated from architecture-dependent
functions. All the vector functions for x86 SSE are moved to a new
header file - mlx5_rxtx_vec_sse.h. And shareable common functions are
now in mlx5_rxtx_vec.c.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: use static assert for compile-time sanity checks
Yongseok Koh [Mon, 9 Oct 2017 18:46:56 +0000 (11:46 -0700)]
net/mlx5: use static assert for compile-time sanity checks

Replace compile-time sanity check with static_assert() as c11 standard
has been set. Add mlx5_rxtx_vec.h and move the sanity checks to the file

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: rename a file of SSE Rx/Tx
Yongseok Koh [Mon, 9 Oct 2017 18:46:55 +0000 (11:46 -0700)]
net/mlx5: rename a file of SSE Rx/Tx

Rename mlx5_rxtx_vec_sse.c to mlx5_rxtx_vec.c to separate shareable
vector functions.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: cleanup memory barriers
Yongseok Koh [Mon, 9 Oct 2017 18:46:54 +0000 (11:46 -0700)]
net/mlx5: cleanup memory barriers

Updating a consumer index to HW doesn't require a memory barrier in case
that there's no updated data to be posted to HW, but a compiler barrier
is sufficient. rte_wmb() is replaced with rte_io_wmb() when it makes
changes visible to HW, not other core.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: add new operations for isolated mode
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:06 +0000 (16:45 +0200)]
net/mlx5: add new operations for isolated mode

Isolated works exclusively with the generic flow API, this patch adds a
new set of operations valid in this mode.

 - promiscuous*()
 - allmulticast*()
 - reta*()
 - rss*()

are not supported in this mode as it is fully supported by generic flow
API.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: support flow director
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:05 +0000 (16:45 +0200)]
net/mlx5: support flow director

Support same functionalities as in
commit cf521eaa3c76 ("net/mlx5: remove flow director support")

This implementation is done on top of the generic flow API.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: handle RSS hash configuration in RSS flow
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:04 +0000 (16:45 +0200)]
net/mlx5: handle RSS hash configuration in RSS flow

Add RSS support according to the RSS configuration.

A special case is handled, when the pattern does not cover the RSS hash
configuration request such as:

flow create 0 ingress pattern eth / end actions rss queues 0 1 end / end

In such situation with the default configuration of testpmd RSS i.e. IP,
it should be converted to 3 Verbs flow to handle correctly the request:

 1. IPv4 flow, an extra IPv4 wildcard specification needs to be added in
    the conversion.
 2. IPv6 flow, same as for IPv4.
 3. Ethernet followed by any other protocol on which no RSS can be
    performed and thus the traffic will be redirected to the first queue
    of the user request.

The same kind of issue is handled if the RSS is performed only on UDPv4
or UDPv6 or TCPv*.

This does not handle a priority conflict which can occurs if the user
adds several colliding flow rules.  Currently in the example above, the
request is already consuming 2 priorities (1 for IPv4/IPV6 matching
rule priority and one for Ethernet matching rule priority + 1).

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: move verbs flows and attributes
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:03 +0000 (16:45 +0200)]
net/mlx5: move verbs flows and attributes

Moves ibv_attr containing the specification of the flow from Verbs point
of view also with the verbs flow itself near the related verbs objects
making the flow.

This is also a preparation to handle correctly the RSS hash
configuration provided by the user, has multiple Verbs flows will be
necessary for a single generic flow.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: reorganise functions in the file
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:02 +0000 (16:45 +0200)]
net/mlx5: reorganise functions in the file

Move mlx5_flow_validate/create/flush/isolate() to the end of the file.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use a better name for the flow parser
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:01 +0000 (16:45 +0200)]
net/mlx5: use a better name for the flow parser

struct mlx5_flow_parse was commonly used with the name "flow" confusing
sometimes the development.  The variable name is replaced by parser to
reflect its use.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: merge internal parser and actions structures
Nélio Laranjeiro [Mon, 9 Oct 2017 14:45:00 +0000 (16:45 +0200)]
net/mlx5: merge internal parser and actions structures

struct mlx5_flow_parse now embed fields from struct mlx5_flow_action.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: process flows actions before of items
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:59 +0000 (16:44 +0200)]
net/mlx5: process flows actions before of items

In case the pattern contains an RSS actions, the RSS configuration to
use is the one provided by the user.  To make the correct conversion
from DPDK RSS hash fields to Verbs ones according to the users requests
the actions must be processed first.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fully convert a flow to verbs in validate
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:58 +0000 (16:44 +0200)]
net/mlx5: fully convert a flow to verbs in validate

Validation of flows is only making few verifications on the pattern, in
some situation the validate action could end by with success whereas the
pattern could not be converted correctly.

This brings this conversion verification part also to the validate.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: remove hash Rx queues support
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:57 +0000 (16:44 +0200)]
net/mlx5: remove hash Rx queues support

From this commit the RSS support becomes un-available until it is
replaced by the generic flow implementation.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: handle a single RSS hash key for all protocols
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:56 +0000 (16:44 +0200)]
net/mlx5: handle a single RSS hash key for all protocols

Since RSS configuration can also be used by flow API, there is no more
necessity to keep a list of RSS configurable for each protocol.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use flow to enable unicast traffic
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:55 +0000 (16:44 +0200)]
net/mlx5: use flow to enable unicast traffic

RSS hash configuration is currently ignored by the PMD, this commits
removes the RSS feature.

This functionality will be added in a later commit.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use flow to enable all multi mode
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:54 +0000 (16:44 +0200)]
net/mlx5: use flow to enable all multi mode

RSS hash configuration is currently ignored by the PMD, this commits
removes the RSS feature on promiscuous mode.

This functionality will be added in a later commit.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: use flow to enable promiscuous mode
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:53 +0000 (16:44 +0200)]
net/mlx5: use flow to enable promiscuous mode

RSS hash configuration is currently ignored by the PMD, this commits
removes the RSS feature on promiscuous mode.

This functionality will be added in a later commit.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix clang compilation error
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:52 +0000 (16:44 +0200)]
net/mlx5: fix clang compilation error

drivers/net/mlx5/mlx5_rxq.c:606:6: error: comparison of constant 4
      with expression of type 'enum hash_rxq_flow_type' is always true
      [-Werror,-Wtautological-constant-out-of-range-compare]
i != (int)RTE_DIM((*priv->hash_rxqs)[0].special_flow);
~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Clang expects to have an index going upto special_flow size which is
defined by MLX5_MAX_SPECIAL_FLOWS and value is 4.  Comparing to an
unrelated enum where index my be lower cause this compilation issue.

Fixes: 36351ea34b92 ("net/mlx: fix build with icc")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add hash Rx queue object
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:51 +0000 (16:44 +0200)]
net/mlx5: add hash Rx queue object

Hash Rx queue is an high level queue providing the RSS hash algorithm,
key and indirection table to spread the packets.  Those objects can be
easily shared between several Verbs flows.  This commit bring this
capability to the PMD.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: make indirection tables shareable
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:50 +0000 (16:44 +0200)]
net/mlx5: make indirection tables shareable

Indirection table in verbs side resides in a list of final work queues
to spread the packets according to an higher level queue.  This
indirection table can be shared among the hash Rx queues which points
to them.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add reference counter on DPDK Rx queues
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:49 +0000 (16:44 +0200)]
net/mlx5: add reference counter on DPDK Rx queues

Use the same design for DPDK queue as for Verbs queue for symmetry, this
also helps in fixing some issues like the DPDK release queue API which
is not expected to fail.  With such design, the queue is released when
the reference counters reaches 0.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add reference counter on DPDK Tx queues
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:48 +0000 (16:44 +0200)]
net/mlx5: add reference counter on DPDK Tx queues

Use the same design for DPDK queue as for Verbs queue for symmetry, this
also helps in fixing some issues like the DPDK release queue API which
is not expected to fail.  With such design, the queue is released when
the reference counters reaches 0.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: separate DPDK from verbs Tx queue objects
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:47 +0000 (16:44 +0200)]
net/mlx5: separate DPDK from verbs Tx queue objects

Move verbs object to their own functions to allocate/release them
independently from the DPDK queue.  At the same time a reference counter
is added to help in issues detections when the queue is being release
but still in use somewhere else (flows for instance).

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: separate DPDK from verbs Rx queue objects
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:46 +0000 (16:44 +0200)]
net/mlx5: separate DPDK from verbs Rx queue objects

Move verbs object to their own functions to allocate/release them
independently from the DPDK queue.  At the same time a reference counter
is added to help in issues detections when the queue is being release
but still in use somewhere else (flows for instance).

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: add reference counter on memory region
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:45 +0000 (16:44 +0200)]
net/mlx5: add reference counter on memory region

This patch introduce the Memory region as a shared object where users
should get a reference to it by calling the priv_mr_get() or
priv_mr_new() to create the memory region.  This last one will
register the memory pool in the kernel driver and retrieve the
associated memory region.

This should help to reduce the memory consumption cause by registering
multiple times the same memory pool.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix SSE Rx support verification
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:44 +0000 (16:44 +0200)]
net/mlx5: fix SSE Rx support verification

The number of queues in DPDK does not means that the array of queue will be
totally filled, those information are uncorrelated.  The number of queues
is provided in the port configuration whereas the array is filled by
calling tx/rx_queue_setup().  As this number of queue is not increased or
decrease according to tx/rx_queue_setup() or tx/rx_queue_release(), PMD
must consider a queue may not be initialised in some position of the array.

Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix crash during RETA update
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:43 +0000 (16:44 +0200)]
net/mlx5: fix crash during RETA update

Reta update needs to stop/start the port but stopping the port does not
disable the polling functions which may end in a segfault if a core is
polling the queue while the control thread is modifying it.

This patch changes the sequences to an order where such situation cannot
happen.

Fixes: aa13338faf5e ("net/mlx5: rebuild flows on updating RETA")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: verify all flows are been removed on close
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:42 +0000 (16:44 +0200)]
net/mlx5: verify all flows are been removed on close

Debug tools to verify all flows are be un-register from the NIC.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: remove redundant started flag
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:41 +0000 (16:44 +0200)]
net/mlx5: remove redundant started flag

This flag is already present in the Ethernet device.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: prefix Tx structures and functions
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:40 +0000 (16:44 +0200)]
net/mlx5: prefix Tx structures and functions

Prefix struct txq_ctrl and associated function with mlx5.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: prefix Rx structures and functions
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:39 +0000 (16:44 +0200)]
net/mlx5: prefix Rx structures and functions

Prefix struct rxq_ctrl and associated functions with mlx5.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: remove flow director support
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:38 +0000 (16:44 +0200)]
net/mlx5: remove flow director support

Generic flow API should be use for flow steering as is provides a better
and easier way to configure flows.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: merge action and flow parser structure
Nélio Laranjeiro [Mon, 9 Oct 2017 14:44:37 +0000 (16:44 +0200)]
net/mlx5: merge action and flow parser structure

mlx5_flow_create() and mlx5_flow_validate() are making common checks.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>