dpdk.git
5 years agoapp/testpmd: support symmetric Toeplitz hash
Simei Su [Tue, 1 Oct 2019 09:22:13 +0000 (17:22 +0800)]
app/testpmd: support symmetric Toeplitz hash

This patch adds command line support for Symmetric Toeplitz
hash configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
5 years agoethdev: add symmetric Toeplitz hash
Simei Su [Tue, 1 Oct 2019 09:22:12 +0000 (17:22 +0800)]
ethdev: add symmetric Toeplitz hash

Currently, there are DEFAULT,TOEPLITZ and SIMPLE_XOR hash function.
To support symmetric hash by rte_flow RSS action, this patch adds
new hash function "Symmetric Toeplitz" which is supported by some hardware.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: add PPPoE to flow API
Ying A Wang [Wed, 28 Aug 2019 06:00:38 +0000 (14:00 +0800)]
ethdev: add PPPoE to flow API

- RTE_FLOW_ITEM_TYPE_PPPOES: matches a PPPoE session header.

- RTE_FLOW_ITEM_TYPE_PPPOED: matches a PPPoE discovery header.

- RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID: matches a PPPoE session
  protocol identifier.

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoethdev: add GTP extension header to flow API
Ying A Wang [Wed, 28 Aug 2019 06:00:37 +0000 (14:00 +0800)]
ethdev: add GTP extension header to flow API

- RTE_FLOW_ITEM_TYPE_GTP_PSC: matches a GTP
- RTE_FLOW_ITEM_TYPE_GTP_PSC: matches a GTP
  PDU extension header (PDU session container).

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/iavf: use dynamic log type for Tx/Rx debug
Stephen Hemminger [Tue, 16 Jul 2019 15:40:13 +0000 (08:40 -0700)]
net/iavf: use dynamic log type for Tx/Rx debug

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/i40e: use dynamic log type for Tx/Rx debug
Stephen Hemminger [Tue, 16 Jul 2019 15:40:12 +0000 (08:40 -0700)]
net/i40e: use dynamic log type for Tx/Rx debug

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: use dynamic log type for Tx/Rx debug
Stephen Hemminger [Tue, 16 Jul 2019 15:40:11 +0000 (08:40 -0700)]
net/ice: use dynamic log type for Tx/Rx debug

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ixgbe: use dynamic log type for Tx/Rx debug
Stephen Hemminger [Tue, 16 Jul 2019 15:40:10 +0000 (08:40 -0700)]
net/ixgbe: use dynamic log type for Tx/Rx debug

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/fm10k: use dynamic log type for Tx/Rx debug
Stephen Hemminger [Tue, 16 Jul 2019 15:40:09 +0000 (08:40 -0700)]
net/fm10k: use dynamic log type for Tx/Rx debug

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver must dynamic log types.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/e1000: use dynamic log type for Tx/Rx debug
Stephen Hemminger [Tue, 16 Jul 2019 15:40:08 +0000 (08:40 -0700)]
net/e1000: use dynamic log type for Tx/Rx debug

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Every driver should register the logtypes
for itself.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix OOB access in other aggregator modes
Hui Zhao [Thu, 21 Mar 2019 20:28:14 +0000 (21:28 +0100)]
net/bonding: fix OOB access in other aggregator modes

slave aggregator_port_id is in [0, RTE_MAX_ETHPORTS-1] range.
If RTE_MAX_ETHPORTS is > 8, we can hit out of bound accesses on
agg_bandwidth[] and agg_count[] arrays.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: stable@dpdk.org
Signed-off-by: Hui Zhao <zhaohui8@huawei.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Chas Williams <chas3@att.com>
5 years agonet/bonding: fix slave id types
Hui Zhao [Thu, 21 Mar 2019 20:28:13 +0000 (21:28 +0100)]
net/bonding: fix slave id types

mode_bond_id and mode_band_id are slave ids, stored on 16bits.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: Hui Zhao <zhaohui8@huawei.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/i40e: set speed to undefined for default case
Laurent Hardy [Wed, 11 Sep 2019 16:02:51 +0000 (18:02 +0200)]
net/i40e: set speed to undefined for default case

During PF/VF link update, a default speed value of 100M will be set
if get_link_info has failed or speed is unknown.

Consequently if PF is put in no-carrier state, VFs will switch to
"in carrier" state due to a link up + a link speed set to 100M
(default value if no speed detected).

