dpdk.git
4 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>
4 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>
4 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>
4 years agoethdev: change promiscuous mode controllers to return errors
Ivan Ilchenko [Sat, 14 Sep 2019 11:37:21 +0000 (12:37 +0100)]
ethdev: change promiscuous mode controllers to return errors

Change rte_eth_promiscuous_enable()/rte_eth_promiscuous_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>
4 years agodoc: cleanup license in bnx2x guide
Rasesh Mody [Thu, 19 Sep 2019 21:11:57 +0000 (14:11 -0700)]
doc: cleanup license in bnx2x guide

Removed redundant BSD boilerplate text from bnx2x guide.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/octeontx2: add packet type translation for ICMP6
Nithin Dabilpuram [Wed, 4 Sep 2019 08:04:32 +0000 (13:34 +0530)]
net/octeontx2: add packet type translation for ICMP6

Update ptype translation logic with ICMP6
in both outer and inner layers.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: fix packet type translation
Nithin Dabilpuram [Wed, 4 Sep 2019 08:04:31 +0000 (13:34 +0530)]
net/octeontx2: fix packet type translation

Extract and use layer type LB..LE for non-tunnel ptype and
LF..LH as tunnel ptype translation.

Fixes: 6e892eabce11 ("net/octeontx2: support packet type")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: fix port Tx VLAN insertion
Nithin Dabilpuram [Fri, 16 Aug 2019 04:19:55 +0000 (09:49 +0530)]
net/octeontx2: fix port Tx VLAN insertion

This patch fixes configuration for port Tx vlan insertion feature.
As per latest Tx KEX profile, pf_func should be at
KW[0](47:32) and not KW[1](63:48).

Fixes: 168c59cfe42b ("net/octeontx2: add flow MCAM utility functions")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: fix packet type get overflow
Pavan Nikhilesh [Wed, 14 Aug 2019 09:41:13 +0000 (15:11 +0530)]
net/octeontx2: fix packet type get overflow

The function `rte_eth_dev_get_supported_ptypes` expects the underlying
ethernet device to return array of supported ptypes. The ethernet device
needs to set `RTE_PTYPE_UNKNOWN` as the last element which signifies
thats its the end of the ptype array.
Else the function `rte_eth_dev_get_supported_ptypes` might overflow.

Fixes: 6e892eabce11 ("net/octeontx2: support packet type")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agodoc: update octeontx2 supported SoCs
Jerin Jacob [Thu, 5 Sep 2019 13:42:40 +0000 (19:12 +0530)]
doc: update octeontx2 supported SoCs

CNF95XX SoC part is not available for general availability.
Update the documentation to reflect the status.

Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
4 years agovhost: fix slave request fd leak
Tiwei Bie [Thu, 5 Sep 2019 11:01:25 +0000 (19:01 +0800)]
vhost: fix slave request fd leak

We need to close the old slave request fd if any first
before taking the new one.

Fixes: 275c3f944730 ("vhost: support slave requests channel")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: add device op when notification to guest is sent
Eelco Chaudron [Wed, 28 Aug 2019 14:49:39 +0000 (10:49 -0400)]
vhost: add device op when notification to guest is sent

This patch adds an operation callback which gets called every time
the library is waking up the guest trough an eventfd_write() call.

This can be used by 3rd party application, like OVS, to track the
number of times interrupts where generated. This might be of
interest to find out system-call were called in the fast path.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: add Altivec Rx
David Christensen [Wed, 14 Aug 2019 17:49:53 +0000 (12:49 -0500)]
net/virtio: add Altivec Rx

Added the file virtio_rxtx_simple_altivec.c which implements Altivec
code for the virtio vectorized RX functions. Updated the various build
files.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/ice: support device-specific DDP package loading
Ting Xu [Tue, 17 Sep 2019 13:02:28 +0000 (13:02 +0000)]
net/ice: support device-specific DDP package loading

This patch adds the feature that supports loading DDP package
according to the device serial number. Prior to loading the
default DDP package (ice.pkg), the driver will check for the
presence of a device-specific DDP package with the name containing
64-bit PCIe Device Serial Number (ice-xxxxxxxxxxxxxxxx.pkg)
during initialization. Users can use "lspci -vs" to get the device
serial number.
The pkg search path are /lib/firmware/updates/intel/ice/ddp/
and /lib/firmware/intel/ice/ddp/. If the package exists,
the driver will download it to the device instead of the default
one. The loaded package type (OS default and COMMS) will be
stored in ice_adapter->active_pkg_type. The package version is
stored in ice_hw->active_pkg_ver.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice/base: ignore inverse switch recipes
Qi Zhang [Thu, 29 Aug 2019 02:36:56 +0000 (10:36 +0800)]
net/ice/base: ignore inverse switch recipes

