Commit Graph

694 Commits

Author SHA1 Message Date
Beilei Xing
024c72a8f3 net/i40e: enable VF Tx offload
Enable VF Tx offload including outer ip checksum,
TSO and tunnel TSO.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
11556c915a net/i40e: improve packet type parser
Add support for PPPoE and L2TP packet types parser.
Change parser as new metadata 'OIPV4' and 'OIPV6'
added in profile to distinguish outer IP and inner
IP.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
fade5c8743 net/i40e: fix FDIR input set conflict
The first FDIR rule for some PCTYPE will configure input set and
create flow, the following flows must use the same input set,
otherwise it will cause input set conflict and fail to create flow.
If it creates the first rule after flow flush, input set should be
re-configured.

Fixes: 42044b69c6 ("net/i40e: support input set selection for FDIR")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
54f19c9c3b net/i40e: fix VLAN offload setting issue
When using kernel PF + DPDK VF, if setting VLAN strip on
or off in VF side after setting PVID for VF with ethtool in
PF side, it will cause VF Tx error. The root cause is that
Rx VLAN offload is not permitted after setting PVID for VF
in kernel PF side.
This patch fixes the issue by check VLAN offload capability
when setting VLAN offload.

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

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Rami Rosen
a634522fc7 net/i40e: remove forward declaration
This trivial patch removes unnecessary forward declaration
of i40e_xmit_pkts_simple() in i40e_rxtx.c.

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Qi Zhang
48a2037118 net/i40e: fix VLAN offload setting
Vlan offload flag "rx_mode.hw_vlan_extend" should be considerred at
rte_eth_dev_configure stage as well as "rx_mode.hw_vlan_strip" and
"rx_mode.hw_vlan_filter".

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

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
80c557be08 net/i40e: fix ARM big endian build
This patch fixes the following error observed when
compiling with ARM BE compiler.

i40e_ethdev.c: In function ‘i40e_dev_tunnel_filter_set’:
i40e_ethdev.c:6988:5: error: lvalue required as unary ‘&’ operand
     &rte_cpu_to_le_32(ipv4_addr),

Fixes: edc845bd53 ("app/testpmd: fix build on FreeBSD")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-12 17:27:07 +01:00
Thierry Herbelot
8f87ba7015 fix typos
Repeated occurrences of 'the'.

The change was obtained using the following command:

  sed -i "s;the the ;the ;" `git grep -l "the "`

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
2018-01-11 18:26:46 +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
Ilya V. Matveychikov
6c293ffd63 drivers/net: fix number of segment storage type
Fixes: 97cb466d65 ("mbuf: use 2 bytes for port and nb segments")
Cc: stable@dpdk.org

Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-11-10 09:17:13 +00:00
Xiaoyun Li
79f47fc1b7 net/i40e: fix VF cannot forward packets issue
When Rx interrupt is not enabled, there is no need to check if interrupt
allow others. It will cause VF cannot forwarding packets issue. This patch
fixes this issue.

Fixes: 96a9fd03c2 ("net/i40e: fix Rx queue interrupt mapping in VF")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-11-10 02:05:15 +00:00
Wei Dai
96a9fd03c2 net/i40e: fix Rx queue interrupt mapping in VF
When a VF port is bound to VFIO-PCI, miscellaneous interrupt is
mapped to MSI-X vector 0 and Rx queues interrupt are mapped to
other vectors in vfio_enable_msix( ). To simplify implementation,
all VFIO-PCI bound i40e VF Rx queue interrupts can be mapped in
vector 1. And as current igb_uio only support only one vector,
i40e VF PMD should use vector 0 for igb_uio and vector 1 for
VFIO-PCI. Without this patch, VF Rx queue interrupt is mapped
to vector 0 in register settings and mapped to VFIO vector 1
in vfio_enable_msix( ), and then all Rx queue interrupts will
be missed.
Also remove 2 unused macro definitions.

Fixes: 4b90a3ff26 ("i40evf: support Rx interrupt")
Fixes: 975ffea6f6 ("net/i40e: remove DPDK PF version specific code")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-11-03 20:18:16 +01:00
Wei Dai
66b8304f9d net/i40e: fix VFIO interrupt mapping in VF
When a VF port is bound to VFIO-PIC, only miscellaneous interrupt
is mapped to VFIO vector 0 in i40evf_dev_init( ).
In i40evf_dev_interrupt_handle( ) and i40evf_dev_rx_queue_intr_enable( ),
if previous VFIO interrupt mapping set in i40evf_dev_init( ) is not
cleared, it will fail when PMD tries to map Rx queue interrupt to other
VFIO vectors by calling rte_intr_enable( ).

This patch clears the VFIO interrupt mappings before setting both
miscellaneous and Rx queue interrupt mappings again to avoid failure.
And remove the calling of rte_intr_enable( ) in
i40evf_dev_interrupt_handler( ) as there is no need to map VFIO interrupt
in this function repeatedly.