To be consistent with linux drivers on which PF and VFs are in
same carrier state, sets default speed to undefined (instead of 100M)
and updates a link status of VF only if link is up and speed is
different from undefined.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe: fix X553 speed capability
Xiao Zhang [Wed, 25 Sep 2019 02:49:54 +0000 (10:49 +0800)]
net/ixgbe: fix X553 speed capability

The speed capability of X553 1GbE should be ETH_LINK_SPEED_1G |
ETH_LINK_SPEED_100M | ETH_LINK_SPEED_10M rather than ETH_LINK_SPEED_1G |
ETH_LINK_SPEED_10G. Correct it to fix the issue.

Fixes: e274f5732225 ("ethdev: add speed capabilities")
Cc: stable@dpdk.org
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agonet/cxgbe: support setting VLAN PCP via flow API
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:12 +0000 (02:00 +0530)]
net/cxgbe: support setting VLAN PCP via flow API

Add support for setting VLAN PCP field via rte_flow API. Hardware
overwrites the entire 16-bit VLAN TCI field. So, both VLAN VID and
PCP actions must be specified.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: support matching VLAN via flow API
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:11 +0000 (02:00 +0530)]
net/cxgbe: support matching VLAN via flow API

Add support for matching VLAN fields via rte_flow API.

When matching VLAN pattern, the ethertype field in hardware
filter specification must contain VLAN header's ethertype, and
not Ethernet header's ethertype. The hardware automatically
searches for ethertype 0x8100 in Ethernet header, when
parsing incoming packet against VLAN pattern.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fetch max Tx coalesce limit from firmware
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:10 +0000 (02:00 +0530)]
net/cxgbe: fetch max Tx coalesce limit from firmware

Query firmware for max number of packets that can be coalesced by
Tx.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: add devarg to control Tx coalescing
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:09 +0000 (02:00 +0530)]
net/cxgbe: add devarg to control Tx coalescing

Remove compile time option to control Tx coalescing Latency vs
Throughput behavior. Add tx_mode_latency devarg instead, to
dynamically control Tx coalescing behavior.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: separate VF only devargs
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:08 +0000 (02:00 +0530)]
net/cxgbe: separate VF only devargs

Rework devargs parsing logic to separate VF only args.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: use dynamic logging for debug prints
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:07 +0000 (02:00 +0530)]
net/cxgbe: use dynamic logging for debug prints

Remove compile time flags and use dynamic logging for debug prints.
Also remove rarely used debug logs in register access and datapath.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: avoid polling link status before device start
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:06 +0000 (02:00 +0530)]
net/cxgbe: avoid polling link status before device start

Link updates come in firmware event queue, which is only created
when device starts. So, don't poll for link status if firmware
event queue is not yet created.

This fixes NULL dereference when accessing non existent firmware
event queue.

Fixes: 265af08e75ba ("net/cxgbe: add link up and down ops")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix prefetch for non-coalesced Tx packets
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:05 +0000 (02:00 +0530)]
net/cxgbe: fix prefetch for non-coalesced Tx packets

Move prefetch code out of Tx coalesce path to allow prefetching for
non-coalesced Tx packets, as well.

Fixes: bf89cbedd2d9 ("cxgbe: optimize forwarding performance for 40G")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix parsing VLAN ID rewrite action
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:04 +0000 (02:00 +0530)]
net/cxgbe: fix parsing VLAN ID rewrite action

Set VLAN action mode to VLAN_REWRITE only if VLAN_INSERT has not been
set yet. Otherwise, the resulting VLAN packets will have their VLAN
header rewritten, instead of pushing a new outer VLAN header.

Also fix the VLAN ID extraction logic and endianness issues.

Fixes: 1decc62b1cbe ("net/cxgbe: add flow operations to offload VLAN actions")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix slot allocation for IPv6 flows
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:03 +0000 (02:00 +0530)]
net/cxgbe: fix slot allocation for IPv6 flows

IPv6 flows occupy only 2 slots on Chelsio T6 NICs. Fix the slot
calculation logic to return correct number of slots.

Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows")
Fixes: 9eb2c9a48072 ("net/cxgbe: implement flow create operation")
Fixes: 3f2c1e209cfc ("net/cxgbe: add Compressed Local IP region")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix null access when allocating CLIP entry
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:02 +0000 (02:00 +0530)]
net/cxgbe: fix null access when allocating CLIP entry

Pass correct arguments to CLIP allocation code to avoid NULL pointer
dereference.

Fixes: 3f2c1e209cfc ("net/cxgbe: add Compressed Local IP region")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: add prefix to global functions
Rahul Lakkireddy [Fri, 27 Sep 2019 20:30:01 +0000 (02:00 +0530)]
net/cxgbe: add prefix to global functions