When looking for an existing recipes, never choose an inverse
recipe as these are used for anti-spoofing. Choosing inverse
recipes for source MAC address rules was causing errors while
adding the rule.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: update profile to recipe bitmap array
Qi Zhang [Thu, 29 Aug 2019 02:36:55 +0000 (10:36 +0800)]
net/ice/base: update profile to recipe bitmap array

Correctly update profile to recipe bitmap array after adding and
associating recipes. This fixes an issue where determining unused
recipe result index slots was incorrect.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add GENEVE offset
Qi Zhang [Thu, 29 Aug 2019 02:36:54 +0000 (10:36 +0800)]
net/ice/base: add GENEVE offset

Add Geneve offset for tunneled packets to allow dummy packets to be
properly created.

Signed-off-by: Doug Dziggel <douglas.a.dziggel@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: enable RSS with ether layer for PPPoE
Qi Zhang [Thu, 29 Aug 2019 02:36:53 +0000 (10:36 +0800)]
net/ice/base: enable RSS with ether layer for PPPoE

Add these two ptype(MAC_PPPOD_PAY and MAC_PPPOE_PAY) in outer mac
bitmap, so it can hash for outer mac.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: remove Rx flex descriptor programming
Qi Zhang [Thu, 29 Aug 2019 02:36:52 +0000 (10:36 +0800)]
net/ice/base: remove Rx flex descriptor programming

Removing Rx flex descriptor metadata and flag programming from the code,
these registers cannot be written to as they are read only.
The programming for all fields per RxDID is now handled differently.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add AQC get link topology handle support
Qi Zhang [Thu, 29 Aug 2019 02:36:51 +0000 (10:36 +0800)]
net/ice/base: add AQC get link topology handle support

Add AQC get link topology handle support. This is needed to determine
Direct Attach (DA) or backplane media type for PHY types that support
either. Get link topology handle cage node type request can be used to
determine if a cage is present or not. If a cage is present for PHY
types that supports both DA and backplane media type, then the media
type is DA, else the media type is backplane.

Signed-off-by: Paul Greenwalt <paul.greenwalt@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: delay less
Qi Zhang [Thu, 29 Aug 2019 02:36:50 +0000 (10:36 +0800)]
net/ice/base: delay less

Shorten the delay for SQ responses, but increase the number of loops.
Max delay time is unchanged, but some operations complete much more
quickly.

In the process, add a new define to make the delay count and delay time
more explicit, and simplify the code so it's the same for both switch
and NIC mode. Add comments to make things more explicit.

Signed-off-by: Mitch Williams <mitch.a.williams@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: replace open-code duplication
Qi Zhang [Thu, 29 Aug 2019 02:36:49 +0000 (10:36 +0800)]
net/ice/base: replace open-code duplication

Use BIT_ULL() instead of ICE_FLOW_HASH_FLD() which does the same bit shift
operation.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: update to register definition file
Qi Zhang [Thu, 29 Aug 2019 02:36:48 +0000 (10:36 +0800)]
net/ice/base: update to register definition file

Added register definitions for GL_MDCK_TX_TDPU and GL_MDET_TX_TDPU.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: correct abbreviations
Qi Zhang [Thu, 29 Aug 2019 02:36:47 +0000 (10:36 +0800)]
net/ice/base: correct abbreviations

Correct abbreviation issues found by running abbrevcheck.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: remove unnecessary if branch
Qi Zhang [Thu, 29 Aug 2019 02:36:46 +0000 (10:36 +0800)]
net/ice/base: remove unnecessary if branch

We are already in the branch "if (fm_list->vsi_count == 1)"
no need to exit and re-enter.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: remove unnecessary dummy packet finding
Qi Zhang [Thu, 29 Aug 2019 02:36:45 +0000 (10:36 +0800)]
net/ice/base: remove unnecessary dummy packet finding

We don't need to find a dummy packet when removing a rule so remove
the call to get the dummy packet. This also obviates some variables
so remove them also.

Also reduce the scope of rule_buf_sz.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: update switch training packets with open ports
Qi Zhang [Thu, 29 Aug 2019 02:36:44 +0000 (10:36 +0800)]
net/ice/base: update switch training packets with open ports

