dpdk.git
8 years agonet/ixgbe/base: define X550 PCIe serial MAC address
Xiao Wang [Sun, 25 Sep 2016 08:59:56 +0000 (16:59 +0800)]
net/ixgbe/base: define X550 PCIe serial MAC address

Add SERIAL_NUMBER_MAC_ADDR definition for X550.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: fix check for NACK
Xiao Wang [Sun, 25 Sep 2016 08:59:55 +0000 (16:59 +0800)]
net/ixgbe/base: fix check for NACK

Previously we checked return buffer for
(IXGBE_VF_SET_MACVLAN | IXGBE_VT_MSGTYPE_NACK), but this would not
work if index is not 0 and as a result NACK will not be detected.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: access IOSF by host interface
Xiao Wang [Sun, 25 Sep 2016 08:59:54 +0000 (16:59 +0800)]
net/ixgbe/base: access IOSF by host interface

This patch makes sure that we access IOSF registers through the
host interface command (HIC) for the majority of X550em devices.
All devices with NVM are capable of using the HIC.

For consistency all instances where the ixgbe_write_phy_reg_mdi is called
directly are converted to function pointer calls.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: increment PF-VF mailbox version
Xiao Wang [Sun, 25 Sep 2016 08:59:53 +0000 (16:59 +0800)]
net/ixgbe/base: increment PF-VF mailbox version

This patch will pave the way for the new VF unicast promiscuous
mode support.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: report VF MTU setting failure
Xiao Wang [Sun, 25 Sep 2016 08:59:52 +0000 (16:59 +0800)]
net/ixgbe/base: report VF MTU setting failure

Propagate return value when trying to set the maximum packet length. A
PF driver could return a NACK for this request, and the VF driver will
need to know this.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: fix function comments about X550
Xiao Wang [Sun, 25 Sep 2016 08:59:51 +0000 (16:59 +0800)]
net/ixgbe/base: fix function comments about X550

Some function comments are obviously wrong, this patch rewords them.

Fixes: d2e72774e58c ("ixgbe/base: support X550")
Fixes: 0790adeb5675 ("ixgbe/base: support X550em_a device")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: configure DMA coalescing for 10Mb
Xiao Wang [Sun, 25 Sep 2016 08:59:50 +0000 (16:59 +0800)]
net/ixgbe/base: configure DMA coalescing for 10Mb

Provide a DMA coalescing configuration for 10Mb link speed.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: clear page register in error path
Xiao Wang [Sun, 25 Sep 2016 08:59:49 +0000 (16:59 +0800)]
net/ixgbe/base: clear page register in error path

The error exit should at least try to set the page register to 0
since other code will assume that state.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: add flow control autoneg for X550em_a fiber
Xiao Wang [Sun, 25 Sep 2016 08:59:48 +0000 (16:59 +0800)]
net/ixgbe/base: add flow control autoneg for X550em_a fiber

This patch adds a separate function for enabling Flow Control (FC)
auto-negotiation on X550em_a:

- rename ixgbe_fc_autoneg_x550a() to ixgbe_fc_autoneg_backplane_x550em_a().
- create ixgbe_fc_autoneg_fiber_x550em_a() specifically for fiber.
- add definitions for KRM_PCS_KX_AN_LP register and related bits.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: add flow control for X550em_a fiber
Xiao Wang [Sun, 25 Sep 2016 08:59:47 +0000 (16:59 +0800)]
net/ixgbe/base: add flow control for X550em_a fiber

This patch adds a separate function for setting up Flow Control (FC)
on X550em_a fiber:

- rename ixgbe_setup_fc_x550a() to ixgbe_setup_fc_backplane_x550em_a().
- create ixgbe_setup_fc_fiber_x550em_a() to configure FC for fiber.
- add definitions for KRM_AN_CNTL_4 and KRM_PCS_KX_AN along with related
  definitions.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: add VF promiscuous mode constants
Xiao Wang [Sun, 25 Sep 2016 08:59:46 +0000 (16:59 +0800)]
net/ixgbe/base: add VF promiscuous mode constants

Add new definitions to support VF unicast promiscuous mode which
will be implemented in a later patch.

