Commit Graph

596 Commits

Author SHA1 Message Date
Beilei Xing
fcc93dfc77 net/i40e: enable cloud filter for GTP-C and GTP-U
This patch sets TEID of GTP-C and GTP-U as filter type
by replacing existed filter types inner_mac and TUNNEL_KEY.
This configuration will be set when adding GTP-C or
GTP-U filter rules, and it will be invalid only by
NIC core reset.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:50 +02:00
Beilei Xing
47ba0398da net/i40e: add cloud filter parsing function for GTP
This patch adds i40e_flow_parse_gtp_filter parsing
function for GTP-C and GTP-U to support cloud filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:50 +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
Beilei Xing
e163c18a15 net/i40e: update ptype and pctype info
Update new packet type and new pctype info when downloading
profile.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:50 +02:00
Kirill Rybalchenko
350861b35c net/i40e: support updating pctype mapping table
Add new functions which allow modify, return or reset to default
the contents of flow type to pctype dynamic mapping table.

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
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
Kirill Rybalchenko
4553d49289 net/i40e: remove unnecessary bit operations
Remove unnecessary bit operations in I40E_PFQF_HENA
and I40E_VFQF_HENA registers.

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
Kirill Rybalchenko
40d1324423 net/i40e: get ddp profile protocol info
This patch adds new package info types to get list of protocols,
pctypes and ptypes defined in a profile

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
Wei Dai
77a45aeb6b net/i40e: fix mirror rule reset when port is closed
When an i40e PF port is stopped, all mirror rules should be reserved.
But when an i40e PF port is closed, all mirror rules should be removed.
When a mirror rule is removed, its associated hardware and software
resource should also be removed.

Fixes: a4def5edf0 ("i40e: enable port mirroring")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lijuan Tu <lijuanx.a.tu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:49 +02:00
Tomasz Kulasek
ff8cbb49b4 net/i40e: fix assignment of enum values
mixed_enums: Mixing enum types enum i40e_vsi_type and enum
             virtchnl_vsi_type for type

Coverity issue 158651
Fixes: a58860f689 ("net/i40e/base: use new virtchnl header file")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:49 +02:00
Wei Zhao
bd7883c07d net/i40e: refactor some stats related functions
Merge i40evf_dev_stats_get and i40evf_get_statistics to be one function.

Rename i40evf_update_stats to i40evf_query_stats,
and chang i40evf_update_vsi_stats to i40evf_update_stats.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 02:49:49 +02:00
Wei Zhao
0e7ba7326f net/i40e: support reset stats in VF
Add stats reset support to VF.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 02:49:49 +02:00
Wei Zhao
8210e9e0d8 net/i40e: fix clear xstats bug in VF
Clearing VSI stats done by setting an offset value to latest stats
and further stats values are subtracted from that offset.

This setting offset and baselining logic exists in PF driver, but for VF
there is no way to update its VSI offset in the PF.

So same baselining logic added into VF, also setting VSI offset in VF
fixed to support VF stats clear.

Fixes: da61cd0849 ("i40evf: add extended stats")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 02:49:49 +02:00
Jingjing Wu
9df0826a42 net/i40e: fix variable assignment
rx/tx_queue_setup functions are shared between PF and VF
drivers. So the var 'pf' should not be assigned at the beginning.
This patch fixes the issue, and also corrects the return err code.

Fixes: b6583ee402 ("i40e: full VMDQ pools support")
Cc: stable@dpdk.org

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:48 +02:00
Jingjing Wu
c7755aef46 net/i40e/base: fix bool definition
Use stdbool.h instead of defining the bool type, to make
sure the virtchnnl msg format definition is the same
between PF and VF.

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

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:48 +02:00
Qi Zhang
763de290cb net/i40e: fix packet count for PF
Previously, for PF statistics we use VSI register for packet count
but use port's register for packet bytes, that cause inconsistent
situation of PF statistics when some VF is active, since it will
cover VF's packet bytes but not packet count.

The patch will take port register for PF packet count back, but still
exclude main vsi's discard packet count.
Just like previous fix, its still not perfect, (since RX packet number
is over counted when there is VF discard packet) but seems it make the
overall better.

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

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-10-06 02:49:48 +02:00
David Harton
7a4afbad98 net/i40e: fix i40evf MAC filter table
The i40e maintains a single MAC filter table for both
unicast and multicast addresses.  The i40e_validate_mac_addr
function was preventing multicast addresses from being added
to the table via i40evf_add_mac_addr.  Fixed the issue by
adjusting the check in i40evf_add_mac_addr.