To avoid name collisions, add cxgbe_ prefix to some global functions.
Also, make some local functions static in cxgbe_filter.c.

Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows")
Fixes: 9eb2c9a48072 ("net/cxgbe: implement flow create operation")
Fixes: 3a381a4116ed ("net/cxgbe: query firmware for HASH filter resources")
Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region")
Fixes: 41dc98b0827a ("net/cxgbe: support to delete flows in HASH region")
Fixes: 23af667f1507 ("net/cxgbe: add API to program hardware layer 2 table")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/mlx5: fix ConnectX-6 VF type recognition
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:31:53 +0000 (07:31 +0000)]
net/mlx5: fix ConnectX-6 VF type recognition

The PCI virtual function type was not recognized correctly
for ConnectX-6 VF.

Fixes: f0354d842344 ("net/mlx5: add ConnectX-6 device IDs")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: fix BlueField VF type recognition
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:31:18 +0000 (07:31 +0000)]
net/mlx5: fix BlueField VF type recognition

The PCI virtual function type was not recognized correctly
for BlueField VF.

Fixes: f38c54571d62 ("net/mlx5: split PCI from generic probing")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: fix vectorized Rx burst error handling
Dekel Peled [Sun, 22 Sep 2019 07:47:13 +0000 (10:47 +0300)]
net/mlx5: fix vectorized Rx burst error handling

In the process of recovery from error CQE, when using vectorized Rx
burst, the initialization of data length in mbufs was not done.
As a result the wrong length was left written in mbuf, causing
memory overwrite or wrong error report.

This patch fixes the initialization of mbuf data length during
recovery from error CQE, when using vectorized Rx burst,

Fixes: 88c0733535d6 ("net/mlx5: extend Rx completion with error handling")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: fix UAR remap initialization for 32-bit systems
Viacheslav Ovsiienko [Wed, 18 Sep 2019 06:54:11 +0000 (06:54 +0000)]
net/mlx5: fix UAR remap initialization for 32-bit systems

The txq_uar_init() routine uses the uninitialized uar_mmap_offset
field in 32-bit configurations due to this field is initialized
after txq_uar_init() call.

Fixes: 120dc4a7dcd3 ("net/mlx5: remove device register remap")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/vhost: support TSO disabling
Noa Ezra [Wed, 19 Jun 2019 06:13:44 +0000 (06:13 +0000)]
net/vhost: support TSO disabling

TSO (TCP Segmentation Offload) is enabled by default on vhost.
Add the ability to disable TSO on vhost.
The user should also disable the feature on the virtual machine's xml.

Signed-off-by: Noa Ezra <noae@mellanox.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Matan Azrad <matan@mellanox.com>
5 years agomaintainers: update for ena
Michal Krawczyk [Thu, 26 Sep 2019 10:45:27 +0000 (12:45 +0200)]
maintainers: update for ena

Add Igor Chauskin from the Amazon as another maintainer of the driver.
Igor is another person from the Amazon team that is responsible for the
ENA DPDK driver.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
5 years agodoc: clarify MAC/VLAN filtering in virtio guide
Tiwei Bie [Wed, 18 Sep 2019 05:00:50 +0000 (13:00 +0800)]
doc: clarify MAC/VLAN filtering in virtio guide

Explicitly document that the MAC/VLAN filtering in virtio
is best effort to help users understand why unwanted packets
could still arrive.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix mbuf data and packet length mismatch
Marvin Liu [Mon, 23 Sep 2019 14:05:11 +0000 (22:05 +0800)]
net/virtio: fix mbuf data and packet length mismatch

If reserve virtio header room by function rte_pktmbuf_prepend, both
segment data length and packet length of mbuf will be increased.
Data length will be equal to descriptor length, while packet length
should be decreased as virtio-net header won't be taken into packet.
Thus will cause mismatch in mbuf structure. Fix this issue by access
mbuf data directly and increase descriptor length if it is needed.

Fixes: 58169a9c8153 ("net/virtio: support Tx checksum offload")
Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Fixes: 4905ed3a523f ("net/virtio: optimize Tx enqueue for packed ring")
Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: get all pending Rx packets in vectorized paths
Thibaut Collet [Wed, 11 Sep 2019 16:04:09 +0000 (18:04 +0200)]
net/virtio: get all pending Rx packets in vectorized paths

The loop to read packets does not take all packets as the number of
available packets (nb_used) is decremented in the loop.
Take all available packets provides a performance improvement of 3%.