This patch updates UDP tunneled training packets with an appropriate
UDP dest port. For the correct profile to be chosen, an open tunnel
port must be included in the training packet.

Added GENEVE tunnel labels in the test package in order to test GENEVE
tunnel rule creation.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: maximize switch recipe words per line
Qi Zhang [Thu, 29 Aug 2019 02:36:43 +0000 (10:36 +0800)]
net/ice/base: maximize switch recipe words per line

Remove grouping rules to maximize the number of words placed into
a recipe line. This will allow more recipes to be added by reducing
the number of result indices required.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: refactor removal of VLAN promiscuous rules
Qi Zhang [Thu, 29 Aug 2019 02:36:42 +0000 (10:36 +0800)]
net/ice/base: refactor removal of VLAN promiscuous rules

Currently ice_clear_vsi_promisc() detects if the VLAN ID sent is not 0
and sets the recipe_id to ICE_SW_LKUP_PROMISC_VLAN in that case and
ICE_SW_LKUP_PROMISC if the VLAN_ID is 0. However this doesn't allow VLAN
0 promiscuous rules to be removed, but they can be added. Fix this by
checking if the promisc_mask contains ICE_PROMISC_VLAN_RX or
ICE_PROMISC_VLAN_TX. This change was made to match what is being done
for ice_set_vsi_promisc().

Signed-off-by: Brett Creeley <brett.creeley@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix flag settings in AQ call
Qi Zhang [Thu, 29 Aug 2019 02:36:41 +0000 (10:36 +0800)]
net/ice/base: fix flag settings in AQ call

Removed setting Read flag in the Get Allocated Resource Descriptors AQ
command (0x020A). The read flag is not required for this command and
causes the FW to return an error.

Fixes: d781ccbdd15d ("net/ice/base: add functions to get allocated resources")
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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: remove unnecessary conditional check
Qi Zhang [Thu, 29 Aug 2019 02:36:40 +0000 (10:36 +0800)]
net/ice/base: remove unnecessary conditional check

There is no reason to do this conditional check before the assignment so
simply remove it.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add RSS support for PPPoE and GTPU
Qi Zhang [Thu, 29 Aug 2019 02:36:39 +0000 (10:36 +0800)]
net/ice/base: add RSS support for PPPoE and GTPU

Added RSS support for PPPoE with inner TCP and UDP.
Added RSS support for GTPU with IPv4 and IPv6.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: packet encapsulation for RSS
Qi Zhang [Thu, 29 Aug 2019 02:36:38 +0000 (10:36 +0800)]
net/ice/base: packet encapsulation for RSS

RSS configurations calls currently support only non-tunneled packets,
which uses outer-first IPs. Adding another call to configure RSS for
tunneled packets which will enable hashing on inner-last IP. RSS hash
will only be done on the innermost IP.
- Update RSS configuration calls to take packet segment count as input
  argument
- Update flow profile ID to include identifier for encapsulated packet
  [0:31] : Packet match fields
  [32:62]: Protocol header header
  [63]: Encapsulation flag, 0 if non-tunneled, 1 if tunneled

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix for RSS hash on inner UDP port
Qi Zhang [Thu, 29 Aug 2019 02:36:37 +0000 (10:36 +0800)]
net/ice/base: fix for RSS hash on inner UDP port

Before this patch, only outer IP with inner UDP port can appear in
RSS hash, because the extraction sequence uses outer IP protocol
ID with Inner UDP protocol ID. ICE_PROT_UDP_OF always extracts the
TUNNELED UDP port values (i.e., 4789 for VXLAN). ICE_PROT_UDP_IL_OR_S
will extract NON-TUNNELED UDP port or inner UDP port.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: consolidate packet type group
Qi Zhang [Thu, 29 Aug 2019 02:36:36 +0000 (10:36 +0800)]
net/ice/base: consolidate packet type group

This patch is an optimization to decrease the number of TCAM entries
used in the profile blocks, especially for RSS. To be most effective
this will also require a package change in order to decrease the number
of PTYPE groups necessary to program RSS, FD and ACL rules.

Change required package version to 1.3.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add routine for tunnel port query
Qi Zhang [Thu, 29 Aug 2019 02:36:35 +0000 (10:36 +0800)]
net/ice/base: add routine for tunnel port query

