dpdk.git
4 years agonet/qede/base: fix number of ports per engine
Rasesh Mody [Sat, 21 Dec 2019 01:34:51 +0000 (17:34 -0800)]
net/qede/base: fix number of ports per engine

Fix the way in which the number of ports per engine of an adapter is
determined by reading port mode register. Set default value to 1.

Fixes: 3b307c55f2ac ("net/qede/base: update FW to 8.40.25.0")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/octeontx2: allow vector processing packets not by 4
Vamsi Attunuru [Fri, 20 Dec 2019 13:02:52 +0000 (18:32 +0530)]
net/octeontx2: allow vector processing packets not by 4

Current vector mode implementation floor-aligns pkt count
with NIX_DESCS_PER_LOOP and process that many packets.

Patch addresses the case where pkt count modulo NIX_DESCS_PER_LOOP
is non-zero, after the vector mode processing, scalar routine is
used to process if there are any leftover packets. Scalar routine
is also used when descriptor head is about to wrap and turn out to
be unaligned.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agocommon/octeontx2: reduce wait time for mbox messages
Sunil Kumar Kori [Mon, 16 Dec 2019 15:02:53 +0000 (20:32 +0530)]
common/octeontx2: reduce wait time for mbox messages

After each mbox send operation, context waits for minimum 1ms to get
corresponding response although response can come earlier.
So reducing wait time to lower granularity.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/hns3: fix triggering reset procedure in slave process
Chengwen Feng [Thu, 9 Jan 2020 03:15:59 +0000 (11:15 +0800)]
net/hns3: fix triggering reset procedure in slave process

Currently, reset related operations can only be performed in the primary
process and are not allowed in the slave process in hns3 PMD driver.

In the internal function interface named hns3_cmd_send used for
communication between driver and firmware, if the wrong head value is
detected in the static subfunction hns3_cmd_csq_clean, driver will
trigger a function level reset to make the hardware work normally again.

This patch adds check condition to prevent triggering reset procedure in
the slave process to avoid failure.

Fixes: 2790c6464725 ("net/hns3: support device reset")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix link status on failed query
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:58 +0000 (11:15 +0800)]
net/hns3: fix link status on failed query

Currently, the hns3 PMD driver issues command to the firmware and gets
link status information.

When the driver fails to call internal interface function named
hns3_cmd_send to query the status from firmware for some reason, the
link status queried by the driver should be down.

Fixes: 59fad0f32135 ("net/hns3: support link update operation")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix dumping VF register information
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:57 +0000 (11:15 +0800)]
net/hns3: fix dumping VF register information

Currently, when the API interface named rte_eth_dev_get_reg_info is
called by upper applications based on VF device, it returns error.

We can read registers directly to get ring and interrupt related
information in hns3 PF/VF PMD driver. But for some other internal table
entries and common configuration information, we can get them only
through the command interface between driver and firmware in PF driver,
and VF driver has not the related access permission.

This patch fixes it by preventing getting these information through the
command interface based on VF device in 'get_reg' ops implementation
function.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix ring vector related mailbox command format
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:56 +0000 (11:15 +0800)]
net/hns3: fix ring vector related mailbox command format

The format of the ring vector related mailbox commands between driver
and firmware is different from those of other mailbox commands in hns3
network engine.

This patch fixes the error mailbox command format about the vector of
the rings, the related command opcode as below:
HNS3_MBX_MAP_RING_TO_VECTOR
HNS3_MBX_UNMAP_RING_TO_VECTOR
HNS3_MBX_GET_RING_VECTOR_MAP

Fixes: 463e748964f5 ("net/hns3: support mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix crash when closing port
Hongbo Zheng [Thu, 9 Jan 2020 03:15:55 +0000 (11:15 +0800)]
net/hns3: fix crash when closing port

Currently there is a certain probability of segment error in concurrent
reset when the port is closing.
The calltrace info:

This GDB was configured as "aarch64-redhat-linux-gnu".
Reading symbols from /usr/app/testpmd...(no debugging symbols found)...
 done.
[New LWP 98204]
[New LWP 98203]
[New LWP 98206]
[New LWP 98205]
[New LWP 98207]
[New LWP 98208]
Missing separate debuginfo for /root/lib/libnuma.so.1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/app/testpmd --log-level=6 --socket-mem 16'.
Program terminated with signal 11, Segmentation fault.
Missing separate debuginfos, use:
 debuginfo-install glibc-2.17-260.el7.aarch64
(gdb) bt
in hns3vf_service_handler ()
1  0x00000000006988b8 in eal_alarm_callback ()
2  0x00000000006969b4 in eal_intr_thread_main ()
3  0x0000ffffb08d6c48 in start_thread () from /lib64/libpthread.so.0
4  0x0000ffffb0828600 in thread_start () from /lib64/libc.so.6
(gdb)

Reset process may turn on the cancelled link state timer whether the
current port status is on or off, in order to solve this problem, this
patch add judge the current network port state before starting the
timer, only the port in the running state can start the link state
timer, so as to solve the problem that the link state timer accesses the
null pointer and causes the segment error.

Fixes: 2790c6464725 ("net/hns3: support device reset")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix Rx queue search with broadcast packet
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:54 +0000 (11:15 +0800)]
net/hns3: fix Rx queue search with broadcast packet

Currently, there is a certain probability of a type of RAS errors when
receiving broadcast packets. This type of RAS errors are parsed as
rx_q_search_miss error by hns3 PF PMD driver, the related log as below:
0000:bd:00.0 hns3_find_highest_level(): PPP_MFP_ABNORMAL_INT_ST2
rx_q_search_miss found [error status=0x20000000]

