Commit Graph

539 Commits

Author SHA1 Message Date
Beilei Xing
5f0b95d59a net/i40e: support VLAN stripping for VF
VLAN stripping configuration is supported only for DPDK PF
previously. Since kernel PF supports VLAN stripping now, this
patch adds VLAN stripping support for both DPDK PF and kernel
PF.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-07-06 15:00:57 +02:00
Yong Wang
b734923ddc net/i40e: fix division by 0
In function i40e_vsi_config_tc_queue_mapping(), if 'enabled_tcmap' is 0,
'total_tc' might be 0. Then 'total_tc' might be used in a division
by 0 in "qpnum_per_tc = i40e_align_floor(vsi->nb_qps / total_tc)".

Fix it by changing 'total_tc' from 0 to 1 just as func
i40e_vsi_update_queue_mapping() does.

Fixes: 4861cde461 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Andrey Chilikin
b319712f53 net/i40e: extended list of operations for DDP processing
This patch adds ability to remove already loaded profile
or write profile without registering it

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
4fbf801efe net/i40e/base: update base code info
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
73cd7d6dc8 net/i40e: use set switch AQ instead of register setting
TPID can be set by set_switch_config aq, change the TPID setting
by set_switch_config on new FW release.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
496a357f11 net/i40e/base: extend processing of DDP
This patch adds extended processing of DDP packages:
 - Execution of adminq command sections to support AQ-depended profiles,
   for example, for programming cloud filters types.
 - Ability to write a profile without registering it in the list of
   applied profiles, to be used for AQ-depended profiles.
 - Profile rollback is implemented to support restoration of original
   parser/analyzer configuration without the need of core reset,
   for example, for deploying new profile without resetting device.
 - Search for a specific section in a profile, to be used by driver
   to access metadata sections with description of PCTYPE/PTYPEs
   defined in the profile.

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
f5be569181 net/i40e/base: add EEPROM checksum verification
This patch ensures PFs mutually exclusive access to NVM.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
3c8b18c416 net/i40e/base: avoid reset timeout issue
This patch allows detection of upcoming core reset in case NIC gets
stuck while performing FLR reset. The i40e_pf_reset() function returns
I40E_ERR_NOT_READY when global reset was detected.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
156e15b5f7 net/i40e/base: avoid potential null pointer dereference
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
da499ab41b net/i40e/base: use admin queue for setting LEDs behavior
Instead of accessing register directly, use newly added AQC in
order to blink LEDs. Introduce and utilize a new flag to prevent
excessive API version checking.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
6da598714a net/i40e/base: support switch parameters
Adds double VLAN tagging ethertype fields to Set Switch Parameters AQ
command.  These were added in firmware API 1.7.

Callers of i40e_aq_set_switch_config() can specify the ethertypes to
use by filling out the corresponding fields in struct i40e_hw.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
7b8a3cc5df net/i40e/base: update FW AQ API version to 1.7
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
212cd71aac net/i40e/base: track id can be 0
track_id == 0 is valid for “read only” profiles when
profile does not have any “write” commands.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
e8228f1a16 net/i40e/base: report supported link modes
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
aa153cc89f net/i40e/base: add new PHY types for 25G AOC and ACC
This patch adds new phy types for 25G Active Optical Cables (AOC) and
Active Copper Cables (ACC) support.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:57 +02:00
Jingjing Wu
1216fb9f0c net/i40e/base: store the requested FEC information
Store information about FEC modes, that were requested. It will be used
in printing link status information function and this way there is no
need to call admin queue there.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:56 +02:00
Jingjing Wu
606fe321ab net/i40e/base: add support for Adaptive Virtual Function
Add device id define and mac_type assignment needed for Adaptive
Virtual Function.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:56 +02:00
Jingjing Wu
83b0670010 net/i40e/base: add AQ command for read/write PHY registers
This patch adds new additional command for accessing to PHY registers.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:56 +02:00
Jingjing Wu
671f126978 net/i40e/base: sync nvmupdate command and adminq subtask
During NVMupdate, state machine gets into unrecoverable state because
i40e_clean_adminq_subtask can get scheduled after the admin queue
command but before other state variables are updated.