Besides, rename definitions of subdevice IDs on SFP LOM to make it
easier to distinguish.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: rework X550em_a 1G PHY init
Xiao Wang [Sun, 25 Sep 2016 08:59:45 +0000 (16:59 +0800)]
net/ixgbe/base: rework X550em_a 1G PHY init

Fully initialize X550em_a 1G PHYs; move the PHY definitions from
ixgbe_x550.h to ixgbe_phy.h, where they really belong; define
register numbers in decimal because that is how they are in the spec.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: extract PHY probing function
Xiao Wang [Sun, 25 Sep 2016 08:59:44 +0000 (16:59 +0800)]
net/ixgbe/base: extract PHY probing function

Move the PHY probe code into a separate function so that it can be
reused. A subsequent patch will use it for configurations that
provide the PHY address explicitly.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: move X550 MAC ops init into functions
Xiao Wang [Sun, 25 Sep 2016 08:59:43 +0000 (16:59 +0800)]
net/ixgbe/base: move X550 MAC ops init into functions

This patch introduces new init_ops functions for X550EM_a and X550EM_x.
This makes it easier to assign function pointers with specific
dependencies (like media type) for each MAC.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: move multicast mode update
Xiao Wang [Sun, 25 Sep 2016 08:59:42 +0000 (16:59 +0800)]
net/ixgbe/base: move multicast mode update

This patch adds update_xcast_mode callback in mac ops, and moves
ixgbevf_update_xcast_mode function into base code.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: support X550em_a 10G PHY
Xiao Wang [Sun, 25 Sep 2016 08:59:41 +0000 (16:59 +0800)]
net/ixgbe/base: support X550em_a 10G PHY

This patch uses the shared Management Data Input/output (MDIO)
functions ixgbe_read_phy_reg_x550a and ixgbe_write_phy_reg_x550a
for X550em_a 10G PHY which supports flow control auto-negotiation.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: change endianness of PHY data
Xiao Wang [Sun, 25 Sep 2016 08:59:40 +0000 (16:59 +0800)]
net/ixgbe/base: change endianness of PHY data

The x550a related firmware reverses the endianness of the PHY data read
and written via host interface command, so make corresponding changes
to that.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: remove X550em SFP iXFI setup
Xiao Wang [Sun, 25 Sep 2016 08:59:39 +0000 (16:59 +0800)]
net/ixgbe/base: remove X550em SFP iXFI setup

This patch removes X550em SFP iXFI setup for the drivers since there
is no released hardware production with SFP iXFI.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe/base: fix pointer check
Xiao Wang [Sun, 25 Sep 2016 08:59:38 +0000 (16:59 +0800)]
net/ixgbe/base: fix pointer check

The vfta_delta value rather than the pointer should be checked.

Fixes: b978f7b38c14 ("net/ixgbe/base: simplify VLAN management")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/i40e: enable 25G device
Qi Zhang [Tue, 27 Sep 2016 01:37:22 +0000 (09:37 +0800)]
net/i40e: enable 25G device

Add support for 25G link speed to enable 25G device.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/i40e: use PHY type to check PHY capability
Qi Zhang [Tue, 27 Sep 2016 01:37:21 +0000 (09:37 +0800)]
net/i40e: use PHY type to check PHY capability

Using device ID to check PHY capability is not extensible.

Now we are using PHY type to detect PHY capability.

All link speeds supported by the device are encoded into PHY type,
and PHY type value can be read by admin queue "get_phy_capability"
command at initialization stage.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/enic: support scatter Rx in MTU update
John Daley [Thu, 22 Sep 2016 17:02:46 +0000 (10:02 -0700)]
net/enic: support scatter Rx in MTU update

Re-initialize Rq's when MTU is changed. This allows for more
efficient use of mbufs when moving from an MTU that is greater
than the mbuf size to one that is less. Also move to using Rx
scatter mode when moving from an MTU less than the mbuf size
to one that is greater.

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
8 years agonet/enic: fix freeing memory for descriptor ring
Nelson Escobar [Thu, 22 Sep 2016 17:02:45 +0000 (10:02 -0700)]
net/enic: fix freeing memory for descriptor ring