When receiving broadcast packet, network engine select which functions
need to accept it according to the function's promisc_bcast_en bit
configuration. And then search TQP_MAP configuration to select which
hardware queues the packet should enter, if can't find the target
hardware queue, network engine will trigger rx_q_search_miss RAS error.

The root cause as below:
1. VF's promisc_bcast_en bit configuration is not cleared by FLR reset,
   and the configuration has been set in the previous application.
2. There is one bug in setting TQP_MAP configuration in the
   initialization of PF device: when tqp is allocated to VF, it is still
   marked as PF.  This issue will affect the correctness of the TQP_MAP
   configuration.

This patch fixes it with the following modification.
1. Clear all VFs promisc_bcast_en bit in the initialization of PF
   device.
2. Fix the issue to ensure the correct TQP_MAP configuration.

Fixes: d51867db65c1 ("net/hns3: add initialization")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: add free threshold in Rx
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:53 +0000 (11:15 +0800)]
net/hns3: add free threshold in Rx

This patch optimizes the Rx performance by adding the rx_free_thresh
related process in the '.rx_pkt_burst' ops implementation function named
hns3_recv_pkts. The related change as follows:
1. Adding the rx_free_thresh related process to reduce the number of
   writing the HNS3_RING_RX_HEAD_REG register.
2. Adjusting the internal macro named DEFAULT_RX_FREE_THRESH to 32 and
   adjusting HNS3_MIN_RING_DESC to 64 to make the effect of the thresh
   more obvious.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove one IO barrier in Rx
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:52 +0000 (11:15 +0800)]
net/hns3: remove one IO barrier in Rx

When receiving a packet, hns3 hardware network engine firstly writes the
packet content to the memory pointed by the 'addr' field of the Rx
Buffer Descriptor, secondly fills the result of parsing the packet
include the valid field into the Rx Buffer Descriptor in one write
operation, and thirdly writes the number of the Buffer Descriptor not
processed by the driver to the HNS3_RING_RX_FBDNUM_REG register.

This patch optimizes the Rx performance by removing one rte_io_rmb call
in the '.rx_pkt_burst' ops implementation function named hns3_recv_pkts.
The change as follows:
1. Driver no longer read HNS3_RING_RX_FBDNUM_REG register, so remove one
   rte_io_rmb call, and directly read the valid flag of Rx Buffer
   Descriptor to check whether the BD is ready.
2. Delete the non_vld_descs field from the statistic information of the
   hns3 driver because now it has become a common case that the valid
   flag of Rx Buffer Descriptor read by the driver is invalid.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: reduce judgements of free Tx ring space
Yisen Zhuang [Thu, 9 Jan 2020 03:15:51 +0000 (11:15 +0800)]
net/hns3: reduce judgements of free Tx ring space

This patch reduces the number of the judgement of the free Tx ring space
in the 'tx_pkt_burst' ops implementation function to avoid performance
loss. According to hardware constraints, we need to reserve a Tx Buffer
Descriptor in the TX ring in hns3 network engine.

Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support setting VF MAC address by PF driver
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:50 +0000 (11:15 +0800)]
net/hns3: support setting VF MAC address by PF driver

Currently, 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 hns3 DPDK driver.

This patch adds support setting VF MAC address by hns3 PF kernel ethdev
driver on the host by "ip link set ..." command.
1) If the hns3 PF kernel ethdev driver sets the MAC address for VF
   device before the initialization of the related VF device, hns3 VF
   PMD driver should get the MAC address from PF driver through mailbox
   and configure hardware using this MAC address in the initialization.
   The hns3 VF PMD driver get the MAC address form PF driver, if
   obtaining a non-zero MAC address from mailbox, VF driver will
   configure hardware using it, otherwise using a random MAC address in
   the initialization of VF device.
2) If the hns3 PF kernel ethdev driver sets the MAC address for VF
   device after the initialization of the related VF device, the PF
   driver will notify VF driver to reset VF device to make the new MAC
   address effective immediately. The hns3 VF PMD driver should check
   whether the MAC address has been changed by the PF kernel netdevice
   driver, if changed VF driver should configure hardware using the new
   MAC address in the recovering hardware configuration stage of the
   reset process.
3) When user has configured a mac address for VF device by "ip link set
   ..." command based on the PF device, the hns3 PF kernel ethdev driver
   does not allow VF driver to request reconfiguring a different default
   mac address and return -EPREM to VF driver through mailbox.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
4 years agonet/hns3: support different numbers of Rx and Tx queues
Wei Hu (Xavier) [Thu, 9 Jan 2020 03:15:49 +0000 (11:15 +0800)]
net/hns3: support different numbers of Rx and Tx queues

Hardware does not support individually enable/disable/reset the Tx or Rx
queue in hns3 network engine, driver must enable/disable/reset Tx and Rx
queues at the same time.

Currently, hns3 PMD driver does not support the scenarios as below:
1) When calling the following function, the input parameter nb_rx_q and
   nb_tx_q are not equal.
     rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q,
                      uint16_t nb_tx_q,
      const struct rte_eth_conf *dev_conf);
2) When calling the following functions to setup queues, the
   cumulatively setup Rx queues are not the same as the setup Tx queues.
     rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,,,);
     rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,,,);
However, these are common usage scenarios in some applications, such as,
l3fwd, ip_ressmbly and OVS-DPDK, etc.

