Commit Graph

55 Commits

Author SHA1 Message Date
Wei Zhao
21ecd2d7ab net/i40e: revert fix of flow director check
This reverts commit 7546dc4a13.

In i40e FDIR PMD code for checking programming status,
when the action of add FDIR filter is ok, i40e NIC will
not write back to programming status descriptor, so if
PMD code check DD is not done after period of time dealy,
it means the add or remove filter action is ok. It only write
back descriptor when fail. So, there is no issue for the original
code.

Fixes: 7546dc4a13 ("net/i40e: fix check of flow director programming status")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-08-01 15:36:32 +02:00
Wei Zhao
7546dc4a13 net/i40e: fix check of flow director programming status
In i40e FDIR PMD code for checking programming status
function i40e_check_fdir_programming_status(), the initial value
of return value ret should be set to -1 not 0, because if DD bit of
I40E_RX_DESC_STATUS_DD is not write back, this function will return
0 to upper function, this give an error info to upper function, the
fact for this is it is time out for DD write back and it should return
-1.

Fixes: 05999aab4c ("i40e: add or delete flow director")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-07-23 23:55:26 +02:00
Beilei Xing
a075ce2b3e net/i40e: remove summarized global register change info
The summarized global register change info will be logged
no matter if there's real global register change. Since
only real changes are logged now, there's no need to
summarize global register change info, otherwise will
cause misunderstanding.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-07-03 01:35:58 +02:00
Beilei Xing
9153411e44 net/i40e: print global register change info
Global register change info during enabling
flexible payload is not printed.
This patch changes macro to print the global
register change info.

Fixes: d2f9fe8ae3 ("net/i40e: turn off flexible payload on driver init")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2018-05-14 22:31:52 +01:00
Beilei Xing
cfdfca493c net/i40e: fix multiple driver support
This patch provides the option to disable writing some global registers
in PMD, in order to avoid affecting other drivers, when multiple drivers
run on the same NIC and control different physical ports. Because there
are few global resources shared among different physical ports.

Fixes: ec246eeb5d ("i40e: use default filter input set on init")
Fixes: 98f0557076 ("i40e: configure input fields for RSS or flow director")
Fixes: f05ec7d77e ("i40e: initialize flow director flexible payload setting")
Fixes: e536c2e328 ("net/i40e: fix parsing QinQ packets type")
Fixes: 19b16e2f64 ("ethdev: add vlan type when setting ether type")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2018-02-05 13:40:11 +01:00
Beilei Xing
399c635c39 net/i40e: warn when writing global registers
Add warnings when writing global registers.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2018-02-05 13:40:11 +01:00
Yong Wang
b4502b43f0 net/i40e: fix memory leak
There are several func calls to rte_zmalloc() which don't have null
pointer check on the return value. And before return, the memory
is not freed. It fixes by adding null pointer check and rte_free().