The function vnic_dev_free_desc_ring() didn't actually free memory. Fix
this by first changing vnic_dev_alloc_desc_ring() to use the common
allocation function, then in vnic_dev_free_desc_ring call the common
free function.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
8 years agonet/enic: enable link check interrupt
Nelson Escobar [Mon, 19 Sep 2016 18:50:11 +0000 (11:50 -0700)]
net/enic: enable link check interrupt

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agonet/enic: extract code for checking link status
Nelson Escobar [Mon, 19 Sep 2016 18:50:10 +0000 (11:50 -0700)]
net/enic: extract code for checking link status

Move link check code to a new function so that it can be reused
by the interrupt handler.

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agonet/enic: unregister interrupt handler when stopping
Nelson Escobar [Mon, 19 Sep 2016 18:50:09 +0000 (11:50 -0700)]
net/enic: unregister interrupt handler when stopping

enic_disable() wasn't calling rte_intr_disable() or
rte_intr_callback_unregister().  stopping/starting a port would
result in the same interrupt callback being registered multiple
times, which would then cause it to be called multiple times on
every interrupt.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agonet/mlx5: support Mellanox OFED 3.4
Nélio Laranjeiro [Wed, 21 Sep 2016 13:48:12 +0000 (15:48 +0200)]
net/mlx5: support Mellanox OFED 3.4

Some macros are renamed by Mellanox OFED 3.4.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomaintainers: add new bnxt driver maintainer
Ajit Khaparde [Wed, 21 Sep 2016 22:27:14 +0000 (17:27 -0500)]
maintainers: add new bnxt driver maintainer

Add Ajit Khaparde as the maintainer of the bnxt PMD

Reviewed-by: David Christensen <david.christensen@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Stephen Hurd <stephen.hurd@broadcom.com>
8 years agonet/i40e: support ARM platform
Jianbo Liu [Fri, 5 Aug 2016 09:06:23 +0000 (14:36 +0530)]
net/i40e: support ARM platform

And add read memory barrier to avoid status inconsistency
between two Rx descriptors readings.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/enic: get Rx queue count
Nelson Escobar [Mon, 19 Sep 2016 18:50:29 +0000 (11:50 -0700)]
net/enic: get Rx queue count

Add support to enic for rte_eth_rx_queue_count().

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agonet/ixgbe: use macro for PCI log format
Yunjian Wang [Sat, 27 Aug 2016 03:28:54 +0000 (11:28 +0800)]
net/ixgbe: use macro for PCI log format

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Remy Horton <remy.horton@intel.com>
8 years agonet/i40e/base: support FCoE
Qi Zhang [Thu, 25 Aug 2016 20:05:18 +0000 (16:05 -0400)]
net/i40e/base: support FCoE

Add Fibre Channel Over Ethernet (FCoE) in PHY capabilities.
Add data structure for FCoE statistics collection.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: get SAN MAC address
Qi Zhang [Thu, 25 Aug 2016 20:05:17 +0000 (16:05 -0400)]
net/i40e/base: get SAN MAC address

Add function that reads the adapter's Storage Area Network (SAN) MAC
address from NVM.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: minor clean up
Qi Zhang [Thu, 25 Aug 2016 20:05:16 +0000 (16:05 -0400)]
net/i40e/base: minor clean up

Remove unused device ID.
Remove unused compile option.
Adjust code alignment.
Standardize macros.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: enable proxy command for X722
Qi Zhang [Thu, 25 Aug 2016 20:05:15 +0000 (16:05 -0400)]
net/i40e/base: enable proxy command for X722

Add definitions to enable proxy cmd.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: add multicast magic packet enable flag
Qi Zhang [Thu, 25 Aug 2016 20:05:14 +0000 (16:05 -0400)]
net/i40e/base: add multicast magic packet enable flag

Add a definition for multicast magic packet enable flag

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: enable set/get HMC resource profile
Qi Zhang [Thu, 25 Aug 2016 20:05:13 +0000 (16:05 -0400)]
net/i40e/base: enable set/get HMC resource profile

Enable admin queue command that can get or set host memory cache (HMC)
resource profile.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: enable wake on LAN for X722
Qi Zhang [Thu, 25 Aug 2016 20:05:12 +0000 (16:05 -0400)]
net/i40e/base: enable wake on LAN for X722

Add macros and data structure to support wake on
LAN feature for X722.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: get PHY abilities for 25G
Qi Zhang [Thu, 25 Aug 2016 20:05:11 +0000 (16:05 -0400)]
net/i40e/base: get PHY abilities for 25G

