Skip to contentSkip to conversation

Add i40e PMD support

PATCH In review Helin Zhang 4 participants 35 messages Jun 5, 2014 – Jun 19, 2014 5 messages not in the archive Library code

lore
Share & tools
lore
#0 lore raw

v2 cover Add i40e PMD support

Summary:
The 2nd version of series of patches are to add i40e PMD support. It contains the updated basic shared code, and some other enhancements. It adds the support of the latest version of firmware.
* Add new PMD driver of i40e in the folder of librte_pmd_i40e
* Add some neccessary definitions, changes in rte_mbuf.h and eth_dev
* Add new configurations for i40e
* Add or modifiy makefiles to support i40e compilation
* Add neccessary changes in ixgbe, e1000 and vmxnet3 PMD, as hash flags has been enlarged from 16 bits to 64 bits to support i40e
* Add neccessary changes in example applications and testpmd to use ETH_RSS_IP to replace all IP hash flags, as i40e introduced more hash flags.
* Add command in testpmd for port based vlan insertion offload testing
* Add neccessary changes in eth_dev to support configuring maximum packet length of less than 1518
* Add two sys files in igb_uio to support enabling/disabling 'Extended Tag' and resetting 'Max Read Request Size', as it has big impacts on i40e performance
* Add neccessary changes in pci to read/write the above two sys files during probing PCI

Features/enhancements to be implemented later:
* Set link speed, and physically up/down
* Double VLAN support, flow director, VMDq and DCB
* VLAN insertion/stripping, RSS in VF

Validation Summary:
This patch includes 27 files, and has been tested by Intel(R). Please see test environment information as the following:
* Fedora 20 x86_64
* Linux Kernel 3.11.10-301
* GCC 4.8.2
* Intel Xeon CPU E5-2680 v2 @ 2.80GHz
We verified this patch with two NICs (i40e 4x10 SFP+, i40e 2x40G), and performed basic function test on PF and VF.
All cases are passed.
Total cases Passed Failed

          138     138       0

---
Helin Zhang (27):
i40e: add basic shared code
i40e: add PMD source files
pci: add macros and pci device IDs to support i40e
igb_uio: add i40e support
mbuf: add new packet flags for i40e
ethdev: add i40e support
ethdev: support setting maximum packet length to less than 1518
vmxnet3: enlarge the hash flags of RSS to 64 bits
ixgbe: enlarge the hash flags of RSS to 64 bits
igb: enlarge the hash flags of RSS to 64 bits
mk: add i40e support
config: add configurations for i40e
app/test-pmd: support displaying 32 bytes RX descriptors app/test-pmd: add command of 'tx_vlan set pvid port_id vlan_id

    (on|off)'

app/testpmd: enlarge the hash flags of RSS to 64 bits app/test-pmd: add L3 packet type in offload flags examples/dpdk_qat: use ETH_RSS_IP to replace IP hash flags of RSS examples/ip_reassembly: use ETH_RSS_IP to replace IP hash flags of RSS examples/l3fwd-power: use ETH_RSS_IP to replace IP hash flags of RSS examples/l3fwd-vf: use ETH_RSS_IP to replace IP hash flags of RSS examples/l3fwd: use ETH_RSS_IP to replace IP hash flags of RSS examples/load_balancer: use ETH_RSS_IP to replace IP hash flags of RSS examples/multi_process: use ETH_RSS_IP to replace IP hash flags of RSS examples/qos_meter: use ETH_RSS_IP to replace IP hash flags of RSS
igb_uio: add sys files to read/write specific bits in pci config space
pci: support reading/writing sys files of 'extended_tag' and
'max_read_request_size'
config: add configurations for enabling 'Extended Tag' or resetting
'Max Read Request Size'

 app/test-pmd/cmdline.c                            |    65 +-
 app/test-pmd/config.c                             |    45 +-
 app/test-pmd/csumonly.c                           |     2 +
 app/test-pmd/parameters.c                         |     5 +-
 app/test-pmd/testpmd.c                            |     2 +-
 app/test-pmd/testpmd.h                            |     4 +-
 config/common_bsdapp                              |    20 +
 config/common_linuxapp                            |    30 +
 examples/dpdk_qat/main.c                          |     2 +-
 examples/ip_reassembly/main.c                     |     2 +-
 examples/l3fwd-power/main.c                       |     2 +-
 examples/l3fwd-vf/main.c                          |     2 +-
 examples/l3fwd/main.c                             |     2 +-
 examples/load_balancer/init.c                     |     2 +-
 examples/multi_process/symmetric_mp/main.c        |     2 +-
 examples/qos_meter/main.c                         |     2 +-
 lib/Makefile                                      |     1 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h   |    44 +
 lib/librte_eal/linuxapp/eal/eal_pci.c             |    99 +
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c         |   107 +
 lib/librte_ether/rte_ethdev.c                     |    25 +-
 lib/librte_ether/rte_ethdev.h                     |   154 +-
 lib/librte_ether/rte_ether.h                      |    24 +
 lib/librte_mbuf/rte_mbuf.h                        |     8 +
 lib/librte_pmd_e1000/igb_rxtx.c                   |    21 +-
 lib/librte_pmd_i40e/Makefile                      |    85 +
 lib/librte_pmd_i40e/i40e/i40e_adminq.c            |  1103 ++
 lib/librte_pmd_i40e/i40e/i40e_adminq.h            |   158 +
 lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h        |  2179 ++++
 lib/librte_pmd_i40e/i40e/i40e_alloc.h             |    65 +
 lib/librte_pmd_i40e/i40e/i40e_common.c            |  4846 +++++++++
 lib/librte_pmd_i40e/i40e/i40e_dcb.c               |  1104 ++
 lib/librte_pmd_i40e/i40e/i40e_dcb.h               |   264 +
 lib/librte_pmd_i40e/i40e/i40e_diag.c              |   188 +
 lib/librte_pmd_i40e/i40e/i40e_diag.h              |    61 +
 lib/librte_pmd_i40e/i40e/i40e_hmc.c               |   373 +
 lib/librte_pmd_i40e/i40e/i40e_hmc.h               |   244 +
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c           |  1616 +++
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h           |   214 +
 lib/librte_pmd_i40e/i40e/i40e_nvm.c               |   942 ++
 lib/librte_pmd_i40e/i40e/i40e_osdep.h             |   197 +
 lib/librte_pmd_i40e/i40e/i40e_prototype.h         |   435 +
 lib/librte_pmd_i40e/i40e/i40e_register.h          |  3377 ++++++
 lib/librte_pmd_i40e/i40e/i40e_register_x710_int.h | 10712 ++++++++++++++++++++
 lib/librte_pmd_i40e/i40e/i40e_status.h            |   107 +
 lib/librte_pmd_i40e/i40e/i40e_type.h              |  1462 +++
 lib/librte_pmd_i40e/i40e/i40e_virtchnl.h          |   373 +
 lib/librte_pmd_i40e/i40e_ethdev.c                 |  4019 ++++++++
 lib/librte_pmd_i40e/i40e_ethdev.h                 |   356 +
 lib/librte_pmd_i40e/i40e_ethdev_vf.c              |  1336 +++
 lib/librte_pmd_i40e/i40e_logs.h                   |    74 +
 lib/librte_pmd_i40e/i40e_pf.c                     |   928 ++
 lib/librte_pmd_i40e/i40e_pf.h                     |    67 +
 lib/librte_pmd_i40e/i40e_rxtx.c                   |  2204 ++++
 lib/librte_pmd_i40e/i40e_rxtx.h                   |   189 +
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c                 |    22 +-
 lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c             |    16 +-
 mk/rte.app.mk                                     |     4 +
 58 files changed, 39936 insertions(+), 56 deletions(-)
 create mode 100644 lib/librte_pmd_i40e/Makefile
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_alloc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_common.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_dcb.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_dcb.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_diag.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_diag.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_hmc.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_hmc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_nvm.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_osdep.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_prototype.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_register.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_register_x710_int.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_status.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_type.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_virtchnl.h
 create mode 100644 lib/librte_pmd_i40e/i40e_ethdev.c
 create mode 100644 lib/librte_pmd_i40e/i40e_ethdev.h
 create mode 100644 lib/librte_pmd_i40e/i40e_ethdev_vf.c
 create mode 100644 lib/librte_pmd_i40e/i40e_logs.h
 create mode 100644 lib/librte_pmd_i40e/i40e_pf.c
 create mode 100644 lib/librte_pmd_i40e/i40e_pf.h
 create mode 100644 lib/librte_pmd_i40e/i40e_rxtx.c
 create mode 100644 lib/librte_pmd_i40e/i40e_rxtx.h
Signature · 1 line
1.8.1.4

A message that is not in the archive (sent off-list or not yet received): 1401944951-23783-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH v2 1/27 i40e: add basic shared code

Add shared code source files to support basic operations to be called in poll mode driver. The new files are,
- i40e_adminq.c
- i40e_adminq.h
- i40e_adminq_cmd.h
- i40e_alloc.h
- i40e_common.c
- i40e_dcb.c
- i40e_dcb.h
- i40e_diag.c
- i40e_diag.h
- i40e_hmc.c
- i40e_hmc.h
- i40e_lan_hmc.c
- i40e_lan_hmc.h
- i40e_nvm.c
- i40e_prototype.h
- i40e_register.h
- i40e_register_x710_int.h
- i40e_status.h
- i40e_type.h
- i40e_virtchnl.h