This patch adds support for this usage of these functions by setup fake
Tx or Rx queues to adjust numbers of Tx/Rx queues. But these fake queues
are imperceptible, and can not be used by upper applications.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/i40e: support flow director for L2TPv3 over IP
Rory Sexton [Mon, 13 Jan 2020 11:50:41 +0000 (11:50 +0000)]
net/i40e: support flow director for L2TPv3 over IP

Adding FDIR support for L2TPv3 over IP header matching and adding
a new customized pctype for l2tpv3 over IP.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Signed-off-by: Dariusz Jagus <dariuszx.jagus@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agoethdev: add L2TPv3 over IP header to flow API
Rory Sexton [Mon, 13 Jan 2020 11:50:40 +0000 (11:50 +0000)]
ethdev: add L2TPv3 over IP header to flow API

This patch adds the new flow item RTE_FLOW_ITEM_TYPE_L2TPV3OIP to
flow API to match a L2TPv3 over IP header. This patch supports only
L2TPv3 over IP header format which is different to L2TPv2/L2TPv3
over UDP. The difference in header formats between L2TPv3 over IP
and L2TP over UDP require a separate implementation for each.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Signed-off-by: Dariusz Jagus <dariuszx.jagus@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/af_xdp: use single producer/consumer ring
Xiao Wang [Wed, 8 Jan 2020 13:37:08 +0000 (08:37 -0500)]
net/af_xdp: use single producer/consumer ring

The ring is used only by af_xdp PMD itself, so no need to support
multi-producer and multi-consumer mode. This patch changes the ring
to single-producer and single-consumer mode, which could yield better
performance for addr enqueue and dequeue.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agoapp/testpmd: fix GENEVE flow item
Dekel Peled [Wed, 8 Jan 2020 15:07:02 +0000 (17:07 +0200)]
app/testpmd: fix GENEVE flow item

Previous patch added support of GENEVE pattern item in flow rule.
Function flow_item_default_mask() was not updated, so using it with
GENEVE item returns null.
Using testpmd command "set raw_decap" or "set raw_encap" with
GENEVE item, without specifying any parameters, results in
segmentation fault.

This patch updates function flow_item_default_mask(),
adding case to handle GENEVE item.

Fixes: 0f4203fe9d18 ("app/testpmd: support GENEVE pattern item in flow rules")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agoethdev: fix callback unregister with wildcard argument list
Ricardo Roldan [Tue, 7 Jan 2020 15:51:36 +0000 (16:51 +0100)]
ethdev: fix callback unregister with wildcard argument list

The function was checking -1 against the callback data instead of
the given cb_arg parameter.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Ricardo Roldan <rroldan@bequant.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix Tx burst routines set
Viacheslav Ovsiienko [Thu, 9 Jan 2020 11:07:35 +0000 (11:07 +0000)]
net/mlx5: fix Tx burst routines set

The tx_burst routine supporting multi-segment packets with
legacy MPW and without inline was missed, and there was no
valid selection for these options, patch adds the missing
routine.

Fixes: 82e75f8323bf ("net/mlx5: fix legacy multi-packet Tx descriptors")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/ice: use ethernet copy API to do MAC assignment
Haiyue Wang [Mon, 13 Jan 2020 08:22:21 +0000 (16:22 +0800)]
net/ice: use ethernet copy API to do MAC assignment

Use the API rte_ether_addr_copy to do MAC assignment, instead of
calling rte_memcpy function directly.

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf/base: move to drivers common directory
Haiyue Wang [Fri, 10 Jan 2020 01:37:49 +0000 (09:37 +0800)]
net/iavf/base: move to drivers common directory

Change the iavf base code as driver common library, it is used by iavf
PMD now, and it can be used by other Intel SR-IOV PMDs in the future.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e/base: add new link speed constants
Xiaolong Ye [Mon, 13 Jan 2020 02:39:48 +0000 (10:39 +0800)]
net/i40e/base: add new link speed constants

This patch fixes 'NIC Link is Up, Unknown bps' message in dmesg
for 2.5Gb/5Gb speeds. This problem is fixed by adding constants
for VIRTCHNL_LINK_SPEED_2_5GB and VIRTCHNL_LINK_SPEED_5GB.

Fixes: a58860f68929 ("net/i40e/base: use new virtchnl header file")

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: enable LED blinking flow
Xiaolong Ye [Mon, 13 Jan 2020 02:39:47 +0000 (10:39 +0800)]
net/i40e/base: enable LED blinking flow

Add X710T*L device specific operations (in port LED detection and
handling of GLGEN_GPIO_CTL.PIN_FUNC field) to enable LED blinking.

Signed-off-by: Damian Milosek <damian.milosek@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add CRC stripping capability
Xiaolong Ye [Mon, 13 Jan 2020 02:39:46 +0000 (10:39 +0800)]
net/i40e/base: add CRC stripping capability

Some VFs may want to disable CRC stripping on incoming packets
so create an offload for that. The VF already sends information
about configuring it's RX queues so use that structure to
indicate that the CRC stripping should be enabled or not.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: introduce firmware EMP reset register
Xiaolong Ye [Mon, 13 Jan 2020 02:39:45 +0000 (10:39 +0800)]
net/i40e/base: introduce firmware EMP reset register

Introduce offsets of firmware registers holding a number of EMP resets.
Implement offsets as a preprocessor's constants.
Required by drivers to read a number of EMP resets reported by FW.

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: expose LED functionality
Xiaolong Ye [Mon, 13 Jan 2020 02:39:44 +0000 (10:39 +0800)]
net/i40e/base: expose LED functionality

The previous code had the LED code wrapped such that, it was
static to the file and not usable outside of it. It is now available.