Add ice_get_open_tunnel_port routine, which can be used to find
an open tunnel port for creating switch and flow director training
packets.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: move and add some help function and macros
Qi Zhang [Thu, 29 Aug 2019 02:36:34 +0000 (10:36 +0800)]
net/ice/base: move and add some help function and macros

The patch move ice_ilog2 and ice_is_pow2 to ice_type.h, also add help
macro ROUND_UP and IS_ETHER_ADDR_EQUAL.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: improve switch chained recipe
Qi Zhang [Thu, 29 Aug 2019 02:36:33 +0000 (10:36 +0800)]
net/ice/base: improve switch chained recipe

When updating switch database with chained recipes from
firmware, where a null pointer derefence was occurring due to looking
into a sub-recipe entry which is not filled in.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: update UDP tunnel switch training packets
Qi Zhang [Thu, 29 Aug 2019 02:36:32 +0000 (10:36 +0800)]
net/ice/base: update UDP tunnel switch training packets

Change UDP tunnel training packets for the switch to work for both
Geneve and VXLAN cases.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: return switch error on invalid match criteria
Qi Zhang [Thu, 29 Aug 2019 02:36:31 +0000 (10:36 +0800)]
net/ice/base: return switch error on invalid match criteria

Modify ice_add_adv_rule to return an error when an invalid match
criteria is requested by the caller. This happens when the protocol
and offset pair is not supported by the package.

This change required a fix for the offset in the VXLAN GPE header,
and also found an issue with NVGRE where the package does not seem
to extract the correct offsets.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: associate recipes by profile type
Qi Zhang [Thu, 29 Aug 2019 02:36:30 +0000 (10:36 +0800)]
net/ice/base: associate recipes by profile type

Change recipe to profile association logic to determine the profile type
to determine if a profile is compatible with the rule being added.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: support not locking sideband queue
Qi Zhang [Thu, 29 Aug 2019 02:36:29 +0000 (10:36 +0800)]
net/ice/base: support not locking sideband queue

For certain PTP clock adjustments, there is a use case for locking the
sideband queue at a higher level and performing an atomic series of
operations while the sideband queue is locked.  To accommodate this use
case, split ice_sw_send_cmd() into a version that takes the lock and a
version that does not.

Signed-off-by: Ben Shelton <benjamin.h.shelton@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add function to configure Tx AQ command
Qi Zhang [Thu, 29 Aug 2019 02:36:28 +0000 (10:36 +0800)]
net/ice/base: add function to configure Tx AQ command

This function is needed by the driver to move PSM leaf nodes to a new
parent.

Additionally, add struct ice_aqc_move_txqs to struct ice_aq_desc so
driver code can access it.

Signed-off-by: Ben Shelton <benjamin.h.shelton@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: initialize driver NVM data earlier
Qi Zhang [Thu, 29 Aug 2019 02:36:27 +0000 (10:36 +0800)]
net/ice/base: initialize driver NVM data earlier

The driver detects and warns about FW rollback mode before getting the NVM
version (through ice_init_nvm) which results in "0.00 0x0 0.0.0" being
printed. Fix this by calling ice_init_nvm earlier.

This could have been fixed by moving ice_print_rollback_msg as well, but
it made more sense to move ice_init_nvm closer to the flow that gets the
FW version information (i.e. control queue init flow).

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: set status when global cfg lock is unavailable
Qi Zhang [Thu, 29 Aug 2019 02:36:26 +0000 (10:36 +0800)]
net/ice/base: set status when global cfg lock is unavailable

To download the DDP file to the device, a PF first has to grab the
global configuration lock. When a PF can't grab this lock, set
hw->pkg_dwnld_status to ICE_AQ_RC_EEXIST.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add more opcode and macros
Qi Zhang [Thu, 29 Aug 2019 02:36:25 +0000 (10:36 +0800)]
net/ice/base: add more opcode and macros

Add more opcode and macros:

1. Add opcode for the NVM Update EMPR command.
2. Add opcode for NVM save factory settings
3. Add opcode for NVM Write/Write Activate calls
4. Add loopback reporting to get link response macros
5. Add link event defines macros

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: update flag bits
Qi Zhang [Thu, 29 Aug 2019 02:36:24 +0000 (10:36 +0800)]
net/ice/base: update flag bits

Currently the VLAN ice_flg64_bits are off by 1. Fix this by
setting the ICE_FLG_EVLAN_x8100 flag to 14, which also updates
ICE_FLG_EVLAN_x9100 to 15 and ICE_FLG_VLAN_x8100 to 16.