---
 lib/librte_pmd_i40e/i40e/i40e_adminq.c            |  1103 ++
 lib/librte_pmd_i40e/i40e/i40e_adminq.h            |   158 +
 lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h        |  2179 ++++
 lib/librte_pmd_i40e/i40e/i40e_alloc.h             |    65 +
 lib/librte_pmd_i40e/i40e/i40e_common.c            |  4846 +++++++++
 lib/librte_pmd_i40e/i40e/i40e_dcb.c               |  1104 ++
 lib/librte_pmd_i40e/i40e/i40e_dcb.h               |   264 +
 lib/librte_pmd_i40e/i40e/i40e_diag.c              |   188 +
 lib/librte_pmd_i40e/i40e/i40e_diag.h              |    61 +
 lib/librte_pmd_i40e/i40e/i40e_hmc.c               |   373 +
 lib/librte_pmd_i40e/i40e/i40e_hmc.h               |   244 +
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c           |  1616 +++
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h           |   214 +
 lib/librte_pmd_i40e/i40e/i40e_nvm.c               |   942 ++
 lib/librte_pmd_i40e/i40e/i40e_prototype.h         |   435 +
 lib/librte_pmd_i40e/i40e/i40e_register.h          |  3377 ++++++
 lib/librte_pmd_i40e/i40e/i40e_register_x710_int.h | 10712 ++++++++++++++++++++
 lib/librte_pmd_i40e/i40e/i40e_status.h            |   107 +
 lib/librte_pmd_i40e/i40e/i40e_type.h              |  1462 +++
 lib/librte_pmd_i40e/i40e/i40e_virtchnl.h          |   373 +
 20 files changed, 29823 insertions(+)
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_alloc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_common.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_dcb.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_dcb.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_diag.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_diag.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_hmc.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_hmc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_nvm.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_prototype.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_register.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_register_x710_int.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_status.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_type.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_virtchnl.h
lib/librte_pmd_i40e/i40e/i40e_adminq.c new file +1103 -0
new file mode 100644
index 0000000..d078cea
@@ -0,0 +1,1103 @@
+/*******************************************************************************
+
+Copyright (c) 2013 - 2014, Intel Corporation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of the Intel Corporation nor the names of its
+    contributors may be used to endorse or promote products derived from
+    this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+***************************************************************************/
+
+#include "i40e_status.h"
+#include "i40e_type.h"
+#include "i40e_register.h"
+#include "i40e_adminq.h"
+#include "i40e_prototype.h"
+
+#ifndef VF_DRIVER
+/**
+ * i40e_is_nvm_update_op - return true if this is an NVM update operation
+ * @desc: API request descriptor
+ **/
+STATIC INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc)
+{
+	return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase) ||
+		desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update));
+}
+
+#endif /* VF_DRIVER */
+/**
+ *  i40e_adminq_init_regs - Initialize AdminQ registers
+ *  @hw: pointer to the hardware structure
+ *
+ *  This assumes the alloc_asq and alloc_arq functions have already been called
+ **/
+STATIC void i40e_adminq_init_regs(struct i40e_hw *hw)
+{
+	/* set head and tail registers in our local struct */
+	if (hw->mac.type == I40E_MAC_VF) {
+		hw->aq.asq.tail = I40E_VF_ATQT1;
+		hw->aq.asq.head = I40E_VF_ATQH1;
+		hw->aq.asq.len  = I40E_VF_ATQLEN1;
+		hw->aq.asq.bal  = I40E_VF_ATQBAL1;
+		hw->aq.asq.bah  = I40E_VF_ATQBAH1;
+		hw->aq.arq.tail = I40E_VF_ARQT1;
+		hw->aq.arq.head = I40E_VF_ARQH1;
+		hw->aq.arq.len  = I40E_VF_ARQLEN1;
+		hw->aq.arq.bal  = I40E_VF_ARQBAL1;
+		hw->aq.arq.bah  = I40E_VF_ARQBAH1;
+	} else {
+		hw->aq.asq.tail = I40E_PF_ATQT;
+		hw->aq.asq.head = I40E_PF_ATQH;
+		hw->aq.asq.len  = I40E_PF_ATQLEN;
+		hw->aq.asq.bal  = I40E_PF_ATQBAL;
+		hw->aq.asq.bah  = I40E_PF_ATQBAH;
+		hw->aq.arq.tail = I40E_PF_ARQT;
+		hw->aq.arq.head = I40E_PF_ARQH;
+		hw->aq.arq.len  = I40E_PF_ARQLEN;
+		hw->aq.arq.bal  = I40E_PF_ARQBAL;
+		hw->aq.arq.bah  = I40E_PF_ARQBAH;
+	}
+}
+
+/**
+ *  i40e_alloc_adminq_asq_ring - Allocate Admin Queue send rings
+ *  @hw: pointer to the hardware structure
+ **/
+enum i40e_status_code i40e_alloc_adminq_asq_ring(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code;
+
+	ret_code = i40e_allocate_dma_mem(hw, &hw->aq.asq.desc_buf,
+					 i40e_mem_atq_ring,
+					 (hw->aq.num_asq_entries *
+					 sizeof(struct i40e_aq_desc)),
+					 I40E_ADMINQ_DESC_ALIGNMENT);
+	if (ret_code)
+		return ret_code;
+
+	ret_code = i40e_allocate_virt_mem(hw, &hw->aq.asq.cmd_buf,
+					  (hw->aq.num_asq_entries *
+					  sizeof(struct i40e_asq_cmd_details)));
+	if (ret_code) {
+		i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf);
+		return ret_code;
+	}
+
+	return ret_code;
+}
+
+/**
+ *  i40e_alloc_adminq_arq_ring - Allocate Admin Queue receive rings
+ *  @hw: pointer to the hardware structure
+ **/
+enum i40e_status_code i40e_alloc_adminq_arq_ring(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code;
+
+	ret_code = i40e_allocate_dma_mem(hw, &hw->aq.arq.desc_buf,
+					 i40e_mem_arq_ring,
+					 (hw->aq.num_arq_entries *
+					 sizeof(struct i40e_aq_desc)),
+					 I40E_ADMINQ_DESC_ALIGNMENT);
+
+	return ret_code;
+}
+
+/**
+ *  i40e_free_adminq_asq - Free Admin Queue send rings
+ *  @hw: pointer to the hardware structure
+ *
+ *  This assumes the posted send buffers have already been cleaned
+ *  and de-allocated
+ **/
+void i40e_free_adminq_asq(struct i40e_hw *hw)
+{
+	i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf);
+}
+
+/**
+ *  i40e_free_adminq_arq - Free Admin Queue receive rings
+ *  @hw: pointer to the hardware structure
+ *
+ *  This assumes the posted receive buffers have already been cleaned
+ *  and de-allocated
+ **/
+void i40e_free_adminq_arq(struct i40e_hw *hw)
+{
+	i40e_free_dma_mem(hw, &hw->aq.arq.desc_buf);
+}
+
+/**
+ *  i40e_alloc_arq_bufs - Allocate pre-posted buffers for the receive queue
+ *  @hw: pointer to the hardware structure
+ **/
+STATIC enum i40e_status_code i40e_alloc_arq_bufs(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code;
+	struct i40e_aq_desc *desc;
+	struct i40e_dma_mem *bi;
+	int i;
+
+	/* We'll be allocating the buffer info memory first, then we can
+	 * allocate the mapped buffers for the event processing
+	 */
+
+	/* buffer_info structures do not need alignment */
+	ret_code = i40e_allocate_virt_mem(hw, &hw->aq.arq.dma_head,
+		(hw->aq.num_arq_entries * sizeof(struct i40e_dma_mem)));
+	if (ret_code)
+		goto alloc_arq_bufs;
+	hw->aq.arq.r.arq_bi = (struct i40e_dma_mem *)hw->aq.arq.dma_head.va;
+
+	/* allocate the mapped buffers */
+	for (i = 0; i < hw->aq.num_arq_entries; i++) {
+		bi = &hw->aq.arq.r.arq_bi[i];
+		ret_code = i40e_allocate_dma_mem(hw, bi,
+						 i40e_mem_arq_buf,
+						 hw->aq.arq_buf_size,
+						 I40E_ADMINQ_DESC_ALIGNMENT);
+		if (ret_code)
+			goto unwind_alloc_arq_bufs;
+
+		/* now configure the descriptors for use */
+		desc = I40E_ADMINQ_DESC(hw->aq.arq, i);
+
+		desc->flags = CPU_TO_LE16(I40E_AQ_FLAG_BUF);
+		if (hw->aq.arq_buf_size > I40E_AQ_LARGE_BUF)
+			desc->flags |= CPU_TO_LE16(I40E_AQ_FLAG_LB);
+		desc->opcode = 0;
+		/* This is in accordance with Admin queue design, there is no
+		 * register for buffer size configuration
+		 */
+		desc->datalen = CPU_TO_LE16((u16)bi->size);
+		desc->retval = 0;
+		desc->cookie_high = 0;
+		desc->cookie_low = 0;
+		desc->params.external.addr_high =
+			CPU_TO_LE32(I40E_HI_DWORD(bi->pa));
+		desc->params.external.addr_low =
+			CPU_TO_LE32(I40E_LO_DWORD(bi->pa));
+		desc->params.external.param0 = 0;
+		desc->params.external.param1 = 0;
+	}
+
+alloc_arq_bufs:
+	return ret_code;
+
+unwind_alloc_arq_bufs:
+	/* don't try to free the one that failed... */
+	i--;
+	for (; i >= 0; i--)
+		i40e_free_dma_mem(hw, &hw->aq.arq.r.arq_bi[i]);
+	i40e_free_virt_mem(hw, &hw->aq.arq.dma_head);
+
+	return ret_code;
+}
+
+/**
+ *  i40e_alloc_asq_bufs - Allocate empty buffer structs for the send queue
+ *  @hw: pointer to the hardware structure
+ **/
+STATIC enum i40e_status_code i40e_alloc_asq_bufs(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code;
+	struct i40e_dma_mem *bi;
+	int i;
+
+	/* No mapped memory needed yet, just the buffer info structures */
+	ret_code = i40e_allocate_virt_mem(hw, &hw->aq.asq.dma_head,
+		(hw->aq.num_asq_entries * sizeof(struct i40e_dma_mem)));
+	if (ret_code)
+		goto alloc_asq_bufs;
+	hw->aq.asq.r.asq_bi = (struct i40e_dma_mem *)hw->aq.asq.dma_head.va;
+
+	/* allocate the mapped buffers */
+	for (i = 0; i < hw->aq.num_asq_entries; i++) {
+		bi = &hw->aq.asq.r.asq_bi[i];
+		ret_code = i40e_allocate_dma_mem(hw, bi,
+						 i40e_mem_asq_buf,
+						 hw->aq.asq_buf_size,
+						 I40E_ADMINQ_DESC_ALIGNMENT);
+		if (ret_code)
+			goto unwind_alloc_asq_bufs;
+	}
+alloc_asq_bufs:
+	return ret_code;
+
+unwind_alloc_asq_bufs:
+	/* don't try to free the one that failed... */
+	i--;
+	for (; i >= 0; i--)
+		i40e_free_dma_mem(hw, &hw->aq.asq.r.asq_bi[i]);
+	i40e_free_virt_mem(hw, &hw->aq.asq.dma_head);
+
+	return ret_code;
+}
+
+/**
+ *  i40e_free_arq_bufs - Free receive queue buffer info elements
+ *  @hw: pointer to the hardware structure
+ **/
+STATIC void i40e_free_arq_bufs(struct i40e_hw *hw)
+{
+	int i;
+
+	/* free descriptors */
+	for (i = 0; i < hw->aq.num_arq_entries; i++)
+		i40e_free_dma_mem(hw, &hw->aq.arq.r.arq_bi[i]);
+
+	/* free the descriptor memory */
+	i40e_free_dma_mem(hw, &hw->aq.arq.desc_buf);
+
+	/* free the dma header */
+	i40e_free_virt_mem(hw, &hw->aq.arq.dma_head);
+}
+
+/**
+ *  i40e_free_asq_bufs - Free send queue buffer info elements
+ *  @hw: pointer to the hardware structure
+ **/
+STATIC void i40e_free_asq_bufs(struct i40e_hw *hw)
+{
+	int i;
+
+	/* only unmap if the address is non-NULL */
+	for (i = 0; i < hw->aq.num_asq_entries; i++)
+		if (hw->aq.asq.r.asq_bi[i].pa)
+			i40e_free_dma_mem(hw, &hw->aq.asq.r.asq_bi[i]);
+
+	/* free the buffer info list */
+	i40e_free_virt_mem(hw, &hw->aq.asq.cmd_buf);
+
+	/* free the descriptor memory */
+	i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf);
+
+	/* free the dma header */
+	i40e_free_virt_mem(hw, &hw->aq.asq.dma_head);
+}
+
+/**
+ *  i40e_config_asq_regs - configure ASQ registers
+ *  @hw: pointer to the hardware structure
+ *
+ *  Configure base address and length registers for the transmit queue
+ **/
+STATIC enum i40e_status_code i40e_config_asq_regs(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+	u32 reg = 0;
+
+	/* Clear Head and Tail */
+	wr32(hw, hw->aq.asq.head, 0);
+	wr32(hw, hw->aq.asq.tail, 0);
+
+	/* set starting point */
+	wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
+				  I40E_PF_ATQLEN_ATQENABLE_MASK));
+	wr32(hw, hw->aq.asq.bal, I40E_LO_DWORD(hw->aq.asq.desc_buf.pa));
+	wr32(hw, hw->aq.asq.bah, I40E_HI_DWORD(hw->aq.asq.desc_buf.pa));
+
+	/* Check one register to verify that config was applied */
+	reg = rd32(hw, hw->aq.asq.bal);
+	if (reg != I40E_LO_DWORD(hw->aq.asq.desc_buf.pa))
+		ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
+
+	return ret_code;
+}
+
+/**
+ *  i40e_config_arq_regs - ARQ register configuration
+ *  @hw: pointer to the hardware structure
+ *
+ * Configure base address and length registers for the receive (event queue)
+ **/
+STATIC enum i40e_status_code i40e_config_arq_regs(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+	u32 reg = 0;
+
+	/* Clear Head and Tail */
+	wr32(hw, hw->aq.arq.head, 0);
+	wr32(hw, hw->aq.arq.tail, 0);
+
+	/* set starting point */
+	wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries |
+				  I40E_PF_ARQLEN_ARQENABLE_MASK));
+	wr32(hw, hw->aq.arq.bal, I40E_LO_DWORD(hw->aq.arq.desc_buf.pa));
+	wr32(hw, hw->aq.arq.bah, I40E_HI_DWORD(hw->aq.arq.desc_buf.pa));
+
+	/* Update tail in the HW to post pre-allocated buffers */
+	wr32(hw, hw->aq.arq.tail, hw->aq.num_arq_entries - 1);
+
+	/* Check one register to verify that config was applied */
+	reg = rd32(hw, hw->aq.arq.bal);
+	if (reg != I40E_LO_DWORD(hw->aq.arq.desc_buf.pa))
+		ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
+
+	return ret_code;
+}
+
+/**
+ *  i40e_init_asq - main initialization routine for ASQ
+ *  @hw: pointer to the hardware structure
+ *
+ *  This is the main initialization routine for the Admin Send Queue
+ *  Prior to calling this function, drivers *MUST* set the following fields
+ *  in the hw->aq structure:
+ *     - hw->aq.num_asq_entries
+ *     - hw->aq.arq_buf_size
+ *
+ *  Do *NOT* hold the lock when calling this as the memory allocation routines
+ *  called are not going to be atomic context safe
+ **/
+enum i40e_status_code i40e_init_asq(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+
+	if (hw->aq.asq.count > 0) {
+		/* queue already initialized */
+		ret_code = I40E_ERR_NOT_READY;
+		goto init_adminq_exit;
+	}
+
+	/* verify input for valid configuration */
+	if ((hw->aq.num_asq_entries == 0) ||
+	    (hw->aq.asq_buf_size == 0)) {
+		ret_code = I40E_ERR_CONFIG;
+		goto init_adminq_exit;
+	}
+
+	hw->aq.asq.next_to_use = 0;
+	hw->aq.asq.next_to_clean = 0;
+	hw->aq.asq.count = hw->aq.num_asq_entries;
+
+	/* allocate the ring memory */
+	ret_code = i40e_alloc_adminq_asq_ring(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_exit;
+
+	/* allocate buffers in the rings */
+	ret_code = i40e_alloc_asq_bufs(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_free_rings;
+
+	/* initialize base registers */
+	ret_code = i40e_config_asq_regs(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_free_rings;
+
+	/* success! */
+	goto init_adminq_exit;
+
+init_adminq_free_rings:
+	i40e_free_adminq_asq(hw);
+
+init_adminq_exit:
+	return ret_code;
+}
+
+/**
+ *  i40e_init_arq - initialize ARQ
+ *  @hw: pointer to the hardware structure
+ *
+ *  The main initialization routine for the Admin Receive (Event) Queue.
+ *  Prior to calling this function, drivers *MUST* set the following fields
+ *  in the hw->aq structure:
+ *     - hw->aq.num_asq_entries
+ *     - hw->aq.arq_buf_size
+ *
+ *  Do *NOT* hold the lock when calling this as the memory allocation routines
+ *  called are not going to be atomic context safe
+ **/
+enum i40e_status_code i40e_init_arq(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+
+	if (hw->aq.arq.count > 0) {
+		/* queue already initialized */
+		ret_code = I40E_ERR_NOT_READY;
+		goto init_adminq_exit;
+	}
+
+	/* verify input for valid configuration */
+	if ((hw->aq.num_arq_entries == 0) ||
+	    (hw->aq.arq_buf_size == 0)) {
+		ret_code = I40E_ERR_CONFIG;
+		goto init_adminq_exit;
+	}
+
+	hw->aq.arq.next_to_use = 0;
+	hw->aq.arq.next_to_clean = 0;
+	hw->aq.arq.count = hw->aq.num_arq_entries;
+
+	/* allocate the ring memory */
+	ret_code = i40e_alloc_adminq_arq_ring(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_exit;
+
+	/* allocate buffers in the rings */
+	ret_code = i40e_alloc_arq_bufs(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_free_rings;
+
+	/* initialize base registers */
+	ret_code = i40e_config_arq_regs(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_free_rings;
+
+	/* success! */
+	goto init_adminq_exit;
+
+init_adminq_free_rings:
+	i40e_free_adminq_arq(hw);
+
+init_adminq_exit:
+	return ret_code;
+}
+
+/**
+ *  i40e_shutdown_asq - shutdown the ASQ
+ *  @hw: pointer to the hardware structure
+ *
+ *  The main shutdown routine for the Admin Send Queue
+ **/
+enum i40e_status_code i40e_shutdown_asq(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+
+	if (hw->aq.asq.count == 0)
+		return I40E_ERR_NOT_READY;
+
+	/* Stop firmware AdminQ processing */
+	wr32(hw, hw->aq.asq.head, 0);
+	wr32(hw, hw->aq.asq.tail, 0);
+	wr32(hw, hw->aq.asq.len, 0);
+	wr32(hw, hw->aq.asq.bal, 0);
+	wr32(hw, hw->aq.asq.bah, 0);
+
+	/* make sure spinlock is available */
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+
+	hw->aq.asq.count = 0; /* to indicate uninitialized queue */
+
+	/* free ring buffers */
+	i40e_free_asq_bufs(hw);
+
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+
+	return ret_code;
+}
+
+/**
+ *  i40e_shutdown_arq - shutdown ARQ
+ *  @hw: pointer to the hardware structure
+ *
+ *  The main shutdown routine for the Admin Receive Queue
+ **/
+enum i40e_status_code i40e_shutdown_arq(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+
+	if (hw->aq.arq.count == 0)
+		return I40E_ERR_NOT_READY;
+
+	/* Stop firmware AdminQ processing */
+	wr32(hw, hw->aq.arq.head, 0);
+	wr32(hw, hw->aq.arq.tail, 0);
+	wr32(hw, hw->aq.arq.len, 0);
+	wr32(hw, hw->aq.arq.bal, 0);
+	wr32(hw, hw->aq.arq.bah, 0);
+
+	/* make sure spinlock is available */
+	i40e_acquire_spinlock(&hw->aq.arq_spinlock);
+
+	hw->aq.arq.count = 0; /* to indicate uninitialized queue */
+
+	/* free ring buffers */
+	i40e_free_arq_bufs(hw);
+
+	i40e_release_spinlock(&hw->aq.arq_spinlock);
+
+	return ret_code;
+}
+
+/**
+ *  i40e_init_adminq - main initialization routine for Admin Queue
+ *  @hw: pointer to the hardware structure
+ *
+ *  Prior to calling this function, drivers *MUST* set the following fields
+ *  in the hw->aq structure:
+ *     - hw->aq.num_asq_entries
+ *     - hw->aq.num_arq_entries
+ *     - hw->aq.arq_buf_size
+ *     - hw->aq.asq_buf_size
+ **/
+enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code;
+#ifndef VF_DRIVER
+	u16 eetrack_lo, eetrack_hi;
+	int retry = 0;
+#endif
+
+	/* verify input for valid configuration */
+	if ((hw->aq.num_arq_entries == 0) ||
+	    (hw->aq.num_asq_entries == 0) ||
+	    (hw->aq.arq_buf_size == 0) ||
+	    (hw->aq.asq_buf_size == 0)) {
+		ret_code = I40E_ERR_CONFIG;
+		goto init_adminq_exit;
+	}
+
+	/* initialize spin locks */
+	i40e_init_spinlock(&hw->aq.asq_spinlock);
+	i40e_init_spinlock(&hw->aq.arq_spinlock);
+
+	/* Set up register offsets */
+	i40e_adminq_init_regs(hw);
+
+	/* setup ASQ command write back timeout */
+	hw->aq.asq_cmd_timeout = I40E_ASQ_CMD_TIMEOUT;
+
+	/* allocate the ASQ */
+	ret_code = i40e_init_asq(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_destroy_spinlocks;
+
+	/* allocate the ARQ */
+	ret_code = i40e_init_arq(hw);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_free_asq;
+
+#ifndef VF_DRIVER
+	/* There are some cases where the firmware may not be quite ready
+	 * for AdminQ operations, so we retry the AdminQ setup a few times
+	 * if we see timeouts in this first AQ call.
+	 */
+	do {
+		ret_code = i40e_aq_get_firmware_version(hw,
+							&hw->aq.fw_maj_ver,
+							&hw->aq.fw_min_ver,
+							&hw->aq.api_maj_ver,
+							&hw->aq.api_min_ver,
+							NULL);
+		if (ret_code != I40E_ERR_ADMIN_QUEUE_TIMEOUT)
+			break;
+		retry++;
+		i40e_msec_delay(100);
+		i40e_resume_aq(hw);
+	} while (retry < 10);
+	if (ret_code != I40E_SUCCESS)
+		goto init_adminq_free_arq;
+
+	/* get the NVM version info */
+	i40e_read_nvm_word(hw, I40E_SR_NVM_IMAGE_VERSION, &hw->nvm.version);
+	i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo);
+	i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi);
+	hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo;
+
+	if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) {
+		ret_code = I40E_ERR_FIRMWARE_API_VERSION;
+		goto init_adminq_free_arq;
+	}
+
+	/* pre-emptive resource lock release */
+	i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);
+	hw->aq.nvm_busy = false;
+
+	ret_code = i40e_aq_set_hmc_resource_profile(hw,
+						    I40E_HMC_PROFILE_DEFAULT,
+						    0,
+						    NULL);
+	ret_code = I40E_SUCCESS;
+
+#endif /* VF_DRIVER */
+	/* success! */
+	goto init_adminq_exit;
+
+#ifndef VF_DRIVER
+init_adminq_free_arq:
+	i40e_shutdown_arq(hw);
+#endif
+init_adminq_free_asq:
+	i40e_shutdown_asq(hw);
+init_adminq_destroy_spinlocks:
+	i40e_destroy_spinlock(&hw->aq.asq_spinlock);
+	i40e_destroy_spinlock(&hw->aq.arq_spinlock);
+
+init_adminq_exit:
+	return ret_code;
+}
+
+/**
+ *  i40e_shutdown_adminq - shutdown routine for the Admin Queue
+ *  @hw: pointer to the hardware structure
+ **/
+enum i40e_status_code i40e_shutdown_adminq(struct i40e_hw *hw)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+
+	if (i40e_check_asq_alive(hw))
+		i40e_aq_queue_shutdown(hw, true);
+
+	i40e_shutdown_asq(hw);
+	i40e_shutdown_arq(hw);
+
+	/* destroy the spinlocks */
+	i40e_destroy_spinlock(&hw->aq.asq_spinlock);
+	i40e_destroy_spinlock(&hw->aq.arq_spinlock);
+
+	return ret_code;
+}
+
+/**
+ *  i40e_clean_asq - cleans Admin send queue
+ *  @hw: pointer to the hardware structure
+ *
+ *  returns the number of free desc
+ **/
+u16 i40e_clean_asq(struct i40e_hw *hw)
+{
+	struct i40e_adminq_ring *asq = &(hw->aq.asq);
+	struct i40e_asq_cmd_details *details;
+	u16 ntc = asq->next_to_clean;
+	struct i40e_aq_desc desc_cb;
+	struct i40e_aq_desc *desc;
+
+	desc = I40E_ADMINQ_DESC(*asq, ntc);
+	details = I40E_ADMINQ_DETAILS(*asq, ntc);
+#ifdef DMA_SYNC_SUPPORT
+	I40E_DMA_SYNC(&hw->aq.asq.desc_buf, I40E_SYNC_FORKERNEL);
+#endif /* DMA_SYNC_SUPPORT */
+	while (rd32(hw, hw->aq.asq.head) != ntc) {
+		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+			   "%s: ntc %d head %d.\n", __FUNCTION__, ntc,
+			   rd32(hw, hw->aq.asq.head));
+
+		if (details->callback) {
+			I40E_ADMINQ_CALLBACK cb_func =
+					(I40E_ADMINQ_CALLBACK)details->callback;
+			i40e_memcpy(&desc_cb, desc,
+			            sizeof(struct i40e_aq_desc), I40E_DMA_TO_DMA);
+			cb_func(hw, &desc_cb);
+		}
+		i40e_memset(desc, 0, sizeof(*desc), I40E_DMA_MEM);
+		i40e_memset(details, 0, sizeof(*details), I40E_NONDMA_MEM);
+		ntc++;
+		if (ntc == asq->count)
+			ntc = 0;
+		desc = I40E_ADMINQ_DESC(*asq, ntc);
+		details = I40E_ADMINQ_DETAILS(*asq, ntc);
+	}
+
+	asq->next_to_clean = ntc;
+
+	return I40E_DESC_UNUSED(asq);
+}
+
+/**
+ *  i40e_asq_done - check if FW has processed the Admin Send Queue
+ *  @hw: pointer to the hw struct
+ *
+ *  Returns true if the firmware has processed all descriptors on the
+ *  admin send queue. Returns false if there are still requests pending.
+ **/
+bool i40e_asq_done(struct i40e_hw *hw)
+{
+	/* AQ designers suggest use of head for better
+	 * timing reliability than DD bit
+	 */
+	return rd32(hw, hw->aq.asq.head) == hw->aq.asq.next_to_use;
+
+}
+
+/**
+ *  i40e_asq_send_command - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *
+ *  This is the main send command driver routine for the Admin Queue send
+ *  queue.  It runs the queue, cleans the queue, etc
+ **/
+enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
+				struct i40e_aq_desc *desc,
+				void *buff, /* can be NULL */
+				u16  buff_size,
+				struct i40e_asq_cmd_details *cmd_details)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+	struct i40e_dma_mem *dma_buff = NULL;
+	struct i40e_asq_cmd_details *details;
+	struct i40e_aq_desc *desc_on_ring;
+	bool cmd_completed = false;
+	u16  retval = 0;
+	u32  val = 0;
+
+	val = rd32(hw, hw->aq.asq.head);
+	if (val >= hw->aq.num_asq_entries) {
+		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+			   "AQTX: head overrun at %d\n", val);
+		status = I40E_ERR_QUEUE_EMPTY;
+		goto asq_send_command_exit;
+	}
+
+	if (hw->aq.asq.count == 0) {
+		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+			   "AQTX: Admin queue not initialized.\n");
+		status = I40E_ERR_QUEUE_EMPTY;
+		goto asq_send_command_exit;
+	}
+
+#ifndef VF_DRIVER
+	if (i40e_is_nvm_update_op(desc) && hw->aq.nvm_busy) {
+		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: NVM busy.\n");
+		status = I40E_ERR_NVM;
+		goto asq_send_command_exit;
+	}
+
+#endif
+	details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use);
+	if (cmd_details) {
+		i40e_memcpy(details,
+			    cmd_details,
+			    sizeof(struct i40e_asq_cmd_details),
+			    I40E_NONDMA_TO_NONDMA);
+
+		/* If the cmd_details are defined copy the cookie.  The
+		 * CPU_TO_LE32 is not needed here because the data is ignored
+		 * by the FW, only used by the driver
+		 */
+		if (details->cookie) {
+			desc->cookie_high =
+				CPU_TO_LE32(I40E_HI_DWORD(details->cookie));
+			desc->cookie_low =
+				CPU_TO_LE32(I40E_LO_DWORD(details->cookie));
+		}
+	} else {
+		i40e_memset(details, 0,
+			    sizeof(struct i40e_asq_cmd_details),
+			    I40E_NONDMA_MEM);
+	}
+
+	/* clear requested flags and then set additional flags if defined */
+	desc->flags &= ~CPU_TO_LE16(details->flags_dis);
+	desc->flags |= CPU_TO_LE16(details->flags_ena);
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+
+	if (buff_size > hw->aq.asq_buf_size) {
+		i40e_debug(hw,
+			   I40E_DEBUG_AQ_MESSAGE,
+			   "AQTX: Invalid buffer size: %d.\n",
+			   buff_size);
+		status = I40E_ERR_INVALID_SIZE;
+		goto asq_send_command_error;
+	}
+
+	if (details->postpone && !details->async) {
+		i40e_debug(hw,
+			   I40E_DEBUG_AQ_MESSAGE,
+			   "AQTX: Async flag not set along with postpone flag");
+		status = I40E_ERR_PARAM;
+		goto asq_send_command_error;
+	}
+
+	/* call clean and check queue available function to reclaim the
+	 * descriptors that were processed by FW, the function returns the
+	 * number of desc available
+	 */
+	/* the clean function called here could be called in a separate thread
+	 * in case of asynchronous completions
+	 */
+	if (i40e_clean_asq(hw) == 0) {
+		i40e_debug(hw,
+			   I40E_DEBUG_AQ_MESSAGE,
+			   "AQTX: Error queue is full.\n");
+		status = I40E_ERR_ADMIN_QUEUE_FULL;
+		goto asq_send_command_error;
+	}
+
+	/* initialize the temp desc pointer with the right desc */
+	desc_on_ring = I40E_ADMINQ_DESC(hw->aq.asq, hw->aq.asq.next_to_use);
+
+	/* if the desc is available copy the temp desc to the right place */
+	i40e_memcpy(desc_on_ring, desc, sizeof(struct i40e_aq_desc),
+		    I40E_NONDMA_TO_DMA);
+
+	/* if buff is not NULL assume indirect command */
+	if (buff != NULL) {
+		dma_buff = &(hw->aq.asq.r.asq_bi[hw->aq.asq.next_to_use]);
+		/* copy the user buff into the respective DMA buff */
+		i40e_memcpy(dma_buff->va, buff, buff_size,
+			    I40E_NONDMA_TO_DMA);
+		desc_on_ring->datalen = CPU_TO_LE16(buff_size);
+
+		/* Update the address values in the desc with the pa value
+		 * for respective buffer
+		 */
+		desc_on_ring->params.external.addr_high =
+				CPU_TO_LE32(I40E_HI_DWORD(dma_buff->pa));
+		desc_on_ring->params.external.addr_low =
+				CPU_TO_LE32(I40E_LO_DWORD(dma_buff->pa));
+#ifdef DMA_SYNC_SUPPORT
+		I40E_DMA_SYNC(dma_buff, I40E_SYNC_FORDEVICE);
+#endif /* DMA_SYNC_SUPPORT */
+	}
+
+#ifdef DMA_SYNC_SUPPORT
+	I40E_DMA_SYNC(&hw->aq.asq.desc_buf, I40E_SYNC_FORDEVICE);
+#endif /* DMA_SYNC_SUPPORT */
+	/* bump the tail */
+	i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n");
+	i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff);
+	(hw->aq.asq.next_to_use)++;
+	if (hw->aq.asq.next_to_use == hw->aq.asq.count)
+		hw->aq.asq.next_to_use = 0;
+	if (!details->postpone)
+		wr32(hw, hw->aq.asq.tail, hw->aq.asq.next_to_use);
+
+	/* if cmd_details are not defined or async flag is not set,
+	 * we need to wait for desc write back
+	 */
+	if (!details->async && !details->postpone) {
+		u32 total_delay = 0;
+		u32 delay_len = 1;
+
+		do {
+			/* AQ designers suggest use of head for better
+			 * timing reliability than DD bit
+			 */
+			if (i40e_asq_done(hw))
+				break;
+			/* ugh! delay while spin_lock */
+			i40e_msec_delay(delay_len);
+			total_delay += delay_len;
+		} while (total_delay < hw->aq.asq_cmd_timeout);
+	}
+
+	/* if ready, copy the desc back to temp */
+	if (i40e_asq_done(hw)) {
+#ifdef DMA_SYNC_SUPPORT
+		I40E_DMA_SYNC(&hw->aq.asq.desc_buf, I40E_SYNC_FORKERNEL);
+#endif /* DMA_SYNC_SUPPORT */
+		i40e_memcpy(desc, desc_on_ring, sizeof(struct i40e_aq_desc),
+			    I40E_DMA_TO_NONDMA);
+		if (buff != NULL)
+			i40e_memcpy(buff, dma_buff->va, buff_size,
+				    I40E_DMA_TO_NONDMA);
+		retval = LE16_TO_CPU(desc->retval);
+		if (retval != 0) {
+			i40e_debug(hw,
+				   I40E_DEBUG_AQ_MESSAGE,
+				   "AQTX: Command completed with error 0x%X.\n",
+				   retval);
+
+			/* strip off FW internal code */
+			retval &= 0xff;
+		}
+		cmd_completed = true;
+		if ((enum i40e_admin_queue_err)retval == I40E_AQ_RC_OK)
+			status = I40E_SUCCESS;
+		else
+			status = I40E_ERR_ADMIN_QUEUE_ERROR;
+		hw->aq.asq_last_status = (enum i40e_admin_queue_err)retval;
+	}
+
+	if (LE16_TO_CPU(desc->datalen) == buff_size) {
+		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+			   "AQTX: desc and buffer writeback:\n");
+		i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff);
+	}
+
+	/* update the error if time out occurred */
+	if ((!cmd_completed) &&
+	    (!details->async && !details->postpone)) {
+		i40e_debug(hw,
+			   I40E_DEBUG_AQ_MESSAGE,
+			   "AQTX: Writeback timeout.\n");
+		status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
+	}
+
+#ifndef VF_DRIVER
+	if (!status && i40e_is_nvm_update_op(desc))
+		hw->aq.nvm_busy = true;
+
+#endif /* VF_DRIVER */
+asq_send_command_error:
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+asq_send_command_exit:
+	return status;
+}
+
+/**
+ *  i40e_fill_default_direct_cmd_desc - AQ descriptor helper function
+ *  @desc:     pointer to the temp descriptor (non DMA mem)
+ *  @opcode:   the opcode can be used to decide which flags to turn off or on
+ *
+ *  Fill the desc with default values
+ **/
+void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
+				       u16 opcode)
+{
+	/* zero out the desc */
+	i40e_memset((void *)desc, 0, sizeof(struct i40e_aq_desc),
+		    I40E_NONDMA_MEM);
+	desc->opcode = CPU_TO_LE16(opcode);
+	desc->flags = CPU_TO_LE16(I40E_AQ_FLAG_SI);
+}
+
+/**
+ *  i40e_clean_arq_element
+ *  @hw: pointer to the hw struct
+ *  @e: event info from the receive descriptor, includes any buffers
+ *  @pending: number of events that could be left to process
+ *
+ *  This function cleans one Admin Receive Queue element and returns
+ *  the contents through e.  It can also return how many events are
+ *  left to process through 'pending'
+ **/
+enum i40e_status_code i40e_clean_arq_element(struct i40e_hw *hw,
+					     struct i40e_arq_event_info *e,
+					     u16 *pending)
+{
+	enum i40e_status_code ret_code = I40E_SUCCESS;
+	u16 ntc = hw->aq.arq.next_to_clean;
+	struct i40e_aq_desc *desc;
+	struct i40e_dma_mem *bi;
+	u16 desc_idx;
+	u16 datalen;
+	u16 flags;
+	u16 ntu;
+#ifdef DMA_SYNC_SUPPORT
+	I40E_DMA_SYNC(&hw->aq.arq.desc_buf, I40E_SYNC_FORKERNEL);
+#endif /* DMA_SYNC_SUPPORT */
+
+	/* take the lock before we start messing with the ring */
+	i40e_acquire_spinlock(&hw->aq.arq_spinlock);
+
+	/* set next_to_use to head */
+	ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
+	if (ntu == ntc) {
+		/* nothing to do - shouldn't need to update ring's values */
+		i40e_debug(hw,
+			   I40E_DEBUG_AQ_MESSAGE,
+			   "AQRX: Queue is empty.\n");
+		ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK;
+		goto clean_arq_element_out;
+	}
+
+	/* now clean the next descriptor */
+	desc = I40E_ADMINQ_DESC(hw->aq.arq, ntc);
+	desc_idx = ntc;
+#ifdef DMA_SYNC_SUPPORT
+	I40E_DMA_SYNC(&hw->aq.arq.r.arq_bi[desc_idx], I40E_SYNC_FORKERNEL);
+#endif /* DMA_SYNC_SUPPORT */
+
+	flags = LE16_TO_CPU(desc->flags);
+	if (flags & I40E_AQ_FLAG_ERR) {
+		ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
+		hw->aq.arq_last_status =
+			(enum i40e_admin_queue_err)LE16_TO_CPU(desc->retval);
+		i40e_debug(hw,
+			   I40E_DEBUG_AQ_MESSAGE,
+			   "AQRX: Event received with error 0x%X.\n",
+			   hw->aq.arq_last_status);
+	} else {
+		i40e_memcpy(&e->desc, desc, sizeof(struct i40e_aq_desc),
+			    I40E_DMA_TO_NONDMA);
+		datalen = LE16_TO_CPU(desc->datalen);
+		e->msg_size = min(datalen, e->msg_size);
+		if (e->msg_buf != NULL && (e->msg_size != 0))
+			i40e_memcpy(e->msg_buf,
+				    hw->aq.arq.r.arq_bi[desc_idx].va,
+				    e->msg_size, I40E_DMA_TO_NONDMA);
+	}
+
+	i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n");
+	i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf);
+
+	/* Restore the original datalen and buffer address in the desc,
+	 * FW updates datalen to indicate the event message
+	 * size
+	 */
+	bi = &hw->aq.arq.r.arq_bi[ntc];
+	i40e_memset((void *)desc, 0, sizeof(struct i40e_aq_desc), I40E_DMA_MEM);
+
+	desc->flags = CPU_TO_LE16(I40E_AQ_FLAG_BUF);
+	if (hw->aq.arq_buf_size > I40E_AQ_LARGE_BUF)
+		desc->flags |= CPU_TO_LE16(I40E_AQ_FLAG_LB);
+	desc->datalen = CPU_TO_LE16((u16)bi->size);
+	desc->params.external.addr_high = CPU_TO_LE32(I40E_HI_DWORD(bi->pa));
+	desc->params.external.addr_low = CPU_TO_LE32(I40E_LO_DWORD(bi->pa));
+
+	/* set tail = the last cleaned desc index. */
+	wr32(hw, hw->aq.arq.tail, ntc);
+	/* ntc is updated to tail + 1 */
+	ntc++;
+	if (ntc == hw->aq.num_arq_entries)
+		ntc = 0;
+	hw->aq.arq.next_to_clean = ntc;
+	hw->aq.arq.next_to_use = ntu;
+
+clean_arq_element_out:
+	/* Set pending if needed, unlock and return */
+	if (pending != NULL)
+		*pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
+	i40e_release_spinlock(&hw->aq.arq_spinlock);
+
+#ifndef VF_DRIVER
+	if (i40e_is_nvm_update_op(&e->desc)) {
+		hw->aq.nvm_busy = false;
+		if (hw->aq.nvm_release_on_done) {
+			i40e_release_nvm(hw);
+			hw->aq.nvm_release_on_done = false;
+		}
+	}
+
+#endif
+	return ret_code;
+}
+
+void i40e_resume_aq(struct i40e_hw *hw)
+{
+	/* Registers are reset after PF reset */
+	hw->aq.asq.next_to_use = 0;
+	hw->aq.asq.next_to_clean = 0;
+
+#if (I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK)
+#error I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK
+#endif
+	i40e_config_asq_regs(hw);
+
+	hw->aq.arq.next_to_use = 0;
+	hw->aq.arq.next_to_clean = 0;
+
+	i40e_config_arq_regs(hw);
+}
lib/librte_pmd_i40e/i40e/i40e_adminq.h new file +158 -0

