*** Add i40e PMD support ***
cover *** Add i40e PMD support ***
Summary:
The series of patches are to add i40e PMD support.
* 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
Helin Zhang (22):
i40e: add basic shared code
i40e: add PMD source files
i40e: add i40e support
e1000: enlarge the hash flags of RSS to 64 bits
ixgbe: enlarge the hash flags of RSS to 64 bits
vmxnet3: enlarge the hash flags of RSS to 64 bits app/testpmd: enlarge the hash flags of RSS to 64 bits examples/qos_meter: 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/l3fwd: 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-power: 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/dpdk_qat: 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 app/test-pmd: tell the driver the correct packet type to support
i40e TX checksum offload
app/test-pmd: support displaying i40e 32 bytes RX descriptor app/test-pmd: support setting port based VLAN ID offloading
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'
ethdev: support setting maximum packet length to less than 1518
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/defconfig_i686-default-linuxapp-gcc | 30 + config/defconfig_i686-default-linuxapp-icc | 30 + config/defconfig_x86_64-default-bsdapp-gcc | 15 + config/defconfig_x86_64-default-linuxapp-gcc | 30 + config/defconfig_x86_64-default-linuxapp-icc | 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 | 101 + lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 107 + lib/librte_ether/rte_ethdev.c | 25 +- lib/librte_ether/rte_ethdev.h | 146 +- lib/librte_ether/rte_ether.h | 24 + lib/librte_mbuf/rte_mbuf.h | 8 + lib/librte_pmd_e1000/igb_rxtx.c | 16 +- lib/librte_pmd_i40e/Makefile | 85 + lib/librte_pmd_i40e/i40e/i40e_adminq.c | 1210 ++ lib/librte_pmd_i40e/i40e/i40e_adminq.h | 121 + lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h | 2198 ++++ lib/librte_pmd_i40e/i40e/i40e_alloc.h | 65 + lib/librte_pmd_i40e/i40e/i40e_common.c | 5176 ++++++++ lib/librte_pmd_i40e/i40e/i40e_dcb.c | 1165 ++ lib/librte_pmd_i40e/i40e/i40e_dcb.h | 264 + lib/librte_pmd_i40e/i40e/i40e_diag.c | 180 + lib/librte_pmd_i40e/i40e/i40e_diag.h | 61 + lib/librte_pmd_i40e/i40e/i40e_hmc.c | 388 + lib/librte_pmd_i40e/i40e/i40e_hmc.h | 287 + lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c | 1443 ++ lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h | 272 + lib/librte_pmd_i40e/i40e/i40e_nvm.c | 487 + lib/librte_pmd_i40e/i40e/i40e_osdep.h | 192 + lib/librte_pmd_i40e/i40e/i40e_prototype.h | 480 + lib/librte_pmd_i40e/i40e/i40e_register.h | 15210 ++++++++++++++++++++++ lib/librte_pmd_i40e/i40e/i40e_register_int.h | 96 + lib/librte_pmd_i40e/i40e/i40e_status.h | 107 + lib/librte_pmd_i40e/i40e/i40e_type.h | 1660 +++ lib/librte_pmd_i40e/i40e/i40e_virtchnl.h | 385 + lib/librte_pmd_i40e/i40e_ethdev.c | 3961 ++++++ lib/librte_pmd_i40e/i40e_ethdev.h | 349 + lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1286 ++ lib/librte_pmd_i40e/i40e_logs.h | 74 + lib/librte_pmd_i40e/i40e_pf.c | 902 ++ lib/librte_pmd_i40e/i40e_pf.h | 67 + lib/librte_pmd_i40e/i40e_rxtx.c | 2217 ++++ lib/librte_pmd_i40e/i40e_rxtx.h | 187 + lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 16 +- lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 16 +- mk/rte.app.mk | 4 + 61 files changed, 41311 insertions(+), 46 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_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
PATCH 1/22 i40e: add basic shared code
In reply to a message not in the archiveAdd shared code source files to support basic operations to be called in poll mode driver. The new files are,i40e_adminq.ci40e_adminq.hi40e_adminq_cmd.hi40e_alloc.hi40e_common.ci40e_dcb.ci40e_dcb.hi40e_diag.ci40e_diag.hi40e_hmc.ci40e_hmc.hi40e_lan_hmc.ci40e_lan_hmc.hi40e_nvm.ci40e_prototype.hi40e_register.hi40e_register_int.hi40e_status.hi40e_type.hi40e_virtchnl.h
--- lib/librte_pmd_i40e/i40e/i40e_adminq.c | 1210 ++ lib/librte_pmd_i40e/i40e/i40e_adminq.h | 121 + lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h | 2198 ++++ lib/librte_pmd_i40e/i40e/i40e_alloc.h | 65 + lib/librte_pmd_i40e/i40e/i40e_common.c | 5176 +++++++++ lib/librte_pmd_i40e/i40e/i40e_dcb.c | 1165 ++ lib/librte_pmd_i40e/i40e/i40e_dcb.h | 264 + lib/librte_pmd_i40e/i40e/i40e_diag.c | 180 + lib/librte_pmd_i40e/i40e/i40e_diag.h | 61 + lib/librte_pmd_i40e/i40e/i40e_hmc.c | 388 + lib/librte_pmd_i40e/i40e/i40e_hmc.h | 287 + lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c | 1443 +++ lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h | 272 + lib/librte_pmd_i40e/i40e/i40e_nvm.c | 487 + lib/librte_pmd_i40e/i40e/i40e_prototype.h | 480 + lib/librte_pmd_i40e/i40e/i40e_register.h | 15210 +++++++++++++++++++++++++ lib/librte_pmd_i40e/i40e/i40e_register_int.h | 96 + lib/librte_pmd_i40e/i40e/i40e_status.h | 107 + lib/librte_pmd_i40e/i40e/i40e_type.h | 1660 +++ lib/librte_pmd_i40e/i40e/i40e_virtchnl.h | 385 + 20 files changed, 31255 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_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 +1210 -0
@@ -0,0 +1,1210 @@ +/******************************************************************************* + +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" + +/** +* 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.arq.tail =I40E_VF_ARQT1 ; + hw->aq.arq.head =I40E_VF_ARQH1 ; + hw->aq.arq.len =I40E_VF_ARQLEN1 ; +#ifdef I40E_QV + }else if (hw->aq_dbg_ena) { + hw->aq.asq.tail =I40E_GL_ATQT ; + hw->aq.asq.head =I40E_GL_ATQH ; + hw->aq.asq.len =I40E_GL_ATQLEN ; + hw->aq.arq.tail =I40E_GL_ARQT ; + hw->aq.arq.head =I40E_GL_ARQH ; + hw->aq.arq.len =I40E_GL_ARQLEN ; +#endif + }else { + hw->aq.asq.tail =I40E_PF_ATQT ; + hw->aq.asq.head =I40E_PF_ATQH ; + hw->aq.asq.len =I40E_PF_ATQLEN ; + hw->aq.arq.tail =I40E_PF_ARQT ; + hw->aq.arq.head =I40E_PF_ARQH ; + hw->aq.arq.len =I40E_PF_ARQLEN ; + } +} + +/** +* 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) +{ +#ifdef I40E_QV +struct i40e_aq_desc qv_desc; +struct i40e_aq_desc *qv_desc_on_ring; +#endif +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); +#ifdef I40E_QV +/* swap the descriptor with userspace version */ +i40e_memcpy (&qv_desc, desc,sizeof (struct i40e_aq_desc ), +I40E_DMA_TO_NONDMA ); + qv_desc_on_ring = desc; + desc = &qv_desc; +#endif + + 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 ; +#ifdef I40E_QV +/* put the initialized descriptor back to the ring */ +i40e_memcpy (qv_desc_on_ring, desc,sizeof (struct i40e_aq_desc ), +I40E_NONDMA_TO_DMA ); +#endif + } + +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 void i40e_config_asq_regs(struct i40e_hw *hw) +{ +if (hw->mac.type ==I40E_MAC_VF ) { +/* configure the transmit queue */ +wr32 (hw,I40E_VF_ATQBAH1 , +I40E_HI_DWORD (hw->aq.asq.desc_buf.pa)); +wr32 (hw,I40E_VF_ATQBAL1 , +I40E_LO_DWORD (hw->aq.asq.desc_buf.pa)); +wr32 (hw,I40E_VF_ATQLEN1 , (hw->aq.num_asq_entries | +I40E_VF_ATQLEN1_ATQENABLE_MASK )); +#ifdef I40E_QV + }else if (hw->aq_dbg_ena) { +/* configure the transmit queue */ +wr32 (hw,I40E_GL_ATQBAH , +I40E_HI_DWORD (hw->aq.asq.desc_buf.pa)); +wr32 (hw,I40E_GL_ATQBAL , +I40E_LO_DWORD (hw->aq.asq.desc_buf.pa)); +wr32 (hw,I40E_GL_ATQLEN , (hw->aq.num_asq_entries | +I40E_GL_ATQLEN_ATQENABLE_MASK )); +#endif + }else { +/* configure the transmit queue */ +wr32 (hw,I40E_PF_ATQBAH , +I40E_HI_DWORD (hw->aq.asq.desc_buf.pa)); +wr32 (hw,I40E_PF_ATQBAL , +I40E_LO_DWORD (hw->aq.asq.desc_buf.pa)); +wr32 (hw,I40E_PF_ATQLEN , (hw->aq.num_asq_entries | +I40E_PF_ATQLEN_ATQENABLE_MASK )); + } +} + +/** +* 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 void i40e_config_arq_regs(struct i40e_hw *hw) +{ +if (hw->mac.type ==I40E_MAC_VF ) { +/* configure the receive queue */ +wr32 (hw,I40E_VF_ARQBAH1 , +I40E_HI_DWORD (hw->aq.arq.desc_buf.pa)); +wr32 (hw,I40E_VF_ARQBAL1 , +I40E_LO_DWORD (hw->aq.arq.desc_buf.pa)); +wr32 (hw,I40E_VF_ARQLEN1 , (hw->aq.num_arq_entries | +I40E_VF_ARQLEN1_ARQENABLE_MASK )); +#ifdef I40E_QV + }else if (hw->aq_dbg_ena) { +/* configure the receive queue */ +wr32 (hw,I40E_GL_ARQBAH , +I40E_HI_DWORD (hw->aq.arq.desc_buf.pa)); +wr32 (hw,I40E_GL_ARQBAL , +I40E_LO_DWORD (hw->aq.arq.desc_buf.pa)); +wr32 (hw,I40E_GL_ARQLEN , (hw->aq.num_arq_entries | +I40E_GL_ARQLEN_ARQENABLE_MASK )); +#endif + }else { +/* configure the receive queue */ +wr32 (hw,I40E_PF_ARQBAH , +I40E_HI_DWORD (hw->aq.arq.desc_buf.pa)); +wr32 (hw,I40E_PF_ARQBAL , +I40E_LO_DWORD (hw->aq.arq.desc_buf.pa)); +wr32 (hw,I40E_PF_ARQLEN , (hw->aq.num_arq_entries | +I40E_PF_ARQLEN_ARQENABLE_MASK )); + } + +/* Update tail in the HW to post pre-allocated buffers */ +wr32 (hw, hw->aq.arq.tail, hw->aq.num_arq_entries -1 ); +} + +/** +* 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 */ +i40e_config_asq_regs (hw); + +/* 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 */ +i40e_config_arq_regs (hw); + +/* 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 */ +#ifdef I40E_QV +/* Do not reset registers, as Tools AQ is shared resource for QV */ +if (!hw->aq_dbg_ena) { +wr32 (hw, hw->aq.asq.head,0 ); +wr32 (hw, hw->aq.asq.tail,0 ); +wr32 (hw, hw->aq.asq.len,0 ); + } +#else +wr32 (hw, hw->aq.asq.head,0 ); +wr32 (hw, hw->aq.asq.tail,0 ); +wr32 (hw, hw->aq.asq.len,0 ); +#endif + +/* 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 */ +#ifdef I40E_QV +/* Do not reset registers, as Tools AQ is shared resource for QV */ +if (!hw->aq_dbg_ena) { +wr32 (hw, hw->aq.arq.head,0 ); +wr32 (hw, hw->aq.arq.tail,0 ); +wr32 (hw, hw->aq.arq.len,0 ); + } +#else +wr32 (hw, hw->aq.arq.head,0 ); +wr32 (hw, hw->aq.arq.tail,0 ); +wr32 (hw, hw->aq.arq.len,0 ); +#endif + +/* 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); + +/* 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 || +#ifdef FORTVILLE_A0_SUPPORT + !((hw->aq.api_min_ver == I40E_FW_API_VERSION_MINOR) || + (hw->aq.api_min_ver == I40E_FW_API_VERSION_A0_MINOR))) { +#else + hw->aq.api_min_ver > I40E_FW_API_VERSION_MINOR) { +#endif + 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); + +#ifdef FORTVILLE_HW +#ifndef EXTERNAL_RELEASE + /* TODO: Need to get the HMC resource profile from the user */ +#endif + ret_code = i40e_aq_set_hmc_resource_profile(hw, + I40E_HMC_PROFILE_DEFAULT, + 0, + NULL); +#endif /* FORTVILLE_HW */ + 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; + +#ifdef I40E_QV + /* This command is not supported for Tools AQ */ + if (!hw->aq_dbg_ena) { + if (i40e_check_asq_alive(hw)) + i40e_aq_queue_shutdown(hw, true); + } +#else + if (i40e_check_asq_alive(hw)) + i40e_aq_queue_shutdown(hw, true); +#endif + + 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 +#ifndef EXTERNAL_RELEASE + * TODO: this function can be extended to handle asynchronous completes + * and in which case could be called in an irq +#endif + **/ +u16 i40e_clean_asq(struct i40e_hw *hw) +{ +#ifdef I40E_QV + struct i40e_aq_desc qv_desc = {0}; + struct i40e_aq_desc *qv_desc_on_ring; +#endif /* I40E_QV */ + 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 I40E_QV + /* copy the descriptor from ring to userspace buffer */ + i40e_memcpy(&qv_desc, desc, sizeof(struct i40e_aq_desc), + I40E_DMA_TO_NONDMA); + qv_desc_on_ring = desc; + desc = &qv_desc; +#endif /* I40E_QV */ +#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) { + if (details->callback) { + I40E_ADMINQ_CALLBACK cb_func = + (I40E_ADMINQ_CALLBACK)details->callback; + desc_cb = *desc; + cb_func(hw, &desc_cb); + } + i40e_memset(desc, 0, sizeof(*desc), I40E_DMA_MEM); + i40e_memset(details, 0, sizeof(*details), I40E_NONDMA_MEM); +#ifdef I40E_QV + /* copy the descriptor from userspace buffer to ring */ + i40e_memcpy(qv_desc_on_ring, desc, + sizeof(struct i40e_aq_desc), I40E_NONDMA_TO_DMA); +#endif /* I40E_QV */ +#ifndef EXTERNAL_RELEASE + /* TODO, for now we assume the buffers are reclaimed in the + * synchronous path and so we can just clean up the desc here + * when we add asynchronous code we will have to make sure to + * retrieve retval and the returned buff info and pass it + * to the consumer + */ +#endif + ntc++; + if (ntc == asq->count) + ntc = 0; + desc = I40E_ADMINQ_DESC(*asq, ntc); + details = I40E_ADMINQ_DETAILS(*asq, ntc); +#ifdef I40E_QV + /* copy the descriptor from ring to userspace buffer */ + i40e_memcpy(&qv_desc, desc, sizeof(struct i40e_aq_desc), + I40E_DMA_TO_NONDMA); + qv_desc_on_ring = desc; + desc = &qv_desc; +#endif /* I40E_QV */ + } + + 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) +{ +#ifdef I40E_QV + struct i40e_aq_desc qv_desc = {0}; + struct i40e_aq_desc *qv_desc_on_ring; +#endif /* I40E_QV */ + 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; + + 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; + } + + 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; + } + +#ifndef EXTERNAL_RELEASE + /* TODO: if desc not available the overflow queue logic goes here, + * for now we are not going to worry about it + */ +#endif + /* 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); +#ifdef I40E_QV + /* copy the descriptor from ring to userspace buffer */ + i40e_memcpy(&qv_desc, desc_on_ring, sizeof(struct i40e_aq_desc), + I40E_DMA_TO_NONDMA); + qv_desc_on_ring = desc_on_ring; + desc_on_ring = &qv_desc; +#endif /* I40E_QV */ + + /* 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 I40E_QV + /* copy the descriptor from userspace buffer to ring */ + i40e_memcpy(qv_desc_on_ring, desc_on_ring, + sizeof(struct i40e_aq_desc), I40E_NONDMA_TO_DMA); +#endif /* I40E_QV */ +#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_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff); +#ifdef I40E_FPGA_SUPPORT + /* To increase stability */ + i40e_msec_delay(10); +#endif + (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 = 10; + +#ifdef I40E_FPGA_SUPPORT + /* emulator needs a longer delay */ + if ((hw->device_id == I40E_DEV_ID_BVL_I40Q) || + (hw->device_id == I40E_DEV_ID_FPGA_A) || + (hw->device_id == I40E_DEV_ID_FPGA_A_VF)) + delay_len = 1000; +#endif /* I40E_FPGA_SUPPORT */ + do { +#ifdef I40E_QV + /* copy the descriptor from ring to user buffer */ + i40e_memcpy(desc_on_ring, qv_desc_on_ring, + sizeof(struct i40e_aq_desc), I40E_DMA_TO_NONDMA); +#endif /* I40E_QV */ + /* 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_usec_delay(delay_len); + total_delay += delay_len; + } while (total_delay < I40E_ASQ_CMD_TIMEOUT); + } + + /* if ready, copy the desc back to temp */ + if (i40e_asq_done(hw)) { +#ifdef I40E_QV + /* Swap pointer back */ + desc_on_ring = qv_desc_on_ring; +#endif /* I40E_QV */ +#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); +#ifdef SV_SUPPORT + i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff); +#endif + /* 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; + } + + /* 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; + } + +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) +{ +#ifdef I40E_QV + struct i40e_aq_desc qv_desc = {0}; + struct i40e_aq_desc *qv_desc_on_ring; +#endif /* I40E_QV */ + 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); +#ifdef I40E_QV + /* copy the descriptor from ring to userspace buffer */ + i40e_memcpy(&qv_desc, desc, sizeof(struct i40e_aq_desc), + I40E_DMA_TO_NONDMA); + qv_desc_on_ring = desc; + desc = &qv_desc; +#endif /* I40E_QV */ + 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 */ + i40e_debug_aq(hw, + I40E_DEBUG_AQ_COMMAND, + (void *)desc, + hw->aq.arq.r.arq_bi[desc_idx].va); + + 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); + } + + /* 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)); +#ifdef I40E_QV + /* copy the descriptor from userspace buffer to ring */ + i40e_memcpy(qv_desc_on_ring, desc, + sizeof(struct i40e_aq_desc), I40E_NONDMA_TO_DMA); +#endif /* I40E_QV */ + + /* 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); + + return ret_code; +} +#ifdef I40E_MFP_SV + +void i40e_idle_aq(struct i40e_hw *hw) +{ + wr32(hw, hw->aq.asq.len, 0); + wr32(hw, hw->aq.arq.len, 0); + + i40e_msec_delay(2); +} +#endif + +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 +121 -0
121 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h new file +2198 -0
1,669 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 +5176 -0
5,176 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_dcb.c new file +1165 -0
1,165 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 +180 -0
180 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 +388 -0
388 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_hmc.h new file +287 -0
287 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c new file +1443 -0
1,443 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h new file +272 -0
272 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_nvm.c new file +487 -0
487 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_prototype.h new file +480 -0
480 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_register.h new file +15210 -0
15,210 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_register_int.h new file +96 -0
96 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 +1660 -0
1,660 lines not on this page · raw message
lib/librte_pmd_i40e/i40e/i40e_virtchnl.h new file +385 -0
385 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.
PATCH 2/22 i40e: add PMD source files
In reply to a message not in the archiveAdd PMD source files to support Intel(R) 40G Ethernet Controllers. The new files are,i40e_osdep.hi40e_ethdev.ci40e_ethdev.hi40e_ethdev_vf.ci40e_logs.hi40e_pf.ci40e_pf.hi40e_rxtx.ci40e_rxtx.hMakefile
--- lib/librte_pmd_i40e/Makefile | 85 + lib/librte_pmd_i40e/i40e/i40e_osdep.h | 192 ++ lib/librte_pmd_i40e/i40e_ethdev.c | 3961 +++++++++++++++++++++++++++++++++ lib/librte_pmd_i40e/i40e_ethdev.h | 349 +++ lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1286 +++++++++++ lib/librte_pmd_i40e/i40e_logs.h | 74 + lib/librte_pmd_i40e/i40e_pf.c | 902 ++++++++ lib/librte_pmd_i40e/i40e_pf.h | 67 + lib/librte_pmd_i40e/i40e_rxtx.c | 2217 ++++++++++++++++++ lib/librte_pmd_i40e/i40e_rxtx.h | 187 ++ 10 files changed, 9320 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
@@ -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 +192 -0
192 lines not on this page · raw message
lib/librte_pmd_i40e/i40e_ethdev.c new file +3961 -0
2,723 lines not on this page · raw message
lib/librte_pmd_i40e/i40e_ethdev.h new file +349 -0
349 lines not on this page · raw message
lib/librte_pmd_i40e/i40e_ethdev_vf.c new file +1286 -0
1,286 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 +902 -0
902 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 +2217 -0
2,217 lines not on this page · raw message
lib/librte_pmd_i40e/i40e_rxtx.h new file +187 -0
187 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.
PATCH 3/22 i40e: add i40e support
In reply to a message not in the archiveAdd i40e support by modifying neccessary source files. The componets modified are,
- Add configurations for i40e in config/
- Modified neccessary makefiles in both k/ and lib/
- Modified neccessary source files in librte_ether/
- Add more packet bit flags in rte_mbuf.h
- Add i40e support in igb_uio
- Add i40e support in rte_pci_dev_ids.h, including new device IDs
--- config/defconfig_i686-default-linuxapp-gcc | 20 ++++ config/defconfig_i686-default-linuxapp-icc | 20 ++++ config/defconfig_x86_64-default-bsdapp-gcc | 15 +++ config/defconfig_x86_64-default-linuxapp-gcc | 20 ++++ config/defconfig_x86_64-default-linuxapp-icc | 20 ++++ lib/Makefile | 1 + lib/librte_eal/common/include/rte_pci_dev_ids.h | 44 +++++++ lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 + lib/librte_ether/rte_ethdev.c | 15 +++ lib/librte_ether/rte_ethdev.h | 146 +++++++++++++++++++++--- lib/librte_ether/rte_ether.h | 24 ++++ lib/librte_mbuf/rte_mbuf.h | 8 ++ mk/rte.app.mk | 4 + 13 files changed, 323 insertions(+), 16 deletions(-)
config/defconfig_i686-default-linuxapp-gcc +20 -0
@@ -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
config/defconfig_i686-default-linuxapp-icc +20 -0
@@ -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
config/defconfig_x86_64-default-bsdapp-gcc +15 -0
@@ -165,6 +165,21 @@ 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_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 + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=n
config/defconfig_x86_64-default-linuxapp-gcc +20 -0
@@ -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
config/defconfig_x86_64-default-linuxapp-icc +20 -0
@@ -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
lib/Makefile +1 -0
@@ -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
lib/librte_eal/common/include/rte_pci_dev_ids.h +44 -0
73 lines not on this page · raw message
lib/librte_eal/linuxapp/igb_uio/igb_uio.c +2 -0
@@ -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
lib/librte_ether/rte_ethdev.c +15 -0
@@ -1194,6 +1194,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 +130 -16
196 lines not on this page · raw message
lib/librte_ether/rte_ether.h +24 -0
@@ -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
lib/librte_mbuf/rte_mbuf.h +8 -0
@@ -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
mk/rte.app.mk +4 -0
@@ -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
PATCH 4/22 e1000: enlarge the hash flags of RSS to 64 bits
In reply to a message not in the archiveAs 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 e1000 should be enlarged as well. In addition, the flags for e1000 only should be masked, as there are flags for others in that 64 bits.
--- lib/librte_pmd_e1000/igb_rxtx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
lib/librte_pmd_e1000/igb_rxtx.c +14 -2
@@ -1521,17 +1521,29 @@ igb_rss_disable(struct rte_eth_dev *dev)static void igb_rss_configure (struct rte_eth_dev *dev) { +#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) +struct e1000_hw *hw;uint8_t *hash_key;uint32_t rss_key;uint32_t mrqc;uint32_t shift; -uint16_t rss_hf; +uint64_t rss_hf;uint16_t i; hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private); - rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; + rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf & +IGB_RSS_OFFLOAD_ALL ;if (rss_hf ==0 )/* Disable RSS. */ {igb_rss_disable (dev);return ;
Signature · 1 line
1.8.1.4
PATCH 5/22 ixgbe: enlarge the hash flags of RSS to 64 bits
In reply to a message not in the archiveAs 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 should be enlarged as well. In addition, the flags for ixgbe only should be masked, as there are flags for others in that 64 bits.
--- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
lib/librte_pmd_ixgbe/ixgbe_rxtx.c +14 -2
@@ -2294,19 +2294,31 @@ ixgbe_rss_disable(struct rte_eth_dev *dev)static void ixgbe_rss_configure (struct rte_eth_dev *dev) { +#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) +struct ixgbe_hw *hw;uint8_t *hash_key;uint32_t rss_key;uint32_t mrqc;uint32_t reta; -uint16_t rss_hf; +uint64_t rss_hf;uint16_t i;uint16_t j;PMD_INIT_FUNC_TRACE (); hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); - rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; + rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf & +IXGBE_RSS_OFFLOAD_ALL ;if (rss_hf ==0 ) {/* Disable RSS */ ixgbe_rss_disable (dev);return ;
Signature · 1 line
1.8.1.4
PATCH 6/22 vmxnet3: enlarge the hash flags of RSS to 64 bits
In reply to a message not in the archiveAs 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 should be enlarged as well. In addition, the flags for vmxnet3 only should be 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
@@ -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 Ð_RSS_IPV4 ) + rss_hf = port_rss_conf->rss_hf &VMXNET3_RSS_OFFLOAD_ALL ; +if (rss_hf Ð_RSS_IPV4 ) dev_rss_conf->hashType |=VMXNET3_RSS_HASH_TYPE_IPV4 ; -if (port_rss_conf->rss_hf Ð_RSS_IPV4_TCP ) +if (rss_hf Ð_RSS_IPV4_TCP ) dev_rss_conf->hashType |=VMXNET3_RSS_HASH_TYPE_TCP_IPV4 ; -if (port_rss_conf->rss_hf Ð_RSS_IPV6 ) +if (rss_hf Ð_RSS_IPV6 ) dev_rss_conf->hashType |=VMXNET3_RSS_HASH_TYPE_IPV6 ; -if (port_rss_conf->rss_hf Ð_RSS_IPV6_TCP ) +if (rss_hf Ð_RSS_IPV6_TCP ) dev_rss_conf->hashType |=VMXNET3_RSS_HASH_TYPE_TCP_IPV6 ;return VMXNET3_SUCCESS ;
Signature · 1 line
1.8.1.4
PATCH 7/22 app/testpmd: enlarge the hash flags of RSS to 64 bits
In reply to a message not in the archiveAs 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
@@ -1131,9 +1131,9 @@ cmd_config_rss_parsed(void *parsed_result, }if (!strcmp (res->value,"ip" )) - rss_hf =ETH_RSS_IPV4 |ETH_RSS_IPV6 ; + rss_hf =ETH_RSS_IP ;else if (!strcmp (res->value,"udp" )) - rss_hf =ETH_RSS_IPV4 |ETH_RSS_IPV6 |ETH_RSS_IPV4_UDP ; + rss_hf =ETH_RSS_UDP ;else if (!strcmp (res->value,"none" )) rss_hf =0 ;else {
app/test-pmd/parameters.c +2 -3
@@ -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
@@ -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
@@ -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
PATCH 8/22 examples/qos_meter: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 9/22 examples/multi_process: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 10/22 examples/l3fwd: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 11/22 examples/l3fwd-vf: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 12/22 examples/l3fwd-power: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 13/22 examples/ip_reassembly: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 14/22 examples/dpdk_qat: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 15/22 examples/load_balancer: use ETH_RSS_IP to replace IP hash flags of RSS
In reply to a message not in the archiveAs 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
@@ -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
PATCH 16/22 app/test-pmd: tell the driver the correct packet type to support i40e TX checksum offload
In reply to a message not in the archiveAs i40e PMD need to know the L3 packet type for TX checksum offloading, modifications in testpmd should be done for that.
--- app/test-pmd/csumonly.c | 2 ++ 1 file changed, 2 insertions(+)
app/test-pmd/csumonly.c +2 -0
@@ -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
PATCH 17/22 app/test-pmd: support displaying i40e 32 bytes RX descriptor
In reply to a message not in the archiveAs i40e support both 16 and 32 bytes RX descriptors, modifications should be done to support 32 bytes RX descriptors according to the configuration.
--- app/test-pmd/config.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-)
app/test-pmd/config.c +33 -3
@@ -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
PATCH 18/22 app/test-pmd: support setting port based VLAN ID offloading
In reply to a message not in the archiveAs i40e support port based VLAN ID insertion offloading, new command 'tx_vlan set pvid port_id vlan_id (on|off)' is added to support that setting.
--- 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
@@ -281,6 +281,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"
@@ -2202,6 +2205,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 ="ssss" , + .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;
@@ -5189,6 +5249,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
@@ -1510,6 +1510,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
@@ -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
PATCH 19/22 igb_uio: add sys files to read/write specific bits in pci config space
In reply to a message not in the archiveEnabling '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
@@ -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, +#endifNULL , };
Signature · 1 line
1.8.1.4
PATCH 20/22 pci: support reading/writing sys files of 'extended_tag' and 'max_read_request_size'
In reply to a message not in the archiveSys 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 | 101 ++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
lib/librte_eal/linuxapp/eal/eal_pci.c +101 -0
@@ -107,6 +107,11 @@ 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 pci_unbind_kernel_driver (struct rte_pci_device *dev)
@@ -840,6 +845,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 +890,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
PATCH 21/22 config: add configurations for enabling 'Extended Tag' or resetting 'Max Read Request Size'
In reply to a message not in the archiveSys 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/defconfig_i686-default-linuxapp-gcc | 10 ++++++++++ config/defconfig_i686-default-linuxapp-icc | 10 ++++++++++ config/defconfig_x86_64-default-linuxapp-gcc | 10 ++++++++++ config/defconfig_x86_64-default-linuxapp-icc | 10 ++++++++++ 4 files changed, 40 insertions(+)
config/defconfig_i686-default-linuxapp-gcc +10 -0
@@ -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
config/defconfig_i686-default-linuxapp-icc +10 -0
@@ -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
config/defconfig_x86_64-default-linuxapp-gcc +10 -0
@@ -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
config/defconfig_x86_64-default-linuxapp-icc +10 -0
@@ -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
PATCH 22/22 ethdev: support setting maximum packet length to less than 1518
In reply to a message not in the archiveIn ethdev, it will ignore setting maximum packet length to less than 1518. The changes is to fix it and let less than 1518 can be really 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
@@ -553,9 +553,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