Fixes: fc3d66212fed ("virtio: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix Rx stats with vectorized functions
Thibaut Collet [Wed, 11 Sep 2019 16:04:08 +0000 (18:04 +0200)]
net/virtio: fix Rx stats with vectorized functions

With vectorized functions, only the rx stats for number of packets is
incremented.
Update also the other statistics.
Performance impact is about 2%

Fixes: fc3d66212fed ("virtio: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix vring memory partially mapped
Adrian Moreno [Fri, 6 Sep 2019 12:50:20 +0000 (14:50 +0200)]
vhost: fix vring memory partially mapped

Only the mapping of the vring addresses is being ensured. This causes
errors when the vring size is larger than the IOTLB page size. E.g:
queue sizes > 256 for 4K IOTLB pages

Ensure the entire vring memory range gets mapped. Refactor duplicated
code for for IOTLB UPDATE and IOTLB INVALIDATE and add packed virtqueue
support.

Fixes: 09927b524969 ("vhost: translate ring addresses when IOMMU enabled")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: cleanup on demand when in-order Tx
Marvin Liu [Wed, 18 Sep 2019 17:06:55 +0000 (01:06 +0800)]
net/virtio: cleanup on demand when in-order Tx

Check whether space are enough before burst enqueue operation. If more
space is needed, will try to clean up used descriptors for space on
demand. It can give more chances to free used descriptors, thus will
help RFC2544 performance. Also deduct failed xmit packets from total
xmit number.

Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: update stats when in-order Tx done
Marvin Liu [Wed, 18 Sep 2019 17:06:54 +0000 (01:06 +0800)]
net/virtio: update stats when in-order Tx done

When doing xmit in-order enqueue, packets are buffered and then flushed
into avail ring. Buffered packets can be dropped due to insufficient
space. Moving stats update action just after successful avail ring
updates can guarantee correctness.

Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/vhost: fix redundant queue state event
Noa Ezra [Thu, 20 Jun 2019 06:33:03 +0000 (06:33 +0000)]
net/vhost: fix redundant queue state event

In some situations, when a virtual machine is starting,
vring_state_changed can be called while there was no change in the
queue state. This fix makes sure that there was really a change in the
queue state before calling the callback for EVENT_QUEUE_STATE.

Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
Cc: stable@dpdk.org
Signed-off-by: Noa Ezra <noae@mellanox.com>
Reviewed-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: protect vring access done by application
Tiwei Bie [Mon, 19 Aug 2019 11:34:57 +0000 (19:34 +0800)]
vhost: protect vring access done by application

Besides the enqueue/dequeue API, other APIs of the builtin net
backend should also be protected.

Fixes: a3688046995f ("vhost: protect active rings from async ring changes")
Cc: stable@dpdk.org
Reported-by: Peng He <xnhp0320@icloud.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix vring address handling during live migration
Tiwei Bie [Mon, 19 Aug 2019 11:34:56 +0000 (19:34 +0800)]
vhost: fix vring address handling during live migration

When live migration starts, QEMU will set ring addrs again for
each virtqueue. In this case, we should try to translate ring
addrs after we invalidating the ring, otherwise virtqueues can
be enabled with the addrs untranslated. Besides, also leverage
the access_ok flag in non-IOMMU case to prevent the data path
accessing invalidated virtqueues.

Fixes: 5a4933e56be4 ("vhost: postpone ring address translations at kick time only")
Cc: stable@dpdk.org
Reported-by: Yilong Lv <lvyilong.lyl@alibaba-inc.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: forbid reallocation when running
Tiwei Bie [Mon, 19 Aug 2019 11:34:55 +0000 (19:34 +0800)]
vhost: forbid reallocation when running

When the device has been started, don't do the reallocation anymore.
Otherwise the pointers used in application threads can be invalidated
without proper protection. Instead of introducing a global lock to
protect the change of device pointers which will hurt the performance,
let's just do the reallocation during setup.

Fixes: af295ad4698c ("vhost: realloc device and queues to same numa node as vring desc")
Cc: stable@dpdk.org
Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: add missing experimental flag
Jim Harris [Tue, 24 Sep 2019 09:23:34 +0000 (02:23 -0700)]
vhost: add missing experimental flag

This function is listed under EXPERIMENTAL in the
rte_vhost_version.map, so it needs to be marked
with __rte_experimental in the header file as well.

Found by check-experimental-syms.sh when trying to compile
DPDK with -finstrument-functions.  This script didn't
catch this in the normal case, since the function is
declared __rte_always_inline.

This also requires updating the vhost_scsi example to allow
use of this newly marked experimental API.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/ixgbe: release port upon close
Chenxu Di [Fri, 27 Sep 2019 09:09:48 +0000 (09:09 +0000)]
net/ixgbe: release port upon close

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
 for the port can be freed by rte_eth_dev_close().

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice: release port upon close
Chenxu Di [Fri, 27 Sep 2019 09:09:47 +0000 (09:09 +0000)]
net/ice: release port upon close

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
 for the port can be freed by rte_eth_dev_close().

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/i40e: release port upon close
Chenxu Di [Fri, 27 Sep 2019 09:09:46 +0000 (09:09 +0000)]
net/i40e: release port upon close

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
 for the port can be freed by rte_eth_dev_close().

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/fm10k: release port upon close
Chenxu Di [Fri, 27 Sep 2019 09:09:45 +0000 (09:09 +0000)]
net/fm10k: release port upon close

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
 for the port can be freed by rte_eth_dev_close().

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/e1000: release port upon close
Chenxu Di [Fri, 27 Sep 2019 09:09:44 +0000 (09:09 +0000)]
net/e1000: release port upon close

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
 for the port can be freed by rte_eth_dev_close().

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/hns3: support multiple process
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:08 +0000 (22:02 +0800)]
net/hns3: support multiple process

This patch adds multiple process support for hns3 PMD driver.
Multi-process support selection queue by configuring RSS or
flow director. The primary process supports various management
ops, and the secondary process only supports queries ops.
The primary process notifies the secondary processes to start
or stop tranceiver.

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Wang (Jushui) <wangmin3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support device reset
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:07 +0000 (22:02 +0800)]
net/hns3: support device reset