Signed-off-by: Brett Creeley <brett.creeley@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add 32-byte Flex Rx descriptor
Qi Zhang [Thu, 29 Aug 2019 02:36:23 +0000 (10:36 +0800)]
net/ice/base: add 32-byte Flex Rx descriptor

Add 32-byte Flex RX Descriptor structure definition.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add 16-byte Flex Rx descriptor
Qi Zhang [Thu, 29 Aug 2019 02:36:22 +0000 (10:36 +0800)]
net/ice/base: add 16-byte Flex Rx descriptor

Add 16-byte Flex RX descriptor structure definition.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: move function declaration
Qi Zhang [Thu, 29 Aug 2019 02:36:21 +0000 (10:36 +0800)]
net/ice/base: move function declaration

Improve code orgnization, move declaration of ice_cfg_tc_nod_bw_alloc and
ice_cfg_rl_burst_size from ice_common.h to ice_nvm.h.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: improve switch advanced rule
Qi Zhang [Thu, 29 Aug 2019 02:36:20 +0000 (10:36 +0800)]
net/ice/base: improve switch advanced rule

Correct algorithm to detect free field vector indexes to be
used for recipe line result values. The code now scans all
recipes that are associated with all the field vector being
targed for a new recipe to detect which result indexes are
unused.

Change recipe chaining code to place recipe on a single line
if it will fit, rather than looking to break things apart
according to preferred combinations.

These improvements fix a condition where recipes were getting
added with conflicting result index values.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add locks for flow functions
Qi Zhang [Thu, 29 Aug 2019 02:36:19 +0000 (10:36 +0800)]
net/ice/base: add locks for flow functions

Wrap functions to search for flow profiles, add and remove RSS
configurations with flow profile locks. This is to ensure that if
several VFs and PFs are disabled at the same time functions that access
the flow profile lists are thread safe.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: support GTP and PPPoE protocols
Qi Zhang [Thu, 29 Aug 2019 02:36:18 +0000 (10:36 +0800)]
net/ice/base: support GTP and PPPoE protocols

Added switch protocol segments for both GTP and PPPOE protocols.
Added RSS protocol segments for both GTP and PPPOE protocols.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: support NVM access commands
Qi Zhang [Thu, 29 Aug 2019 02:36:17 +0000 (10:36 +0800)]
net/ice/base: support NVM access commands

Add a new structure, ice_nvm_access, used to request access to read or
write certain NVM related registers.

The structure is used by NVM Update to request read or write of specific
NVM registers in order to perform updates.

Additionally, there is a command to request the driver "features"
structure which represents data about what features of the NVM access
interface the driver supports.

Implement ice_handle_nvm_access to parse the access request and perform
the necessary function.

This function verifies that the access request is valid. If so, the
function will delegate to perform the register read, register write, or
copying of the driver ice_nvm_features structure.

If the request is invalid, the function will report a suitable error
codition that can be propagated out.

Only a subset of registers is accessible, and all other registers will
be rejected with ICE_ERR_OUT_OF_RANGE.

When reading, the contents of the variable sized data buffer will be
used as storage for returning the register value. When writing, the
contents will be used as input for the value to write to the register.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: update Boot Configuration Section read of NVM
Qi Zhang [Thu, 29 Aug 2019 02:36:16 +0000 (10:36 +0800)]
net/ice/base: update Boot Configuration Section read of NVM

Boot Configuration Section Block has been moved to the
Preserved Field Area (PFA) of NVM. So, this patch updates
the NVM reads that involve Boot Configuration Section.

Signed-off-by: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix overrun
Qi Zhang [Thu, 29 Aug 2019 02:36:15 +0000 (10:36 +0800)]
net/ice/base: fix overrun

Added boundary check for layer_num in function ice_sched_rm_rl_profile,
and ice_sched_add_rl_profile.

Cc: stable@dpdk.org
Tarun Singh <tarun.k.singh@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix type-mismatch
Qi Zhang [Thu, 29 Aug 2019 02:36:14 +0000 (10:36 +0800)]
net/ice/base: fix type-mismatch

The iterators are u8, but the values being compared against are u16s.
It may not ever be the case that the comparison is against a value
larger than the upper bound of the smaller type, but code analysis tools
don't know that.

Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler")
Cc: stable@dpdk.org
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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: check root pointer for validity
Qi Zhang [Thu, 29 Aug 2019 02:36:13 +0000 (10:36 +0800)]
net/ice/base: check root pointer for validity