158 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h new file +2179 -0

1,739 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_alloc.h new file +65 -0

65 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_common.c new file +4846 -0

4,846 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_dcb.c new file +1104 -0

1,104 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_dcb.h new file +264 -0

264 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_diag.c new file +188 -0

188 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_diag.h new file +61 -0

61 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_hmc.c new file +373 -0

373 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_hmc.h new file +244 -0

244 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c new file +1616 -0

1,616 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h new file +214 -0

214 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_nvm.c new file +942 -0

942 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_prototype.h new file +435 -0

435 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_register.h new file +3377 -0

3,377 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_register_x710_int.h new file +10712 -0

10,712 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_status.h new file +107 -0

107 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_type.h new file +1462 -0

1,462 lines not on this page · raw message

lib/librte_pmd_i40e/i40e/i40e_virtchnl.h new file +373 -0

373 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.1.4

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH v2 2/27 i40e: add PMD source files

In reply to a message not in the archive

Add PMD source files to support Intel(R) 40G Ethernet Controllers. The new files are,
i40e_osdep.h
i40e_ethdev.c
i40e_ethdev.h
i40e_ethdev_vf.c
i40e_logs.h
i40e_pf.c
i40e_pf.h
i40e_rxtx.c
i40e_rxtx.h
Makefile