This patch adds locking around admin queue command and update of
state variables so that adminq_subtask will have accurate information
whenever it gets scheduled.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:56 +02:00
Jingjing Wu
a58860f689 net/i40e/base: use new virtchnl header file
Modify the necessary files to be compatible with the new virtchnl.h file
instead of relying on i40e_virtchnl.h variant. This mostly changes
references to VIRTCHNL_ variables by removing prefix of I40E_.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:56 +02:00
Olivier Matz
2209c3e2c2 net/i40e: avoid PCI probing failure when using bogus SFP
When a port is using a bogus SFP, the PCI probing returns an error,
preventing to register a portid.

To give a better chance to the applications to retry after the SFP is
changed, move this check in eth_i40e_dev_configure(), so that only a
port reconfiguration is needed to retry.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 15:00:56 +02:00
Beilei Xing
6562269ca6 net/i40e: fix flow director for IPv6
After adding a fdir rule for IPv6 with input set TC, IPv6 packets
with the specific TC can't be assigned the right queue.
The root cause is that TC is parsed wrongly, this patch fixes
TC parsing problem.

Fixes: 7d83c152a2 ("net/i40e: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2017-07-06 15:00:56 +02:00
Andrey Chilikin
edeab742ed net/i40e: get information about DDP profile
This patch adds ability to request information about dynamic device
personalization (DDP) profile.

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-07-06 15:00:56 +02:00
Ferruh Yigit
4be4659a93 drivers/net: use device name from device structure
Device name resides in two different locations, in rte_device->name and
in ethernet device private data.

For now, the copy in the ethernet device private data is required for
multi process support, the name is the how secondary process finds about
primary process device.

But for drivers there is no reason to use the copy in the ethernet
device private data.

This patch updates PMDs to use only rte_device->name.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-06 00:17:02 +02:00
Bruce Richardson
80477544fd net/i40e: remove checks for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we no longer
need these checks.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bernard Iremonger
d6af1a13d7 ethdev: add return values to callback process API
Change the rte_eth_dev_callback_process function to return int,
and add a void *ret_param parameter.
The new parameter is used by ixgbe and i40e instead of abusing
the user data of the callback.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2017-07-01 17:19:55 +02:00
Jerin Jacob
98a7ea332b fix typos using codespell utility
Fixing typos across dpdk source code using codespell utility.
Skipped the ethdev driver's base code fixes to keep the base
code intact.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-06-14 23:54:13 +02:00
Ferruh Yigit
92c0b132f2 net/i40e: fix memset size
This causes build error with gcc 7.1.1 :

...dpdk/drivers/net/i40e/i40e_flow.c:2357:2:
error: ‘memset’ used with length equal to number of elements without
       multiplication by element size [-Werror=memset-elt-size]
  memset(off_arr, 0, I40E_MAX_FLXPLD_FIED);
  ^~~~~~

...dpdk/drivers/net/i40e/i40e_flow.c:2358:2:
error: ‘memset’ used with length equal to number of elements without
       multiplication by element size [-Werror=memset-elt-size]
  memset(len_arr, 0, I40E_MAX_FLXPLD_FIED);
  ^~~~~~

Fixed by providing correct size to memset.

Fixes: 6ced3dd72f ("net/i40e: support flexible payload parsing for FDIR")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-06-14 22:54:23 +02:00
Ferruh Yigit
740feaf349 ethdev: remove driver name from device private data
rte_driver->name has the driver name and all physical and virtual
devices has access to it.

Previously it was not possible for virtual ethernet devices to access
rte_driver->name field (because eth_dev used to keep only pci_dev),
and it was required to save driver name in the device private struct.

After re-works on bus and vdev, it is possible for all bus types to
access rte_driver.

It is able to remove the driver name from ethdev device private data and
use eth_dev->device->driver->name.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Jan Blunck <jblunck@infradead.org>
2017-06-12 16:27:44 +01:00
Beilei Xing
d926743473 net/i40e: support ether pattern for FDIR
Previously, i40e PMD will select ethertype filter
parser when adding ether pattern rules. In fact,
FDIR also supports ether pattern.
This patch adds ether pattern support for FDIR.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:29 +01:00
Beilei Xing
c0d8994f42 net/i40e: update supported patterns for FDIR
This patch updates supported patterns for flow
director filters.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:29 +01:00
Beilei Xing
42044b69c6 net/i40e: support input set selection for FDIR
This patch supports input set selection for flow
director filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:29 +01:00
Beilei Xing
6ced3dd72f net/i40e: support flexible payload parsing for FDIR
This patch adds flexible payload parsing support for
flow director filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:29 +01:00
Beilei Xing
30965ca341 net/i40e: add NVGRE flow parsing
This patch adds NVGRE flow parsing function to support NVGRE
classification.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:29 +01:00
Beilei Xing
2e756a9f8f net/i40e: refactor VXLAN flow parsing function
The current vxlan parsing function is not easy to read when parsing
filter type, this patch optimizes the function and makes it more
readable.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:29 +01:00
Qi Zhang
98abce237b net/i40e: fix VF statistics
CRC bytes should be excluded, so rx/tx bytes of VF stats is aligned
with PF stats.

Fixes: 9aace75fc8 ("i40e: fix statistics")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-06-12 10:41:28 +01:00
Qi Zhang
0bcdc44510 net/i40e: exclude internal packet's byte count
Tx/Rx byte counts of internal managed packet should be
excluded from the total rx/tx bytes.

Fixes: 9aace75fc8 ("i40e: fix statistics")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-06-12 10:41:28 +01:00
Beilei Xing
7cf5491b7b net/i40e: update actions for FDIR
This commit adds support of FLAG action and PASSTHRU
action for flow director.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-06-12 10:41:27 +01:00
Wenzhuo Lu
bc9ee862ba net/i40e/base: fix Tx error stats on VF
Unfortunately the datasheet has a mistake. The
address of the TX error counter is wrong.

Fixes: 8db9e2a1b2 ("i40e: base driver")
CC: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
Michael Lilja
68d19b480e net/i40e: improve FDIR programming times
Previously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of
22usec with a max of 60usec .

Signed-off-by: Michael Lilja <ml@napatech.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-06-12 10:41:25 +01:00
Ferruh Yigit
c0802544d9 drivers/net: add generic ethdev macro to get PCI device
Instead of many PMD define their own macro, define a generic one in
ethdev and use that in PMDs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:25 +01:00
Ferruh Yigit
dd2c630a5f drivers/net: remove unnecessary macro for unused variables
remove __rte_unused instances that are not required.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
Herakliusz Lipiec
799c5c602d net/i40e: add return value checks
Coverity issue: 1379362
Coverity issue: 1379365
Fixes: 71d35259ff ("i40e: tear down flow director")
Cc: stable@dpdk.org

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2017-06-12 10:41:25 +01:00
Bruce Richardson
b25f49d8e1 net/i40e: add compile-time checks to vector driver
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-12 10:41:25 +01:00
Jerin Jacob
c0583d98a9 eal: introduce macro for always inline
Different drivers use internal macros like force_inline for compiler
always inline feature.
Standardizing it through __rte_always_inline macro.

Verified the change by comparing the output binary file.
No difference found in the output binary file with this change.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-06 17:21:55 +02:00
David Marchand
06e81dc9b7 drivers/net: fix vfio kmod dependency
vfio is the kernel framework used by the vfio-pci kernel driver.
DPDK drivers do not rely solely on vfio, but rather on vfio-pci to gain
access to pci resources.

Fixes: 0880c40113 ("drivers: advertise kmod dependencies in pmdinfo")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-06-05 20:56:54 +02:00
Qi Zhang
f4afa1a048 net/i40e: fix memory overflow in 32-bit SSE Rx
Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: 8e109464c0 ("i40e: allow vector Rx and Tx usage")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-05-05 17:40:21 +02:00
Wenzhuo Lu
ff8282f4bb net/i40e: consider QinQ when setting MTU
When counting max packet length from MTU, count
VLAN tag length twice for QinQ packets.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-05-05 17:24:22 +02:00
Beilei Xing
b4325edd9a net/i40e: add LLDP check for ethertype filter
LLDP rule is not supported in ethertype filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-05-05 17:19:52 +02:00
Wei Dai
6d01e580ac ethdev: fix adding invalid MAC address
Some customers find adding MAC addr to VF sometimes can fail,
but it is still stored in dev->data->mac_addrs[ ]. So this
can lead to some errors that assumes the non-zero entry in
dev->data->mac_addrs[ ] is valid.
Following acknowledgements are from specific NIC PMD
maintainer for their managing part.

This patch changes the ethdev internal API, it should not be
backported to a stable/LTS release so far.

Fixes: af75078fec ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 16:27:11 +02:00