Fixes: 4861cde461 ("i40e: new poll mode driver")
Fixes: 97ac72aa71 ("i40e: support setting VF MAC address")
Cc: stable@dpdk.org

Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:48 +02:00
Jingjing Wu
d031bff503 net/i40e: fix memory leak if VF init fails
Fixes: 4861cde461 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:48 +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
Jingjing Wu
15543fe12e net/i40e: remove unused and incorrect definition
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-06 02:49:48 +02:00
Beilei Xing
45ea1d8b2e net/i40e: fix VF device stop issue
i40e HW data is gotten wrongly in i40evf_dev_stop function,
it may cause device can't be stopped.
This patch is to fix the issue.

Fixes: 1859934202 ("net/i40e: fix VF add/del MAC")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:47 +02:00
Jingjing Wu
cfd662d22e net/i40e: fix interrupt throttling setting in PF
As no matter the PF host driver is DPDK or other kernel drivers,
they are sharing the same virtchnnl interfaces to communicate to VFs.
To follow the generic interface, DPDK PF need to set Interrupt
Throttling (ITR) index according to the rxitr_idx from virtchnnl
instead of ITR_NONE.

Fixes: 6d59e4ea74 ("net/i40e: change version number to support Linux VF")
Cc: stable@dpdk.org

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-06 02:49:47 +02:00
Beilei Xing
975ffea6f6 net/i40e: remove DPDK PF version specific code
This patch removes unused code related to DPDK PF version.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:47 +02:00
Beilei Xing
4c7213beca net/i40e: remove virtual channel command for VSI queue
This patch removes specific virtual channel command
VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:47 +02:00
Beilei Xing
28be95598b net/i40e: remove virtual channel command for VLAN pvid
Since there's no specific version number to distinguish
DPDK PF and Linux kernel PF, DPDK VF won't recognize if
host is DPDK PF or kernel PF. The specific virtual channel
commands for DPDK pf can be deleted.
This patch removes I40E_VIRTCHNL_OP_CFG_VLAN_PVID.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:47 +02:00
Wenzhuo Lu
8f5dbd4ed9 net/i40e: new API to add VF MAC address from PF
Currently, rte_eth_dev_mac_addr_add is used by a testpmd CLI
to add a MAC address for VF. But the parameter 'pool' of this
API means the VMDq pool, not VF.
So, it's wrong to use it to add the VF MAC address.

This patch provides a new API that can be used to
add VF MAC address on i40e.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-10-06 02:49:47 +02:00
Xiaoyun Li
16048c4cb7 net/i40e: fix PF notify issue when VF is not up
This patch stops PF from sending message to VF when VF's admin queue
isn't enabled, namely VF isn't up.

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

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-10-06 02:49:47 +02:00
Qi Zhang
273dcde1c3 net/i40e: fix flow control watermark mismatch
Flow control watermark is not read out correctly,
that may cause an application who not intend to change
watermark but does change it with a rte_eth_dev_flow_ctrl_set
call right after rte_eth_dev_flow_ctrl_get.

The idea fix is, during init, the watermark is set with default value,
so it is not necessary to read out from hw register during flow_ctl_get,
But due to I40E_GLRPB_GHW limitation, it is shared by different ports on
the same device, it is possible the value is changed on another port,
but local variable not sync, so we have to read out register every
flow_ctl_get.

Fixes: f53577f069 ("i40e: support flow control")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2017-10-06 02:49:47 +02:00
Daniel Mrzyglod
7f109dbac5 net/i40e: fix return code not checked
Calling i40e_vsi_delete_mac without checking return
value (as is done elsewhere 5 out of 6 times)

Coverity issue: 140735
Fixes: 43c89d5a4f ("net/i40e: set VF MAC from PF")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 02:49:47 +02:00
Wei Dai
c162832a09 net/i40e: support NIC reset
Reset a NIC by calling dev_uninit() and then dev_init().
Go through the same way in NIC PCI remove without release
of ethdev resource and then NIC PCI probe function without
ethdev resource allocation.

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-09-13 23:08:11 +02:00
Xiaoyun Li
f0adeebde0 net/i40e: revert fix of PF notify when VF not up
This reverts commit 035a8cf88f.
Don't send messages to inactive VF will cause DPDK PF failing
to send messages to kernel VF.
With this revert, this issue will be solved.

Fixes: 035a8cf88f ("net/i40e: fix PF notify when VF is not up")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-08-05 01:30:14 +02:00
Qi Zhang
1ff8e79591 net/i40e: fix Rx data segment buffer length
Buffer length be configured for each data segment should not exceed
the requested value, or device may fill data that exceed the boundary
of memory that be reserved.

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

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Tested-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
2017-08-03 22:45:52 +02:00
Xiaoyun Li
035a8cf88f net/i40e: fix PF notify when VF is not up
This patch stops PF from sending messages to inactive VF
and modifies VF state to active when VF reset is completed.

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

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-31 19:58:41 +02:00
Kuba Kozak
c2be7f9b23 net/i40e: fix parsing QinQ pattern
Add check if o_vlan_mask and i_vlan_mask are not a NULL pointer.