---
 lib/librte_pmd_i40e/Makefile          |   85 +
 lib/librte_pmd_i40e/i40e/i40e_osdep.h |  197 ++
 lib/librte_pmd_i40e/i40e_ethdev.c     | 4019 +++++++++++++++++++++++++++++++++
 lib/librte_pmd_i40e/i40e_ethdev.h     |  356 +++
 lib/librte_pmd_i40e/i40e_ethdev_vf.c  | 1336 +++++++++++
 lib/librte_pmd_i40e/i40e_logs.h       |   74 +
 lib/librte_pmd_i40e/i40e_pf.c         |  928 ++++++++
 lib/librte_pmd_i40e/i40e_pf.h         |   67 +
 lib/librte_pmd_i40e/i40e_rxtx.c       | 2204 ++++++++++++++++++
 lib/librte_pmd_i40e/i40e_rxtx.h       |  189 ++
 10 files changed, 9455 insertions(+)
 create mode 100644 lib/librte_pmd_i40e/Makefile
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_osdep.h
 create mode 100644 lib/librte_pmd_i40e/i40e_ethdev.c
 create mode 100644 lib/librte_pmd_i40e/i40e_ethdev.h
 create mode 100644 lib/librte_pmd_i40e/i40e_ethdev_vf.c
 create mode 100644 lib/librte_pmd_i40e/i40e_logs.h
 create mode 100644 lib/librte_pmd_i40e/i40e_pf.c
 create mode 100644 lib/librte_pmd_i40e/i40e_pf.h
 create mode 100644 lib/librte_pmd_i40e/i40e_rxtx.c
 create mode 100644 lib/librte_pmd_i40e/i40e_rxtx.h
lib/librte_pmd_i40e/Makefile new file +85 -0
new file mode 100644
index 0000000..09f2087
@@ -0,0 +1,85 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_pmd_i40e.a
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+ifeq ($(CC), icc)
+CFLAGS_SHARED_DRIVERS = -wd593
+else
+CFLAGS_SHARED_DRIVERS =  -Wno-unused-but-set-variable
+CFLAGS_SHARED_DRIVERS += -Wno-sign-compare
+CFLAGS_SHARED_DRIVERS += -Wno-unused-value
+CFLAGS_SHARED_DRIVERS += -Wno-unused-parameter
+CFLAGS_SHARED_DRIVERS += -Wno-strict-aliasing
+CFLAGS_SHARED_DRIVERS += -Wno-format
+CFLAGS_SHARED_DRIVERS += -Wno-missing-field-initializers
+CFLAGS_SHARED_DRIVERS += -Wno-pointer-to-int-cast
+CFLAGS_SHARED_DRIVERS += -Wno-format-nonliteral
+CFLAGS_SHARED_DRIVERS += -Wno-format-security
+endif
+
+#
+# Add extra flags for ND source files to disable warnings
+#
+SHARED_DRIVERS_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(RTE_SDK)/lib/librte_pmd_i40e/i40e/*.c)))
+$(foreach obj, $(SHARED_DRIVERS_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_SHARED_DRIVERS)))
+
+VPATH += $(RTE_SDK)/lib/librte_pmd_i40e/i40e
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_adminq.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_common.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_diag.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_hmc.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_lan_hmc.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_nvm.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_dcb.c
+
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_rxtx.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_ethdev_vf.c
+SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_pf.c
+# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_eal lib/librte_ether
+DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_mempool lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_net lib/librte_malloc
+
+include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_pmd_i40e/i40e/i40e_osdep.h new file +197 -0

197 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_ethdev.c new file +4019 -0

2,718 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_ethdev.h new file +356 -0

356 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_ethdev_vf.c new file +1336 -0

1,336 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_logs.h new file +74 -0

74 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_pf.c new file +928 -0

928 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_pf.h new file +67 -0

67 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_rxtx.c new file +2204 -0

2,204 lines not on this page · raw message

lib/librte_pmd_i40e/i40e_rxtx.h new file +189 -0

189 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.1.4

Part of the diff is not shown here. View the raw message.

#4 lore raw

PATCH v2 3/27 pci: add macros and pci device IDs to support i40e

In reply to a message not in the archive

The pci device IDs of i40e have been added. The new macros have been added in rte_pci_dev_ids.h to support i40e.

---
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 44 +++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
lib/librte_eal/common/include/rte_pci_dev_ids.h +44 -0
index a51c1ef..f89b0e8 100644
@@ -73,6 +73,8 @@
  * RTE_PCI_DEV_ID_DECL_IGBVF
  * RTE_PCI_DEV_ID_DECL_IXGBE
  * RTE_PCI_DEV_ID_DECL_IXGBEVF
+ * RTE_PCI_DEV_ID_DECL_I40E
+ * RTE_PCI_DEV_ID_DECL_I40EVF
  * RTE_PCI_DEV_ID_DECL_VIRTIO
  * at the time when this file is included.
  *
@@ -114,6 +116,14 @@
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev)
 #endif
 
+#ifndef RTE_PCI_DEV_ID_DECL_I40E
+#define RTE_PCI_DEV_ID_DECL_I40E(vend, dev)
+#endif
+
+#ifndef RTE_PCI_DEV_ID_DECL_I40EVF
+#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev)
+#endif
+
 #ifndef RTE_PCI_DEV_ID_DECL_VIRTIO
 #define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev)
 #endif
@@ -444,6 +454,30 @@ RTE_PCI_DEV_ID_DECL_IXGBE(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X540T1)
 RTE_PCI_DEV_ID_DECL_IXGBE(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_82599_BYPASS)
 #endif
 
+/*************** Physical I40E devices from i40e_type.h *****************/
+
+#define I40E_DEV_ID_SFP_XL710           0x1572
+#define I40E_DEV_ID_SFP_X710            0x1573
+#define I40E_DEV_ID_QEMU                0x1574
+#define I40E_DEV_ID_KX_A                0x157F
+#define I40E_DEV_ID_KX_B                0x1580
+#define I40E_DEV_ID_KX_C                0x1581
+#define I40E_DEV_ID_KX_D                0x1582
+#define I40E_DEV_ID_QSFP_A              0x1583
+#define I40E_DEV_ID_QSFP_B              0x1584
+#define I40E_DEV_ID_QSFP_C              0x1585
+
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_SFP_XL710)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_SFP_X710)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_QEMU)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_KX_A)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_KX_B)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_KX_C)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_KX_D)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_QSFP_A)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_QSFP_B)
+RTE_PCI_DEV_ID_DECL_I40E(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_QSFP_C)
+
 /****************** Virtual IGB devices from e1000_hw.h ******************/
 
 #define E1000_DEV_ID_82576_VF                   0x10CA
@@ -468,6 +502,14 @@ RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_82599_VF_HV)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X540_VF)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X540_VF_HV)
 
+/****************** Virtual I40E devices from i40e_type.h ********************/
+
+#define I40E_DEV_ID_VF                  0x154C
+#define I40E_DEV_ID_VF_HV               0x1571
+
+RTE_PCI_DEV_ID_DECL_I40EVF(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_VF)
+RTE_PCI_DEV_ID_DECL_I40EVF(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_VF_HV)
+
 /****************** Virtio devices from virtio.h ******************/
 
 #define QUMRANET_DEV_ID_VIRTIO                   	0x1000
@@ -488,5 +530,7 @@ RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
 #undef RTE_PCI_DEV_ID_DECL_IGBVF
 #undef RTE_PCI_DEV_ID_DECL_IXGBE
 #undef RTE_PCI_DEV_ID_DECL_IXGBEVF
+#undef RTE_PCI_DEV_ID_DECL_I40E
+#undef RTE_PCI_DEV_ID_DECL_I40EVF
 #undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
Signature · 1 line
1.8.1.4
#5 lore raw

PATCH v2 4/27 igb_uio: add i40e support

In reply to a message not in the archive

The definitions have been added to support i40e devices.

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 ++
 1 file changed, 2 insertions(+)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +2 -0