ice_sched_get_tc_node uses pi->root without checking for NULL. Add a
check to prevent NULL pointer dereference.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix memory leak
Qi Zhang [Thu, 29 Aug 2019 02:36:12 +0000 (10:36 +0800)]
net/ice/base: fix memory leak

Need to free new ice_vsig_prof if no valid ptype can be found.

Fixes: d935fb5bb091 ("net/ice/base: fix packet type size")
Cc: stable@dpdk.org
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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: resolve static analysis issues
Qi Zhang [Thu, 29 Aug 2019 02:36:11 +0000 (10:36 +0800)]
net/ice/base: resolve static analysis issues

Coverity complains first_free can be -1 resulting in a negative shift left
when k equals 0; i.e. the expression 1 << (first_free - k). Fix this by
explicitly checking for this case.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: enable masking for RSS and FD field vectors
Qi Zhang [Thu, 29 Aug 2019 02:36:10 +0000 (10:36 +0800)]
net/ice/base: enable masking for RSS and FD field vectors

Allow masking per word field on RSS and FD field vectors.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: move VSI to VSI group
Qi Zhang [Thu, 29 Aug 2019 02:36:09 +0000 (10:36 +0800)]
net/ice/base: move VSI to VSI group

Add function to add a VSI to a given VSIG and update package with this
entry. The usual flow in XLT management would iterate through all
characteristics of the input VSI and create a new VSIG and TCAMs till a
matching characteristic is found. When a match is found the VSI is moved
into a matching VSIG and entries are collapsed, leading to added package
update calls. This function serves as an optimization if we know
beforehand that the input VSI has characteristics same as VSI configured
previously added to a VSIG. This is particularly useful for VF VSIs
which are all usually programmed with the same configurations.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add NVM pkg flag
Qi Zhang [Thu, 29 Aug 2019 02:36:08 +0000 (10:36 +0800)]
net/ice/base: add NVM pkg flag

Add flag for case where active package has been loaded from NVM.

Signed-off-by: Ashish Shah <ashish.n.shah@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: adjust DCB INIT for SW mode
Qi Zhang [Thu, 29 Aug 2019 02:36:07 +0000 (10:36 +0800)]
net/ice/base: adjust DCB INIT for SW mode

Adjust ice_init_dcb to set the is_sw_lldp boolean
in the case where the FW has been detected to be
in an untenable state such that the driver
should forcibly make sure it is off.

This will ensure that the FW is in a known state.

Signed-off-by: Dave Ertman <david.m.ertman@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: support reading REPC statistics
Qi Zhang [Thu, 29 Aug 2019 02:36:06 +0000 (10:36 +0800)]
net/ice/base: support reading REPC statistics

The GLV_REPC register contains statistics for tracking received packets
that are discarded due to certain errors.

This register behaves differently from some of the other related
statistics registers in two ways. First, it contains two 16bit
statistics, and thus cannot be read as a 32bit or 40bit statistic.

Second, the two stats do not roll over, but instead cap at 0xFFFF.

Add a new ice_stat_update_repc function which will read the register and
increment the appropriate statistics in the ice_eth_stats structure.

Since the register does not roll over, make use of the "Write Clear"
behavior, and write to the register to reset it every time we read it.

Add extra space for the two statistics that are counted by this
register, rx_errors, and rx_no_desc.

For now, wrap the new function and stats counters in !LINUX_SUPPORT.
This can later be removed if and when the Linux driver implements
support for reading the statistics.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add helper functions for PHY caching
Qi Zhang [Thu, 29 Aug 2019 02:36:05 +0000 (10:36 +0800)]
net/ice/base: add helper functions for PHY caching

Add additional functions to aide in caching PHY
configuration.  In order to cache the initial modes,
we need to determine the operating mode based on
capabilities.   Add helper functions for flow control
and FEC to take a set of capabilities and return the
operating mode matching those capabilities.  Also add
a helper function to determine whether a PHY capability
matches a PHY configuration.

Introduce a mask for valid link speeds and unwrap
ice_copy_caps_to_cfg() for more builds so that we can utilize
it in more places.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add capabilities when in safe mode
Qi Zhang [Thu, 29 Aug 2019 02:36:04 +0000 (10:36 +0800)]
net/ice/base: add capabilities when in safe mode