This patch adds reset related process for hns3 PMD driver.
The following three scenarios will trigger the reset process,
and the driver settings will be restored after the reset is
successful:
1. Receive a reset interrupt
2. PF receives a hardware error interrupt
3. VF is notified by PF to reset

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support device stats
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:06 +0000 (22:02 +0800)]
net/hns3: support device stats

This patch adds stats_get, stats_reset, xstats_get, xstats_get_names
xstats_reset, xstats_get_by_id and xstats_get_names_by_id related
function codes.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: add abnormal interrupt process
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:05 +0000 (22:02 +0800)]
net/hns3: add abnormal interrupt process

This patch adds abnormal interrupt process for hns3 PMD driver,
the interrupt reported by NIC hardware.

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support dump register
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:04 +0000 (22:02 +0800)]
net/hns3: support dump register

This patch adds get_reg related function codes for hns3 PMD driver.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: add start/stop and configure operations
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:03 +0000 (22:02 +0800)]
net/hns3: add start/stop and configure operations

This patch adds dev_start, dev_stop, dev_configure, promiscuous_enable,
promiscuous_disable, allmulticast_enable, allmulticast_disable,
dev_infos_get related function codes.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support Rx/Tx and related operations
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:02 +0000 (22:02 +0800)]
net/hns3: support Rx/Tx and related operations

This patch adds queue related operation, package sending and
receiving function codes.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Wang (Jushui) <wangmin3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support VF
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:01 +0000 (22:02 +0800)]
net/hns3: support VF

This patch adds support for hns3 VF PMD driver.

In current version, we only support VF device is bound to vfio_pci or
igb_uio and then driven by DPDK driver when PF is driven by kernel mode
hns3 ethdev driver, VF is not supported when PF is driven by DPDK
driver.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@hisilicon.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support mailbox
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:02:00 +0000 (22:02 +0800)]
net/hns3: support mailbox

This patch adds support for mailbox of hns3 PMD driver, mailbox is
used for communication between PF and VF driver.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support VLAN
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:59 +0000 (22:01 +0800)]
net/hns3: support VLAN

This patch adds support for vlan related operation of hns3 PMD driver.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support flow control
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:58 +0000 (22:01 +0800)]
net/hns3: support flow control

This patch adds support for MAC PAUSE flow control and priority flow
control(PFC).

MAC PAUSE flow control features:
All user priorities(up) are mapped to tc0. It supports settings of flow
mode and pause time.

DCB features:
Up can be mapped to other tc driver permits according to business
requirement. We can config DCB information and enable PFC by
rte_eth_dev_configure interface. Besides, enabling flow control of a
priority is supported by rte_eth_dev_priority_flow_ctrl_set interface.
we can also set flow mode and pause time by
rte_eth_dev_priority_flow_ctrl_set. we do not support manual setting of
ETS, but driver equally distributes bandwidth for each tc according to
number of used tc.

In addition, flow control function by default is turned off to ensure
that app startup state is the same each time.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support RSS
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:57 +0000 (22:01 +0800)]
net/hns3: support RSS