index 09c40bf..79fe97d 100644
@@ -79,6 +79,8 @@ static struct pci_device_id igbuio_pci_ids[] = {
 #define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {PCI_DEVICE(vend, dev)},
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {PCI_DEVICE(vend, dev)},
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {PCI_DEVICE(vend, dev)},
+#define RTE_PCI_DEV_ID_DECL_I40E(vend, dev) {PCI_DEVICE(vend, dev)},
+#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {PCI_DEVICE(vend, dev)},
 #ifdef RTE_LIBRTE_VIRTIO_PMD
 #define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {PCI_DEVICE(vend, dev)},
 #endif
Signature · 1 line
1.8.1.4
#6 lore raw

PATCH v2 5/27 mbuf: add new packet flags for i40e

In reply to a message not in the archive

New packet flags of both RX and TX have been added to support i40e.

---
 lib/librte_mbuf/rte_mbuf.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_mbuf/rte_mbuf.h +8 -0
index 4a9ab41..ded2ce6 100644
@@ -85,6 +85,11 @@ struct rte_ctrlmbuf {
 #define PKT_RX_FDIR          0x0004 /**< RX packet with FDIR infos. */
 #define PKT_RX_L4_CKSUM_BAD  0x0008 /**< L4 cksum of RX pkt. is not OK. */
 #define PKT_RX_IP_CKSUM_BAD  0x0010 /**< IP cksum of RX pkt. is not OK. */
+#define PKT_RX_EIP_CKSUM_BAD 0x0000 /**< External IP header checksum error. */
+#define PKT_RX_OVERSIZE      0x0000 /**< Num of desc of an RX pkt oversize. */
+#define PKT_RX_HBUF_OVERFLOW 0x0000 /**< Header buffer overflow. */
+#define PKT_RX_RECIP_ERR     0x0000 /**< Hardware processing error. */
+#define PKT_RX_MAC_ERR       0x0000 /**< MAC error. */
 #define PKT_RX_IPV4_HDR      0x0020 /**< RX packet with IPv4 header. */
 #define PKT_RX_IPV4_HDR_EXT  0x0040 /**< RX packet with extended IPv4 header. */
 #define PKT_RX_IPV6_HDR      0x0080 /**< RX packet with IPv6 header. */
@@ -94,6 +99,9 @@ struct rte_ctrlmbuf {
 
 #define PKT_TX_VLAN_PKT      0x0800 /**< TX packet is a 802.1q VLAN packet. */
 #define PKT_TX_IP_CKSUM      0x1000 /**< IP cksum of TX pkt. computed by NIC. */
+#define PKT_TX_IPV4_CSUM     0x1000 /**< Alias of PKT_TX_IP_CKSUM. */
+#define PKT_TX_IPV4          PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
+#define PKT_TX_IPV6          PKT_RX_IPV6_HDR /**< IPv6 packet */
 /*
  * Bit 14~13 used for L4 packet type with checksum enabled.
  *     00: Reserved
Signature · 1 line
1.8.1.4

A message that is not in the archive (sent off-list or not yet received): 1401944951-23783-6-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#8 lore raw

Re: [PATCH v2 05/27] mbuf: add new packet flags for i40e

lib/librte_mbuf/rte_mbuf.h struct rte_ctrlmbuf { · line 92

Quoted 5 lines · On Thu, 5 Jun 2014 13:08:49 +0800 Helin Zhang…
lib/librte_mbuf/rte_mbuf.h +5 -0
+#define PKT_RX_EIP_CKSUM_BAD 0x0000 /**< External IP header checksum error. */
+#define PKT_RX_OVERSIZE      0x0000 /**< Num of desc of an RX pkt oversize. */
+#define PKT_RX_HBUF_OVERFLOW 0x0000 /**< Header buffer overflow. */
+#define PKT_RX_RECIP_ERR     0x0000 /**< Hardware processing error. */
+#define PKT_RX_MAC_ERR       0x0000 /**< MAC error. */

Flags are useless if all zero!

A message that is not in the archive (sent off-list or not yet received): F35DEAC7BCE34641BA9FAC6BCA4A12E70A735ACB@SHSMSX104.ccr.corp.intel.com

A message that is not in the archive (sent off-list or not yet received): F35DEAC7BCE34641BA9FAC6BCA4A12E70A735ACB-0J0gbvR4kTg/[email protected]

#11 lore raw

Re: [PATCH v2 05/27] mbuf: add new packet flags for i40e

Adding cc list.

-----Original Message-----
From: Zhang, Helin
Sent: Friday, June 6, 2014 8:30 AM
To: Stephen Hemminger
Subject: RE: [dpdk-dev] [PATCH v2 05/27] mbuf: add new packet flags for i40e

Hi Hemminger

Thanks for pointing out that!
As ol_flags is currently 16 bits, we do not have additional bits for new flags. I just add the flags there, and wait the new mbuf structure to be defined, which will be happen soon. After that, the new values will be added.

Regards,
Helin

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, June 5, 2014 11:30 PM
To: Zhang, Helin
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 05/27] mbuf: add new packet flags for i40e

lib/librte_mbuf/rte_mbuf.h struct rte_ctrlmbuf { · line 92

Quoted 5 lines · On Thu, 5 Jun 2014 13:08:49 +0800 Helin Zhang…
lib/librte_mbuf/rte_mbuf.h +5 -0
+#define PKT_RX_EIP_CKSUM_BAD 0x0000 /**< External IP header checksum error. */
+#define PKT_RX_OVERSIZE      0x0000 /**< Num of desc of an RX pkt oversize. */
+#define PKT_RX_HBUF_OVERFLOW 0x0000 /**< Header buffer overflow. */
+#define PKT_RX_RECIP_ERR     0x0000 /**< Hardware processing error. */
+#define PKT_RX_MAC_ERR       0x0000 /**< MAC error. */

Flags are useless if all zero!

#12 lore raw

PATCH v2 6/27 ethdev: add i40e support

In reply to a message not in the archive

To support i40e,
- New link speeds have been defined.
- New ops has been added to support setting port based vlan insertion.
- i40e RSS flags have been added.
- A generic function of is_same_ether_addr() has been added to compare two ethernet address.
- A new configuration of 'uint8_t rss_key_len' has been added in 'struct rte_eth_rss_conf' to support different length of RSS keys.

---
 lib/librte_ether/rte_ethdev.c |  15 ++++
 lib/librte_ether/rte_ethdev.h | 154 +++++++++++++++++++++++++++++++++++++-----
 lib/librte_ether/rte_ether.h  |  24 +++++++
 3 files changed, 175 insertions(+), 18 deletions(-)
lib/librte_ether/rte_ethdev.c +15 -0
index 11e877b..53cb7a9 100644
@@ -1298,6 +1298,21 @@ rte_eth_dev_get_vlan_offload(uint8_t port_id)
 	return ret;
 }
 
+int
+rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on)
+{
+	struct rte_eth_dev *dev;
+
+	if (port_id >= nb_ports) {
+		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
+		return (-ENODEV);
+	}
+	dev = &rte_eth_devices[port_id];
+	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_pvid_set, -ENOTSUP);
+	(*dev->dev_ops->vlan_pvid_set)(dev, pvid, on);
+
+	return 0;
+}
 
 int
 rte_eth_dev_fdir_add_signature_filter(uint8_t port_id,
lib/librte_ether/rte_ethdev.h +136 -18

204 lines not on this page · raw message

lib/librte_ether/rte_ether.h +24 -0
index 71dc788..1799980 100644
@@ -86,6 +86,30 @@ struct ether_addr {
 #define ETHER_GROUP_ADDR       0x01 /**< Multicast or broadcast Eth. address. */
 
 /**
+ * Check if two Ethernet addresses are the same.
+ *
+ * @param ea1
+ *  A pointer to the first ether_addr structure containing
+ *  the ethernet address.
+ * @param ea2
+ *  A pointer to the second ether_addr structure containing
+ *  the ethernet address.
+ *
+ * @return
+ *  True  (1) if the given two ethernet address are the same;
+ *  False (0) otherwise.
+ */
+static inline int is_same_ether_addr(const struct ether_addr *ea1,
+				     const struct ether_addr *ea2)
+{
+	int i;
+	for (i = 0; i < ETHER_ADDR_LEN; i++)
+		if (ea1->addr_bytes[i] != ea2->addr_bytes[i])
+			return 0;
+	return 1;
+}
+
+/**
  * Check if an Ethernet address is filled with zeros.
  *
  * @param ea
Signature · 1 line
1.8.1.4
#13 lore raw

PATCH v2 7/27 ethdev: support setting maximum packet length to less than 1518

In reply to a message not in the archive

In ethdev, it ignores setting maximum packet length to less than 1518. The changes is to remove this limitation and let less than 1518 can be set for 'maximum packet length'.

---
 lib/librte_ether/rte_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
lib/librte_ether/rte_ethdev.c +7 -3
index 53cb7a9..1791ed7 100644
@@ -657,9 +657,13 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 				(unsigned)ETHER_MIN_LEN);
 			return (-EINVAL);
 		}
-	} else
-		/* Use default value */
-		dev->data->dev_conf.rxmode.max_rx_pkt_len = ETHER_MAX_LEN;
+	} else {
+		if (dev_conf->rxmode.max_rx_pkt_len < ETHER_MIN_LEN ||
+			dev_conf->rxmode.max_rx_pkt_len > ETHER_MAX_LEN)
+			/* Use default value */
+			dev->data->dev_conf.rxmode.max_rx_pkt_len =
+							ETHER_MAX_LEN;
+	}
 
 	/* multipe queue mode checking */
 	diag = rte_eth_dev_check_mq_mode(port_id, nb_rx_q, nb_tx_q, dev_conf);
Signature · 1 line
1.8.1.4
#14 lore raw

PATCH v2 8/27 vmxnet3: enlarge the hash flags of RSS to 64 bits

In reply to a message not in the archive

As the hash flags of RSS has been enlarged from 16 bits to 64 bits in 'struct rte_eth_rss_conf' in rte_ethdev.h, the size of it in vmxnet3 has to be enlarged as well. In addition, the flags for vmxnet3 only are masked, as there are flags for others in that 64 bits.

---
 lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c +12 -4
index 1072654..ad7cbb2 100644
@@ -882,9 +882,16 @@ static uint8_t rss_intel_key[40] = {
 int
 vmxnet3_rss_configure(struct rte_eth_dev *dev)
 {
+#define VMXNET3_RSS_OFFLOAD_ALL ( \
+		ETH_RSS_IPV4 | \
+		ETH_RSS_IPV4_TCP | \
+		ETH_RSS_IPV6 | \
+		ETH_RSS_IPV6_TCP)
+
 	struct vmxnet3_hw *hw;
 	struct VMXNET3_RSSConf *dev_rss_conf;
 	struct rte_eth_rss_conf *port_rss_conf;
+	uint64_t rss_hf;
 	uint8_t i, j;
 
 	PMD_INIT_FUNC_TRACE();
@@ -916,13 +923,14 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev)
 
 	/* loading hashType */
 	dev_rss_conf->hashType = 0;
-	if (port_rss_conf->rss_hf & ETH_RSS_IPV4)
+	rss_hf = port_rss_conf->rss_hf & VMXNET3_RSS_OFFLOAD_ALL;
+	if (rss_hf & ETH_RSS_IPV4)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV4;
-	if (port_rss_conf->rss_hf & ETH_RSS_IPV4_TCP)
+	if (rss_hf & ETH_RSS_IPV4_TCP)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV4;
-	if (port_rss_conf->rss_hf & ETH_RSS_IPV6)
+	if (rss_hf & ETH_RSS_IPV6)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6;
-	if (port_rss_conf->rss_hf & ETH_RSS_IPV6_TCP)
+	if (rss_hf & ETH_RSS_IPV6_TCP)
 		dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6;
 
 	return VMXNET3_SUCCESS;
Signature · 1 line
1.8.1.4
#15 lore raw

PATCH v2 9/27 ixgbe: enlarge the hash flags of RSS to 64 bits

In reply to a message not in the archive

As the hash flags of RSS has been enlarged from 16 bits to 64 bits in 'struct rte_eth_rss_conf' in rte_ethdev.h, the size of it in ixgbe has to be enlarged as well. In addition, the flags for ixgbe only are masked, as there are flags for others in those 64 bits.

---
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
lib/librte_pmd_ixgbe/ixgbe_rxtx.c +15 -7
index dc79c4b..bdae98e 100644
@@ -77,10 +77,18 @@
 #include "ixgbe_ethdev.h"
 #include "ixgbe/ixgbe_dcb.h"
 #include "ixgbe/ixgbe_common.h"
-
-
 #include "ixgbe_rxtx.h"
 
+#define IXGBE_RSS_OFFLOAD_ALL ( \
+		ETH_RSS_IPV4 | \
+		ETH_RSS_IPV4_TCP | \
+		ETH_RSS_IPV6 | \
+		ETH_RSS_IPV6_EX | \
+		ETH_RSS_IPV6_TCP | \
+		ETH_RSS_IPV6_TCP_EX | \
+		ETH_RSS_IPV4_UDP | \
+		ETH_RSS_IPV6_UDP | \
+		ETH_RSS_IPV6_UDP_EX)
 
 static inline struct rte_mbuf *
 rte_rxmbuf_alloc(struct rte_mempool *mp)
@@ -2299,7 +2307,7 @@ ixgbe_hw_rss_hash_set(struct ixgbe_hw *hw, struct rte_eth_rss_conf *rss_conf)
 	uint8_t  *hash_key;
 	uint32_t mrqc;
 	uint32_t rss_key;
-	uint16_t rss_hf;
+	uint64_t rss_hf;
 	uint16_t i;
 
 	hash_key = rss_conf->rss_key;