Signed-off-by: Mateusz Rusinski <mateusz.rusinski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add function to read LPI statistics
Xiaolong Ye [Mon, 13 Jan 2020 02:39:43 +0000 (10:39 +0800)]
net/i40e/base: add function to read LPI statistics

There was no time duration statistics for LPI (Low Power Idle)
in EEE (Energy-Efficient Ethernet).
Added new procedure to get duration values from FW.
Otherwise there is no available procedure to get tx_lpi_duration
and rx_lpi_duration values.

Signed-off-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: set PHY access flag on X722
Xiaolong Ye [Mon, 13 Jan 2020 02:39:42 +0000 (10:39 +0800)]
net/i40e/base: set PHY access flag on X722

The X722 FW API version 1.9 adds support for accessing PHY
registers with Admin Queue Command. This enables reading
EEPROM data from (Q)SFP+ transceivers, what was previously
possible only on X710 devices.

Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: remove unreachable code
Xiaolong Ye [Mon, 13 Jan 2020 02:39:41 +0000 (10:39 +0800)]
net/i40e/base: remove unreachable code

The result of the check is always FALSE and the code within "if"
is never executed.

Signed-off-by: Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add flow director constants
Xiaolong Ye [Mon, 13 Jan 2020 02:39:40 +0000 (10:39 +0800)]
net/i40e/base: add flow director constants

Add defines for creating Flow Director flows as defined in datasheet
section 7.1.5.4 for field vectors.

Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: fix display of FEC settings
Xiaolong Ye [Mon, 13 Jan 2020 02:39:39 +0000 (10:39 +0800)]
net/i40e/base: fix display of FEC settings

Fix display of FEC settings for ethtool.
This patch change variable 'phy.link_info.req_fec_info' sent to ethtool.
Without this patch wrong FEC settings can be shown.

Fixes: 1216fb9f0c8c ("net/i40e/base: store the requested FEC information")

Signed-off-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: mark additional AQ bits as reserved
Xiaolong Ye [Mon, 13 Jan 2020 02:39:38 +0000 (10:39 +0800)]
net/i40e/base: mark additional AQ bits as reserved

Mark bits 0xD through 0xF for the command flags of a cloud filter as
reserved. These bits are not yet defined and are considered as reserved
in the data sheet.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: fix retrying logic
Xiaolong Ye [Mon, 13 Jan 2020 02:39:37 +0000 (10:39 +0800)]
net/i40e/base: fix retrying logic

Fixed a bug where driver was breaking out of the loop and
reporting an error without retrying first.

Fixes: 466eec7d6b1a ("net/i40e/base: retry AQC to overcome IRCRead hangs")

Signed-off-by: Marcin Formela <marcin.formela@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add function to set MAC type
Xiaolong Ye [Mon, 13 Jan 2020 02:39:36 +0000 (10:39 +0800)]
net/i40e/base: add function to set MAC type

Make i40e_set_mac_type() public. i40e driver requires
i40e_set_mac_type() to be public. It is required for recovery mode
handling. Without this patch recovery mode could not be detected at
probe() function.

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: support persistent LLDP
Xiaolong Ye [Mon, 13 Jan 2020 02:39:35 +0000 (10:39 +0800)]
net/i40e/base: support persistent LLDP

This patch adds a function to read NVM module data and uses it to
read current LLDP agent configuration from NVM API version 1.8.

Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: update FW API version
Xiaolong Ye [Mon, 13 Jan 2020 02:39:34 +0000 (10:39 +0800)]
net/i40e/base: update FW API version

Update FW API version to 1.9.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add FWS1B register masks
Xiaolong Ye [Mon, 13 Jan 2020 02:39:33 +0000 (10:39 +0800)]
net/i40e/base: add FWS1B register masks

Function check_recovery_mode had wrong if statement. Now we check proper
FWS1B register values, which are responsible for the recovery mode.
Recovery mode has 6 values in total. That's why we need 6 different
flags.  Now in if statement we recognize type of mac and register value.
Without those changes driver could show wrong state.

Signed-off-by: Adrian Podlawski <adrian.podlawski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add drop mode parameter to set MAC config
Xiaolong Ye [Mon, 13 Jan 2020 02:39:32 +0000 (10:39 +0800)]
net/i40e/base: add drop mode parameter to set MAC config

This patch adds "drop mode" parameter to set mac config AQ command.
This bit controls the behavior when a no-drop packet is blocking a TC
queue.
0 – The PF driver is notified.
1 – The blocking packet is dropped and then the PF driver is notified.

Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: extend PHY access AQ command
Xiaolong Ye [Mon, 13 Jan 2020 02:39:31 +0000 (10:39 +0800)]
net/i40e/base: extend PHY access AQ command

Currently FW use MDIO I/F number corresponded with current PF for PHY
access. This code allow to specify used MDIO I/F number.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: fix Tx descriptors number
Xiaolong Ye [Mon, 13 Jan 2020 02:39:30 +0000 (10:39 +0800)]
net/i40e/base: fix Tx descriptors number

The existing driver allows setting the number of TX descriptors
to the value that is indivisible by 32. This is not properly
supported by x710 hardware. The patch limits the number of TX
descriptors to the whole value of 32.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org
Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Dariusz Chaberski <dariuszx.chaberski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: update status codes
Xiaolong Ye [Mon, 13 Jan 2020 02:39:29 +0000 (10:39 +0800)]
net/i40e/base: update status codes