Add extended PHY types to get PHY abilities for 25G, then put
PHY types for 25G into the proper field when the PHY capabilities
are queried.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: add 25G PHY capability
Qi Zhang [Thu, 25 Aug 2016 20:05:10 +0000 (16:05 -0400)]
net/i40e/base: add 25G PHY capability

Add PHY type macros for 25G PHY capabilities.
Change data type and bit setting defines for 25G.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: define PHY type capability constants
Qi Zhang [Thu, 25 Aug 2016 20:05:09 +0000 (16:05 -0400)]
net/i40e/base: define PHY type capability constants

Define macros for PHY type capabilities to replace exist enum type.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: fix UDP packet header
Qi Zhang [Thu, 25 Aug 2016 20:05:08 +0000 (16:05 -0400)]
net/i40e/base: fix UDP packet header

Correct Rx ptype payload layer for non_tunneled ipv6 with UDP.

Fixes: 8db9e2a1b232 ("i40e: base driver")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e/base: add function to clear default VSI
Qi Zhang [Thu, 25 Aug 2016 20:05:07 +0000 (16:05 -0400)]
net/i40e/base: add function to clear default VSI

Add a function to return the VSI to default settings.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
8 years agonet/i40e: fix parsing QinQ packets type
Beilei Xing [Mon, 12 Sep 2016 09:41:46 +0000 (17:41 +0800)]
net/i40e: fix parsing QinQ packets type

Previously, PTYPE filed in the RX descriptors is not set properly
for QinQ packets. The wrong PTYPE is generated because outer Tag did
not have ORT/PIT configured, so fix this issue by configuring ORT/PIT.
This patch also changes bitmask of outer VLAN tag in L2 header
to support RSS and flow director for QinQ.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: 4072d503aaa5 ("i40e: fix VLAN bitmasks for input set")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/i40e: fix null pointer dereferences when using VMDq+RSS
Rich Lane [Tue, 2 Aug 2016 19:34:56 +0000 (12:34 -0700)]
net/i40e: fix null pointer dereferences when using VMDq+RSS

When using VMDQ+RSS, the queue ids used by the application are not
contiguous (see i40e_pf_config_rss). Most of the driver already handled
this, but there were a few cases where it assumed all configured queues
had been setup.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: 6b4537128394 ("i40e: free queue memory when closing")
Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")

Signed-off-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/ixgbe: fix VF reset to apply to correct VF
Alex Zelezniak [Tue, 30 Aug 2016 01:23:29 +0000 (20:23 -0500)]
net/ixgbe: fix VF reset to apply to correct VF

In SR-IOV configuration, queues 0 - nb_rx_queues belong to VF0,
which means that with the current implementation when a reset mbox
message comes from any VF, it affects the settings of VF0.

Fix this by using PF queue index to update the correct queue.

Fixes: dbb0b8737f64 ("ixgbe: add vlan offload support")

Signed-off-by: Alex Zelezniak <alexz@att.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/ixgbe: start Rx/Tx after all config done
Wang Wei [Tue, 6 Sep 2016 12:05:17 +0000 (20:05 +0800)]
net/ixgbe: start Rx/Tx after all config done

Starting rxtx before flow director config will cause driver not to
receive packets from NIC.

Signed-off-by: Wang Wei <lnykww@gmail.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/i40e: fix dropping packets with ethertype 0x88A8
Beilei Xing [Wed, 17 Aug 2016 01:58:06 +0000 (09:58 +0800)]
net/i40e: fix dropping packets with ethertype 0x88A8

In FW default settings, Ethertype 0x88A8 is treated as S-TAG,
and packets with S-TAG should be received in Port Virtualizer mode.
However, Port Virtualizer mode is not initialized in DPDK, so X710 will
drop packets with Ethertype 0x88A8.
This patch fixes this issue by turning off S-TAG identification.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/enic: fix bad L4 checksum flag on ICMP packets
John Daley [Wed, 17 Aug 2016 22:15:26 +0000 (15:15 -0700)]
net/enic: fix bad L4 checksum flag on ICMP packets

The bad L4 checksum flag was set on IP packets which were not
also TCP or UDP packets. This includes ICMP, IGMP and OSPF packets.