Fixes: 4b90a3ff26 ("i40evf: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-11-03 20:13:42 +01:00
Jianbo Liu
987990bbf8 net/i40e: fix Rx packets number for NEON
Fix i40e stop receiving on ARM, as the statuses of RX descriptors
are not consistent, which is caused by cacheable hugepages.

Fixes: ae0eb310f2 ("net/i40e: implement vector PMD for ARM")
Cc: stable@dpdk.org

Signed-off-by: Jianbo Liu <jianbo.liu@arm.com>
2017-11-01 22:17:06 +01:00
Qi Zhang
d8a4baafe8 net/i40e: fix mirror with firmware 6.0
Value of I40E_GL_SWR_PRI_JOIN_MAP_0 need to be corrected or mirror
does not work on latest firmware 6.0.

Fixes: 77370db964 ("net/i40e: fix ethertype filter for new FW")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-11-01 22:17:06 +01:00
Thomas Monjalon
bfa9a8a460 mbuf: rename data address helpers to IOVA
The following inline functions and macros have been renamed to be
consistent with the IOVA wording:

rte_mbuf_data_dma_addr         -> rte_mbuf_data_iova
rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
rte_pktmbuf_mtophys            -> rte_pktmbuf_iova
rte_pktmbuf_mtophys_offset     -> rte_pktmbuf_iova_offset

The deprecated functions and macros are kept to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-11-06 22:44:26 +01:00
Santosh Shukla
455da54539 mbuf: rename physical address to IOVA
Rename buf_physaddr to buf_iova.
Keep the deprecated name in an anonymous union to avoid breaking
the API.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-11-06 22:44:26 +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
Thomas Monjalon
4c00cfdc0e remove useless memzone includes
The memzone header is often included without good reason.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-11-06 22:12:08 +01:00
Gaetan Rivet
c752998b5e pci: introduce library and driver
The PCI lib defines the types and methods allowing to use PCI elements.

The PCI bus implements a bus driver for PCI devices by constructing
rte_bus elements using the PCI lib.

Move the relevant code out of the EAL to its expected place.

Libraries, drivers, unit tests and applications are updated to use the
new rte_bus_pci.h header when necessary.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
David Harton
289ba0c0f5 ethdev: allow returning error on VLAN offload ops
Some devices may not support or fail setting VLAN offload
configuration based on dynamic circumstances so the
vlan_offload_set_t vector is modified to return an int so
the caller can determine success or not.

rte_eth_dev_set_vlan_offload is updated to return the
value provided by the vector when called along with restoring
the original offload configs on failure.

Existing vlan_offload_set_t vectors are modified to return
an int.  Majority of cases return 0 but a few that actually
can fail now return their failure codes.

Finally, a vlan_offload_set_t vector is added to virtio
to facilitate dynamically turning VLAN strip on or off.

Signed-off-by: David Harton <dharton@cisco.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Olivier Matz
380a7aab1a mbuf: rename deprecated VLAN flags
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Gaetan Rivet
00a3d8104a ethdev: remove detachable device flag
This flag is not necessary at the ether layer anymore.
Buses are able to advertise their hotplug support. The ether layer can
rely upon this capability instead of a special flag.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2017-10-26 02:33:01 +02:00
Wei Zhao
70697032d5 net/i40e: fix queue number error in queue region
when VSI is enabled with smaller number of queues, for example 1 or 6,
it will cause error.

64 is the max number of queues that can be used for RSS, but VSI might
be created with only few queues.

Fixes: 7cbecc2f74 ("net/i40e: support queue region set and flush")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Kirill Rybalchenko
412f60a0e1 net/i40e: fix unsecure usage of strncpy function
Use more secure snprintf function instead of strncpy
to prevent memory access violation.

Fixes: 40d1324423 ("net/i40e: get ddp profile protocol info")

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-26 02:33:01 +02: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
Beilei Xing
373840beaf net/i40e: fix flow director issue
For L3 or L4 packets, PCtype is parsed wrongly when
input set is VLAN only.
This patch fixes the issue.

Fixes: 15018d79f0 ("net/i40e: add FDIR support for GTP-C and GTP-U")
Fixes: 7d83c152a2 ("net/i40e: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-26 02:33:01 +02:00
Beilei Xing
3a112d0940 net/i40e: update parsing inner packet info
Since meta data in profile is updated, parsing inner
packet information needs to be updated, too.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-26 02:33:01 +02:00
Beilei Xing
5838a74502 net/i40e: fix string overflow issue
This patch fixes the coverity STRING_OVERFLOW issue.

Coverity issue: 195002
Fixes: e163c18a15 ("net/i40e: update ptype and pctype info")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-26 02:33:01 +02:00
Wenzhuo Lu
49b6b461af net/i40e: fix parent when adding TM node
Queue's parent is TC not port. It's wrong to always set
the parent to root.

Fixes: e0ff4d304c ("net/ixgbe: support adding TM node")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
70039fe684 net/i40e: fix not supporting NULL TM profile
It's by design that APP can add a TM node without shaper
profile. But i40e doesn't support it currently.

Fixes: 03a249b62b ("net/i40e: support adding TM node")
Fixes: cac29c3c00 ("net/i40e: support committing TM hierarchy")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
0d0f144831 net/i40e: fix TM level capability getting
Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when getting the TM level capability.

Fixes: 0fb1ef1e79 ("net/i40e: support getting TM level capability")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
1be6985827 net/i40e: fix TM node parameter checking
Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when checking the parameters of the TM nodes.

Fixes: 03a249b62b ("net/i40e: support adding TM node")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Jingjing Wu
8cacf78469 net/i40e: fix VF initialization error
In igb_uio, FLR is issued during open device file. i40evf is trying
to initialize admin queue when driver probe, while the FLR is not
done by host driver. That will cause initialization fail.

This patch is adding the checking if VF reset is done before
adimin queue initialization.

Fixes: b58eedfc7d ("igb_uio: issue FLR during open and release of device file")
Cc: stable@dpdk.org

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-13 22:35:29 +01:00
Zhiyong Yang
04b443fb2c net/i40e: fix port id type
Some functions applied were still developed on top of uint8_t port_id,
however port_id has been increased range to uint16_t. The patch fixes
the issue.

Fixes: f8244c6399 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-13 21:57:48 +02:00
Wei Zhao
562251e007 net/i40e: fix build on FreeBSD
ENODATA can not be build in FreeBSD.

Fixes: 7cbecc2f74 ("net/i40e: support queue region set and flush")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-10-13 12:46:03 +02:00
Qi Zhang
24853544c8 net/i40e: fix mbuf free in vector Tx
vPMD tx does not set sw_ring's mbuf to NULL after free.
Therefore, in cases where the vector transmit function is in
use, we must use the appropriate index and threshold values
for the queue to only free the unreleased mbufs

Fixes: b4669bb950 ("i40e: add vector Tx")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-13 01:15:10 +01:00
Andrey Chilikin
1edc13a83b net/i40e: fix flexible payload configuration
Removed legacy writes to ORT/PIT registers from
i40e_GLQF_reg_init(struct i40e_hw *hw) function.
Latest NVM versions contain all relevant values
and these values should not be overwritten by SW to
maintain driver/firmware compatibility and to avoid
conflicts with dynamic device personalization profiles.

Fixes: f05ec7d77e ("i40e: initialize flow director flexible payload setting")
Cc: stable@dpdk.org

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-10-13 00:35:46 +01:00
Luca Boccassi
62bc760dea mk: sort source files before compilation
In order to achieve reproducible builds, always use the same
order when listing files for compilation.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
2017-10-12 22:31:33 +02:00
Jianfeng Tan
f37dfab21c drivers/net: enable IOVA mode for Intel PMDs
If we want to enable IOVA mode, introduced by
commit 93878cf025 ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-10-12 21:05:32 +01:00
Wei Zhao
7cbecc2f74 net/i40e: support queue region set and flush
This feature enable queue regions configuration for RSS in PF,
so that different traffic classes or different packet
classification types can be separated to different queues in
different queue regions.This patch can set queue region range,
it include queue number in a region and the index of first queue.
This patch enable mapping between different priorities (UP) and
different traffic classes.It also enable mapping between a region
index and a sepcific flowtype(PCTYPE).It also provide the solution
of flush all configuration about queue region the above described.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-10-12 01:52:50 +01:00
Matan Azrad
d5b0924ba6 ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot
return an error in case of failure at stats getting process time.

Since PCI devices can be removed and there is a time between the
physical removal to the RMV interrupt, the user may get invalid stats
without any indication.

This patch changes the stats_get API return value to be int instead of
void.

All the net PMDs stats_get dev ops are adjusted by this patch.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-12 01:52:49 +01:00
Yong Wang
47cf8373a1 net/i40e: fix uninitialized variable
In func i40evf_dev_link_update(), "new_link.link_autoneg" is used in
func call i40evf_dev_atomic_write_link_status(), but is uninitialized.

Fixes: 2a73125b70 ("i40evf: fix link info update")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-12 01:52:49 +01:00
Rory Sexton
a399ed9ae4 net/i40e: support converting VF MAC to VF id
Need a way to convert a VF id to a PF id on the host so as to query the
PF for relevant statistics which are used for the frequency changes in
the vm_power_manager app.

Used when profiles are passed down from the guest to the host, allowing
the host to map the VFs to PFs.

Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>
Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-10-12 00:40:39 +01: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
Jianfeng Tan
1950bd7694 xen: remove dependency in libraries
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-09 01:52:08 +02:00
Zhiyong Yang
f8244c6399 ethdev: increase port id range
Extend port_id definition from uint8_t to uint16_t in lib and drivers
data structures, specifically rte_eth_dev_data. Modify the APIs,
drivers and app using port_id at the same time.

Fix some checkpatch issues from the original code and remove some
unnecessary cast operations.

release_17_11 and deprecation docs have been updated in this patch.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 18:23:25 +02:00
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
Wenzhuo Lu
a1c1746d99 net/i40e: support deleting TM node
Add the support of the Traffic Management API,
rte_tm_node_delete.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-07-11 19:57:29 +02:00
Wenzhuo Lu
03a249b62b net/i40e: support adding TM node
Add the support of the Traffic Management API,
rte_tm_node_add.

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