This patch adds support for RSS of hns3 PMD driver. It included the
follow functions:
In file hns3_rss.c:
1) Set/query hash key, rss_hf by .rss_hash_update/.rss_hash_conf_get ops
   callback functions.
2) Set/query redirection table by .reta_update/.reta_query. ops callback
   functions.
3) Set/query hash algorithm by .filter_ctrl ops callback function when
   the 'filter_type' is RTE_ETH_FILTER_HASH.

In file hns3_flow.c:
1) Set hash key, rss_hf, redirection table and algorithm by .create ops
   callback function.
2) Disable RSS by .destroy or .flush ops callback function.
3) Check the effectiveness of the RSS's configuration by .validate ops
   callback function.

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support flow director
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:56 +0000 (22:01 +0800)]
net/hns3: support flow director

This patch adds support for rte_flow_ops operation and flow
director of hns3 PMD driver.
Flow director feature is only supported in hns3 PF driver.
It supports the network L2\L3\L4 and tunnel packet creation,
deletion, flushing, and querying hit statistics.

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support link update operation
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:55 +0000 (22:01 +0800)]
net/hns3: support link update operation

This patch adds link_update operation to hns3 PMD driver.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support some device operations
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:54 +0000 (22:01 +0800)]
net/hns3: support some device operations

This patch adds the following operations defined in struct eth_dev_ops:
mtu_set, infos_get and fw_version_get for hns3 PMD driver.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support MAC address related operations
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:53 +0000 (22:01 +0800)]
net/hns3: support MAC address related operations

This patch adds the following mac address related operations defined in
struct eth_dev_ops: mac_addr_add, mac_addr_remove, mac_addr_set
and set_mc_addr_list.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: add initialization
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:52 +0000 (22:01 +0800)]
net/hns3: add initialization

This patch adds the initialization of hns3 PF PMD driver. It gets
configuration from IMP such as queue information, configures queue,
inits mac, inits manage table, disables gro etc.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: support command interface with firmware
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:51 +0000 (22:01 +0800)]
net/hns3: support command interface with firmware

This patch adds support for cmd of hns3 PMD driver, driver can interact
with firmware through command to complete hardware configuration.

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: register and add log interface
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:50 +0000 (22:01 +0800)]
net/hns3: register and add log interface

This patch registers hns3 PMD driver and adds the definition for log
interfaces.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: add some definitions for data structure and macro
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:49 +0000 (22:01 +0800)]
net/hns3: add some definitions for data structure and macro

This patch adds some data structure definitions, macro definitions and
inline functions for hns3 PMD drivers.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: add hardware registers definition
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:48 +0000 (22:01 +0800)]
net/hns3: add hardware registers definition

This patch adds hardware definition header file for hns3 PMD driver.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/hns3: add build and doc infrastructure
Wei Hu (Xavier) [Thu, 26 Sep 2019 14:01:47 +0000 (22:01 +0800)]
net/hns3: add build and doc infrastructure

This patch adds build and doc infrastructure for hns3 PMD driver.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ena: change license clause to SPDX tags
Maciej Bielski [Fri, 27 Sep 2019 11:41:45 +0000 (13:41 +0200)]
net/ena: change license clause to SPDX tags

Signed-off-by: Maciej Bielski <mba@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
5 years agoapp/testpmd: fix build for 16-byte Rx descriptor mode
Tao Zhu [Wed, 25 Sep 2019 18:03:15 +0000 (02:03 +0800)]
app/testpmd: fix build for 16-byte Rx descriptor mode

This minor patch fixes unused variable ‘ret’ compile error When
CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC was selected.

Fixes: 6f51deb903b2 ("app/testpmd: check status of getting ethdev info")

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoapp/testpmd: fix crash on port reset
Shougang Wang [Tue, 24 Sep 2019 04:49:03 +0000 (04:49 +0000)]
app/testpmd: fix crash on port reset

port reset cause crash when ports are not stopped. Fixed by refusing the
reset when port is not stopped.

Fixes: 97f1e196799f ("app/testpmd: add port reset command")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/ipn3ke: setup MTU during HW init
Andy Pei [Wed, 4 Sep 2019 01:52:46 +0000 (09:52 +0800)]
net/ipn3ke: setup MTU during HW init

Set up MTU to the minimum among Tx MTU, Rx MTU and
IPN3KE_MAC_FRAME_SIZE_MAX.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/ice: remove legacy Rx descriptor definition
Haiyue Wang [Tue, 24 Sep 2019 02:38:09 +0000 (10:38 +0800)]
net/ice: remove legacy Rx descriptor definition