L4 ptypes were being treated as bits instead of values within the
L4 mask causing the code to check L4 checksum in the completion
queue and incorrectly set the L4 bad checksum flag.

Fixes: 947d860c821f ("enic: improve Rx performance")

Reviewed-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
8 years agonet/fm10k: fix MAC address removal from switch
Xiao Wang [Fri, 5 Aug 2016 03:17:43 +0000 (11:17 +0800)]
net/fm10k: fix MAC address removal from switch

When testpmd quits with two ports, the second port's MAC address
remains in the MAC table of switch manager.

There needs to be some time for HW to quiesce when closing a port,
otherwise a subsequent port close won't be handled correctly.

This patch adds a delay after turning off a logic port, just as
the kernel driver does.

Fixes: 8b5c9ec20b7b ("fm10k: support VMDQ in MAC/VLAN filter")

Reported-by: Xueqin Lin <xueqin.lin@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agonet/enic: move link checking init to probe time
Nelson Escobar [Tue, 9 Aug 2016 21:42:04 +0000 (14:42 -0700)]
net/enic: move link checking init to probe time

The enic DMAs link status information to the host and this requires a
little setup. This setup was being done as a result of calling
rte_eth_dev_start(). But applications expect to be able to check link
status before calling rte_eth_dev_start().

This patch moves the link status setup to enic_init() which is called
at device probe time so that link status can be checked anytime.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agonet/pcap: fix memory leak in jumbo frames
Dror Birkman [Tue, 20 Sep 2016 12:08:56 +0000 (15:08 +0300)]
net/pcap: fix memory leak in jumbo frames

If rte_pktmbuf_alloc() fails on any segment that is not the initial
segment, previously allocated mbufs are not freed.

Fixes: 6db141c91e1f ("pcap: support jumbo frames")

Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agonet/mlx5: remove gather loop on segments
Nélio Laranjeiro [Tue, 20 Sep 2016 08:53:51 +0000 (10:53 +0200)]
net/mlx5: remove gather loop on segments

Tx function was handling a double loop to send segmented packets, it can be
done in a single one.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
8 years agonet/mlx5: reduce memory overhead for WQE handling
Nélio Laranjeiro [Tue, 20 Sep 2016 08:53:50 +0000 (10:53 +0200)]
net/mlx5: reduce memory overhead for WQE handling

PMD uses only power of two number of Work Queue Elements (aka WQE), storing
the number of elements in log2 helps to reduce the size of the container to
store it.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/mlx5: reduce memory overhead for BF handling
Nélio Laranjeiro [Tue, 20 Sep 2016 08:53:49 +0000 (10:53 +0200)]
net/mlx5: reduce memory overhead for BF handling

Blue Flame (aka BF) is a buffer allocated with a power of two value, its
size is returned by Verbs in log2.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/mlx5: reduce memory overhead for CQE handling
Nélio Laranjeiro [Tue, 20 Sep 2016 08:53:48 +0000 (10:53 +0200)]
net/mlx5: reduce memory overhead for CQE handling

PMD uses only power of two number of Completion Queue Elements (aka CQE),
storing the number of elements in log2 helps to reduce the size of the
container to store it.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/mlx5: reduce memory overhead of Rx/Tx descriptors
Nélio Laranjeiro [Tue, 20 Sep 2016 08:53:47 +0000 (10:53 +0200)]
net/mlx5: reduce memory overhead of Rx/Tx descriptors

PMD uses only power of two number of descriptors, storing the number of
elements in log2 helps to reduce the size of the container to store it.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agonet/mlx5: rework hardware structures
Nélio Laranjeiro [Tue, 20 Sep 2016 08:53:46 +0000 (10:53 +0200)]
net/mlx5: rework hardware structures

Rework Work Queue Element (aka WQE) structures to fit PMD needs.
A WQE is an aggregation of 16 bytes elements known as "data segments"
(aka dseg).

The only common part is the first two elements i.e. the control one to
define the job type, and the Ethernet segment which embed offload requests
with other information, after that, it can have:
  - a raw data packet,
  - a data pointer to the packet itself,
  - both.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/nfp: unregister interrupt callback when closing
Alejandro Lucero [Fri, 16 Sep 2016 11:11:14 +0000 (12:11 +0100)]
net/nfp: unregister interrupt callback when closing