Add a few new status codes and rename a few to make them more
consistent.  Error code are mapped to similar values as in
i40e_status.h, so as to be compatible with older VF drivers not using
this status enum.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: backport style changes from upstream Linux
Xiaolong Ye [Mon, 13 Jan 2020 02:39:28 +0000 (10:39 +0800)]
net/i40e/base: backport style changes from upstream Linux

The upstream virtchnl.h has a few minor style differences to what is
out-of-tree, and there is no real reason we should prefer the current
style over whats upstream.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add function to read LPI counters
Xiaolong Ye [Mon, 13 Jan 2020 02:39:27 +0000 (10:39 +0800)]
net/i40e/base: add function to read LPI counters

This change introduces new function i40e_get_lpi_counters() reading
Low Power Idle (LPI) mode counters from Energy Efficient Ethernet (EEE)
statistics. Since reading EEE statistics requires running DNL script,
function i40e_aq_run_phy_activity() able to run it, was implemented.

i40e_lpi_stat_update() was introduced as helper function for retrieving
LPI counters' values relative to given offsets.

This change also fixes order of fields in struct
i40e_aqc_run_phy_activity and introduces union in the struct
providing more descriptive names of fields depending on usage
(command or response).

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: fix missing link modes
Xiaolong Ye [Mon, 13 Jan 2020 02:39:26 +0000 (10:39 +0800)]
net/i40e/base: fix missing link modes

Fix for missing "Supported link modes" and "Advertised link modes"
info in ethtool after changed speed on X722 devices with BASE-T PHY
with FW API version >= 1.7.
The same FW API version on X710 and X722 does not mean the same
feature set so the change was needed as mac type of the device
should also be checked instead of FW API version only.

Fixes: e8228f1a16b7 ("net/i40e/base: report supported link modes")

Signed-off-by: Martyna Szapar <martyna.szapar@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: read LPI status from external PHY
Xiaolong Ye [Mon, 13 Jan 2020 02:39:25 +0000 (10:39 +0800)]
net/i40e/base: read LPI status from external PHY

When external PHY is used, MAC register may not reflect actual
state of LPI. Add function reading it directly from PHY or MAC,
depending on what is supported by the device.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: support Energy Efficient Ethernet
Xiaolong Ye [Mon, 13 Jan 2020 02:39:24 +0000 (10:39 +0800)]
net/i40e/base: support Energy Efficient Ethernet

This change adds i40e_enable_eee() function controlling advertisement
of Energy Efficient Ethernet mode (EEE).

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add function to get FW LLDP agent status
Xiaolong Ye [Mon, 13 Jan 2020 02:39:23 +0000 (10:39 +0800)]
net/i40e/base: add function to get FW LLDP agent status

This change introduces i40e_get_fw_lldp_status() function capable of
reporting status of FW Link Layer Discovery Protocol (LLDP) agent.

Since reading LLDP configuration from NVM only gives information what
is the default state of FW LLDP agent after POR, this change introduces
more reliable method for checking if agent is enabled.

Current state of FW LLDP agent may be different if user disabled the
agent, so i40e_get_fw_lldp_status() uses LLDP MIB checking to determine
status of the agent.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: improve AQ log granularity
Xiaolong Ye [Mon, 13 Jan 2020 02:39:22 +0000 (10:39 +0800)]
net/i40e/base: improve AQ log granularity

This patch makes it possible to log only AQ descriptors, without the
entire AQ message buffers being dumped too. It should greatly reduce
kernel log size in cases where a full AQ dump is not needed.
Selection is made by setting flags in hw->debug_mask.

Additionally, some debug messages that preceded an AQ dump have been
moved to I40E_DEBUG_AQ_COMMAND class, which seems more appropriate.

Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add flags for PHY types
Xiaolong Ye [Mon, 13 Jan 2020 02:39:21 +0000 (10:39 +0800)]
net/i40e/base: add flags for PHY types

Adding bit flags to enable/disable EEE capability for 2.5GBase-T and
5GBase-T PHY types as well as 'Set autonomous EEE for relevant enabled
PHY types' flag.

Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Michal Litwicki <michalx.litwicki@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: check MAC type
Xiaolong Ye [Mon, 13 Jan 2020 02:39:20 +0000 (10:39 +0800)]
net/i40e/base: check MAC type

Some features were introduced in different FW API version on XL710 and
X722 MACs. Others are available only on specific MAC type. Make sure
that they are properly assigned. Also fix the style issues reported by
current check-patch.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: add new device IDs
Xiaolong Ye [Mon, 13 Jan 2020 02:39:19 +0000 (10:39 +0800)]
net/i40e/base: add new device IDs

New device ids are created to support SFP+ and backplane connections.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: support LLDP agent
Xiaolong Ye [Mon, 13 Jan 2020 02:39:18 +0000 (10:39 +0800)]
net/i40e/base: support LLDP agent

This code implements changes necessary for LLDP Agent support.

1. Modified i40e_aq_start_lldp and i40e_aq_stop_lldp. Now Stop and Start
can also be persistent across power cycles.
2. Added new function i40e_aq_restore_lldp which restores factory
setting for LLDP Agent or gets its status.

Signed-off-by: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: fix error message
Xiaolong Ye [Mon, 13 Jan 2020 02:39:17 +0000 (10:39 +0800)]
net/i40e/base: fix error message

This patch changes an error code for an admin queue head overrun to use
I40E_ERR_ADMIN_QUEUE_FULL instead of I40E_ERR_QUEUE_EMPTY.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: decouple MIB change event from DCB init
Xiaolong Ye [Mon, 13 Jan 2020 02:39:16 +0000 (10:39 +0800)]
net/i40e/base: decouple MIB change event from DCB init