Since now the ice PMD only handles Rx Flex descriptor, so remove the
legacy descriptor definition.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: switch to Rx flexible descriptor in AVX path
Leyi Rong [Tue, 24 Sep 2019 02:38:08 +0000 (10:38 +0800)]
net/ice: switch to Rx flexible descriptor in AVX path

Switch to Rx flexible descriptor format instead of legacy
descriptor format.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: switch to flexible descriptor in SSE path
Wenzhuo Lu [Tue, 24 Sep 2019 02:38:07 +0000 (10:38 +0800)]
net/ice: switch to flexible descriptor in SSE path

With this path, the flexible descriptor is supported
in SSE path. And the legacy descriptor is not supported.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support protocol extraction per Rx queue
Haiyue Wang [Tue, 24 Sep 2019 02:38:06 +0000 (10:38 +0800)]
net/ice: support protocol extraction per Rx queue

The ice has the feature to extract protocol fields into flex descriptor
by programming per queue. Currently, the ice PMD will put the protocol
fields into rte_mbuf::udata64 with different type format. Application
can access the protocol fields quickly.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: handle Rx flex descriptor
Haiyue Wang [Tue, 24 Sep 2019 02:38:05 +0000 (10:38 +0800)]
net/ice: handle Rx flex descriptor

Set the RXDID with flex descriptor type by default, change the Rx
function to support new descriptor handling.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: add Rx flex descriptor definition
Haiyue Wang [Tue, 24 Sep 2019 02:38:04 +0000 (10:38 +0800)]
net/ice: add Rx flex descriptor definition

The Rx flex descriptor has 16B and 32B size, with different
field definitions compared to legacy type.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: limit the number of VF messages
Alvin Zhang [Tue, 24 Sep 2019 14:24:43 +0000 (22:24 +0800)]
net/i40e: limit the number of VF messages

PF driver supports counting VF adminQ messages. If any VF driver
sends much more adminQ messages to its PF driver in a period of
time, it will trigger the PF's message limitation, then in the
next certain amount of seconds the PF driver will ignore any new
adminQ message from that VF.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: remove unused code
Qi Zhang [Mon, 23 Sep 2019 07:44:48 +0000 (15:44 +0800)]
net/ice/base: remove unused code

Remove unused code.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: support switch for IPv6 TC field
Qi Zhang [Mon, 23 Sep 2019 07:44:47 +0000 (15:44 +0800)]
net/ice/base: support switch for IPv6 TC field

Add support for IPv6 traffic class (tc) field for switch rule.
Correct ice_ipv6_hdr based on the IPv6 Protocol using bitfields.
Add big/little endian convert for tc field before it is inserted,
since tc is only one byte and also does not have a byte-aligned
offset.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: fix packet type bitmap
Qi Zhang [Mon, 23 Sep 2019 07:44:46 +0000 (15:44 +0800)]
net/ice/base: fix packet type bitmap

Before this patch, IPv4 and UDP inner hash rule will be over
written by later rules after RSS initialization phase. This is
because the PTYPE bitmap table cover some PTYPEs belong to another
PTGs. And some PTYPEs are reserved. Remove these PTYPEs in TCP,
UDP, SCTP and ipv4 bitmap table.

Fixes: aa1cd410fa64 ("net/ice/base: add flow module")

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: fix alignment
Qi Zhang [Mon, 23 Sep 2019 07:44:45 +0000 (15:44 +0800)]
net/ice/base: fix alignment

As title says, fix an alignment issue.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")
Cc: stable@dpdk.org
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: use bitmap copy where appropriate
Qi Zhang [Mon, 23 Sep 2019 07:44:44 +0000 (15:44 +0800)]
net/ice/base: use bitmap copy where appropriate

ice_cp_bitmap() already exists and should be used instead of
using ice_memcpy().  Note, there are a couple comments that suggest
using a bitmap-specific copy function, but those are not correct
since the source block of memory is not a bitmap.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: remove unnecessary error log
Qi Zhang [Mon, 23 Sep 2019 07:44:43 +0000 (15:44 +0800)]
net/ice/base: remove unnecessary error log

Remove the error log message when attempting to download a
package that has an unsupported version.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: fix 4 bytes alignment for PPPoE dummy packet
Qi Zhang [Mon, 23 Sep 2019 07:44:42 +0000 (15:44 +0800)]
net/ice/base: fix 4 bytes alignment for PPPoE dummy packet

Add two bytes to meet the requirement of 4 bytes alignment for dummy
packet for creating switch rule for PPPoE.