With an app using hotplug feature, when a device is unplugged without
unregistering makes the interrupt handling unstable.

Fixes: 6c53f87b3497 ("nfp: add link status interrupt")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
8 years agonet/nfp: fix copying MAC address
Alejandro Lucero [Fri, 16 Sep 2016 11:11:04 +0000 (12:11 +0100)]
net/nfp: fix copying MAC address

Fixes: defb9a5dd156 ("nfp: introduce driver initialization")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
8 years agonet/nfp: use random MAC address if not configured
Alejandro Lucero [Fri, 16 Sep 2016 11:10:48 +0000 (12:10 +0100)]
net/nfp: use random MAC address if not configured

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
8 years agonet/thunderx: support 81xx SoC
Jerin Jacob [Thu, 21 Jul 2016 14:01:47 +0000 (19:31 +0530)]
net/thunderx: support 81xx SoC

81xx NIC subsystem differs in new PCI subsystem_device_id and
NICVF_CAP_CQE_RX2 capability.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agonet/thunderx: add tunneling extension info capability flag
Jerin Jacob [Thu, 21 Jul 2016 14:01:46 +0000 (19:31 +0530)]
net/thunderx: add tunneling extension info capability flag

Certain thunderx SoC pass has additional optional word
in Rx descriptor to hold tunneling extension info.
Based on this capability, the location where packet pointer
address stored in Rx descriptor will vary.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agonet/thunderx: remove generic passX references
Jerin Jacob [Thu, 21 Jul 2016 14:01:45 +0000 (19:31 +0530)]
net/thunderx: remove generic passX references

thunderx pmd driver needs to support multiple SoC
variants in ThunderX family.
Remove generic pass references from driver as each SoC
can have same pass number.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agonet/mlx: fix debug build with gcc 6.1
Bruce Richardson [Mon, 19 Sep 2016 14:36:54 +0000 (15:36 +0100)]
net/mlx: fix debug build with gcc 6.1

With recent gcc versions, e.g. gcc 6.1, compilation of mlx drivers with
debug enabled produces lots of errors complaining that "pedantic" is
not a warning level that can be ignored.

error: ‘-pedantic’ is not an option that controls warnings [-Werror=pragmas]
 #pragma GCC diagnostic ignored "-pedantic"
                                 ^~~~~~~~~~~

These errors can be removed by changing the "-pedantic" to "-Wpedantic".

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agonet/pcap: fix checkpatch warnings
Ferruh Yigit [Fri, 26 Aug 2016 11:17:59 +0000 (12:17 +0100)]
net/pcap: fix checkpatch warnings

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: remove rte prefix from static functions
Ferruh Yigit [Fri, 26 Aug 2016 11:17:58 +0000 (12:17 +0100)]
net/pcap: remove rte prefix from static functions

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: coding convention updates
Ferruh Yigit [Fri, 26 Aug 2016 11:17:57 +0000 (12:17 +0100)]
net/pcap: coding convention updates

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: fix missing Tx interface assignment
Ferruh Yigit [Fri, 26 Aug 2016 11:17:56 +0000 (12:17 +0100)]
net/pcap: fix missing Tx interface assignment

Missing pcap assignment may cause pcap file/interface to be opened
again, and previous one not closed.

Fixes: 1e38a7c66923 ("pcap: fix storage of name and type in queues")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: simplify function
Ferruh Yigit [Fri, 26 Aug 2016 11:17:55 +0000 (12:17 +0100)]
net/pcap: simplify function

simplify function rte_eth_from_pcaps_common by using interim variables.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: remove redundant assignment
Ferruh Yigit [Fri, 26 Aug 2016 11:17:54 +0000 (12:17 +0100)]
net/pcap: remove redundant assignment

data->name assigned twice.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: remove unnecessary check
Ferruh Yigit [Fri, 26 Aug 2016 11:17:53 +0000 (12:17 +0100)]
net/pcap: remove unnecessary check

Both fields are fields of same type of struct, one's size can't be bigger
than others.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: update single interface handling
Ferruh Yigit [Fri, 26 Aug 2016 11:17:52 +0000 (12:17 +0100)]
net/pcap: update single interface handling