Fixes: 078259773d ("net/i40e: store ethertype filter")
Fixes: 425c3325f0 ("net/i40e: store tunnel filter")
Fixes: c50474f31e ("net/i40e: support tunnel filter to VF")
Fixes: 5c53c82c81 ("net/i40e: store flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-29 10:04:28 +01:00
Ferruh Yigit
ffc905f3b8 ethdev: separate driver APIs
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.

There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.

More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-22 01:26:49 +01:00
Beilei Xing
f4c8ad4f97 net/i40e: fix flow director Rx resource defect
FDIR Rx ring isn't initialized and Rx queue HW tail isn't updated
when there's error detected during programming FDIR flow. There'll
be some potential risk.
This patch updates FDIR Rx resource.

Fixes: a778a1fa2e ("i40e: set up and initialize flow director")
Fixes: 05999aab4c ("i40e: add or delete flow director")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-21 15:51:52 +01:00
Kirill Rybalchenko
2c6b19af78 ethdev: increase flow type limit from 32 to 64
Increase the internal limit for flow types from 32 to 64
to support future flow type extensions.

Change type of variables from uint32_t[] to uint64_t[]:
rte_eth_fdir_info.flow_types_mask
rte_eth_hash_global_conf.sym_hash_enable_mask
rte_eth_hash_global_conf.valid_bit_mask

This modification affects the following components:
net/i40e
net/ixgbe
app/testpmd

ABI versioning used to keep ABI stability.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-01-21 15:51:52 +01:00
Kirill Rybalchenko
d2f9fe8ae3 net/i40e: turn off flexible payload on driver init
Function i40e_GLQF_reg_init() overwrites global register for
flexible payload, forcing extraction of first 16 bytes of
L2/L3/L4 payload to the field vector even if flexible payload
is not used by an application. Such unconditional turn on of
flexible payload effectively disables ability to use outer
IP Destination address for RSS/FDIR for tunnelled packets,
as flexible payload overwrites outer IP destination address
on the field vector.
Now flexible payload turned on only when flow director is
enabled and configured.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-16 18:47:49 +01:00
Bruce Richardson
5566a3e358 drivers: use SPDX tag for Intel copyright files
Replace the BSD license header with the SPDX tag for files
with only an Intel copyright on them.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-04 22:41:39 +01:00
Thomas Monjalon
f17ca7870f memzone: rename address from physical to IOVA
The struct rte_memzone field .phys_addr is renamed to .iova.
The deprecated name is kept in an anonymous union to avoid breaking
the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-11-06 22:25:44 +01:00
Kirill Rybalchenko
66c78f4799 net/i40e: add support for packet template to flow director
For complex packets use raw flow type with pre-constructed packet buffer
instead of creating a packet internally in PMD.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Jianfeng Tan
a7cb2e20d2 mem: remove API to get physical address in dom0
Previously, to get MFN address in dom0, this API is a wrapper to
obtain the "physical address".

As we will removed xen dom0 support, this API is not necessary.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-09 01:52:37 +02:00
Beilei Xing
15018d79f0 net/i40e: add FDIR support for GTP-C and GTP-U
This patch adds FDIR support for GTP-C and GTP-U. The
input set of GTP-C and GTP-U is TEID.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Reviewed-by: Seán Harte <seanbh@gmail.com>
2017-10-06 02:49:50 +02:00
Beilei Xing
4149825bbd net/i40e: finish integration FDIR with generic flow API
rte_eth_fdir_* structures are still used in FDIR functions.
This patch adds i40e private FDIR related structures and
functions to finish integration FDIR with generic flow API.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:50 +02:00
Kirill Rybalchenko
a286ebeb07 net/i40e: add dynamic mapping of SW flow types to HW pctypes
Implement dynamic mapping of software flow types to hardware pctypes.
This allows to add new flow types and pctypes for DDP without changing
API of the driver. The mapping table is located in private
data area for particular network adapter and can be individually
modified with set of appropriate functions.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 02:49:50 +02:00
Stephen Hemminger
1910eb50db net/i40e: remove unnecessary void casts
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:48 +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
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
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
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
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
Jan Blunck
fdf91e0f2f drivers/net: do not use ethdev driver
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2017-04-18 19:05:46 +02:00
Olivier Matz
c143e5a3d9 net/i40e: use dynamic log type for control logs
This is an example of how a dynamic log type can be used in a
PMD.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:48:45 +02:00
Ferruh Yigit
f2462150ec drivers/net: remove redundant new line from logs
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2017-01-30 22:18:27 +01:00
Beilei Xing
b0ea2716e0 net/i40e: add flow flush function
This patch adds i40e_flow_flush function to flush all
filters for users. And flow director flush function
is involved first.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:40:54 +01:00
Beilei Xing
c0a27b40dc net/i40e: add flow create function
This patch adds i40e_flow_create function to create a
rule. It will check if a flow matches ethertype filter
or flow director filter or tunnel filter, if the flow
matches some kind of filter, then set the filter to HW.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:40:54 +01:00
Beilei Xing
38e9fa650c net/i40e: restore flow director filter
Add support of restoring flow director filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:40:53 +01:00
Beilei Xing
5c53c82c81 net/i40e: store flow director filter
Currently there's no flow director filter stored in SW. This
patch stores flow director filters in SW with cuckoo hash,
also adds protection if a flow director filter has been added.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:40:53 +01:00
Jeff Guo
4675752f1d net/i40e: fix flow director on X710
Because some registers are only supported by X722, for example,
I40E_GLQF_FD_PCTYPES, the driver needs to use the mac type to distinguish
the behavior of X722 from X710 and other NICs, or it would result in
errors on X710.

Fixes: 8c5cb3c115 ("net/i40e: add packet type translation for X722")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-10-26 19:42:23 +02:00
Jeff Guo
8c5cb3c115 net/i40e: add packet type translation for X722
To make the PCTYPE in x722 compatible with original PCTYPE in
flow director (FD) filters, the PCTYPE in the FD programming
descriptor needs to be translated into a different PCTYPE using
GLQF_FD_PCTYPE table.
Translation needs to be done before the FD filter is programmed.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-09-30 12:27:18 +02:00
Jan Viktorin
2f3193cf0f pci: inherit common driver in PCI driver
Remove the 'name' member from rte_pci_driver and move to generic
rte_driver.

Most of the PMD drivers were initially using DRIVER_REGISTER_PCI(<name>..)
as well as assigning a name to eth_driver.pci_drv.name member.
In this patch, only the original DRIVER_REGISTER_PCI(<name>..) name has
been populated into the rte_driver.name member - assignments through
eth_driver has been removed.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
[Shreyansh: Rebase and expand changes to newly added files]
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:33:55 +02:00
Slawomir Mrozowicz
6e15a19c62 net/i40e: fix unintended sign extension
Suspicious implicit sign extension: pf->fdir.match_counter_index
with type unsigned short (16 bits, unsigned) is promoted in
"pf->fdir.match_counter_index << 20" to type int (32 bits, signed),
then sign-extended to type unsigned long (64 bits, unsigned).
If "pf->fdir.match_counter_index << 20" is greater than 0x7FFFFFFF,
the upper bits of the result will all be 1.

To fix the issue explicitly cast pf->fdir.match_counter_index to uint32_t.

Coverity issue: 13315
Fixes: 05999aab4c ("i40e: add or delete flow director")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-15 17:13:55 +02:00
Jingjing Wu
19fec29373 net/i40e: fix disabling flex payload selection rule
When setting up the flexible paylaod selection rules, the value
NONUSE_FLX_PIT_DEST_OFF (== 63) is meant to disable the rule.
However, since the MK_FLX_PIT macro always added on an additional
offset of I40E_FLX_OFFSET_IN_FIELD_VECTOR (== 50) to the value passed
the functionality to disable the rule was broken.
This patch fixes this by checking for the disable value and not adding
the offset in that case.

Fixes: d8b90c4eab ("i40e: take flow director flexible payload configuration")

Reported-by: Michael Habibi <mikehabibi@gmail.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Zhe Tao <zhe.tao@intel.com>
2016-06-15 17:13:55 +02:00
Jingjing Wu
db340cf2ef i40e: fix VLAN stripping from inner header
Previously, for tunnel packets, such as VXLAN/NVGRE, the vlan
tags of the inner header will be stripped without putting vlan
info to descriptor, what is not expected behaviour.
This patch fixes it by changing hardware configuration to leave
the inner packet alone.

Fixes: 4861cde461 ("i40e: new poll mode driver")
Fixes: a778a1fa2e ("i40e: set up and initialize flow director")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2016-05-06 15:51:22 +02:00
Rami Rosen
4bc0650ef6 i40e: remove redundant fdir forward declarations
This patch removes several redundant forward declarations
in i40e_fdir.c.

Fixes: a778a1fa2e ("i40e: set up and initialize flow director")

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-05-06 15:51:22 +02:00
Rami Rosen
8f75bdd42f i40e: fix typo in flow director comment
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
2016-03-31 14:21:52 +02:00
Jingjing Wu
0a1237440f i40e: extend flow director for VLAN
This patch extends flow director to select vlan id as part of
filter's input set and program the filter rule with vlan id.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-25 19:01:38 +01:00
Jingjing Wu
92cf7f8ec0 i40e: allow filtering on more IP header fields
This patch extends flow director to select more IP Header fields
as filter input set.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-25 19:01:38 +01:00
Jingjing Wu
f2b2e2354b i40e: split function for hash and flow director input
For the input set selection, Hash filter and Flow director shared
the same function, i.e. i40e_filter_inset_select.
For code readability, this patch replaces i40e_filter_inset_select
with two new functions: i40e_hash_filter_inset_select and
i40e_fdir_filter_inset_select for Hash filter and Flow director
respectively.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-25 19:01:37 +01:00
Helin Zhang
b6a0ec4182 i40e: use AQ for Rx control register read/write
RX control register read/write functions are added, as directly
read/write may fail when under stress small traffic. After the
adminq is ready, all rx control registers should be read/written
by dedicated functions.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-03-16 17:36:10 +01:00
Jingjing Wu
e34189abaf i40e: fix flow director index sign
Coverity issue reported like
CID 119268 (#1 of 1): Unintended sign extension
(SIGN_EXTENSION)sign_extension: Suspicious implicit sign extension:
vsi_id with type unsigned short (16 bits, unsigned) is promoted in
vsi_id << 23 to type int (32 bits, signed), then sign-extended to type
unsigned long (64 bits, unsigned). If vsi_id << 23 is greater than
0x7FFFFFFF, the upper bits of the result will all be 1.

Fixes: 88ebc2b7f9 ("i40e: extend flow director to support VF")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-12-15 18:06:54 +01:00
Stephen Hemminger
98aeb8c5a6 i40e: use common functions to manage DMA zone
Handle Xen support at runtime.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
2015-11-13 11:47:40 +01:00
Pablo de Lara
6e4775cc9b i40e: fix build with icc 2015
Fix for the following error on icc 2015, due to incorrect type:
	drivers/net/i40e/i40e_fdir.c(1376): error #188:
	enumerated type mixed with another type
		case RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT:

Fixes: 98f05570 ("i40e: configure input fields for RSS or flow director")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-11-11 19:38:11 +01:00
Andrey Chilikin
13834ea7c0 i40e: add flow director passthru
Add support for RTE_ETH_FDIR_PASSTHRU flow director behavior so
output queue is assigned by other filters.

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2015-11-04 22:51:57 +01:00
Jingjing Wu
88ebc2b7f9 i40e: extend flow director to support VF
This patch extends flow director to filtering in VFs.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2015-11-04 13:40:57 +01:00
Helin Zhang
98f0557076 i40e: configure input fields for RSS or flow director
The default input set of fields of a received packet are loaded from
firmware, which cannot be modified even users want to use different
fields for RSS or flow director. Here adds more flexibilities of
selecting packet fields for hash calculation or flow director for
users.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
2015-11-04 00:20:02 +01:00
Thomas Monjalon
51c764c1d7 ethdev: remove SCTP flow entries switch
The extended SCTP flow entries are now part of the standard API.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-09-03 19:22:48 +02:00