There is a need to enable MIB change event, not at the same time as
init_dcb. This patch will serve this requirement.

Modify the i40e_init_dcb to return the correct error when LLDP or DCBX
is not in operational state.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: fix buffer address
Xiaolong Ye [Mon, 13 Jan 2020 02:39:15 +0000 (10:39 +0800)]
net/i40e/base: fix buffer address

The high 32-bits were being set incorrectly in the 'Set Local LLDP MIB'
AQ command (0x0A08). Change it to use the right macro to get the correct
bits.

Fixes: 1fa6324ad30b ("i40e/base: add new interfaces")
Cc: stable@dpdk.org
Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: increase max VSI count for VFs
Xiaolong Ye [Mon, 13 Jan 2020 02:39:14 +0000 (10:39 +0800)]
net/i40e/base: increase max VSI count for VFs

For historical reasons, we allowed 3 VSIs per VF, but never used more
than one. Now with ADq, we can use up to 4 VSIs per VF, so change this
value to match.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: support NVM feature flags
Xiaolong Ye [Mon, 13 Jan 2020 02:39:13 +0000 (10:39 +0800)]
net/i40e/base: support NVM feature flags

Extend NVM Update API to support reporting of features
available for the tools.

This change is needed by NVM Update to determine if driver
supports changing NVM layout from structured to flat.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/octeontx2: fix getting supported packet types
Harman Kalra [Thu, 12 Dec 2019 17:58:56 +0000 (17:58 +0000)]
net/octeontx2: fix getting supported packet types

Setting up supported ptypes using testpmd command is failing
because supported_ptypes_get callback will never return ptypes
supported, as NIX_RX_OFFLOAD_PTYPE_F bit in rx_offload_flags
is zero by default in testpmd.

Fixes: d2706e15e6fb ("net/octeontx2: support reduced set of packet types")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/qede: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:52 +0000 (14:51 -0600)]
net/qede: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

(Not sure if the previous code is checking for true/false condition.
Recommend careful review on this patch.)

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/fm10k: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:51 +0000 (14:51 -0600)]
net/fm10k: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
4 years agonet/e1000: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:50 +0000 (14:51 -0600)]
net/e1000: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bnx2x: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:49 +0000 (14:51 -0600)]
net/bnx2x: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/vmxnet3: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:48 +0000 (14:51 -0600)]
net/vmxnet3: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.
Remove 'typedef char Bool' and use 'bool' instead.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yong Wang <yongwang@vmware.com>
4 years agonet/cxgbe: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:47 +0000 (14:51 -0600)]
net/cxgbe: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ixgbe: avoid multiple definitions of bool
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:46 +0000 (14:51 -0600)]
net/ixgbe: avoid multiple definitions of bool

Compilation issue arises due to multiple definitions of 'bool'
in 'ixgbe_ethdev.h'.

Error:
'/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c: In function
‘ixgbe_dev_setup_link_alarm_handler’:
/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:4075:43:
error: passing argument 3 of ‘ixgbe_get_link_capabilities’ from
incompatible pointer type [-Werror=incompatible-pointer-types]
   ixgbe_get_link_capabilities(hw, &speed, &autoneg);
                                           ^
In file included from /dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:41:0:
/dpdk/drivers/net/ixgbe/base/ixgbe_api.h:63:5: note: expected
‘bool * {aka int *}’ but argument is of type ‘_Bool *’'

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/octeontx2: improve performance in vector Rx
Jerin Jacob [Tue, 10 Dec 2019 12:08:44 +0000 (17:38 +0530)]
net/octeontx2: improve performance in vector Rx

Use scalar loads instead of vector loads for fields
that don't need any vector operations.

Signed-off-by: Andrew Pinski <apinski@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
4 years agonet/octeontx2: fix VF configuration
Harman Kalra [Mon, 2 Dec 2019 14:41:15 +0000 (14:41 +0000)]
net/octeontx2: fix VF configuration

Returning -ENOTSUP only in case loopback mode is enabled and
device is VF or SDP.

Fixes: c2c0aa75cd01 ("net/octeontx2: fix loopback config return for VF")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/mlx5: support IPv4/IPv6 DSCP rewrite action
Suanming Mou [Tue, 7 Jan 2020 07:24:02 +0000 (09:24 +0200)]
net/mlx5: support IPv4/IPv6 DSCP rewrite action

This commit add the IPv4/IPv6 DSCP rewrite actions to the PMD code.

Supported actions:
RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP
RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agoethdev: add IPv4/IPv6 DSCP rewrite action
Suanming Mou [Tue, 7 Jan 2020 07:24:01 +0000 (09:24 +0200)]
ethdev: add IPv4/IPv6 DSCP rewrite action

For some overlay network, such as VXLAN, the DSCP field in the new outer
IP header after VXLAN decapsulation may need to be updated accordingly.

This commit introduce the DSCP modify action for IPv4 and IPv6.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agovhost: fix socket initial value
Xiao Wang [Fri, 3 Jan 2020 18:36:21 +0000 (13:36 -0500)]
vhost: fix socket initial value

By default, a vhost socket is created without attaching VDPA device,
this patch fixes the initial value of vdpa_dev_id.

Fixes: b4953225cea4 ("vhost: add APIs for datapath configuration")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agonet/virtio-user: check file descriptor before closing
Stephen Hemminger [Mon, 6 Jan 2020 19:18:37 +0000 (11:18 -0800)]
net/virtio-user: check file descriptor before closing

Valgrind complains that virtio_user is calling close(-1).
Fix this by adding check in virtio that is similar to existing code.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agonet/vhost: check creation failure
Yunjian Wang [Tue, 7 Jan 2020 03:25:48 +0000 (11:25 +0800)]
net/vhost: check creation failure