Remove hardcoded single interface values, make it more obvious.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: reorder functions
Ferruh Yigit [Fri, 26 Aug 2016 11:17:51 +0000 (12:17 +0100)]
net/pcap: reorder functions

Reorder functions to be able to remove function declarations in .c file.
Function definitions not modified.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: reorder includes
Ferruh Yigit [Fri, 26 Aug 2016 11:17:50 +0000 (12:17 +0100)]
net/pcap: reorder includes

Remove unused ones and sort remaining.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: make const array static
Ferruh Yigit [Fri, 26 Aug 2016 11:17:49 +0000 (12:17 +0100)]
net/pcap: make const array static

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: group stats related fields into a struct
Ferruh Yigit [Fri, 26 Aug 2016 11:17:48 +0000 (12:17 +0100)]
net/pcap: group stats related fields into a struct

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: use single interface flag instead of hardcoding
Ferruh Yigit [Fri, 26 Aug 2016 11:17:47 +0000 (12:17 +0100)]
net/pcap: use single interface flag instead of hardcoding

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: remove duplicated max queue number check
Ferruh Yigit [Fri, 26 Aug 2016 11:17:46 +0000 (12:17 +0100)]
net/pcap: remove duplicated max queue number check

Remove duplicated check by reorganizing the code, no functional change.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: move comment
Ferruh Yigit [Fri, 26 Aug 2016 11:17:45 +0000 (12:17 +0100)]
net/pcap: move comment

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: do not carry kvlist argument
Ferruh Yigit [Fri, 26 Aug 2016 11:17:44 +0000 (12:17 +0100)]
net/pcap: do not carry kvlist argument

Don't carry kvlist argument into sub function and used it, use kvlist
argument in upper level of call stack.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: do not carry numa node argument
Ferruh Yigit [Fri, 26 Aug 2016 11:17:43 +0000 (12:17 +0100)]
net/pcap: do not carry numa node argument

Instead of defining numa_node variable upper level of call stack and
carry into sub function, set it where needs to be used.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: update function to allow reuse
Ferruh Yigit [Fri, 26 Aug 2016 11:17:42 +0000 (12:17 +0100)]
net/pcap: update function to allow reuse

rte_eth_from_pcaps and rte_eth_from_pcaps_n_dumpers functions are very
close, updated rte_eth_from_pcaps function and reused.

No functional update.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: check max queue number
Ferruh Yigit [Fri, 26 Aug 2016 11:17:41 +0000 (12:17 +0100)]
net/pcap: check max queue number

Number of queues is defined by devargs, a check added to be sure this
number is not bigger than configured max number of queue.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: reorganize private structs
Ferruh Yigit [Fri, 26 Aug 2016 11:17:40 +0000 (12:17 +0100)]
net/pcap: reorganize private structs

struct rx_pcaps and tx_pcaps used to point parsed devargs, but it is not
clear with current names.

Merged both into single struct and modified struct name and field names.

Functionality not changed, only struct names.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: use macros for parameter string
Ferruh Yigit [Fri, 26 Aug 2016 11:17:39 +0000 (12:17 +0100)]
net/pcap: use macros for parameter string

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/pcap: convert config option to a macro
Ferruh Yigit [Fri, 26 Aug 2016 11:17:38 +0000 (12:17 +0100)]
net/pcap: convert config option to a macro

pcap PMD is using ring PMD configuration parameters to set max number of
queues. This creates an unnecessary dependency and confusion.

Stop using configuration parameter to set max number of queues and
convert this variable into a macro within source code, to simplify
configuration file.

Default value of macro is same as ring parameter's default.

pcap pmd doesn't need to be configured in a detail to set rx and tx max
queue numbers separately, so using same macro for both queues.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agonet/e1000: fix returned number of available Rx descriptors
Ali Volkan Atli [Wed, 27 Jul 2016 13:11:09 +0000 (16:11 +0300)]
net/e1000: fix returned number of available Rx descriptors

Fixes: 0f6b7c7f7a37 ("igb: use DD bit to count RX available descriptors")

Signed-off-by: Ali Volkan Atli <volkan.atli@argela.com.tr>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agonet/mlx5: fix inline logic
Nélio Laranjeiro [Wed, 14 Sep 2016 11:53:55 +0000 (13:53 +0200)]
net/mlx5: fix inline logic