Fixes: d1c2f76b440a ("net/ice/base: support GTP and PPPoE protocols")

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: search field vector indices for result slots
Qi Zhang [Mon, 23 Sep 2019 07:44:41 +0000 (15:44 +0800)]
net/ice/base: search field vector indices for result slots

Previously, switch code would use only pre-reserved index
slots at the end of each field vector for recipe result index
locations. This patch adds code that detects other internal
empty index slots that could potentially be used. For each
recipe that is added, a determ ination is made as to whether
any of these additional index slots alige with all the profiles
selected for the recipe; if alignment is achieved, then these
result index slots can be used.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: remove unused DDP package macros
Qi Zhang [Mon, 23 Sep 2019 07:44:40 +0000 (15:44 +0800)]
net/ice/base: remove unused DDP package macros

Macros no longer be used and can be removed

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: fix segment in remove existing RSS rule
Qi Zhang [Mon, 23 Sep 2019 07:44:39 +0000 (15:44 +0800)]
net/ice/base: fix segment in remove existing RSS rule

Before this patch, RSS tunneled rules can not be destroyed at runtime.
This is because it can not find the existing matching profile for tunnels.
segs[0] should always be zero and all matched, segs[1] for inner part.
It only construct one segment.

This patch modifies construct segment in ice_rem_rss_cfg_sync() to
match ice_add_rss_cfg_sync().

Fixes: b7d34ccc47b5 ("net/ice/base: packet encapsulation for RSS")

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: fix bitmap for TCP in RSS
Qi Zhang [Mon, 23 Sep 2019 07:44:38 +0000 (15:44 +0800)]
net/ice/base: fix bitmap for TCP in RSS

Before this patch, if set rule for IPv4 first and then set rule
for TCP with IPv4. The first rule for inner IP will be overwritten
by TCP rule. This is because MAC_IPV6_TUN_MAC_IPV4_PAY using the
same ptgs PTG_TUN_INNER_IPV4_OTHER with MAC_IPV4_TUN_MAC_IPV4_PAY,
this ptype should not in TCP bitmap.
Remove this bit in TCP bitmap.

Fixes: aa1cd410fa64 ("net/ice/base: add flow module")
Cc: stable@dpdk.org
Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: support FDIR for GTPU QFI field
Qi Zhang [Mon, 23 Sep 2019 07:44:37 +0000 (15:44 +0800)]
net/ice/base: support FDIR for GTPU QFI field

Add GTPU qfi field support for flow director. Note that for GTPU pkt,
only qfi field (6 bits) can be set for FD. The supported GTPU pkts are
defined as:
ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP,
ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP,
ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP,
ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER (FRAG and PAY belong to this)

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: replace alloc-followed-by-copy with memdup
Qi Zhang [Mon, 23 Sep 2019 07:44:36 +0000 (15:44 +0800)]
net/ice/base: replace alloc-followed-by-copy with memdup

ice_memdup() is preferred over an alloc immediately followed by a copy.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: enable symmetric hash for RSS
Qi Zhang [Mon, 23 Sep 2019 07:44:35 +0000 (15:44 +0800)]
net/ice/base: enable symmetric hash for RSS

Add parameter "symm" to rss configuration APIs.
When symm is 1, Symmetric Teoplitz Hash can be enabled by
configuring GLQF_HSYMM properly.

NOTE:
Symmetric Teoplitz hash will work only if hash schema of
VSIQF_HASH_CTL be configured to 01b and it is assumed be enabled
in PMD.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: update FW API minor version
Qi Zhang [Mon, 23 Sep 2019 07:44:34 +0000 (15:44 +0800)]
net/ice/base: update FW API minor version

Update FW API minor version to align to current value advertised
by FW in NVM images.

Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: support destination MAC field for FDIR
Qi Zhang [Mon, 23 Sep 2019 07:44:33 +0000 (15:44 +0800)]
net/ice/base: support destination MAC field for FDIR

Add dest MAC address support so that this field can be matched when
we set Flow Director filter with dst addr for MAC.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: enable setting up FDIR counters
Qi Zhang [Mon, 23 Sep 2019 07:44:32 +0000 (15:44 +0800)]
net/ice/base: enable setting up FDIR counters

Enable getting value from input to set up flow director counters,
so that the FDIR counters can count none, packets only, bytes only
or both packets and bytes as demanded.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice/base: enable FDIR queue region
Qi Zhang [Mon, 23 Sep 2019 07:44:31 +0000 (15:44 +0800)]
net/ice/base: enable FDIR queue region

Add fdir queue region support.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>