The function eth_dev_vhost_create() could return errors,
the return value need to be checked.

Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agovhost: add dynamic logging system
Adrian Moreno [Wed, 4 Dec 2019 15:07:29 +0000 (16:07 +0100)]
vhost: add dynamic logging system

Currently there are a couple of limitations on the logging system: Most
of the logs are compiled out and both datapath and controlpath logs
share the same loglevel.

This patch tries to help fix that situation by:
- Splitting control plane and data plane logs
- Making control plane logs dynamic while keeping data plane logs
  compiled out by default for log levels lower than the INFO.

As a result, two macros are introduced:
- VHOST_LOG_CONFIG(LEVEL, ...): Config path logging. Level can be
  dynamically controlled by "lib.vhost.config"

- VHOST_LOG_DATA(LEVEL, ...): Data path logging. Level can be
  dynamically controlled by "lib.vhost.data". Every log macro with a
  level lower than RTE_LOG_DP_LEVEL (which defaults to RTE_LOG_INFO)
  will be compiled out.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agoexamples/vhost_blk: check unused value on init
Jin Yu [Wed, 27 Nov 2019 12:16:58 +0000 (20:16 +0800)]
examples/vhost_blk: check unused value on init

Add the assert to handle error.

Coverity issue: 350592
Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/af_xdp: fix redundant check for wakeup need
Xiao Wang [Mon, 6 Jan 2020 14:09:40 +0000 (09:09 -0500)]
net/af_xdp: fix redundant check for wakeup need

Function kick_tx() has built-in detection on NEED_WAKEUP flag, so just
call it directly, like elsewhere in the driver.

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
4 years agonet/axgbe: add xstats
Chandu Babu N [Fri, 20 Dec 2019 12:43:21 +0000 (18:13 +0530)]
net/axgbe: add xstats

Implements eth dev ops xstats_get, xstats_reset, xstats_get_names,
xstats_get_names_by_id, xstats_get_by_id

Signed-off-by: Chandu Babu N <chandu@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
4 years agonet/ena: support Rx offset
Maciej Bielski [Fri, 13 Dec 2019 13:32:16 +0000 (14:32 +0100)]
net/ena: support Rx offset

Allow the data in the first buffer to be shifted by `pkt_offset` after
the header room. The offset value is provided by `ena_rx_ctx`.

As part of this update, the version of the ENA was upgraded to v2.0.3.

Signed-off-by: Maciej Bielski <mba@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
4 years agonet/ena/base: upgrade HAL for new HW features
Michal Krawczyk [Thu, 9 Jan 2020 15:39:12 +0000 (16:39 +0100)]
net/ena/base: upgrade HAL for new HW features

This version of the HAL allows to use the latest HW features, like
rx offsets.

Driver was adjusted to the new version to fix the build.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Signed-off-by: Maciej Bielski <mba@semihalf.com>
4 years agomaintainers: update for flow API
Ori Kam [Sun, 29 Dec 2019 08:56:58 +0000 (08:56 +0000)]
maintainers: update for flow API

I volunteer to be co-maintainer for the rte_flow lib.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ice/base: clean up
Qi Zhang [Mon, 6 Jan 2020 03:38:51 +0000 (11:38 +0800)]
net/ice/base: clean up

Couple minor code clean include:
1. Improve debug message format.
2. Add missing macro and comment.
3. Remove unnecessary compile options.

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>
4 years agonet/ice: support 1/10G device IDs
Qi Zhang [Mon, 6 Jan 2020 03:38:50 +0000 (11:38 +0800)]
net/ice: support 1/10G device IDs

Add support for 1/10G devices.

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>
4 years agonet/ice/base: support adding MAC rules on specific port
Qi Zhang [Mon, 6 Jan 2020 03:38:49 +0000 (11:38 +0800)]
net/ice/base: support adding MAC rules on specific port

ice_add_mac_rule allow user to add rule to port based on
hw->port_info->lport number. Function in some case should
allow user to add filter rule on different port, write
another function which implemented that behaviour.
The same situation is which removing mac function.

Add new API function which allow user to choose port on which
rule going to be added. Leave add mac rule function that always
add rule on hw->port_info->lport to avoid changes in components
which don't need to choose different port. Also add function to
remove rule from specific port.

Alloc more switch_info structs to track separately rules for each
port. Choose switch_info struct basing on logic port number
because in FW added rules are connected with port.

Signed-off-by: Michal Swiatkowski <michal.swiatkowski@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>
4 years agonet/ice/base: rework flow director desc preparation
Qi Zhang [Mon, 6 Jan 2020 03:38:48 +0000 (11:38 +0800)]
net/ice/base: rework flow director desc preparation

Change internal implementation of how FD filter programming desc
is prepared. This is to minimize the amount of code needed to prep
the FD filter programming desc (avoid memcpy, etc...) and just use
predefined shifts and mask. This type of change are needed to expedite
FD setup during data path (ADQ uses this codepath during initial
flow setup) and it will also be useful when adding side-band
flow-director filter.

Signed-off-by: Kiran Patil <kiran.patil@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>
4 years agonet/ice/base: increase PF reset wait timeout
Qi Zhang [Mon, 6 Jan 2020 03:38:47 +0000 (11:38 +0800)]
net/ice/base: increase PF reset wait timeout

Increase the maximum time that the driver will wait for a PF reset
from 200 milliseconds to 300 milliseconds, to account for possibility
of a slightly longer than expected PF reset.

