dpdk.git
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>
5 years agonet/ice/base: enable RSS for PPPoE with SCTP
Qi Zhang [Mon, 23 Sep 2019 07:44:30 +0000 (15:44 +0800)]
net/ice/base: enable RSS for PPPoE with SCTP

Add two ptypes(MAC_PPPOE_IPV4_SCTP and MAC_PPPOE_IPV6_SCTP) in
sctp ptype bitmap to enable 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: associate switch recipe to profiles
Qi Zhang [Mon, 23 Sep 2019 07:44:29 +0000 (15:44 +0800)]
net/ice/base: associate switch recipe to profiles

Properly associate switch recipes to profiles. Previous code was
using the wrong bitfield for updating the associations, which was
causing other PFs to not properly identify and use existing
recipes. This sometimes resulted in rules not being added when it
should have been possible.

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: refactor data structure
Qi Zhang [Mon, 23 Sep 2019 07:44:28 +0000 (15:44 +0800)]
net/ice/base: refactor data structure

When declaring the ice_prot_ext, and ice_prot_id_tbl structure,
we can use a fixed length array instead of a variable length one
which helps us catch future code changes that might desynchronize
the enum ice_protocol_type and the structs.  This change also
necessitates removing the last member of the structs which was
just there to be a placeholder.

Also reorder the ice_prot_ext struct to match the ordering in the
associated enum ice_protocol_type.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@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 switch rule about VLAN PPPoE
Qi Zhang [Mon, 23 Sep 2019 07:44:27 +0000 (15:44 +0800)]
net/ice/base: support switch rule about VLAN PPPoE

Add support for switch rule about single-VLAN-PPPoE. Note that double
VLAN is not supported by the hardware at this point, therefore only
single-VLAN support for PPPoE is added.

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: remove RSS code as iavf host
Qi Zhang [Mon, 23 Sep 2019 07:44:26 +0000 (15:44 +0800)]
net/ice/base: remove RSS code as iavf host

The DPDK PF doesn't support SRIOV so remove the related iavf host
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: remove null check of port info
Qi Zhang [Mon, 23 Sep 2019 07:44:25 +0000 (15:44 +0800)]
net/ice/base: remove null check of port info

The code in ice_sched_cleanup_all checks whether the port info is NULL
prior to calling ice_sched_clear_port.

More importantly, it also checks whether the port structure has been
initialized by checking its port_state field as well.

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>
5 years agonet/ice/base: propagate errors from functions
Qi Zhang [Mon, 23 Sep 2019 07:44:24 +0000 (15:44 +0800)]
net/ice/base: propagate errors from functions

There could be an error returned from ice_fill_adv_dummy_packet()
so we need to propagate that to the caller. Additionally, the
call to ice_flow_xtract_pkt_flags() could also return an error so
we need to propagate it as well.

Also add in the correct offsets for GENEVE and VXLAN_GPE to the
dummy packets.

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 mask for checking protocol header
Qi Zhang [Mon, 23 Sep 2019 07:44:23 +0000 (15:44 +0800)]
net/ice/base: fix mask for checking protocol header

Before this patch, the logic of protocol header checking only support
non-tunneled packet. This patch remove the inner protocol in L3/L4 RSS
seg hdr mask and change the protocol header validation to reflect this.
So, for ice_add_rss_cfg(), the last parameter addl_hdrs could specify
the protocol header for tunnel.

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: add non-word aligned IPv6 field support
Qi Zhang [Mon, 23 Sep 2019 07:44:22 +0000 (15:44 +0800)]
net/ice/base: add non-word aligned IPv6 field support

Add non-word aligned field support for IPv6 with hlim, tc and proto.
All these fields are one byte within one word. In order to match
bytes within the IPv6 header for flow director we need to use a mask.

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: add non-word aligned IPv4 field support
Qi Zhang [Mon, 23 Sep 2019 07:44:21 +0000 (15:44 +0800)]
net/ice/base: add non-word aligned IPv4 field support

Add non-word aligned field support for ipv4 with ttl, tos and proto.
All these fields are one byte within one word. In order to match
bytes within the IPv4 header for flow director we need to use a mask.

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: support tunnel packets
Qi Zhang [Mon, 23 Sep 2019 07:44:20 +0000 (15:44 +0800)]
net/ice/base: support tunnel packets

Add VXLAN tunnel training packets to flow director and change the
interface to support tunnel packets.

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>
5 years agonet/ice/base: remove redundant empty lines
Qi Zhang [Mon, 23 Sep 2019 07:44:19 +0000 (15:44 +0800)]
net/ice/base: remove redundant empty lines

Remove redundant empty lines

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 agoexamples/ipv4_multicast: check allmulticast enable status
Ivan Ilchenko [Tue, 24 Sep 2019 12:56:13 +0000 (13:56 +0100)]
examples/ipv4_multicast: check allmulticast enable status

rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return
value was changed from void to int, so this patch modify usage
of these functions across examples/ipv4_multicast
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp/testpmd: check code of allmulticast mode switch
Ivan Ilchenko [Tue, 24 Sep 2019 12:56:12 +0000 (13:56 +0100)]
app/testpmd: check code of allmulticast mode switch

rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return
value was changed from void to int, so this patch modify usage
of these functions across app/test-pmd
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: do nothing if all-multicast mode is applied again
Andrew Rybchenko [Tue, 24 Sep 2019 12:56:11 +0000 (13:56 +0100)]
ethdev: do nothing if all-multicast mode is applied again

Since driver callbacks return status code now, there is no necessity
to enable or disable all-multicast mode once again if it is already
successfully enabled or disabled.

Configuration restore at startup tries to ensure that configured
all-multicast mode is applied and start will return error if it fails.

Also it avoids theoretical cases when already configured all-multicast
mode is applied once again and fails. In this cases it is unclear
which value should be reported on get (configured or opposite).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: change allmulticast callbacks to return status
Ivan Ilchenko [Tue, 24 Sep 2019 12:56:10 +0000 (13:56 +0100)]
ethdev: change allmulticast callbacks to return status

Enabling/disabling of allmulticast mode is not always successful and
it should be taken into account to be able to handle it properly.

When correct return status is unclear from driver code, -EAGAIN is used.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/bonding: check code of allmulticast mode switch
Ivan Ilchenko [Tue, 24 Sep 2019 12:56:09 +0000 (13:56 +0100)]
net/bonding: check code of allmulticast mode switch

rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return
value was changed from void to int, so this patch modify usage
of these functions across net/bonding
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/failsafe: check code of allmulticast mode switch
Ivan Ilchenko [Tue, 24 Sep 2019 12:56:08 +0000 (13:56 +0100)]
net/failsafe: check code of allmulticast mode switch

rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return
value was changed from void to int, so this patch modify usage
of these functions across net/failsafe according to new return type.

Try to keep all-multicast mode consistent across all active
devices in the case of failure.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoethdev: change allmulticast mode API to return errors
Ivan Ilchenko [Tue, 24 Sep 2019 12:56:07 +0000 (13:56 +0100)]
ethdev: change allmulticast mode API to return errors

Change rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable()
return value from void to int and return negative errno values
in case of error conditions.
Modify usage of these functions across the ethdev according
to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: change owner delete function to return int
Igor Romanov [Tue, 10 Sep 2019 09:02:16 +0000 (10:02 +0100)]
ethdev: change owner delete function to return int

Change rte_eth_dev_owner_delete() return value from void to int
and return negative errno values in case of error conditions.

Right now there is only one error case for rte_eth_dev_owner_delete() -
invalid owner, but it still makes sense to return error to catch bugs
in the code which uses the function.

Also update the usage of the function in drivers/netvsc
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoexamples: check status of getting MAC address
Igor Romanov [Tue, 10 Sep 2019 08:52:20 +0000 (09:52 +0100)]
examples: check status of getting MAC address

The return value of rte_eth_macaddr_get() was changed from void to int.
Update the usage of the functions according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp: check status of getting MAC address
Igor Romanov [Tue, 10 Sep 2019 08:52:17 +0000 (09:52 +0100)]
app: check status of getting MAC address

The return value of rte_eth_macaddr_get() was changed from void to int.
Update the usage of the functions according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp/testpmd: check status of getting MAC address
Igor Romanov [Tue, 10 Sep 2019 08:52:16 +0000 (09:52 +0100)]
app/testpmd: check status of getting MAC address

Add a wrapper for rte_eth_macaddr_get() that prints an
error and returns a status code if the function fails.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: change MAC address get function to return int
Igor Romanov [Tue, 10 Sep 2019 08:52:15 +0000 (09:52 +0100)]
ethdev: change MAC address get function to return int

Change rte_eth_macaddr_get() return value from void to int
and return negative errno values in case of error conditions.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoexamples: check status of getting link info
Igor Romanov [Tue, 10 Sep 2019 08:25:50 +0000 (09:25 +0100)]
examples: check status of getting link info

The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp: check status of getting link info
Igor Romanov [Tue, 10 Sep 2019 08:25:47 +0000 (09:25 +0100)]
app: check status of getting link info

The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp/pipeline: check status of getting link info
Andrew Rybchenko [Tue, 10 Sep 2019 08:25:49 +0000 (09:25 +0100)]
app/pipeline: check status of getting link info

The return value of rte_eth_link_get_nowait() was changed from void to int.
Update the usage of the function according to the new return type.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/memif: check status of getting link info
Andrew Rybchenko [Tue, 10 Sep 2019 08:25:46 +0000 (09:25 +0100)]
net/memif: check status of getting link info