@@ -2344,7 +2352,7 @@ ixgbe_dev_rss_hash_update(struct rte_eth_dev *dev,
 {
 	struct ixgbe_hw *hw;
 	uint32_t mrqc;
-	uint16_t rss_hf;
+	uint64_t rss_hf;
 
 	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
@@ -2357,7 +2365,7 @@ ixgbe_dev_rss_hash_update(struct rte_eth_dev *dev,
 	 * initialization time, or does not attempt to enable RSS, if RSS was
 	 * disabled at initialization time.
 	 */
-	rss_hf = rss_conf->rss_hf;
+	rss_hf = rss_conf->rss_hf & IXGBE_RSS_OFFLOAD_ALL;
 	mrqc = IXGBE_READ_REG(hw, IXGBE_MRQC);
 	if (!(mrqc & IXGBE_MRQC_RSSEN)) { /* RSS disabled */
 		if (rss_hf != 0) /* Enable RSS */
@@ -2379,7 +2387,7 @@ ixgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	uint8_t *hash_key;
 	uint32_t mrqc;
 	uint32_t rss_key;
-	uint16_t rss_hf;
+	uint64_t rss_hf;
 	uint16_t i;
 
 	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -2456,7 +2464,7 @@ ixgbe_rss_configure(struct rte_eth_dev *dev)
 	 * the RSS hash of input packets.
 	 */
 	rss_conf = dev->data->dev_conf.rx_adv_conf.rss_conf;
-	if (rss_conf.rss_hf == 0) {
+	if ((rss_conf.rss_hf & IXGBE_RSS_OFFLOAD_ALL) == 0) {
 		ixgbe_rss_disable(dev);
 		return;
 	}
Signature · 1 line
1.8.1.4
#16 lore raw

PATCH v2 10/27 igb: enlarge the hash flags of RSS to 64 bits

In reply to a message not in the archive

As the hash flags of RSS has been enlarged from 16 bits to 64 bits in 'struct rte_eth_rss_conf' in rte_ethdev.h, the size of it in igb has to be enlarged as well. In addition, the flags for igb only are masked, as there are flags for others in those 64 bits.

---
 lib/librte_pmd_e1000/igb_rxtx.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
lib/librte_pmd_e1000/igb_rxtx.c +16 -5
index ae53428..cbb9588 100644
@@ -73,6 +73,17 @@
 #include "e1000/e1000_api.h"
 #include "e1000_ethdev.h"
 
+#define IGB_RSS_OFFLOAD_ALL ( \
+		ETH_RSS_IPV4 | \
+		ETH_RSS_IPV4_TCP | \
+		ETH_RSS_IPV6 | \
+		ETH_RSS_IPV6_EX | \
+		ETH_RSS_IPV6_TCP | \
+		ETH_RSS_IPV6_TCP_EX | \
+		ETH_RSS_IPV4_UDP | \
+		ETH_RSS_IPV6_UDP | \
+		ETH_RSS_IPV6_UDP_EX)
+
 static inline struct rte_mbuf *
 rte_rxmbuf_alloc(struct rte_mempool *mp)
 {
@@ -1524,7 +1535,7 @@ igb_hw_rss_hash_set(struct e1000_hw *hw, struct rte_eth_rss_conf *rss_conf)
 	uint8_t  *hash_key;
 	uint32_t rss_key;
 	uint32_t mrqc;
-	uint16_t rss_hf;
+	uint64_t rss_hf;
 	uint16_t i;
 
 	hash_key = rss_conf->rss_key;
@@ -1569,7 +1580,7 @@ eth_igb_rss_hash_update(struct rte_eth_dev *dev,
 {
 	struct e1000_hw *hw;
 	uint32_t mrqc;
-	uint16_t rss_hf;
+	uint64_t rss_hf;
 
 	hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
@@ -1579,7 +1590,7 @@ eth_igb_rss_hash_update(struct rte_eth_dev *dev,
 	 * initialization time, or does not attempt to enable RSS, if RSS was
 	 * disabled at initialization time.
 	 */
-	rss_hf = rss_conf->rss_hf;
+	rss_hf = rss_conf->rss_hf & IGB_RSS_OFFLOAD_ALL;
 	mrqc = E1000_READ_REG(hw, E1000_MRQC);
 	if (!(mrqc & E1000_MRQC_ENABLE_MASK)) { /* RSS disabled */
 		if (rss_hf != 0) /* Enable RSS */
@@ -1600,7 +1611,7 @@ int eth_igb_rss_hash_conf_get(struct rte_eth_dev *dev,
 	uint8_t *hash_key;
 	uint32_t rss_key;
 	uint32_t mrqc;
-	uint16_t rss_hf;
+	uint64_t rss_hf;
 	uint16_t i;
 
 	hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1676,7 +1687,7 @@ igb_rss_configure(struct rte_eth_dev *dev)
 	 * the RSS hash of input packets.
 	 */
 	rss_conf = dev->data->dev_conf.rx_adv_conf.rss_conf;
-	if (rss_conf.rss_hf == 0) {
+	if ((rss_conf.rss_hf & IGB_RSS_OFFLOAD_ALL) == 0) {
 		igb_rss_disable(dev);
 		return;
 	}
Signature · 1 line
1.8.1.4
#17 lore raw

PATCH v2 11/27 mk: add i40e support

In reply to a message not in the archive

i40e support has been added in lib/Makefile and mk/rte.app.mk.

---
 lib/Makefile  | 1 +
 mk/rte.app.mk | 4 ++++
 2 files changed, 5 insertions(+)
lib/Makefile +1 -0
index b92b392..e5b6635 100644
@@ -42,6 +42,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
 DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether
 DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += librte_pmd_e1000
 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_ixgbe
+DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += librte_pmd_pcap
 DIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += librte_pmd_virtio
mk/rte.app.mk +4 -0
index a836577..ceb7fd8 100644
@@ -161,6 +161,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y)
 LDLIBS += -lrte_pmd_virtio_uio
 endif
 
+ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y)
+LDLIBS += -lrte_pmd_i40e
+endif
+
 ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
 LDLIBS += -lrte_pmd_ixgbe
 endif
Signature · 1 line
1.8.1.4
#18 lore raw

PATCH v2 12/27 config: add configurations for i40e

In reply to a message not in the archive

configurations for i40e have been added in both common_bsdapp and common_linuxapp.

---
 config/common_bsdapp   | 20 ++++++++++++++++++++
 config/common_linuxapp | 20 ++++++++++++++++++++
 2 files changed, 40 insertions(+)
config/common_bsdapp +20 -0
index 2cc7b80..5e17d46 100644
@@ -165,6 +165,26 @@ CONFIG_RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_IXGBE_ALLOW_UNSUPPORTED_SFP=n
 
 #
+# Compile burst-oriented I40E PMD driver
+#
+# CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL can be 0 to 8160 us,
+# otherwise a default value will be used instead.
+# The interval will be aligned to 2, due to the hardware restriction.
+#
+CONFIG_RTE_LIBRTE_I40E_PMD=y
+CONFIG_RTE_LIBRTE_I40E_DEBUG_INIT=y
+CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=y
+CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=y
+CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=y
+CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER=y
+CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC=y
+CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=n
+CONFIG_RTE_LIBRTE_I40E_ALLOW_UNSUPPORTED_SFP=y
+CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
+CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4
+CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1
+
+#
 # Compile burst-oriented VIRTIO PMD driver
 #
 CONFIG_RTE_LIBRTE_VIRTIO_PMD=n
config/common_linuxapp +20 -0
index 62619c6..da20011 100644
@@ -179,6 +179,26 @@ CONFIG_RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_IXGBE_ALLOW_UNSUPPORTED_SFP=n
 
 #
+# Compile burst-oriented I40E PMD driver
+#
+# CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL can be 0 to 8160 us,
+# otherwise a default value will be used instead.
+# The interval will be aligned to 2, due to the hardware restriction.
+#
+CONFIG_RTE_LIBRTE_I40E_PMD=y
+CONFIG_RTE_LIBRTE_I40E_DEBUG_INIT=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER=n
+CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC=n
+CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
+CONFIG_RTE_LIBRTE_I40E_ALLOW_UNSUPPORTED_SFP=n
+CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
+CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4
+CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1
+
+#
 # Compile burst-oriented VIRTIO PMD driver
 #
 CONFIG_RTE_LIBRTE_VIRTIO_PMD=y
Signature · 1 line
1.8.1.4
#19 lore raw

PATCH v2 13/27 app/test-pmd: support displaying 32 bytes RX descriptors

In reply to a message not in the archive

i40e supports both 16 and 32 bytes RX descriptors, while ixgbe and igb support 16 bytes size only. Code changes have been made in test-pmd to support both 16 and 32 bytes RX descriptors according to the configuration in config files.

---
 app/test-pmd/config.c | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)
app/test-pmd/config.c +33 -3
index d6291e7..3dc7fba 100644
@@ -558,13 +558,43 @@ union igb_ring_dword {
 	} words;
 };
 
+#ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC
+struct igb_ring_desc_32B {
+	union igb_ring_dword lo_dword;
+	union igb_ring_dword hi_dword;
+	union igb_ring_dword resv1;
+	union igb_ring_dword resv2;
+};
+#endif
+
 struct igb_ring_desc {
 	union igb_ring_dword lo_dword;
 	union igb_ring_dword hi_dword;
 };
 
 static void
-ring_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id)
+ring_rx_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id)
+{
+#ifdef RTE_LIBRTE_I40E_16BYTE_RX_DESC
+	struct igb_ring_desc *ring;
+	struct igb_ring_desc rd;
+
+	ring = (struct igb_ring_desc *) ring_mz->addr;
+#else
+	struct igb_ring_desc_32B *ring;
+	struct igb_ring_desc_32B rd;
+
+	ring = (struct igb_ring_desc_32B *) ring_mz->addr;
+#endif
+	rd.lo_dword = rte_le_to_cpu_64(ring[desc_id].lo_dword);
+	rd.hi_dword = rte_le_to_cpu_64(ring[desc_id].hi_dword);
+	printf("    0x%08X - 0x%08X / 0x%08X - 0x%08X\n",
+		(unsigned)rd.lo_dword.words.lo, (unsigned)rd.lo_dword.words.hi,
+		(unsigned)rd.hi_dword.words.lo, (unsigned)rd.hi_dword.words.hi);
+}
+
+static void
+ring_tx_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id)
 {
 	struct igb_ring_desc *ring;
 	struct igb_ring_desc rd;
@@ -591,7 +621,7 @@ rx_ring_desc_display(portid_t port_id, queueid_t rxq_id, uint16_t rxd_id)
 	rx_mz = ring_dma_zone_lookup("rx_ring", port_id, rxq_id);
 	if (rx_mz == NULL)
 		return;
-	ring_descriptor_display(rx_mz, rxd_id);
+	ring_rx_descriptor_display(rx_mz, rxd_id);
 }
 
 void
@@ -608,7 +638,7 @@ tx_ring_desc_display(portid_t port_id, queueid_t txq_id, uint16_t txd_id)
 	tx_mz = ring_dma_zone_lookup("tx_ring", port_id, txq_id);
 	if (tx_mz == NULL)
 		return;
-	ring_descriptor_display(tx_mz, txd_id);
+	ring_tx_descriptor_display(tx_mz, txd_id);
 }
 
 void
Signature · 1 line
1.8.1.4
#20 lore raw

PATCH v2 14/27 app/test-pmd: add command of 'tx_vlan set pvid port_id vlan_id (on|off)'

In reply to a message not in the archive

New command of 'tx_vlan set pvid port_id vlan_id (on|off)' has been added in test-pmd to configure port based vlan insertion.

---
 app/test-pmd/cmdline.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
 app/test-pmd/config.c  |  9 ++++++++
 app/test-pmd/testpmd.h |  2 +-
 3 files changed, 71 insertions(+), 1 deletion(-)
app/test-pmd/cmdline.c +61 -0
index 0be28f6..ddb825d 100644
@@ -285,6 +285,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"    Set hardware insertion of VLAN ID in packets sent"
 			" on a port.\n\n"
 
+			"tx_vlan set pvid port_id vlan_id (on|off)\n"
+			"    Set port based TX VLAN insertion.\n\n"
+
 			"tx_vlan reset (port_id)\n"
 			"    Disable hardware insertion of a VLAN header in"
 			" packets sent on a port.\n\n"
@@ -2352,6 +2355,63 @@ cmdline_parse_inst_t cmd_tx_vlan_set = {
 	},
 };
 
+/* *** ENABLE/DISABLE PORT BASED TX VLAN INSERTION *** */
+struct cmd_tx_vlan_set_pvid_result {
+	cmdline_fixed_string_t tx_vlan;
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t pvid;
+	uint8_t port_id;
+	uint16_t vlan_id;
+	cmdline_fixed_string_t mode;
+};
+
+static void
+cmd_tx_vlan_set_pvid_parsed(void *parsed_result,
+			    __attribute__((unused)) struct cmdline *cl,
+			    __attribute__((unused)) void *data)
+{
+	struct cmd_tx_vlan_set_pvid_result *res = parsed_result;
+
+	if (strcmp(res->mode, "on") == 0)
+		tx_vlan_pvid_set(res->port_id, res->vlan_id, 1);
+	else
+		tx_vlan_pvid_set(res->port_id, res->vlan_id, 0);
+}
+
+cmdline_parse_token_string_t cmd_tx_vlan_set_pvid_tx_vlan =
+	TOKEN_STRING_INITIALIZER(struct cmd_tx_vlan_set_pvid_result,
+				 tx_vlan, "tx_vlan");
+cmdline_parse_token_string_t cmd_tx_vlan_set_pvid_set =
+	TOKEN_STRING_INITIALIZER(struct cmd_tx_vlan_set_pvid_result,
+				 set, "set");
+cmdline_parse_token_string_t cmd_tx_vlan_set_pvid_pvid =
+	TOKEN_STRING_INITIALIZER(struct cmd_tx_vlan_set_pvid_result,
+				 pvid, "pvid");
+cmdline_parse_token_num_t cmd_tx_vlan_set_pvid_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_tx_vlan_set_pvid_result,
+			     port_id, UINT8);
+cmdline_parse_token_num_t cmd_tx_vlan_set_pvid_vlan_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_tx_vlan_set_pvid_result,
+			      vlan_id, UINT16);
+cmdline_parse_token_string_t cmd_tx_vlan_set_pvid_mode =
+	TOKEN_STRING_INITIALIZER(struct cmd_tx_vlan_set_pvid_result,
+				 mode, "on#off");
+
+cmdline_parse_inst_t cmd_tx_vlan_set_pvid = {
+	.f = cmd_tx_vlan_set_pvid_parsed,
+	.data = NULL,
+	.help_str = "tx_vlan set pvid port_id vlan_id (on|off)",
+	.tokens = {
+		(void *)&cmd_tx_vlan_set_pvid_tx_vlan,
+		(void *)&cmd_tx_vlan_set_pvid_set,
+		(void *)&cmd_tx_vlan_set_pvid_pvid,
+		(void *)&cmd_tx_vlan_set_pvid_port_id,
+		(void *)&cmd_tx_vlan_set_pvid_vlan_id,
+		(void *)&cmd_tx_vlan_set_pvid_mode,
+		NULL,
+	},
+};
+
 /* *** DISABLE HARDWARE INSERTION OF VLAN HEADER IN TX PACKETS *** */
 struct cmd_tx_vlan_reset_result {
 	cmdline_fixed_string_t tx_vlan;
@@ -5339,6 +5399,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_rx_vlan_filter,
 	(cmdline_parse_inst_t *)&cmd_tx_vlan_set,
 	(cmdline_parse_inst_t *)&cmd_tx_vlan_reset,
+	(cmdline_parse_inst_t *)&cmd_tx_vlan_set_pvid,
 	(cmdline_parse_inst_t *)&cmd_tx_cksum_set,
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set,
 	(cmdline_parse_inst_t *)&cmd_priority_flow_control_set,
app/test-pmd/config.c +9 -0
index 3dc7fba..a5814ca 100644
@@ -1603,6 +1603,15 @@ tx_vlan_reset(portid_t port_id)
 }
 
 void
+tx_vlan_pvid_set(portid_t port_id, uint16_t vlan_id, int on)
+{
+	if (port_id_is_invalid(port_id))
+		return;
+
+	rte_eth_dev_set_vlan_pvid(port_id, vlan_id, on);
+}
+
+void
 set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value)
 {
 	uint16_t i;
app/test-pmd/testpmd.h +1 -1
index 0cf5a92..c2b970e 100644
@@ -486,7 +486,7 @@ void vlan_extend_set(portid_t port_id, int on);
 void vlan_tpid_set(portid_t port_id, uint16_t tp_id);
 void tx_vlan_set(portid_t port_id, uint16_t vlan_id);
 void tx_vlan_reset(portid_t port_id);
-
+void tx_vlan_pvid_set(portid_t port_id, uint16_t vlan_id, int on);
 
 void set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value);
 
Signature · 1 line
1.8.1.4
#21 lore raw

PATCH v2 15/27 app/testpmd: enlarge the hash flags of RSS to 64 bits

In reply to a message not in the archive

As the hash flags of RSS has been enlarged from 16 bits to 64 bits in 'struct rte_eth_rss_conf' in rte_ethdev.h, the size of it in testpmd should be enlarged as well. In addition, macro of ETH_RSS_IP is used to replace all IP hash flags of RSS.

---
 app/test-pmd/cmdline.c    | 4 ++--
 app/test-pmd/parameters.c | 5 ++---
 app/test-pmd/testpmd.c    | 2 +-
 app/test-pmd/testpmd.h    | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)