Fixes: 453d087ccaff ("net/ice/base: add common functions")
Cc: stable@dpdk.org
Signed-off-by: Jacob Keller <jacob.e.keller@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>
4 years agonet/ice/base: fix loop limit
Qi Zhang [Mon, 6 Jan 2020 03:38:46 +0000 (11:38 +0800)]
net/ice/base: fix loop limit

In ice_prot_type_to_id routine, correct the loop limit check
to use ARRAY_SIZE instead of looking for the array element to
have a specific value.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org
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>
4 years agonet/ice/base: enable clearing of HW tables
Qi Zhang [Mon, 6 Jan 2020 03:38:45 +0000 (11:38 +0800)]
net/ice/base: enable clearing of HW tables

Enable the code to clear the HW tables.

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>
4 years agonet/ice/base: allow flexbytes matching on header
Qi Zhang [Mon, 6 Jan 2020 03:38:44 +0000 (11:38 +0800)]
net/ice/base: allow flexbytes matching on header

Change the extraction sequence generated by flow director flexbytes to
use package mac protocol. Without this change data in packet headers
cannot be used for flexbyte matching. The old extraction for flex bytes
started at the beginning of the payload which is after the header.

Signed-off-by: Henry Tieman <henry.w.tieman@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>
4 years agonet/ice/base: cleanup format of static const declarations
Qi Zhang [Mon, 6 Jan 2020 03:38:43 +0000 (11:38 +0800)]
net/ice/base: cleanup format of static const declarations

Use a format consistent with the rest of the code.

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>
4 years agonet/ice/base: do not wait for PE unit to load
Qi Zhang [Mon, 6 Jan 2020 03:38:42 +0000 (11:38 +0800)]
net/ice/base: do not wait for PE unit to load

When RDMA is not enabled, when checking for completion of a CORER or
GLOBR do not wait for the PE unit to be loaded (indicated by GLNVM_ULD
register's PE_DONE bit being set) since that does not happen and will
cause issues such as failing to initialize the device.

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>
4 years agonet/ice/base: support MAC/VLAN with TCP/UDP in switch
Qi Zhang [Mon, 6 Jan 2020 03:38:41 +0000 (11:38 +0800)]
net/ice/base: support MAC/VLAN with TCP/UDP in switch

Add a feature to allow user to add switch filter using input like
MAC + VLAN (C-tag only) + L4 (TCP/UDP) port. API "ice_add_adv_rule"
is extended to handle this filter type.

Signed-off-by: Kiran Patil <kiran.patil@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>
4 years agonet/ice/base: whitelist register for NVM access
Qi Zhang [Mon, 6 Jan 2020 03:38:40 +0000 (11:38 +0800)]
net/ice/base: whitelist register for NVM access

Allow tools to access register offset 0xB8188 (GLGEN_RSTAT) for
NVMUpdate operations.  This is a read-only register, so risk of other
issues stemming from this change is low. Even so, update the write
command to prevent and reject any commands which attempt to write to
this register, just like we do for GL_HICR_EN.

Signed-off-by: Jeb Cramer <jeb.j.cramer@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>
4 years agoapp/testpmd: call cleanup on exit
Stephen Hemminger [Tue, 7 Jan 2020 18:59:42 +0000 (10:59 -0800)]
app/testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which
is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can
be checked with tools like valgrind.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/hns3: remove unused constants
Hao Chen [Sat, 21 Dec 2019 10:32:53 +0000 (18:32 +0800)]
net/hns3: remove unused constants

This patch removed some unused macros defined in hns3_rss.h,
these macros are used to set tuples for abandoned RTE_ETH_FILTER_HASH
in hns3_dev_filter_ctrl().

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove unnecessary assignments in Tx
Wei Hu (Xavier) [Sat, 21 Dec 2019 10:32:52 +0000 (18:32 +0800)]
net/hns3: remove unnecessary assignments in Tx

This patch removes the unnecessary assignment in the '.tx_pkt_burst' ops
implementation function to avoid performance loss.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
4 years agonet/hns3: remove useless variable initializations
Wei Hu (Xavier) [Sat, 21 Dec 2019 10:32:51 +0000 (18:32 +0800)]
net/hns3: remove useless variable initializations

This patch removes the redundant initialization of the variable
named ret.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove redundant stats reset
Hao Chen [Sat, 21 Dec 2019 10:32:50 +0000 (18:32 +0800)]
net/hns3: remove redundant stats reset

This patch removes the redundant statement calling hns3_stats_reset()
to clear statistical information explicitly in the initialization of
VF device, because hardware has been reset by FLR in the initialization
and the initial hardware and software statistics values are 0.

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: optimize default RSS algorithm
Hao Chen [Sat, 21 Dec 2019 10:32:49 +0000 (18:32 +0800)]
net/hns3: optimize default RSS algorithm

This patch changed the default algorithm of RSS from simle_xor to
toeplitz because toeplitz is used more frequently by upper applications
such as ceph.

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove custom macro for minimum length
Huisong Li [Sat, 21 Dec 2019 10:32:48 +0000 (18:32 +0800)]
net/hns3: remove custom macro for minimum length

This patch replaces custom macro named HNS3_MIN_FRAME_LEN for ethernet
minimum frame length with the macro named RTE_ETHER_MIN_LEN that defined
in DPDK framework.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: modify return value of enable MSI-X
Wei Hu (Xavier) [Sat, 21 Dec 2019 10:32:47 +0000 (18:32 +0800)]
net/hns3: modify return value of enable MSI-X

This patch replaces the return value "-1" with "-ENXIO".

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>