To improve performance the NIC expects for large packets to have a pointer
to a cache aligned address, old inline code could break this assumption
which hurts performance.

Fixes: 2a66cf378954 ("net/mlx5: support inline send")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
8 years agonet/mlx5: re-factorize functions
Nélio Laranjeiro [Wed, 14 Sep 2016 11:53:54 +0000 (13:53 +0200)]
net/mlx5: re-factorize functions

Rework logic of wqe_write() and wqe_write_vlan() which are pretty similar
to keep a single one.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/mlx5: force inline for completion function
Nélio Laranjeiro [Wed, 14 Sep 2016 11:53:53 +0000 (13:53 +0200)]
net/mlx5: force inline for completion function

This function was supposed to be inlined, but was not because several
functions calls it.  This function should always be inline avoid
external function calls and to optimize code in data-path.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/mlx5: fix flow director drop mode
Yaacov Hazan [Wed, 14 Sep 2016 11:53:52 +0000 (13:53 +0200)]
net/mlx5: fix flow director drop mode

Packet rejection was routed to a polled queue.  This patch route them to a
dummy queue which is not polled.

Fixes: 76f5c99e6840 ("mlx5: support flow director")

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/mlx5: refactor allocation of flow director queues
Yaacov Hazan [Wed, 14 Sep 2016 11:53:51 +0000 (13:53 +0200)]
net/mlx5: refactor allocation of flow director queues

This is done to prepare support for drop queues, which are not related to
existing Rx queues and need to be managed separately.

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agonet/mlx5: fix removing VLAN filter
Raslan Darawsheh [Wed, 14 Sep 2016 11:53:50 +0000 (13:53 +0200)]
net/mlx5: fix removing VLAN filter

memmove was moving bytes as the number of elements next to i, while it
should move the number of elements multiplied by the size of each element.

Fixes: e9086978 ("mlx5: support VLAN filtering")

Signed-off-by: Raslan Darawsheh <rdarawsheh@asaltech.com>
8 years agonet/mlx5: fix Rx VLAN offload capability report
Adrien Mazarguil [Wed, 14 Sep 2016 11:53:49 +0000 (13:53 +0200)]
net/mlx5: fix Rx VLAN offload capability report

This capability is implemented but not reported.

Fixes: f3db9489188a ("mlx5: support Rx VLAN stripping")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agonet/mlx5: fix inconsistent return value in flow director
Yaacov Hazan [Wed, 14 Sep 2016 11:53:48 +0000 (13:53 +0200)]
net/mlx5: fix inconsistent return value in flow director

The return value in DPDK is negative errno on failure.
Since internal functions in mlx driver return positive
values need to negate this value when it returned to
dpdk layer.

Fixes: 76f5c99 ("mlx5: support flow director")

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
8 years agodoc: fix typo in VF guide
Rami Rosen [Sat, 6 Aug 2016 06:16:23 +0000 (09:16 +0300)]
doc: fix typo in VF guide

This patch fixes a typo in doc/guides/nics/intel_vf.rst.

Fixes: fc1f2750a3ec ("doc: programmers guide")

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agonet/mlx5: fix possible NULL dereference in Rx path
Sagi Grimberg [Tue, 2 Aug 2016 14:41:21 +0000 (17:41 +0300)]
net/mlx5: fix possible NULL dereference in Rx path

The user is allowed to call ->rx_pkt_burst() even without free
mbufs in the pool. In this scenario we'll fail allocating a rep mbuf
on the first iteration (where pkt is still NULL). This would cause us
to deref a NULL pkt (reset refcount and free).

Fix this by checking the pkt before freeing it.

Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx")

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agonet/i40e: add packet type translation for X722
Jeff Guo [Wed, 7 Sep 2016 09:38:40 +0000 (05:38 -0400)]
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>
8 years agonet/i40e: add new packet types for device X722
Jeff Guo [Wed, 7 Sep 2016 09:38:02 +0000 (05:38 -0400)]
net/i40e: add new packet types for device X722

There are 6 new PCTYPEs enabled in the device x722.

The 6 new PCTYPEs As below:
* NonF Unicast IPv4, UDP
* NonF Multicast IPv4, UDP
* NonF IPv4, TCP, SYN, no ACK
* NonF Unicast IPv6, UDP
* NonF Multicast IPv6, UDP

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>