The dynamic device personalization (DDP) file download onto the device
can fail, and when this happens the driver has to transition to "safe
mode" where only basic functionality is possible.

The device though doesn't understand safe mode, and so the opcodes to
discover device/function capabilities (0x000A and 0x000B) return all
the capabilities of the device, which includes capabilities that the
driver cannot support when in safe mode.

The initialization flows in the driver are based on the capabilities
information (obtained by the driver with the above mentioned opcodes).
To reuse the same initialization flows in safe mode, it becomes
necessary for the driver to override the currently stored capabilities
information with safe mode capabilities. This is done by a new function
introduced in this patch - ice_set_safe_mode_caps.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: improve debug print message
Qi Zhang [Thu, 29 Aug 2019 02:36:03 +0000 (10:36 +0800)]
net/ice/base: improve debug print message

Improve debug print message.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add SFF EEPROM AQ command
Qi Zhang [Thu, 29 Aug 2019 02:36:02 +0000 (10:36 +0800)]
net/ice/base: add SFF EEPROM AQ command

read/write module eeprom on i2c bus.

Signed-off-by: Scott W Taylor <scott.w.taylor@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: remove debug code
Qi Zhang [Thu, 29 Aug 2019 02:36:01 +0000 (10:36 +0800)]
net/ice/base: remove debug code

Remove firmware logging debug 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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: correct argument port info
Qi Zhang [Thu, 29 Aug 2019 02:36:00 +0000 (10:36 +0800)]
net/ice/base: correct argument port info

correct argument pi(port_info) passed in function
ice_sched_get_first_node(), otherwise it will return the incorrect
node.

functions ice_sched_get_agg_node and ice_sched_cfg_sibl_node_prio:
change argument from hw to pi for it to align to correct port.

Moved saving tc node bw info from hardware structure(hw) to port info
structure(pi). This change allows multiple ports to save and replay
the information correctly.

Signed-off-by: Tarun Singh <tarun.k.singh@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add read PBA module function
Qi Zhang [Thu, 29 Aug 2019 02:35:59 +0000 (10:35 +0800)]
net/ice/base: add read PBA module function

New support function added - ice_get_pfa_module_tlv(), the driver or
other modules can make use of this function to read the pfa area.

Signed-off-by: Tarun Singh <tarun.k.singh@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: store number of functions for the device
Qi Zhang [Thu, 29 Aug 2019 02:35:58 +0000 (10:35 +0800)]
net/ice/base: store number of functions for the device

Store the number of functions the device has.  This value can be
very useful when calculating how to best allocate global resources.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: support init RXDID descs fields
Qi Zhang [Thu, 29 Aug 2019 02:35:57 +0000 (10:35 +0800)]
net/ice/base: support init RXDID descs fields

Add new switch cases to init RXDID descs MD fields.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: support NVM rollback detection
Qi Zhang [Thu, 29 Aug 2019 02:35:56 +0000 (10:35 +0800)]
net/ice/base: support NVM rollback detection

This patch adds code to detect NVM rollback. The rollback detection
is done as part of the HW init flow. When NVM rollback is detected,
a warning message is printed along with the FW/NVM version data.
To do this, this patch adds a helper function ice_get_nvm_version.

Also, a pointer to hw->nvm is already available in ice_init_nvm. Just use
this instead of &hw->nvm.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: add function to get FW mode
Qi Zhang [Thu, 29 Aug 2019 02:35:55 +0000 (10:35 +0800)]
net/ice/base: add function to get FW mode

Add a helper function to get FW mode. The FW mode can be normal,
debug, recovery or rollback.

This makes ice_is_fw_in_rec_mode redundant, so remove it.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: enhance NVM read
Qi Zhang [Thu, 29 Aug 2019 02:35:54 +0000 (10:35 +0800)]
net/ice/base: enhance NVM read

Add an option to read NVM from flash directly.

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: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/vmxnet3: remove unused variable attribute
Ferruh Yigit [Fri, 13 Sep 2019 18:49:10 +0000 (19:49 +0100)]
net/vmxnet3: remove unused variable attribute

No functional change, just removing unused variable tag from a used
variable.

Fixes: 643fba770705 ("net/vmxnet3: add v4 boot and guest UDP RSS config")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yong Wang <yongwang@vmware.com>
4 years agonet/memif: allow for full key size in socket name
Stephen Hemminger [Tue, 16 Jul 2019 17:20:57 +0000 (10:20 -0700)]
net/memif: allow for full key size in socket name