The return value of rte_eth_link_get() was changed from void to int.
Update the usage of the function according to the new return type.

Just log error if something goes wrong.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/ixgbe: check status of getting link info
Igor Romanov [Tue, 10 Sep 2019 08:25:45 +0000 (09:25 +0100)]
net/ixgbe: check status of getting link info

The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/bonding: check status of getting link info
Igor Romanov [Tue, 10 Sep 2019 08:25:44 +0000 (09:25 +0100)]
net/bonding: check status of getting link info

The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp/testpmd: check status of getting link info
Igor Romanov [Tue, 10 Sep 2019 08:25:43 +0000 (09:25 +0100)]
app/testpmd: check status of getting link info

Add a wrapper for rte_eth_eth_link_get_nowait() that prints an
error and returns a status code if the function fails.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: change link status get functions to return int
Igor Romanov [Tue, 10 Sep 2019 08:25:42 +0000 (09:25 +0100)]
ethdev: change link status get functions to return int

Change rte_eth_link_get() and rte_eth_link_get_nowait() return value
from void to int and return negative errno values in case of error
conditions.

Return value of link_update callback is ignored since the callback
returns not errors but whether link up status has changed or not.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/bonding: fix link speed update in broadcast mode
Igor Romanov [Tue, 10 Sep 2019 08:25:41 +0000 (09:25 +0100)]
net/bonding: fix link speed update in broadcast mode

Fix the issue that the link speed of the bond device was set to the
link speed of the first active slave in broadcast mode.

Set the link speed of the bond device to the minimum value across
all of the slaves in that case.

Fixes: deba8a2f8b0b ("net/bonding: fix link properties management")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Chas Williams <chas3@att.com>
5 years agoethdev: make stats and xstats reset callbacks return int
Igor Romanov [Fri, 6 Sep 2019 14:34:54 +0000 (15:34 +0100)]
ethdev: make stats and xstats reset callbacks return int

Change return value of the callbacks from void to int. Make
implementations across all drivers return negative errno
values in case of error conditions.

Both callbacks are updated together because a large number of
drivers assign the same function to both callbacks.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoethdev: change xstats reset function to return int
Igor Romanov [Fri, 6 Sep 2019 14:34:53 +0000 (15:34 +0100)]
ethdev: change xstats reset function to return int

Change rte_eth_xstats_reset() return value from void to int and
return negative errno values in case of error conditions.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoexamples: take promiscuous mode switch result into account
Ivan Ilchenko [Sat, 14 Sep 2019 11:37:33 +0000 (12:37 +0100)]
examples: take promiscuous mode switch result into account

rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across examples according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp: check code of promiscuous mode switch
Ivan Ilchenko [Sat, 14 Sep 2019 11:37:26 +0000 (12:37 +0100)]
app: check code of promiscuous mode switch

rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across apps according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp/testpmd: check code of promiscuous mode switch
Ivan Ilchenko [Sat, 14 Sep 2019 11:37:27 +0000 (12:37 +0100)]
app/testpmd: check code of promiscuous mode switch

rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across app/testpmd
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agokni: check code of promiscuous mode switch
Ivan Ilchenko [Sat, 14 Sep 2019 11:37:31 +0000 (12:37 +0100)]
kni: check code of promiscuous mode switch

rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so modify usage of these
functions across lib/librte_kni according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: do nothing if promiscuous mode is applied again
Andrew Rybchenko [Sat, 14 Sep 2019 11:37:25 +0000 (12:37 +0100)]
ethdev: do nothing if promiscuous mode is applied again

Since driver callbacks return status code now, there is no necessity
to enable or disable promiscuous mode once again if it is already
successfully enabled or disabled.

Configuration restore at startup tries to ensure that configured
promiscuous mode is applied and start will return error if it fails.

Also it avoids theoretical cases when already configured promiscuous
mode is applied once again and fails. In this cases it is unclear
which value should be reported on get (configured or opposite).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: change promiscuous callbacks to return status
Andrew Rybchenko [Sat, 14 Sep 2019 11:37:24 +0000 (12:37 +0100)]
ethdev: change promiscuous callbacks to return status

Enabling/disabling of promiscuous mode is not always successful and
it should be taken into account to be able to handle it properly.

When correct return status is unclear from driver code, -EAGAIN is used.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/bonding: check code of promiscuous mode switch
Ivan Ilchenko [Sat, 14 Sep 2019 11:37:23 +0000 (12:37 +0100)]
net/bonding: check code of promiscuous mode switch

rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across net/bonding according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/failsafe: check code of promiscuous mode switch
Ivan Ilchenko [Sat, 14 Sep 2019 11:37:22 +0000 (12:37 +0100)]
net/failsafe: check code of promiscuous mode switch

rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across net/failsafe according to new return type.

Try to keep promiscuous mode consistent across all active
devices in the case of failure.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>