Coverity issue: 143448
Coverity issue: 143449
Fixes: d37705068e ("net/i40e: parse QinQ pattern")
Cc: stable@dpdk.org

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-31 19:58:41 +02:00
David Hunt
935bceb9ba net/i40e: fix sync phy type by adding retry
Some phy's take longer than others to come up. Add a retry to give
more phy's a chance to come up before returning an error.

Fixes: 2209c3e2c2 ("net/i40e: avoid PCI probing failure when using bogus SFP")

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-31 19:58:41 +02:00
Jeff Guo
1bb8f66116 net/i40e: fix link down and negotiation
Enable the functions set link down and set link up in i40e by check
phy_type, and fix the issue of auto negotiation failed in XXV710 when
bind kernel driver after unbind from DPDK driver by modify the speed
setting distinguish from set link up and down. With this fix, if unbind
DPDK to bind kernel driver, no need to set auto negotiation and ifconfig
up anymore, remove the part from doc.

Fixes: ca7e599d45 ("net/i40e: fix link management")
Fixes: 2f1e228174 ("i40e: skip link control as firmware workaround")
Fixes: 6e145fcc75 ("i40e: support autoneg or force link speed")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-31 19:58:41 +02:00
Wenzhuo Lu
41ab4ff5e5 net/i40e: fix TM hierarchy commit check
If there's no Traffic Management node added. Not
necessary to check if TM is committed.

Fixes: cac29c3c00 ("net/i40e: support committing TM hierarchy")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-07-31 19:16:23 +02:00
Jeff Guo
1859934202 net/i40e: fix VF add/del MAC
i40e VF close would stop the VF first, if VF already stopped this
result duplicate add/del MAC address which cause failure in executing
admin command.

Fix this by adding VF stop status check and sync up VF MAC address count
during add/del.

Fixes: d42aaf3000 ("i40e: support port hotplug")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-07-19 16:25:43 +03:00
Beilei Xing
77370db964 net/i40e: fix ethertype filter for new FW
Previously SW workaround for GL_SWR_PRI_JOIN_MAP is added for X710
performance. As new FW version 6.0 supports ADQ,
value for GL_SWR_PRI_JOIN_MAP should be changed, otherwise
ehtertype filter will be impacted.

Fixes: 973273c7a4 ("i40e: workaround for X710 performance")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-07-19 11:09:13 +03:00
Beilei Xing
5b1324145c net/i40e: fix virtchnl message response timeout
PF driver and VF driver communicated with each other by virtual
channel message. When VF sends message to PF to enable some
offload capability, PF should response if it is successful or not.
VIRTCHNL_OP_ENABLE_VLAN_STRIPPING is a new added message and the
old PF driver doesn’t support that. So no response is received by
DPDK VF. Then VF is blocked on this message and cannot roll back.
This patch clears pending command on VF side when the waiting duration
expires to avoid blocking following communication.

Fixes: 5f0b95d59a ("net/i40e: support VLAN stripping for VF")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-07-19 11:09:13 +03:00
Tiwei Bie
a08fdcad2c net/i40e: remove an unnecessary goto
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-07-19 11:09:13 +03:00
Beilei Xing
b2753f9ef7 net/i40e: check invalid VF queue id for FDIR
There's only invalid queue id checking for PF when creating FDIR
rules, this patch adds checking invalid queue id for VF.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-07-19 11:09:13 +03:00
Jingjing Wu
d58244b9cf net/i40e: fix LSC interrupt
If LSC flag is changed to off at last device start, the
enable flag is not cleared in HW.
This patch fixes it.

Fixes: f4668a33ef ("net/i40e: fix link status change interrupt")
Cc: stable@dpdk.org

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-19 11:09:13 +03:00
Qi Zhang
e0b3f4cf3e net/i40e: fix VF Tx bytes
Tx CRC size is not counted by VSI's stats register, so it is not necessary
excluded by driver.

Fixes: 98abce237b ("net/i40e: fix VF statistics")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-07-19 11:09:13 +03:00
Stephen Hemminger
7d47868c26 drivers/net: remove duplicate includes
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-16 17:30:24 +02:00
Wenzhuo Lu
cac29c3c00 net/i40e: support committing TM hierarchy
Add the support of the Traffic Management API,
rte_tm_hierarchy_commit.
When calling this API, the driver tries to enable
the TM configuration on HW.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-11 19:57:30 +02:00
Wenzhuo Lu
8936f28b66 net/i40e: support getting TM node capability
Add the support of the Traffic Management API,
rte_tm_node_capabilities_get.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-11 19:57:30 +02:00
Wenzhuo Lu
0fb1ef1e79 net/i40e: support getting TM level capability
Add the support of the Traffic Management API,
rte_tm_level_capabilities_get.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-11 19:57:30 +02:00
Wenzhuo Lu
ba3a083772 net/i40e: support getting TM node type
Add the support of the Traffic Management API,
rte_tm_node_type_get.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-11 19:57:29 +02:00