The key size for memif is 256 but the unix domain socket structure has
space for 100 bytes. Change it to use a larger buffer and not hard
code the keysize everywhere.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Jakub Grajciar <jgrajcia@cisco.com>
4 years agonet/ena: use dynamic log type for debug logging
Stephen Hemminger [Tue, 16 Jul 2019 20:43:27 +0000 (13:43 -0700)]
net/ena: use dynamic log type for debug logging

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Michal Krawczyk <mk@semihalf.com>
4 years agonet/kni: remove resources when port is closed
Ferruh Yigit [Fri, 26 Jul 2019 16:33:04 +0000 (17:33 +0100)]
net/kni: remove resources when port is closed

Add .dev_close to clean resources on device close,
also set RTE_ETH_DEV_CLOSE_REMOVE device flag to cause all ethdev
resources removed on 'rte_eth_dev_close()' call.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/sfc: fix missing notification on link status change
Andrew Rybchenko [Fri, 6 Sep 2019 10:49:49 +0000 (11:49 +0100)]
net/sfc: fix missing notification on link status change

rte_eth_linkstatus_set() returns 0 when link up status changes.

Fixes: 4abe903e5078 ("net/sfc: use link status helper functions")
Cc: stable@dpdk.org
Reported-by: Shuki Katzenelson <shuki@lightbitslabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agoexamples: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:29 +0000 (17:42 +0100)]
examples: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoexamples/vhost: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:49 +0000 (17:42 +0100)]
examples/vhost: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/vhost according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agoexamples/qos_sched: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:38 +0000 (17:42 +0100)]
examples/qos_sched: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/qos_sched according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
4 years agoexamples/flow_filtering: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:39 +0000 (17:42 +0100)]
examples/flow_filtering: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/flow_filtering according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoexamples/flow_classify: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:54 +0000 (17:42 +0100)]
examples/flow_classify: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/flow_classify according to its 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>
4 years agoexamples/ipsec-secgw: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:58 +0000 (17:42 +0100)]
examples/ipsec-secgw: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
examples/ipsec-secgw according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoethdev: change device info get callback to return int
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:28 +0000 (17:42 +0100)]
ethdev: change device info get callback to return int

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

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/softnic: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:27 +0000 (17:42 +0100)]
net/softnic: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
net/softnic according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/netvsc: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:26 +0000 (17:42 +0100)]
net/netvsc: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to int,
so this patch modify rte_eth_dev_info_get() usage across
net/netvsc according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/failsafe: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:25 +0000 (17:42 +0100)]
net/failsafe: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
net/failsafe according to its new return type.

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>
4 years agonet/bonding: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:24 +0000 (17:42 +0100)]
net/bonding: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
net/bonding according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bnxt: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:23 +0000 (17:42 +0100)]
net/bnxt: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to int, so
this patch modify rte_eth_dev_info_get() usage across
net/bnxt according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agoapp: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:15 +0000 (17:42 +0100)]
app: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to int, so
this patch modify rte_eth_dev_info_get() usage across apps
according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:14 +0000 (17:42 +0100)]
app/testpmd: check status of getting ethdev info

Add eth_dev_info_get_print_err() which is a wrapper for
rte_eth_dev_info_get() printing error if rte_eth_dev_info_get()
fails and returning its status code.

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>
4 years agopdump: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:18 +0000 (17:42 +0100)]
pdump: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to int,
so this patch modify rte_eth_dev_info_get() usage across
pdump component according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agolatency: check status of getting ethdev info
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:17 +0000 (17:42 +0100)]
latency: check status of getting ethdev info

rte_eth_dev_info_get() return value was changed from void to
int, so this patch modify rte_eth_dev_info_get() usage across
latency component according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoethdev: add return code to device info get function
Ivan Ilchenko [Thu, 12 Sep 2019 16:42:13 +0000 (17:42 +0100)]
ethdev: add return code to device info get function

Change rte_eth_dev_info_get() return value from void to int and return
negative errno values in case of error conditions.
Modify rte_eth_dev_info_get() usage 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>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoethdev: remove redundant device info cleanup before get
Andrew Rybchenko [Thu, 12 Sep 2019 16:42:12 +0000 (17:42 +0100)]
ethdev: remove redundant device info cleanup before get

rte_eth_dev_info_get() always fills in device information memory
with zeros on entry.

Fixes: b6719879855d ("ethdev: avoid getting uninitialized info for bad port")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>