app/test-pmd/cmdline.c +2 -2
index ddb825d..fb52e89 100644
@@ -1135,9 +1135,9 @@ cmd_config_rss_parsed(void *parsed_result,
 	uint8_t i;
 
 	if (!strcmp(res->value, "ip"))
-		rss_conf.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6;
+		rss_conf.rss_hf = ETH_RSS_IP;
 	else if (!strcmp(res->value, "udp"))
-		rss_conf.rss_hf = ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_UDP;
+		rss_conf.rss_hf = ETH_RSS_UDP;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
 	else {
app/test-pmd/parameters.c +2 -3
index 7a60048..725ca6f 100644
@@ -832,10 +832,9 @@ launch_args_parse(int argc, char** argv)
 			if (!strcmp(lgopts[opt_idx].name, "forward-mode"))
 				set_pkt_forwarding_mode(optarg);
 			if (!strcmp(lgopts[opt_idx].name, "rss-ip"))
-				rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6;
+				rss_hf = ETH_RSS_IP;
 			if (!strcmp(lgopts[opt_idx].name, "rss-udp"))
-				rss_hf = ETH_RSS_IPV4 |
-						ETH_RSS_IPV6 | ETH_RSS_IPV4_UDP;
+				rss_hf = ETH_RSS_UDP;
 			if (!strcmp(lgopts[opt_idx].name, "rxq")) {
 				n = atoi(optarg);
 				if (n >= 1 && n <= (int) MAX_QUEUE_ID)
app/test-pmd/testpmd.c +1 -1
index bc38305..eea2c6c 100644
@@ -250,7 +250,7 @@ uint32_t txq_flags = 0; /* No flags set. */
 /*
  * Receive Side Scaling (RSS) configuration.
  */
-uint16_t rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6; /* RSS IP by default. */
+uint64_t rss_hf = ETH_RSS_IP; /* RSS IP by default. */
 
 /*
  * Port topology configuration
app/test-pmd/testpmd.h +1 -1
index c2b970e..f91f9cd 100644
@@ -326,7 +326,7 @@ extern portid_t fwd_ports_ids[RTE_MAX_ETHPORTS];
 extern struct rte_port *ports;
 
 extern struct rte_eth_rxmode rx_mode;
-extern uint16_t rss_hf;
+extern uint64_t rss_hf;
 
 extern queueid_t nb_rxq;
 extern queueid_t nb_txq;
Signature · 1 line
1.8.1.4
#22 lore raw

PATCH v2 16/27 app/test-pmd: add L3 packet type in offload flags

In reply to a message not in the archive

As i40e PMD need to know the L3 packet type for TX checksum offloading, the packet type has been added in rte_mbuf offload flags.

---
 app/test-pmd/csumonly.c | 2 ++
 1 file changed, 2 insertions(+)
app/test-pmd/csumonly.c +2 -0
index 3568ba0..0e6441a 100644
@@ -313,6 +313,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 				ol_flags |= PKT_TX_IP_CKSUM;
 			}
 			else {
+				ol_flags |= PKT_TX_IPV4;
 				/* SW checksum calculation */
 				ipv4_hdr->src_addr++;
 				ipv4_hdr->hdr_checksum = get_ipv4_cksum(ipv4_hdr);
@@ -373,6 +374,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 					unsigned char *) + l2_len);
 			l3_len = sizeof(struct ipv6_hdr) ;
 			l4_proto = ipv6_hdr->proto;
+			ol_flags |= PKT_TX_IPV6;
 
 			if (l4_proto == IPPROTO_UDP) {
 				udp_hdr = (struct udp_hdr*) (rte_pktmbuf_mtod(mb,
Signature · 1 line
1.8.1.4
#23 lore raw

PATCH v2 17/27 examples/dpdk_qat: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in dpdk_qat example application to support all PMDs.

---
 examples/dpdk_qat/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/dpdk_qat/main.c +1 -1
index 741d3f3..76a1ac5 100644
@@ -170,7 +170,7 @@ static struct rte_eth_conf port_conf = {
 	.rx_adv_conf = {
 		.rss_conf = {
 			.rss_key = NULL,
-			.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+			.rss_hf = ETH_RSS_IP,
 		},
 	},
 	.txmode = {
Signature · 1 line
1.8.1.4
#24 lore raw

PATCH v2 18/27 examples/ip_reassembly: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in ip_reassembly example application to support all PMDs.

---
 examples/ip_reassembly/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/ip_reassembly/main.c +1 -1
index bafa8d9..bb2f810 100644
@@ -235,7 +235,7 @@ static struct rte_eth_conf port_conf = {
 	.rx_adv_conf = {
 		.rss_conf = {
 			.rss_key = NULL,
-			.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+			.rss_hf = ETH_RSS_IP,
 		},
 	},
 	.txmode = {
Signature · 1 line
1.8.1.4
#25 lore raw

PATCH v2 19/27 examples/l3fwd-power: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in l3fwd-power example application to support all PMDs.

---
 examples/l3fwd-power/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/l3fwd-power/main.c +1 -1
index 598b7a2..ab5d2a1 100644
@@ -247,7 +247,7 @@ static struct rte_eth_conf port_conf = {
 	.rx_adv_conf = {
 		.rss_conf = {
 			.rss_key = NULL,
-			.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+			.rss_hf = ETH_RSS_IP,
 		},
 	},
 	.txmode = {
Signature · 1 line
1.8.1.4
#26 lore raw

PATCH v2 20/27 examples/l3fwd-vf: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in l3fwd-vf example application to support all PMDs.

---
 examples/l3fwd-vf/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/l3fwd-vf/main.c +1 -1
index 793cacc..d37eb35 100644
@@ -207,7 +207,7 @@ static struct rte_eth_conf port_conf = {
 	.rx_adv_conf = {
 		.rss_conf = {
 			.rss_key = NULL,
-			.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+			.rss_hf = ETH_RSS_IP,
 		},
 	},
 	.txmode = {
Signature · 1 line
1.8.1.4
#27 lore raw

PATCH v2 21/27 examples/l3fwd: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in l3fwd example application to support all PMDs.

---
 examples/l3fwd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/l3fwd/main.c +1 -1
index 8ee1af9..6588d3c 100755
@@ -227,7 +227,7 @@ static struct rte_eth_conf port_conf = {
 	.rx_adv_conf = {
 		.rss_conf = {
 			.rss_key = NULL,
-			.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+			.rss_hf = ETH_RSS_IP,
 		},
 	},
 	.txmode = {
Signature · 1 line
1.8.1.4
#28 lore raw

PATCH v2 22/27 examples/load_balancer: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in load_balancer example application to support all PMDs.

---
 examples/load_balancer/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/load_balancer/init.c +1 -1
index e997238..160a938 100644
@@ -87,7 +87,7 @@ static struct rte_eth_conf port_conf = {
 	.rx_adv_conf = {
 		.rss_conf = {
 			.rss_key = NULL,
-			.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+			.rss_hf = ETH_RSS_IP,
 		},
 	},
 	.txmode = {
Signature · 1 line
1.8.1.4
#29 lore raw

PATCH v2 23/27 examples/multi_process: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in multi_process example application to support all PMDs.

---
 examples/multi_process/symmetric_mp/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/multi_process/symmetric_mp/main.c +1 -1
index 028f98d..7e0a357 100644
@@ -251,7 +251,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues)
 			.rx_adv_conf = {
 				.rss_conf = {
 					.rss_key = NULL,
-					.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+					.rss_hf = ETH_RSS_IP,
 				},
 			},
 			.txmode = {
Signature · 1 line
1.8.1.4
#30 lore raw

PATCH v2 24/27 examples/qos_meter: use ETH_RSS_IP to replace IP hash flags of RSS

In reply to a message not in the archive

As hash flags of RSS have been enlarged from 16 bits to 64 bits to support more possible types in all PMDs, and new macro of ETH_RSS_IP has been defined to cover all IP hash flags of RSS. That macro should be used in qos_meter example application to support all PMDs.

---
 examples/qos_meter/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/qos_meter/main.c +1 -1
index e1698cc..55a9e98 100755
@@ -94,7 +94,7 @@ static struct rte_eth_conf port_conf = {
 	.rx_adv_conf = {
 		.rss_conf = {
 			.rss_key = NULL,
-			.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
+			.rss_hf = ETH_RSS_IP,
 		},
 	},
 	.txmode = {
Signature · 1 line
1.8.1.4
#31 lore raw

PATCH v2 25/27 igb_uio: add sys files to read/write specific bits in pci config space

In reply to a message not in the archive

Enabling 'Extended Tag' and resetting 'Max Read Request Size' in PCI config space have big impacts to i40e performance. They cannot be changed on some BIOS implementations, though can on others. Two sys files of 'extended_tag' and 'max_read_request_size' are added to support changing them by 'echo' in user space.

---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 105 ++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +105 -0
index 79fe97d..55e801d 100644
@@ -47,6 +47,15 @@
 #define PCI_MSIX_ENTRY_CTRL_MASKBIT     1
 #endif
 
+#ifdef RTE_PCI_CONFIG
+#define PCI_SYS_FILE_BUF_SIZE      10
+#define PCI_DEV_CAP_REG            0xA4
+#define PCI_DEV_CTRL_REG           0xA8
+#define PCI_DEV_CAP_EXT_TAG_MASK   0x20
+#define PCI_DEV_CTRL_EXT_TAG_SHIFT 8
+#define PCI_DEV_CTRL_EXT_TAG_MASK  (1 << PCI_DEV_CTRL_EXT_TAG_SHIFT)
+#endif
+
 #define IGBUIO_NUM_MSI_VECTORS 1
 
 /* interrupt mode */
@@ -151,9 +160,105 @@ store_max_vfs(struct device *dev, struct device_attribute *attr,
 	return err ? err : count;							
 }
 
+#ifdef RTE_PCI_CONFIG
+static ssize_t
+show_extended_tag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev);
+	uint32_t val = 0;
+
+	pci_read_config_dword(pci_dev, PCI_DEV_CAP_REG, &val);
+	if (!(val & PCI_DEV_CAP_EXT_TAG_MASK)) /* Not supported */
+		return snprintf(buf, PCI_SYS_FILE_BUF_SIZE, "%s\n", "invalid");
+
+	val = 0;
+	pci_bus_read_config_dword(pci_dev->bus, pci_dev->devfn,
+					PCI_DEV_CTRL_REG, &val);
+
+	return snprintf(buf, PCI_SYS_FILE_BUF_SIZE, "%s\n",
+		(val & PCI_DEV_CTRL_EXT_TAG_MASK) ? "on" : "off");
+}
+
+static ssize_t
+store_extended_tag(struct device *dev,
+		   struct device_attribute *attr,
+		   const char *buf,
+		   size_t count)
+{
+	struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev);
+	uint32_t val = 0, enable;
+
+	if (strncmp(buf, "on", 2) == 0)
+		enable = 1;
+	else if (strncmp(buf, "off", 3) == 0)
+		enable = 0;
+	else
+		return -EINVAL;
+
+	pci_bus_read_config_dword(pci_dev->bus, pci_dev->devfn,
+					PCI_DEV_CAP_REG, &val);
+	if (!(val & PCI_DEV_CAP_EXT_TAG_MASK)) /* Not supported */
+		return -EPERM;
+
+	val = 0;
+	pci_bus_read_config_dword(pci_dev->bus, pci_dev->devfn,
+					PCI_DEV_CTRL_REG, &val);
+	if (enable)
+		val |= PCI_DEV_CTRL_EXT_TAG_MASK;
+	else
+		val &= ~PCI_DEV_CTRL_EXT_TAG_MASK;
+	pci_bus_write_config_dword(pci_dev->bus, pci_dev->devfn,
+					PCI_DEV_CTRL_REG, val);
+
+	return count;
+}
+
+static ssize_t
+show_max_read_request_size(struct device *dev,
+			   struct device_attribute *attr,
+			   char *buf)
+{
+	struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev);
+	int val = pcie_get_readrq(pci_dev);
+
+	return snprintf(buf, PCI_SYS_FILE_BUF_SIZE, "%d\n", val);
+}
+
+static ssize_t
+store_max_read_request_size(struct device *dev,
+			    struct device_attribute *attr,
+			    const char *buf,
+			    size_t count)
+{
+	struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev);
+	unsigned long size = 0;
+	int ret;
+
+	if (strict_strtoul(buf, 0, &size) != 0)
+		return -EINVAL;
+
+	ret = pcie_set_readrq(pci_dev, (int)size);
+	if (ret < 0)
+		return ret;
+
+	return count;
+}
+#endif
+
 static DEVICE_ATTR(max_vfs, S_IRUGO | S_IWUSR, show_max_vfs, store_max_vfs);
+#ifdef RTE_PCI_CONFIG
+static DEVICE_ATTR(extended_tag, S_IRUGO | S_IWUSR, show_extended_tag, \
+						store_extended_tag);
+static DEVICE_ATTR(max_read_request_size, S_IRUGO | S_IWUSR, \
+	show_max_read_request_size, store_max_read_request_size);
+#endif
+
 static struct attribute *dev_attrs[] = {
 	&dev_attr_max_vfs.attr,
+#ifdef RTE_PCI_CONFIG
+	&dev_attr_extended_tag.attr,
+	&dev_attr_max_read_request_size.attr,
+#endif
         NULL,
 };
 
Signature · 1 line
1.8.1.4
#32 lore raw

PATCH v2 26/27 pci: support reading/writing sys files of 'extended_tag' and 'max_read_request_size'

In reply to a message not in the archive

Sys files of 'extended_tag' and 'max_read_request_size' are supported by igb_uio. Reading or writing them to enable/disable 'Extended Tag' or reset 'Max Read Request Size' automatically according to the configurations are added.

---
 lib/librte_eal/linuxapp/eal/eal_pci.c | 99 +++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)
lib/librte_eal/linuxapp/eal/eal_pci.c +99 -0
index ac2c1fe..17f5675 100644
@@ -106,6 +106,9 @@ TAILQ_HEAD(uio_res_list, uio_resource);
 
 static struct uio_res_list *uio_res_list = NULL;
 static int pci_parse_sysfs_value(const char *filename, uint64_t *val);
+#ifdef RTE_PCI_CONFIG
+static void pci_config_space_set(struct rte_pci_device *dev);
+#endif
 
 /* unbind kernel driver for this device */
 static int
@@ -840,6 +843,13 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
 		}
 
 		if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO) {
+#ifdef RTE_PCI_CONFIG
+			/*
+			 * Set PCIe config space for high performance.
+			 * Return value can be ignored.
+			 */
+			pci_config_space_set(dev);
+#endif
 			/* map resources for devices that use igb_uio */
 			if (pci_uio_map_resource(dev) < 0)
 				return -1;
@@ -878,3 +888,92 @@ rte_eal_pci_init(void)
 	}
 	return 0;
 }
+
+#ifdef RTE_PCI_CONFIG
+static int
+pci_config_extended_tag(struct rte_pci_device *dev)
+{
+	struct rte_pci_addr *loc = &dev->addr;
+	char filename[PATH_MAX];
+	char buf[BUFSIZ];
+	FILE *f;
+
+	/* not configured, let it as is */
+	if (strncmp(RTE_PCI_EXTENDED_TAG, "on", 2) != 0 &&
+		strncmp(RTE_PCI_EXTENDED_TAG, "off", 3) != 0)
+		return 0;
+
+	rte_snprintf(filename, sizeof(filename),
+		SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/" "extended_tag",
+		loc->domain, loc->bus, loc->devid, loc->function);
+	f = fopen(filename, "rw+");
+	if (!f)
+		return -1;
+
+	fgets(buf, sizeof(buf), f);
+	if (strncmp(RTE_PCI_EXTENDED_TAG, "on", 2) == 0) {
+		/* enable Extended Tag*/
+		if (strncmp(buf, "on", 2) != 0) {
+			fseek(f, 0, SEEK_SET);
+			fputs("on", f);
+		}
+	} else {
+		/* disable Extended Tag */
+		if (strncmp(buf, "off", 3) != 0) {
+			fseek(f, 0, SEEK_SET);
+			fputs("off", f);
+		}
+	}
+	fclose(f);
+
+	return 0;
+}
+
+static int
+pci_config_max_read_request_size(struct rte_pci_device *dev)
+{
+	struct rte_pci_addr *loc = &dev->addr;
+	char filename[PATH_MAX];
+	char buf[BUFSIZ], param[BUFSIZ];
+	FILE *f;
+	uint32_t max_size = RTE_PCI_MAX_READ_REQUEST_SIZE;
+
+	/* not configured, let it as is */
+	if (!max_size)
+		return 0;
+
+	rte_snprintf(filename, sizeof(filename),
+		SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/" "max_read_request_size",
+			loc->domain, loc->bus, loc->devid, loc->function);
+	f = fopen(filename, "rw+");
+	if (!f)
+		return -1;
+
+	fgets(buf, sizeof(buf), f);
+	rte_snprintf(param, sizeof(param), "%d", max_size);
+
+	/* check if the size to be set is the same as current */
+	if (strcmp(buf, param) == 0) {
+		fclose(f);
+		return 0;
+	}
+	fseek(f, 0, SEEK_SET);
+	fputs(param, f);
+	fclose(f);
+
+	return 0;
+}
+
+static void
+pci_config_space_set(struct rte_pci_device *dev)
+{
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return;
+
+	/* configure extended tag */
+	pci_config_extended_tag(dev);
+
+	/* configure max read request size */
+	pci_config_max_read_request_size(dev);
+}
+#endif
Signature · 1 line
1.8.1.4
#33 lore raw

PATCH v2 27/27 config: add configurations for enabling 'Extended Tag' or resetting 'Max Read Request Size'

In reply to a message not in the archive

Sys files of 'extended_tag' and 'max_read_request_size' have been supported in igb_uio, and can be changed during probing PCI. Three items in configuration files are needed to support them at compile time. Those three items are,
- CONFIG_RTE_PCI_CONFIG
- CONFIG_RTE_PCI_EXTENDED_TAG
- CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE

---
 config/common_linuxapp | 10 ++++++++++
 1 file changed, 10 insertions(+)
config/common_linuxapp +10 -0
index da20011..a020451 100644
@@ -125,6 +125,16 @@ CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
 
 #
+# Special configurations in PCI Config Space for high performance
+# CONFIG_RTE_PCI_CONFIG is the compile switch for two features below
+# CONFIG_RTE_PCI_EXTENDED_TAG can be "on", "off"
+# CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE can be 128, 256, 512, 1024, 2048, 4096
+#
+CONFIG_RTE_PCI_CONFIG=n
+CONFIG_RTE_PCI_EXTENDED_TAG=""
+CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE=0
+
+#
 # Compile Environment Abstraction Layer for linux
 #
 CONFIG_RTE_LIBRTE_EAL_LINUXAPP=y
Signature · 1 line
1.8.1.4
Acked-by Acked-by Cunming Liang Acked-by Jijiang Liu Acked-by Jingjing Wu Tested-by Waterman Cao
#34 lore raw
In reply to a message not in the archive

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Helin Zhang
Sent: Thursday, June 05, 2014 1:09 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 00/27] Add i40e PMD support

Summary:
The 2nd version of series of patches are to add i40e PMD support. It contains the updated basic shared code, and some other enhancements. It adds the support of the latest version of firmware.
* Add new PMD driver of i40e in the folder of librte_pmd_i40e
* Add some neccessary definitions, changes in rte_mbuf.h and eth_dev
* Add new configurations for i40e
* Add or modifiy makefiles to support i40e compilation
* Add neccessary changes in ixgbe, e1000 and vmxnet3 PMD, as hash flags has been enlarged from 16 bits to 64 bits to support i40e
* Add neccessary changes in example applications and testpmd to use ETH_RSS_IP to replace all IP hash flags, as i40e introduced more hash flags.
* Add command in testpmd for port based vlan insertion offload testing
* Add neccessary changes in eth_dev to support configuring maximum packet length of less than 1518
* Add two sys files in igb_uio to support enabling/disabling 'Extended Tag' and resetting 'Max Read Request Size', as it has big impacts on i40e performance
* Add neccessary changes in pci to read/write the above two sys files during probing PCI

Features/enhancements to be implemented later:
* Set link speed, and physically up/down
* Double VLAN support, flow director, VMDq and DCB
* VLAN insertion/stripping, RSS in VF

Validation Summary:
This patch includes 27 files, and has been tested by Intel(R).
Please see test environment information as the following:
* Fedora 20 x86_64
* Linux Kernel 3.11.10-301
* GCC 4.8.2
* Intel Xeon CPU E5-2680 v2 @ 2.80GHz
We verified this patch with two NICs (i40e 4x10 SFP+, i40e 2x40G), and performed basic function test on PF and VF. All cases are passed.
Total cases Passed Failed

          138     138       0

---
Helin Zhang (27):
i40e: add basic shared code
i40e: add PMD source files
pci: add macros and pci device IDs to support i40e
igb_uio: add i40e support
mbuf: add new packet flags for i40e
ethdev: add i40e support
ethdev: support setting maximum packet length to less than 1518
vmxnet3: enlarge the hash flags of RSS to 64 bits
ixgbe: enlarge the hash flags of RSS to 64 bits
igb: enlarge the hash flags of RSS to 64 bits
mk: add i40e support
config: add configurations for i40e
app/test-pmd: support displaying 32 bytes RX descriptors app/test-pmd: add command of 'tx_vlan set pvid port_id vlan_id

    (on|off)'

app/testpmd: enlarge the hash flags of RSS to 64 bits app/test-pmd: add L3 packet type in offload flags examples/dpdk_qat: use ETH_RSS_IP to replace IP hash flags of RSS examples/ip_reassembly: use ETH_RSS_IP to replace IP hash flags of RSS examples/l3fwd-power: use ETH_RSS_IP to replace IP hash flags of RSS examples/l3fwd-vf: use ETH_RSS_IP to replace IP hash flags of RSS examples/l3fwd: use ETH_RSS_IP to replace IP hash flags of RSS examples/load_balancer: use ETH_RSS_IP to replace IP hash flags of RSS examples/multi_process: use ETH_RSS_IP to replace IP hash flags of RSS examples/qos_meter: use ETH_RSS_IP to replace IP hash flags of RSS
igb_uio: add sys files to read/write specific bits in pci config space
pci: support reading/writing sys files of 'extended_tag' and
'max_read_request_size'
config: add configurations for enabling 'Extended Tag' or resetting
'Max Read Request Size'

 app/test-pmd/cmdline.c                            |    65 +-
 app/test-pmd/config.c                             |    45 +-
 app/test-pmd/csumonly.c                           |     2 +
 app/test-pmd/parameters.c                         |     5 +-
 app/test-pmd/testpmd.c                            |     2 +-
 app/test-pmd/testpmd.h                            |     4 +-
 config/common_bsdapp                              |    20 +
 config/common_linuxapp                            |    30 +
 examples/dpdk_qat/main.c                          |     2 +-
 examples/ip_reassembly/main.c                     |     2 +-
 examples/l3fwd-power/main.c                       |     2 +-
 examples/l3fwd-vf/main.c                          |     2 +-
 examples/l3fwd/main.c                             |     2 +-
 examples/load_balancer/init.c                     |     2 +-
 examples/multi_process/symmetric_mp/main.c        |     2 +-
 examples/qos_meter/main.c                         |     2 +-
 lib/Makefile                                      |     1 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h   |    44 +
 lib/librte_eal/linuxapp/eal/eal_pci.c             |    99 +
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c         |   107 +
 lib/librte_ether/rte_ethdev.c                     |    25 +-
 lib/librte_ether/rte_ethdev.h                     |   154 +-
 lib/librte_ether/rte_ether.h                      |    24 +
 lib/librte_mbuf/rte_mbuf.h                        |     8 +
 lib/librte_pmd_e1000/igb_rxtx.c                   |    21 +-
 lib/librte_pmd_i40e/Makefile                      |    85 +
 lib/librte_pmd_i40e/i40e/i40e_adminq.c            |  1103 ++
 lib/librte_pmd_i40e/i40e/i40e_adminq.h            |   158 +
 lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h        |  2179 ++++
 lib/librte_pmd_i40e/i40e/i40e_alloc.h             |    65 +
 lib/librte_pmd_i40e/i40e/i40e_common.c            |  4846 +++++++++
 lib/librte_pmd_i40e/i40e/i40e_dcb.c               |  1104 ++
 lib/librte_pmd_i40e/i40e/i40e_dcb.h               |   264 +
 lib/librte_pmd_i40e/i40e/i40e_diag.c              |   188 +
 lib/librte_pmd_i40e/i40e/i40e_diag.h              |    61 +
 lib/librte_pmd_i40e/i40e/i40e_hmc.c               |   373 +
 lib/librte_pmd_i40e/i40e/i40e_hmc.h               |   244 +
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c           |  1616 +++
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h           |   214 +
 lib/librte_pmd_i40e/i40e/i40e_nvm.c               |   942 ++
 lib/librte_pmd_i40e/i40e/i40e_osdep.h             |   197 +
 lib/librte_pmd_i40e/i40e/i40e_prototype.h         |   435 +
 lib/librte_pmd_i40e/i40e/i40e_register.h          |  3377 ++++++
 lib/librte_pmd_i40e/i40e/i40e_register_x710_int.h | 10712 ++++++++++++++++++++
 lib/librte_pmd_i40e/i40e/i40e_status.h            |   107 +
 lib/librte_pmd_i40e/i40e/i40e_type.h              |  1462 +++
 lib/librte_pmd_i40e/i40e/i40e_virtchnl.h          |   373 +
 lib/librte_pmd_i40e/i40e_ethdev.c                 |  4019 ++++++++
 lib/librte_pmd_i40e/i40e_ethdev.h                 |   356 +
 lib/librte_pmd_i40e/i40e_ethdev_vf.c              |  1336 +++
 lib/librte_pmd_i40e/i40e_logs.h                   |    74 +
 lib/librte_pmd_i40e/i40e_pf.c                     |   928 ++
 lib/librte_pmd_i40e/i40e_pf.h                     |    67 +
 lib/librte_pmd_i40e/i40e_rxtx.c                   |  2204 ++++
 lib/librte_pmd_i40e/i40e_rxtx.h                   |   189 +
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c                 |    22 +-
 lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c             |    16 +-
 mk/rte.app.mk                                     |     4 +
 58 files changed, 39936 insertions(+), 56 deletions(-)  create mode 100644 lib/librte_pmd_i40e/Makefile  create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_alloc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_common.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_dcb.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_dcb.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_diag.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_diag.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_hmc.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_hmc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_nvm.c
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_osdep.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_prototype.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_register.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_register_x710_int.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_status.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_type.h
 create mode 100644 lib/librte_pmd_i40e/i40e/i40e_virtchnl.h
 create mode 100644 lib/librte_pmd_i40e/i40e_ethdev.c  create mode 100644 lib/librte_pmd_i40e/i40e_ethdev.h  create mode 100644 lib/librte_pmd_i40e/i40e_ethdev_vf.c
 create mode 100644 lib/librte_pmd_i40e/i40e_logs.h  create mode 100644 lib/librte_pmd_i40e/i40e_pf.c  create mode 100644 lib/librte_pmd_i40e/i40e_pf.h  create mode 100644 lib/librte_pmd_i40e/i40e_rxtx.c  create mode 100644 lib/librte_pmd_i40e/i40e_rxtx.h

--
1.8.1.4

#35 lore raw
In reply to a message not in the archive
Quoted 26 lines

The 2nd version of series of patches are to add i40e PMD support. It contains the updated basic shared code, and some other enhancements. It adds the support of the latest version of firmware.
* Add new PMD driver of i40e in the folder of librte_pmd_i40e
* Add some neccessary definitions, changes in rte_mbuf.h and eth_dev
* Add new configurations for i40e
* Add or modifiy makefiles to support i40e compilation
* Add neccessary changes in ixgbe, e1000 and vmxnet3 PMD, as hash flags has been enlarged from 16 bits to 64 bits to support i40e
* Add neccessary changes in example applications and testpmd to use ETH_RSS_IP to replace all IP hash flags, as i40e introduced more hash flags.
* Add command in testpmd for port based vlan insertion offload testing
* Add neccessary changes in eth_dev to support configuring maximum packet length of less than 1518
* Add two sys files in igb_uio to support enabling/disabling 'Extended Tag' and resetting 'Max Read Request Size', as it has big impacts on i40e performance
* Add neccessary changes in pci to read/write the above two sys files during probing PCI

Features/enhancements to be implemented later:
* Set link speed, and physically up/down
* Double VLAN support, flow director, VMDq and DCB
* VLAN insertion/stripping, RSS in VF

Quoted 7 lines

Applied for version 1.7.0.

Some things could be cleaned up later, especially i40e specific flags in generic API must be removed. Please work on a patch for next release.

Thanks for the hard work

Signature · 1 line
Thomas
#36 lore raw

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, June 18, 2014 12:28 AM
To: Zhang, Helin; Chen, Jing D
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 00/27] Add i40e PMD support

Quoted 26 lines

The 2nd version of series of patches are to add i40e PMD support. It contains the updated basic shared code, and some other enhancements. It adds the support of the latest version of firmware.
* Add new PMD driver of i40e in the folder of librte_pmd_i40e
* Add some neccessary definitions, changes in rte_mbuf.h and eth_dev
* Add new configurations for i40e
* Add or modifiy makefiles to support i40e compilation
* Add neccessary changes in ixgbe, e1000 and vmxnet3 PMD, as hash flags has been enlarged from 16 bits to 64 bits to support i40e
* Add neccessary changes in example applications and testpmd to use ETH_RSS_IP to replace all IP hash flags, as i40e introduced more hash flags.
* Add command in testpmd for port based vlan insertion offload testing
* Add neccessary changes in eth_dev to support configuring maximum packet length of less than 1518
* Add two sys files in igb_uio to support enabling/disabling 'Extended Tag' and resetting 'Max Read Request Size', as it has big impacts on i40e performance
* Add neccessary changes in pci to read/write the above two sys files during probing PCI

Features/enhancements to be implemented later:
* Set link speed, and physically up/down
* Double VLAN support, flow director, VMDq and DCB
* VLAN insertion/stripping, RSS in VF

Quoted 7 lines

Applied for version 1.7.0.

Some things could be cleaned up later, especially i40e specific flags in generic API must be removed. Please work on a patch for next release.

Thanks for the hard work
--
Thomas

------------------------------------------------------------------------------------

Hi Thomas

Thank you greatly to merge those code!

Btw, what do you mean the i40e specific flags in generic API? Did you mean the new flags defined in rte_mbuf.h? Yes, we are working on some bug fixes and enhancements which might need to be added in the next release. Hopefully we can see them soon.

Regards,
Helin

A message that is not in the archive (sent off-list or not yet received): F35DEAC7BCE34641BA9FAC6BCA4A12E70A74457A-0J0gbvR4kTg/[email protected]

#38 lore raw

2014-06-18 08:51, Zhang, Helin:

Quoted 7 lines

Thomas Monjalon:

Quoted 2 lines

Some things could be cleaned up later, especially i40e specific flags in generic API must be removed. Please work on a patch for next release.

Btw, what do you mean the i40e specific flags in generic API? Did you mean the new flags defined in rte_mbuf.h? Yes, we are working on some bug fixes and enhancements which might need to be added in the next release.

I mean that RSS flags are really Intel-specific. In case other NIC vendors would use this RSS API, it can be a problem to address. But we can wait for this one.
About mbuf flags, they are all zeros and useless. So a patch is needed to get some space and define new values (as you already explained).
And last but not the least, RTE_LIBRTE_I40E_16BYTE_RX_DESC handling is very strange as it can be seen in this commit:

	http://dpdk.org/browse/dpdk/commit/?id=ac2ece3fb1f5511
Signature · 1 line
Thomas
#39 lore raw

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, June 18, 2014 5:24 PM
To: Zhang, Helin
Cc: Chen, Jing D; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 00/27] Add i40e PMD support

2014-06-18 08:51, Zhang, Helin:

Quoted 7 lines

Thomas Monjalon:

Quoted 2 lines

Some things could be cleaned up later, especially i40e specific flags in generic API must be removed. Please work on a patch for next release.

Btw, what do you mean the i40e specific flags in generic API? Did you mean the new flags defined in rte_mbuf.h? Yes, we are working on some bug fixes and enhancements which might need to be added in the next release.

I mean that RSS flags are really Intel-specific. In case other NIC vendors would use this RSS API, it can be a problem to address. But we can wait for this one. About mbuf flags, they are all zeros and useless. So a patch is needed to get some space and define new values (as you already explained). And last but not the least, RTE_LIBRTE_I40E_16BYTE_RX_DESC handling is very strange as it can be seen in this commit:

	http://dpdk.org/browse/dpdk/commit/?id=ac2ece3fb1f5511
Signature · 10 lines
Thomas

--------------------------------------------------------------------------

Hi Thomas

I am now working on several small bug fixes and enhancements which is for the next rc, including the rework of the last item you indicated in testpmd. Thank you very much!

Regards,
Helin