[dpdk-dev] [PATCH 1/1] net/i40e: enable auto link update for XXV710
Hi Ferruh: > -Original Message- > From: Yigit, Ferruh > Sent: Wednesday, November 30, 2016 1:46 AM > To: Zhang, Qi Z ; Wu, Jingjing intel.com>; > Zhang, Helin > Cc: dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH 1/1] net/i40e: enable auto link update for > XXV710 > > Hi Qi, > > On 11/24/2016 11:43 PM, Qi Zhang wrote: > > This patch remove the limitation that XXV710 device does > > XXV710 is 25G device, and support added in 16.11 (please correct me if this is > wrong.), but I can't find any DPDK documentation for this device. > > Can you please add some documentation, at least to http://dpdk.org/doc/nics > and http://dpdk.org/doc/guides/nics/i40e.html > in a different patch? For 16.11, since XXV710 is not officially supported, so they are missing in document. For 17.02 this will be updated. Thanks for remind. > > > not support auto link update. > > Can you please add more details that why we can remove the limitation now? Ok, will update in v2. > > > > > Signed-off-by: Qi Zhang > > --- > > drivers/net/i40e/i40e_ethdev.c | 8 > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 67778ba..b7a916d 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -1628,6 +1628,8 @@ i40e_phy_conf_link(struct i40e_hw *hw, > > > > /* use get_phy_abilities_resp value for the rest */ > > phy_conf.phy_type = phy_ab.phy_type; > > + phy_conf.phy_type_ext = phy_ab.phy_type_ext; > > + phy_conf.fec_config = phy_ab.mod_type_ext; > > And these changes look like called for all device types, just to double > check, are > these 25G specific? Actually only XXV710 need this two lines, but base on firmware engineer's input, this could be implemented in generic way since no impact for other i40e devices. > > > phy_conf.eee_capability = phy_ab.eee_capability; > > phy_conf.eeer = phy_ab.eeer_val; > > phy_conf.low_power_ctrl = phy_ab.d3_lpan; @@ -1653,8 +1655,7 @@ > > i40e_apply_link_speed(struct rte_eth_dev *dev) > > struct rte_eth_conf *conf = >data->dev_conf; > > > > speed = i40e_parse_link_speeds(conf->link_speeds); > > - if (!I40E_PHY_TYPE_SUPPORT_25G(hw->phy.phy_types)) > > - abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; > > + abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; > > if (!(conf->link_speeds & ETH_LINK_SPEED_FIXED)) > > abilities |= I40E_AQ_PHY_AN_ENABLED; > > abilities |= I40E_AQ_PHY_LINK_ENABLED; @@ -1990,8 +1991,7 @@ > > i40e_dev_set_link_down(struct rte_eth_dev *dev) > > uint8_t abilities = 0; > > struct i40e_hw *hw = > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > > > - if (!I40E_PHY_TYPE_SUPPORT_25G(hw->phy.phy_types)) > > - abilities = I40E_AQ_PHY_ENABLE_ATOMIC_LINK; > > + abilities = I40E_AQ_PHY_ENABLE_ATOMIC_LINK; > > return i40e_phy_conf_link(hw, abilities, speed); } > > > > Thanks! Qi
[dpdk-dev] Recall: [PATCH 1/1] net/i40e: enable auto link update for XXV710
Zhang, Qi Z would like to recall the message, "[PATCH 1/1] net/i40e: enable auto link update for XXV710".
[dpdk-dev] Recall: [PATCH 1/1] net/i40e: enable auto link update for XXV710
Zhang, Qi Z would like to recall the message, "[PATCH 1/1] net/i40e: enable auto link update for XXV710".
[dpdk-dev] [PATCH 1/5] i40e: extract non-x86 specific code from vector driver
Hi Jianbo > -Original Message- > From: Jianbo Liu [mailto:jianbo.liu at linaro.org] > Sent: Thursday, October 13, 2016 11:00 AM > To: Zhang, Qi Z > Cc: Zhang, Helin ; Wu, Jingjing > ; jerin.jacob at caviumnetworks.com; dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH 1/5] i40e: extract non-x86 specific code from > vector driver > > On 12 October 2016 at 10:55, Zhang, Qi Z wrote: > > Hi Jianbo > > > >> -Original Message- > >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jianbo Liu > >> Sent: Wednesday, August 24, 2016 5:54 PM > >> To: Zhang, Helin ; Wu, Jingjing > >> ; jerin.jacob at caviumnetworks.com; > dev at dpdk.org > >> Cc: Jianbo Liu > >> Subject: [dpdk-dev] [PATCH 1/5] i40e: extract non-x86 specific code > >> from vector driver > >> > >> move scalar code which does not use x86 intrinsic functions to new > >> file "i40e_rxtx_vec_common.h", while keeping x86 code in > i40e_rxtx_vec.c. > >> This allows the scalar code to to be shared among vector drivers for > >> different platforms. > >> > >> Signed-off-by: Jianbo Liu > >> --- > ... > > > > Should we rename the function "_40e_rx_queue_release_mbufs_vec" to > > "i40e_rx_queue_release_mbufs_vec_default", so functions be wrapped > can follow a consistent rule? > > I think these two ways are different. > For func/_func, _func implements what func needs to do, they are same. > We needs _func inline, to be called in different ARCHs. > But for func/func_default, func_default is the default behavior, but you can > use or not-use it in func. Got your point, I also saw ixgbe is implemented in the same way. Thanks! Qi
[dpdk-dev] [PATCH 1/5] i40e: extract non-x86 specific code from vector driver
Hi Jianbo > -Original Message- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jianbo Liu > Sent: Wednesday, August 24, 2016 5:54 PM > To: Zhang, Helin ; Wu, Jingjing > ; jerin.jacob at caviumnetworks.com; dev at dpdk.org > Cc: Jianbo Liu > Subject: [dpdk-dev] [PATCH 1/5] i40e: extract non-x86 specific code from > vector > driver > > move scalar code which does not use x86 intrinsic functions to new file > "i40e_rxtx_vec_common.h", while keeping x86 code in i40e_rxtx_vec.c. > This allows the scalar code to to be shared among vector drivers for different > platforms. > > Signed-off-by: Jianbo Liu > --- > drivers/net/i40e/i40e_rxtx_vec.c| 184 +--- > drivers/net/i40e/i40e_rxtx_vec_common.h | 239 > > 2 files changed, 243 insertions(+), 180 deletions(-) create mode 100644 > drivers/net/i40e/i40e_rxtx_vec_common.h > > diff --git a/drivers/net/i40e/i40e_rxtx_vec.c > b/drivers/net/i40e/i40e_rxtx_vec.c > index 51fb282..f847469 100644 > --- a/drivers/net/i40e/i40e_rxtx_vec.c > +++ b/drivers/net/i40e/i40e_rxtx_vec.c > @@ -39,6 +39,7 @@ > #include "base/i40e_type.h" > #include "i40e_ethdev.h" > #include "i40e_rxtx.h" > +#include "i40e_rxtx_vec_common.h" > > #include > > @@ -421,68 +422,6 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf > **rx_pkts, > return _recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL); } > > -static inline uint16_t > -reassemble_packets(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_bufs, > -uint16_t nb_bufs, uint8_t *split_flags) > -{ > - struct rte_mbuf *pkts[RTE_I40E_VPMD_RX_BURST]; /*finished pkts*/ > - struct rte_mbuf *start = rxq->pkt_first_seg; > - struct rte_mbuf *end = rxq->pkt_last_seg; > - unsigned pkt_idx, buf_idx; > - > - for (buf_idx = 0, pkt_idx = 0; buf_idx < nb_bufs; buf_idx++) { > - if (end != NULL) { > - /* processing a split packet */ > - end->next = rx_bufs[buf_idx]; > - rx_bufs[buf_idx]->data_len += rxq->crc_len; > - > - start->nb_segs++; > - start->pkt_len += rx_bufs[buf_idx]->data_len; > - end = end->next; > - > - if (!split_flags[buf_idx]) { > - /* it's the last packet of the set */ > - start->hash = end->hash; > - start->ol_flags = end->ol_flags; > - /* we need to strip crc for the whole packet */ > - start->pkt_len -= rxq->crc_len; > - if (end->data_len > rxq->crc_len) { > - end->data_len -= rxq->crc_len; > - } else { > - /* free up last mbuf */ > - struct rte_mbuf *secondlast = start; > - > - while (secondlast->next != end) > - secondlast = secondlast->next; > - secondlast->data_len -= (rxq->crc_len - > - end->data_len); > - secondlast->next = NULL; > - rte_pktmbuf_free_seg(end); > - end = secondlast; > - } > - pkts[pkt_idx++] = start; > - start = end = NULL; > - } > - } else { > - /* not processing a split packet */ > - if (!split_flags[buf_idx]) { > - /* not a split packet, save and skip */ > - pkts[pkt_idx++] = rx_bufs[buf_idx]; > - continue; > - } > - end = start = rx_bufs[buf_idx]; > - rx_bufs[buf_idx]->data_len += rxq->crc_len; > - rx_bufs[buf_idx]->pkt_len += rxq->crc_len; > - } > - } > - > - /* save the partial packet for next time */ > - rxq->pkt_first_seg = start; > - rxq->pkt_last_seg = end; > - memcpy(rx_bufs, pkts, pkt_idx * (sizeof(*pkts))); > - return pkt_idx; > -} > - > /* vPMD receive routine that reassembles scattered packets > * Notice: > * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet @@ > -548,73 +487,6 @@ vtx(volatile struct i40e_tx_desc *txdp, > vtx1(txdp, *pkt, flags); > } > > -static inline int __attribute__((always_inline)) -i40e_tx_free_bufs(struct > i40e_tx_queue *txq) -{ > - struct i40e_tx_entry *txep; > - uint32_t n; > - uint32_t i; > - int nb_free = 0; > - struct rte_mbuf *m, *free[RTE_I40E_TX_MAX_FREE_BUF_SZ]; > - > - /* check DD bits on threshold descriptor */ >
[dpdk-dev] [PATCH 2/5] i40e: implement vector PMD for ARM architecture
Hi Jianbo: > -Original Message- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jianbo Liu > Sent: Wednesday, August 24, 2016 5:54 PM > To: Zhang, Helin ; Wu, Jingjing > ; jerin.jacob at caviumnetworks.com; dev at dpdk.org > Cc: Jianbo Liu > Subject: [dpdk-dev] [PATCH 2/5] i40e: implement vector PMD for ARM > architecture > > Use ARM NEON intrinsic to implement i40e vPMD > > Signed-off-by: Jianbo Liu > --- > drivers/net/i40e/Makefile | 4 + > drivers/net/i40e/i40e_rxtx_vec_neon.c | 581 > ++ > 2 files changed, 585 insertions(+) > create mode 100644 drivers/net/i40e/i40e_rxtx_vec_neon.c > > diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index > 53fe145..9e92b38 100644 > --- a/drivers/net/i40e/Makefile > +++ b/drivers/net/i40e/Makefile > @@ -97,7 +97,11 @@ 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 > +ifeq ($(CONFIG_RTE_ARCH_ARM64),y) > +SRCS-$(CONFIG_RTE_LIBRTE_I40E_INC_VECTOR) += i40e_rxtx_vec_neon.c > else > SRCS-$(CONFIG_RTE_LIBRTE_I40E_INC_VECTOR) += i40e_rxtx_vec.c > +endif > SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_ethdev_vf.c > SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_pf.c > SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_fdir.c diff --git > a/drivers/net/i40e/i40e_rxtx_vec_neon.c > b/drivers/net/i40e/i40e_rxtx_vec_neon.c > new file mode 100644 > index 000..015fa9f > --- /dev/null > +++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c > @@ -0,0 +1,581 @@ > +/*- > + * BSD LICENSE > + * > + * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. > + * Copyright(c) 2016, Linaro Limited > + * 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 > +#include > +#include > + > +#include "base/i40e_prototype.h" > +#include "base/i40e_type.h" > +#include "i40e_ethdev.h" > +#include "i40e_rxtx.h" > +#include "i40e_rxtx_vec_common.h" > + > +#include > + > +#pragma GCC diagnostic ignored "-Wcast-qual" > + > +static inline void > +i40e_rxq_rearm(struct i40e_rx_queue *rxq) { > + int i; > + uint16_t rx_id; > + volatile union i40e_rx_desc *rxdp; > + struct i40e_rx_entry *rxep = >sw_ring[rxq->rxrearm_start]; > + struct rte_mbuf *mb0, *mb1; > + uint64x2_t dma_addr0, dma_addr1; > + uint64x2_t zero = vdupq_n_u64(0); > + uint64_t paddr; > + uint8x8_t p; > + > + rxdp = rxq->rx_ring + rxq->rxrearm_start; > + > + /* Pull 'n' more MBUFs into the software ring */ > + if (unlikely(rte_mempool_get_bulk(rxq->mp, > + (void *)rxep, > + RTE_I40E_RXQ_REARM_THRESH) < 0)) { > + if (rxq->rxrearm_nb + RTE_I40E_RXQ_REARM_THRESH >= > + rxq->nb_rx_desc) { > + for (i = 0; i < RTE_I40E_DESCS_PER_LOOP; i++) { > + rxep[i].mbuf = >fake_mbuf; > + vst1q_u64((uint64_t *)[i].read, zero); > + } > + } > + rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed += > + RTE_I40E_RXQ_REARM_THRESH; > + return; > + } > + > + p = vld1_u8((uint8_t *)>mbuf_initializer); > + > + /* Initialize
[dpdk-dev] [PATCH v2 2/2] net/i40e: enable 25G device
Add code branch for 25G link speed, so 25G device will be functional. Signed-off-by: Zhang Qi --- drivers/net/i40e/i40e_ethdev.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index fc7e128..e5b6554 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1567,6 +1567,8 @@ i40e_parse_link_speeds(uint16_t link_speeds) if (link_speeds & ETH_LINK_SPEED_40G) link_speed |= I40E_LINK_SPEED_40GB; + if (link_speeds & ETH_LINK_SPEED_25G) + link_speed |= I40E_LINK_SPEED_25GB; if (link_speeds & ETH_LINK_SPEED_20G) link_speed |= I40E_LINK_SPEED_20GB; if (link_speeds & ETH_LINK_SPEED_10G) @@ -1592,6 +1594,7 @@ i40e_phy_conf_link(struct i40e_hw *hw, I40E_AQ_PHY_FLAG_PAUSE_RX | I40E_AQ_PHY_FLAG_LOW_POWER; const uint8_t advt = I40E_LINK_SPEED_40GB | + I40E_LINK_SPEED_25GB | I40E_LINK_SPEED_10GB | I40E_LINK_SPEED_1GB | I40E_LINK_SPEED_100MB; @@ -1644,7 +1647,8 @@ i40e_apply_link_speed(struct rte_eth_dev *dev) struct rte_eth_conf *conf = >data->dev_conf; enum i40e_aq_link_speed link_speed = i40e_get_link_speed_by_devid(hw->device_id); speed = i40e_parse_link_speeds(conf->link_speeds); - abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + if (link_speed != I40E_LINK_SPEED_25GB) + abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; if (!(conf->link_speeds & ETH_LINK_SPEED_FIXED)) abilities |= I40E_AQ_PHY_AN_ENABLED; abilities |= I40E_AQ_PHY_LINK_ENABLED; @@ -1746,7 +1750,8 @@ i40e_dev_start(struct rte_eth_dev *dev) /* Apply link configure */ if (dev->data->dev_conf.link_speeds & ~(ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G | - ETH_LINK_SPEED_20G | ETH_LINK_SPEED_40G)) { + ETH_LINK_SPEED_20G | ETH_LINK_SPEED_25G | + ETH_LINK_SPEED_40G)) { PMD_DRV_LOG(ERR, "Invalid link setting"); goto err_up; } @@ -1966,9 +1971,10 @@ static int i40e_dev_set_link_down(struct rte_eth_dev *dev) { uint8_t speed = I40E_LINK_SPEED_UNKNOWN; - uint8_t abilities = I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + uint8_t abilities = 0; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); - + if (i40e_get_link_speed_by_devid(hw->device_id) != I40E_LINK_SPEED_25GB) + abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; return i40e_phy_conf_link(hw, abilities, speed); } @@ -2026,6 +2032,9 @@ i40e_dev_link_update(struct rte_eth_dev *dev, case I40E_LINK_SPEED_20GB: link.link_speed = ETH_SPEED_NUM_20G; break; + case I40E_LINK_SPEED_25GB: + link.link_speed = ETH_SPEED_NUM_25G; + break; case I40E_LINK_SPEED_40GB: link.link_speed = ETH_SPEED_NUM_40G; break; @@ -2630,6 +2639,9 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ dev_info->speed_capa = ETH_LINK_SPEED_40G; + if (link_speed == I40E_LINK_SPEED_25GB) + /* For XXL710 */ + dev_info->speed_capa = ETH_LINK_SPEED_25G; else /* For X710 */ dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G; @@ -8077,7 +8089,8 @@ i40e_configure_registers(struct i40e_hw *hw) for (i = 0; i < RTE_DIM(reg_table); i++) { if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { - if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ + if (link_speed == I40E_LINK_SPEED_40GB || + link_speed == I40E_LINK_SPEED_25GB) /* For XL710 */ reg_table[i].val = I40E_GL_SWR_PM_UP_THR_SF_VALUE; else /* For X710 */ -- 2.7.4
[dpdk-dev] [PATCH v2 1/2] net/i40e: add func to check link speed
Add a help function to check link speed by device ID. Replace macro "i40e_is_40G_device" with the new function. Signed-off-by: Zhang Qi --- drivers/net/i40e/i40e_ethdev.c | 19 --- drivers/net/i40e/i40e_ethdev.h | 42 ++ 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index acc25a2..fc7e128 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1642,7 +1642,7 @@ i40e_apply_link_speed(struct rte_eth_dev *dev) uint8_t abilities = 0; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_conf *conf = >data->dev_conf; - + enum i40e_aq_link_speed link_speed = i40e_get_link_speed_by_devid(hw->device_id); speed = i40e_parse_link_speeds(conf->link_speeds); abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; if (!(conf->link_speeds & ETH_LINK_SPEED_FIXED)) @@ -1650,7 +1650,7 @@ i40e_apply_link_speed(struct rte_eth_dev *dev) abilities |= I40E_AQ_PHY_LINK_ENABLED; /* Skip changing speed on 40G interfaces, FW does not support */ - if (i40e_is_40G_device(hw->device_id)) { + if (link_speed == I40E_LINK_SPEED_40GB) { speed = I40E_LINK_SPEED_UNKNOWN; abilities |= I40E_AQ_PHY_AN_ENABLED; } @@ -2554,6 +2554,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_vsi *vsi = pf->main_vsi; + enum i40e_aq_link_speed link_speed = I40E_LINK_SPEED_UNKNOWN; dev_info->max_rx_queues = vsi->nb_qps; dev_info->max_tx_queues = vsi->nb_qps; @@ -2624,8 +2625,9 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_queues += dev_info->vmdq_queue_num; dev_info->max_tx_queues += dev_info->vmdq_queue_num; } - - if (i40e_is_40G_device(hw->device_id)) + + link_speed = i40e_get_link_speed_by_devid(hw->device_id); + if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ dev_info->speed_capa = ETH_LINK_SPEED_40G; else @@ -2845,6 +2847,7 @@ i40e_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) [RTE_FC_TX_PAUSE] = I40E_FC_TX_PAUSE, [RTE_FC_FULL] = I40E_FC_FULL }; + enum i40e_aq_link_speed link_speed = I40E_LINK_SPEED_UNKNOWN; /* high_water field in the rte_eth_fc_conf using the kilobytes unit */ @@ -2872,8 +2875,9 @@ i40e_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) err = i40e_set_fc(hw, _failure, true); if (err < 0) return -ENOSYS; - - if (i40e_is_40G_device(hw->device_id)) { + + link_speed = i40e_get_link_speed_by_devid(hw->device_id); + if (link_speed == I40E_LINK_SPEED_40GB) { /* Configure flow control refresh threshold, * the value for stat_tx_pause_refresh_timer[8] * is used for global pause operation. @@ -8069,10 +8073,11 @@ i40e_configure_registers(struct i40e_hw *hw) uint64_t reg; uint32_t i; int ret; + enum i40e_aq_link_speed link_speed = i40e_get_link_speed_by_devid(hw->device_id); for (i = 0; i < RTE_DIM(reg_table); i++) { if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { - if (i40e_is_40G_device(hw->device_id)) /* For XL710 */ + if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ reg_table[i].val = I40E_GL_SWR_PM_UP_THR_SF_VALUE; else /* For X710 */ diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 92c8fad..633bcdf 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -712,4 +712,46 @@ i40e_calc_itr_interval(int16_t interval) (pctype) == I40E_FILTER_PCTYPE_NONF_IPV6_OTHER || \ (pctype) == I40E_FILTER_PCTYPE_L2_PAYLOAD) +static inline enum i40e_aq_link_speed +i40e_get_link_speed_by_devid(u16 dev_id) +{ + switch (dev_id) { + case I40E_DEV_ID_10G_BASE_T: + case I40E_DEV_ID_10G_BASE_T4: +#ifdef X722_SUPPORT +#ifdef X722_A0_SUPPORT + case I40E_DEV_ID_X722_A0: +#if defined(INTEGRATED_VF) || defined(VF_DRIVER) + case I40E_DEV_ID_X722_A0_VF: +#endif +#endif + case I40E_DEV_ID_KX_X722: + case I40E_DEV_ID_QSFP_X722: + case I40E_DEV_ID_SFP_X722: + case I40E_DEV_ID_1G_BASE_T_X722: + case I40E_DEV_ID_10G_BASE_T_X722: + case I
[dpdk-dev] [PATCH v2 0/2] net/i40e: enable 25G device
The patch enable devices that support 25G link speed. It is based on previous 25G base driver update: http://dpdk.org/ml/archives/dev/2016-August/045569.html Zhang Qi (2): net/i40e: add func to check link speed net/i40e: enable 25G device drivers/net/i40e/i40e_ethdev.c | 40 +--- drivers/net/i40e/i40e_ethdev.h | 42 ++ 2 files changed, 71 insertions(+), 11 deletions(-) -- 2.7.4
[dpdk-dev] [PATCH 2/2] net/i40e: enable 25G device
Add code branch for 25G link speed, so 25G device will be functional. Signed-off-by: Zhang Qi --- drivers/net/i40e/i40e_ethdev.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index fc7e128..e5b6554 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1567,6 +1567,8 @@ i40e_parse_link_speeds(uint16_t link_speeds) if (link_speeds & ETH_LINK_SPEED_40G) link_speed |= I40E_LINK_SPEED_40GB; + if (link_speeds & ETH_LINK_SPEED_25G) + link_speed |= I40E_LINK_SPEED_25GB; if (link_speeds & ETH_LINK_SPEED_20G) link_speed |= I40E_LINK_SPEED_20GB; if (link_speeds & ETH_LINK_SPEED_10G) @@ -1592,6 +1594,7 @@ i40e_phy_conf_link(struct i40e_hw *hw, I40E_AQ_PHY_FLAG_PAUSE_RX | I40E_AQ_PHY_FLAG_LOW_POWER; const uint8_t advt = I40E_LINK_SPEED_40GB | + I40E_LINK_SPEED_25GB | I40E_LINK_SPEED_10GB | I40E_LINK_SPEED_1GB | I40E_LINK_SPEED_100MB; @@ -1644,7 +1647,8 @@ i40e_apply_link_speed(struct rte_eth_dev *dev) struct rte_eth_conf *conf = >data->dev_conf; enum i40e_aq_link_speed link_speed = i40e_get_link_speed_by_devid(hw->device_id); speed = i40e_parse_link_speeds(conf->link_speeds); - abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + if (link_speed != I40E_LINK_SPEED_25GB) + abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; if (!(conf->link_speeds & ETH_LINK_SPEED_FIXED)) abilities |= I40E_AQ_PHY_AN_ENABLED; abilities |= I40E_AQ_PHY_LINK_ENABLED; @@ -1746,7 +1750,8 @@ i40e_dev_start(struct rte_eth_dev *dev) /* Apply link configure */ if (dev->data->dev_conf.link_speeds & ~(ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G | - ETH_LINK_SPEED_20G | ETH_LINK_SPEED_40G)) { + ETH_LINK_SPEED_20G | ETH_LINK_SPEED_25G | + ETH_LINK_SPEED_40G)) { PMD_DRV_LOG(ERR, "Invalid link setting"); goto err_up; } @@ -1966,9 +1971,10 @@ static int i40e_dev_set_link_down(struct rte_eth_dev *dev) { uint8_t speed = I40E_LINK_SPEED_UNKNOWN; - uint8_t abilities = I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + uint8_t abilities = 0; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); - + if (i40e_get_link_speed_by_devid(hw->device_id)!=I40E_LINK_SPEED_25GB) + abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; return i40e_phy_conf_link(hw, abilities, speed); } @@ -2026,6 +2032,9 @@ i40e_dev_link_update(struct rte_eth_dev *dev, case I40E_LINK_SPEED_20GB: link.link_speed = ETH_SPEED_NUM_20G; break; + case I40E_LINK_SPEED_25GB: + link.link_speed = ETH_SPEED_NUM_25G; + break; case I40E_LINK_SPEED_40GB: link.link_speed = ETH_SPEED_NUM_40G; break; @@ -2630,6 +2639,9 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ dev_info->speed_capa = ETH_LINK_SPEED_40G; + if (link_speed == I40E_LINK_SPEED_25GB) + /* For XXL710 */ + dev_info->speed_capa = ETH_LINK_SPEED_25G; else /* For X710 */ dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G; @@ -8077,7 +8089,8 @@ i40e_configure_registers(struct i40e_hw *hw) for (i = 0; i < RTE_DIM(reg_table); i++) { if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { - if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ + if (link_speed == I40E_LINK_SPEED_40GB || + link_speed == I40E_LINK_SPEED_25GB) /* For XL710 */ reg_table[i].val = I40E_GL_SWR_PM_UP_THR_SF_VALUE; else /* For X710 */ -- 2.7.4
[dpdk-dev] [PATCH 1/2] net/i40e: add func to check link speed
Add a help function to check link speed by device ID. Replace macro "i40e_is_40G_device" with the new function. Signed-off-by: Zhang Qi --- drivers/net/i40e/i40e_ethdev.c | 19 --- drivers/net/i40e/i40e_ethdev.h | 42 ++ 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index acc25a2..fc7e128 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1642,7 +1642,7 @@ i40e_apply_link_speed(struct rte_eth_dev *dev) uint8_t abilities = 0; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_conf *conf = >data->dev_conf; - + enum i40e_aq_link_speed link_speed = i40e_get_link_speed_by_devid(hw->device_id); speed = i40e_parse_link_speeds(conf->link_speeds); abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK; if (!(conf->link_speeds & ETH_LINK_SPEED_FIXED)) @@ -1650,7 +1650,7 @@ i40e_apply_link_speed(struct rte_eth_dev *dev) abilities |= I40E_AQ_PHY_LINK_ENABLED; /* Skip changing speed on 40G interfaces, FW does not support */ - if (i40e_is_40G_device(hw->device_id)) { + if (link_speed == I40E_LINK_SPEED_40GB) { speed = I40E_LINK_SPEED_UNKNOWN; abilities |= I40E_AQ_PHY_AN_ENABLED; } @@ -2554,6 +2554,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_vsi *vsi = pf->main_vsi; + enum i40e_aq_link_speed link_speed = I40E_LINK_SPEED_UNKNOWN; dev_info->max_rx_queues = vsi->nb_qps; dev_info->max_tx_queues = vsi->nb_qps; @@ -2624,8 +2625,9 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_queues += dev_info->vmdq_queue_num; dev_info->max_tx_queues += dev_info->vmdq_queue_num; } - - if (i40e_is_40G_device(hw->device_id)) + + link_speed = i40e_get_link_speed_by_devid(hw->device_id); + if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ dev_info->speed_capa = ETH_LINK_SPEED_40G; else @@ -2845,6 +2847,7 @@ i40e_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) [RTE_FC_TX_PAUSE] = I40E_FC_TX_PAUSE, [RTE_FC_FULL] = I40E_FC_FULL }; + enum i40e_aq_link_speed link_speed = I40E_LINK_SPEED_UNKNOWN; /* high_water field in the rte_eth_fc_conf using the kilobytes unit */ @@ -2872,8 +2875,9 @@ i40e_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) err = i40e_set_fc(hw, _failure, true); if (err < 0) return -ENOSYS; - - if (i40e_is_40G_device(hw->device_id)) { + + link_speed = i40e_get_link_speed_by_devid(hw->device_id); + if (link_speed == I40E_LINK_SPEED_40GB) { /* Configure flow control refresh threshold, * the value for stat_tx_pause_refresh_timer[8] * is used for global pause operation. @@ -8069,10 +8073,11 @@ i40e_configure_registers(struct i40e_hw *hw) uint64_t reg; uint32_t i; int ret; + enum i40e_aq_link_speed link_speed = i40e_get_link_speed_by_devid(hw->device_id); for (i = 0; i < RTE_DIM(reg_table); i++) { if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { - if (i40e_is_40G_device(hw->device_id)) /* For XL710 */ + if (link_speed == I40E_LINK_SPEED_40GB) /* For XL710 */ reg_table[i].val = I40E_GL_SWR_PM_UP_THR_SF_VALUE; else /* For X710 */ diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 92c8fad..633bcdf 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -712,4 +712,46 @@ i40e_calc_itr_interval(int16_t interval) (pctype) == I40E_FILTER_PCTYPE_NONF_IPV6_OTHER || \ (pctype) == I40E_FILTER_PCTYPE_L2_PAYLOAD) +static inline enum i40e_aq_link_speed +i40e_get_link_speed_by_devid(u16 dev_id) +{ + switch (dev_id) { + case I40E_DEV_ID_10G_BASE_T: + case I40E_DEV_ID_10G_BASE_T4: +#ifdef X722_SUPPORT +#ifdef X722_A0_SUPPORT + case I40E_DEV_ID_X722_A0: +#if defined(INTEGRATED_VF) || defined(VF_DRIVER) + case I40E_DEV_ID_X722_A0_VF: +#endif +#endif + case I40E_DEV_ID_KX_X722: + case I40E_DEV_ID_QSFP_X722: + case I40E_DEV_ID_SFP_X722: + case I40E_DEV_ID_1G_BASE_T_X722: + case I40E_DEV_ID_10G_BASE_T_X722:
[dpdk-dev] [PATCH 0/2] net/i40e: enable 25G device
The patch enable devices that support 25G link speed. It is based on previous 25G base driver update: http://dpdk.org/ml/archives/dev/2016-August/045569.html Zhang Qi (2): net/i40e: add func to check link speed net/i40e: enable 25G device drivers/net/i40e/i40e_ethdev.c | 40 +--- drivers/net/i40e/i40e_ethdev.h | 42 ++ 2 files changed, 71 insertions(+), 11 deletions(-) -- 2.7.4
[dpdk-dev] [PATCH 12/12] net/i40e/base: add FCoE support
Enable FCoE in get PHY capability. Add data structure for FCoE statistics collection. Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_adminq_cmd.h | 12 +- drivers/net/i40e/base/i40e_type.h | 219 2 files changed, 230 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 36e1569..4f06772 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -1768,6 +1768,8 @@ struct i40e_aq_get_phy_abilities_resp { #define I40E_AQ_PHY_LINK_ENABLED 0x08 #define I40E_AQ_PHY_AN_ENABLED 0x10 #define I40E_AQ_PHY_FLAG_MODULE_QUAL 0x20 +#define I40E_AQ_PHY_FEC_ABILITY_KR 0x40 +#define I40E_AQ_PHY_FEC_ABILITY_RS 0x80 __le16 eee_capability; #define I40E_AQ_EEE_100BASE_TX 0x0002 #define I40E_AQ_EEE_1000BASE_T 0x0004 @@ -1811,7 +1813,13 @@ struct i40e_aq_set_phy_config { /* same bits as above in all */ #define I40E_AQ_PHY_TYPE_EXT_25G_CR0X02 #define I40E_AQ_PHY_TYPE_EXT_25G_SR0x04 #define I40E_AQ_PHY_TYPE_EXT_25G_LR0x08 - u8 reserved[2]; + u8 fec_config; +#define I40E_AQ_SET_FEC_ABILITY_KR (1 << 0) +#define I40E_AQ_SET_FEC_ABILITY_RS (1 << 1) +#define I40E_AQ_SET_FEC_REQUEST_KR (1 << 2) +#define I40E_AQ_SET_FEC_REQUEST_RS (1 << 3) +#define I40E_AQ_SET_FEC_AUTO (1 << 4) + u8 reserved; }; I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config); @@ -1901,6 +1909,8 @@ struct i40e_aqc_get_link_status { u8 loopback; /* use defines from i40e_aqc_set_lb_mode */ __le16 max_frame_size; u8 config; +#define I40E_AQ_CONFIG_FEC_KR_ENA 0x01 +#define I40E_AQ_CONFIG_FEC_RS_ENA 0x02 #define I40E_AQ_CONFIG_CRC_ENA 0x04 #define I40E_AQ_CONFIG_PACING_MASK 0x78 u8 power_desc; diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index de3cb2b..b5f72c3 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -1392,6 +1392,23 @@ struct i40e_veb_tc_stats { u64 tc_tx_bytes[I40E_MAX_TRAFFIC_CLASS]; }; +/* Statistics collected per function for FCoE */ +struct i40e_fcoe_stats { + u64 rx_fcoe_packets;/* fcoeprc */ + u64 rx_fcoe_dwords; /* focedwrc */ + u64 rx_fcoe_dropped;/* fcoerpdc */ + u64 tx_fcoe_packets;/* fcoeptc */ + u64 tx_fcoe_dwords; /* focedwtc */ + u64 fcoe_bad_fccrc; /* fcoecrc */ + u64 fcoe_last_error;/* fcoelast */ + u64 fcoe_ddp_count; /* fcoeddpc */ +}; + +/* offset to per function FCoE statistics block */ +#define I40E_FCOE_VF_STAT_OFFSET 0 +#define I40E_FCOE_PF_STAT_OFFSET 128 +#define I40E_FCOE_STAT_MAX (I40E_FCOE_PF_STAT_OFFSET + I40E_MAX_PF) + /* Statistics collected by the MAC */ struct i40e_hw_port_stats { /* eth stats collected by the port */ @@ -1513,6 +1530,208 @@ struct i40e_hw_port_stats { #define I40E_SRRD_SRCTL_ATTEMPTS 10 +/* FCoE Tx context descriptor - Use the i40e_tx_context_desc struct */ + +enum i40E_fcoe_tx_ctx_desc_cmd_bits { + I40E_FCOE_TX_CTX_DESC_OPCODE_SINGLE_SEND= 0x00, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_TSO_FC_CLASS2 = 0x01, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_TSO_FC_CLASS3 = 0x05, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_ETSO_FC_CLASS2 = 0x02, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_ETSO_FC_CLASS3 = 0x06, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_DWO_FC_CLASS2 = 0x03, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_DWO_FC_CLASS3 = 0x07, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_DDP_CTX_INVL = 0x08, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_OPCODE_DWO_CTX_INVL = 0x09, /* 4 BITS */ + I40E_FCOE_TX_CTX_DESC_RELOFF= 0x10, + I40E_FCOE_TX_CTX_DESC_CLRSEQ= 0x20, + I40E_FCOE_TX_CTX_DESC_DIFENA= 0x40, + I40E_FCOE_TX_CTX_DESC_IL2TAG2 = 0x80 +}; + +/* FCoE DIF/DIX Context descriptor */ +struct i40e_fcoe_difdix_context_desc { + __le64 flags_buff0_buff1_ref; + __le64 difapp_msk_bias; +}; + +#define I40E_FCOE_DIFDIX_CTX_QW0_FLAGS_SHIFT 0 +#define I40E_FCOE_DIFDIX_CTX_QW0_FLAGS_MASK(0xFFFULL << \ + I40E_FCOE_DIFDIX_CTX_QW0_FLAGS_SHIFT) + +enum i40e_fcoe_difdix_ctx_desc_flags_bits { + /* 2 BITS */ + I40E_FCOE_DIFDIX_CTX_DESC_RSVD = 0x, + /* 1 BIT */ + I40E_FCOE_DIFDIX_CTX_DESC_APPTYPE_TAGCHK= 0x, + /* 1 BIT */ + I40E_FCOE_DIFDIX_CTX_DESC_APPTYPE_TAGNOTCHK = 0x0004, + /* 2 BITS */ + I4
[dpdk-dev] [PATCH 11/12] net/i40e/base: add function to get SAN MAC address
Add function that reads the adapter's SAN MAC address from NVM Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_common.c| 26 ++ drivers/net/i40e/base/i40e_prototype.h | 1 + 2 files changed, 27 insertions(+) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 40aac06..9a6b3ed 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -1189,6 +1189,32 @@ void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable) } /** + * i40e_get_san_mac_addr - get SAN MAC address + * @hw: pointer to the HW structure + * @mac_addr: pointer to SAN MAC address + * + * Reads the adapter's SAN MAC address from NVM + **/ +enum i40e_status_code i40e_get_san_mac_addr(struct i40e_hw *hw, + u8 *mac_addr) +{ + struct i40e_aqc_mac_address_read_data addrs; + enum i40e_status_code status; + u16 flags = 0; + + status = i40e_aq_mac_address_read(hw, , , NULL); + if (status) + return status; + + if (flags & I40E_AQC_SAN_ADDR_VALID) + memcpy(mac_addr, _san_mac, sizeof(addrs.pf_san_mac)); + else + status = I40E_ERR_INVALID_MAC_ADDR; + + return status; +} + +/** * i40e_read_pba_string - Reads part number string from EEPROM * @hw: pointer to hardware structure * @pba_num: stores the part number string from the EEPROM diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h index f17636b..3aab5ca 100644 --- a/drivers/net/i40e/base/i40e_prototype.h +++ b/drivers/net/i40e/base/i40e_prototype.h @@ -440,6 +440,7 @@ enum i40e_status_code i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr); enum i40e_status_code i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num, u32 pba_num_size); void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable); +enum i40e_status_code i40e_get_san_mac_addr(struct i40e_hw *hw, u8 *mac_addr); enum i40e_aq_link_speed i40e_get_link_speed(struct i40e_hw *hw); /* prototype for functions used for NVM access */ enum i40e_status_code i40e_init_nvm(struct i40e_hw *hw); -- 2.7.4
[dpdk-dev] [PATCH 10/12] net/i40e: minor changes for clean up
Remove unused device ID. Remove unused compile option. Adjust code alignment. Standardize macros. Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_common.c | 18 -- drivers/net/i40e/base/i40e_devids.h | 1 - drivers/net/i40e/base/i40e_type.h | 6 -- drivers/net/i40e/i40e_ethdev.c | 1 - 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index ff64dca..40aac06 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -81,7 +81,6 @@ STATIC enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw) case I40E_DEV_ID_1G_BASE_T_X722: case I40E_DEV_ID_10G_BASE_T_X722: case I40E_DEV_ID_SFP_I_X722: - case I40E_DEV_ID_QSFP_I_X722: hw->mac.type = I40E_MAC_X722; break; #endif @@ -383,8 +382,7 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, d_buf[j] = buf[i]; i40e_debug(hw, mask, "\t0x%04X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", - i_sav, d_buf[0], d_buf[1], - d_buf[2], d_buf[3], + i_sav, d_buf[0], d_buf[1], d_buf[2], d_buf[3], d_buf[4], d_buf[5], d_buf[6], d_buf[7], d_buf[8], d_buf[9], d_buf[10], d_buf[11], d_buf[12], d_buf[13], d_buf[14], d_buf[15]); @@ -3822,16 +3820,8 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, if (p->fcoe) i40e_debug(hw, I40E_DEBUG_ALL, "device is FCoE capable\n"); -#ifdef I40E_FCOE_ENA - /* Software override ensuring FCoE is disabled if npar or mfp -* mode because it is not supported in these modes. -*/ - if (p->npar_enable || p->flex10_enable) - p->fcoe = false; -#else /* Always disable FCoE if compiled without the I40E_FCOE_ENA flag */ p->fcoe = false; -#endif /* count the enabled ports (aka the "not disabled" ports) */ hw->num_ports = 0; @@ -5482,12 +5472,12 @@ STATIC void i40e_fix_up_geneve_vni( u16 tnl_type; u32 ti; - tnl_type = (le16_to_cpu(f[i].flags) & + tnl_type = (LE16_TO_CPU(f[i].flags) & I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK) >> I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT; if (tnl_type == I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE) { - ti = le32_to_cpu(f[i].tenant_id); - f[i].tenant_id = cpu_to_le32(ti << 8); + ti = LE32_TO_CPU(f[i].tenant_id); + f[i].tenant_id = CPU_TO_LE32(ti << 8); } } } diff --git a/drivers/net/i40e/base/i40e_devids.h b/drivers/net/i40e/base/i40e_devids.h index ed73e1d..8bd5793 100644 --- a/drivers/net/i40e/base/i40e_devids.h +++ b/drivers/net/i40e/base/i40e_devids.h @@ -68,7 +68,6 @@ POSSIBILITY OF SUCH DAMAGE. #define I40E_DEV_ID_1G_BASE_T_X722 0x37D1 #define I40E_DEV_ID_10G_BASE_T_X7220x37D2 #define I40E_DEV_ID_SFP_I_X722 0x37D3 -#define I40E_DEV_ID_QSFP_I_X7220x37D4 #if defined(INTEGRATED_VF) || defined(VF_DRIVER) || defined(I40E_NDIS_SUPPORT) #define I40E_DEV_ID_X722_VF0x37CD #define I40E_DEV_ID_X722_VF_HV 0x37D9 diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index 86c072d..de3cb2b 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -157,8 +157,10 @@ enum i40e_debug_mask { #define I40E_PCI_LINK_SPEED_5000 0x2 #define I40E_PCI_LINK_SPEED_8000 0x3 -#define I40E_MDIO_STCODE 0 -#define I40E_MDIO_OPCODE_ADDRESS 0 +#define I40E_MDIO_STCODE I40E_MASK(0, \ + I40E_GLGEN_MSCA_STCODE_SHIFT) +#define I40E_MDIO_OPCODE_ADDRESS I40E_MASK(0, \ + I40E_GLGEN_MSCA_OPCODE_SHIFT) #define I40E_MDIO_OPCODE_WRITE I40E_MASK(1, \ I40E_GLGEN_MSCA_OPCODE_SHIFT) #define I40E_MDIO_OPCODE_READ_INC_ADDR I40E_MASK(2, \ diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index d0aeb70..acc25a2 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -474,7 +474,6 @@ static const struct rte_pci_id pci_id_i40e_map[] = { { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722) }, { RTE_PCI_DEVICE(I
[dpdk-dev] [PATCH 09/12] net/i40e/base: enable proxy cmd for x722
Fill the data structure for set proxying configuration command table entry for X722 Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_adminq_cmd.h | 38 ++--- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index a1594eb..36e1569 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -475,13 +475,15 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration); /* Set ARP Proxy command / response (indirect 0x0104) */ struct i40e_aqc_arp_proxy_data { __le16 command_flags; -#define I40E_AQ_ARP_INIT_IPV4 0x0008 -#define I40E_AQ_ARP_UNSUP_CTL 0x0010 -#define I40E_AQ_ARP_ENA0x0020 -#define I40E_AQ_ARP_ADD_IPV4 0x0040 -#define I40E_AQ_ARP_DEL_IPV4 0x0080 +#define I40E_AQ_ARP_INIT_IPV4 0x0800 +#define I40E_AQ_ARP_UNSUP_CTL 0x1000 +#define I40E_AQ_ARP_ENA0x2000 +#define I40E_AQ_ARP_ADD_IPV4 0x4000 +#define I40E_AQ_ARP_DEL_IPV4 0x8000 __le16 table_id; - __le32 pfpm_proxyfc; + __le32 enabled_offloads; +#define I40E_AQ_ARP_DIRECTED_OFFLOAD_ENABLE0x0020 +#define I40E_AQ_ARP_OFFLOAD_ENABLE 0x0800 __le32 ip_addr; u8 mac_addr[6]; u8 reserved[2]; @@ -496,17 +498,19 @@ struct i40e_aqc_ns_proxy_data { __le16 table_idx_ipv6_0; __le16 table_idx_ipv6_1; __le16 control; -#define I40E_AQ_NS_PROXY_ADD_0 0x0100 -#define I40E_AQ_NS_PROXY_DEL_0 0x0200 -#define I40E_AQ_NS_PROXY_ADD_1 0x0400 -#define I40E_AQ_NS_PROXY_DEL_1 0x0800 -#define I40E_AQ_NS_PROXY_ADD_IPV6_00x1000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_00x2000 -#define I40E_AQ_NS_PROXY_ADD_IPV6_10x4000 -#define I40E_AQ_NS_PROXY_DEL_IPV6_10x8000 -#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0001 -#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0002 -#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0004 +#define I40E_AQ_NS_PROXY_ADD_0 0x0001 +#define I40E_AQ_NS_PROXY_DEL_0 0x0002 +#define I40E_AQ_NS_PROXY_ADD_1 0x0004 +#define I40E_AQ_NS_PROXY_DEL_1 0x0008 +#define I40E_AQ_NS_PROXY_ADD_IPV6_00x0010 +#define I40E_AQ_NS_PROXY_DEL_IPV6_00x0020 +#define I40E_AQ_NS_PROXY_ADD_IPV6_10x0040 +#define I40E_AQ_NS_PROXY_DEL_IPV6_10x0080 +#define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0100 +#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0200 +#define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0400 +#define I40E_AQ_NS_PROXY_OFFLOAD_ENABLE0x0800 +#define I40E_AQ_NS_PROXY_DIRECTED_OFFLOAD_ENABLE 0x1000 u8 mac_addr_0[6]; u8 mac_addr_1[6]; u8 local_mac_addr[6]; -- 2.7.4
[dpdk-dev] [PATCH 08/12] net/i40e/base: add multicast magic packet enable flag
Add a definiation for multicast magic packet enable flag Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_adminq_cmd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 271bebe..a1594eb 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -556,6 +556,7 @@ I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_address_read_data); /* Manage MAC Address Write Command (0x0108) */ struct i40e_aqc_mac_address_write { __le16 command_flags; +#define I40E_AQC_MC_MAG_EN 0x0100 #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x #define I40E_AQC_WRITE_TYPE_LAA_WOL0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -- 2.7.4
[dpdk-dev] [PATCH 07/12] net/i40e/base: enable set/get HMC resource profile
Enable admin queue command that can get or set HMC resource profile Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_adminq_cmd.h | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 271f9b5..271bebe 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -224,6 +224,9 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_suspend_port_tx= 0x041B, i40e_aqc_opc_resume_port_tx = 0x041C, i40e_aqc_opc_configure_partition_bw = 0x041D, + /* hmc */ + i40e_aqc_opc_query_hmc_resource_profile = 0x0500, + i40e_aqc_opc_set_hmc_resource_profile = 0x0501, /* phy commands*/ i40e_aqc_opc_get_phy_abilities = 0x0600, @@ -1663,6 +1666,24 @@ struct i40e_aqc_configure_partition_bw_data { I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data); +/* Get and set the active HMC resource profile and status. + * (direct 0x0500) and (direct 0x0501) + */ +struct i40e_aq_get_set_hmc_resource_profile { + u8 pm_profile; + u8 pe_vf_enabled; + u8 reserved[14]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile); + +enum i40e_aq_hmc_profile { + /* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */ + I40E_HMC_PROFILE_DEFAULT= 1, + I40E_HMC_PROFILE_FAVOR_VF = 2, + I40E_HMC_PROFILE_EQUAL = 3, +}; + /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */ /* set in param0 for get phy abilities to report qualified modules */ -- 2.7.4
[dpdk-dev] [PATCH 06/12] net/i40e/base: enable wake on LAN for X722
Add macro and data structure to support wake on LAN feature for X722. Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_adminq_cmd.h | 36 + 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 4ae4315..271f9b5 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -196,6 +196,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_remove_control_packet_filter = 0x025B, i40e_aqc_opc_add_cloud_filters = 0x025C, i40e_aqc_opc_remove_cloud_filters = 0x025D, + i40e_aqc_opc_clear_wol_switch_filters = 0x025E, i40e_aqc_opc_add_mirror_rule= 0x0260, i40e_aqc_opc_delete_mirror_rule = 0x0261, @@ -581,9 +582,18 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe); struct i40e_aqc_set_wol_filter { __le16 filter_index; #define I40E_AQC_MAX_NUM_WOL_FILTERS 8 +#define I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_SHIFT 15 +#define I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_MASK(0x1 << \ + I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_SHIFT) + +#define I40E_AQC_SET_WOL_FILTER_INDEX_SHIFT0 +#define I40E_AQC_SET_WOL_FILTER_INDEX_MASK (0x7 << \ + I40E_AQC_SET_WOL_FILTER_INDEX_SHIFT) __le16 cmd_flags; #define I40E_AQC_SET_WOL_FILTER0x8000 #define I40E_AQC_SET_WOL_FILTER_NO_TCO_WOL 0x4000 +#define I40E_AQC_SET_WOL_FILTER_ACTION_CLEAR 0 +#define I40E_AQC_SET_WOL_FILTER_ACTION_SET 1 __le16 valid_flags; #define I40E_AQC_SET_WOL_FILTER_ACTION_VALID 0x8000 #define I40E_AQC_SET_WOL_FILTER_NO_TCO_ACTION_VALID0x4000 @@ -594,23 +604,29 @@ struct i40e_aqc_set_wol_filter { I40E_CHECK_CMD_LENGTH(i40e_aqc_set_wol_filter); +struct i40e_aqc_set_wol_filter_data { + u8 filter[128]; + u8 mask[16]; +}; + +I40E_CHECK_STRUCT_LEN(0x90, i40e_aqc_set_wol_filter_data); + /* Get Wake Reason (0x0121) */ struct i40e_aqc_get_wake_reason_completion { u8 reserved_1[2]; __le16 wake_reason; +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_SHIFT 0 +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_MASK (0xFF << \ + I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_SHIFT) +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_SHIFT 8 +#define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_MASK (0xFF << \ + I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_SHIFT) u8 reserved_2[12]; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_get_wake_reason_completion); -struct i40e_aqc_set_wol_filter_data { - u8 filter[128]; - u8 mask[16]; -}; - -I40E_CHECK_STRUCT_LEN(0x90, i40e_aqc_set_wol_filter_data); - #endif /* X722_SUPPORT */ /* Switch configuration commands (0x02xx) */ @@ -694,6 +710,8 @@ struct i40e_aqc_set_port_parameters { #define I40E_AQ_SET_P_PARAMS_PAD_SHORT_PACKETS 2 /* must set! */ #define I40E_AQ_SET_P_PARAMS_DOUBLE_VLAN_ENA 4 __le16 bad_frame_vsi; +#define I40E_AQ_SET_P_PARAMS_BFRAME_SEID_SHIFT 0x0 +#define I40E_AQ_SET_P_PARAMS_BFRAME_SEID_MASK 0x3FF __le16 default_seid;/* reserved for command */ u8 reserved[10]; }; @@ -745,6 +763,7 @@ I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp); /* Set Switch Configuration (direct 0x0205) */ struct i40e_aqc_set_switch_config { __le16 flags; +/* flags used for both fields below */ #define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 __le16 valid_flags; @@ -1858,11 +1877,12 @@ struct i40e_aqc_get_link_status { u8 config; #define I40E_AQ_CONFIG_CRC_ENA 0x04 #define I40E_AQ_CONFIG_PACING_MASK 0x78 - u8 external_power_ability; + u8 power_desc; #define I40E_AQ_LINK_POWER_CLASS_1 0x00 #define I40E_AQ_LINK_POWER_CLASS_2 0x01 #define I40E_AQ_LINK_POWER_CLASS_3 0x02 #define I40E_AQ_LINK_POWER_CLASS_4 0x03 +#define I40E_AQ_PWR_CLASS_MASK 0x03 u8 reserved[4]; }; -- 2.7.4
[dpdk-dev] [PATCH 05/12] net/i40e/base: enable 25G get PHY abilities
Add extended PHY types to get PHY abilities command response struct for 25G, then put PHY types for 25g into the proper PHY_Type_Ext field. Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_adminq_cmd.h | 15 +-- drivers/net/i40e/base/i40e_common.c | 4 +++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 2831593..4ae4315 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -1733,7 +1733,13 @@ struct i40e_aq_get_phy_abilities_resp { __le32 eeer_val; u8 d3_lpan; #define I40E_AQ_SET_PHY_D3_LPAN_ENA0x01 - u8 reserved[3]; + u8 phy_type_ext; +#define I40E_AQ_PHY_TYPE_EXT_25G_KR0X01 +#define I40E_AQ_PHY_TYPE_EXT_25G_CR0X02 +#define I40E_AQ_PHY_TYPE_EXT_25G_SR0x04 +#define I40E_AQ_PHY_TYPE_EXT_25G_LR0x08 + u8 mod_type_ext; + u8 ext_comp_code; u8 phy_id[4]; u8 module_type[3]; u8 qualified_module_count; @@ -1755,7 +1761,12 @@ struct i40e_aq_set_phy_config { /* same bits as above in all */ __le16 eee_capability; __le32 eeer; u8 low_power_ctrl; - u8 reserved[3]; + u8 phy_type_ext; +#define I40E_AQ_PHY_TYPE_EXT_25G_KR0X01 +#define I40E_AQ_PHY_TYPE_EXT_25G_CR0X02 +#define I40E_AQ_PHY_TYPE_EXT_25G_SR0x04 +#define I40E_AQ_PHY_TYPE_EXT_25G_LR0x08 + u8 reserved[2]; }; I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config); diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 1de0e39..ff64dca 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -1670,8 +1670,10 @@ enum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw, if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) status = I40E_ERR_UNKNOWN_PHY; - if (report_init) + if (report_init) { hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type); + hw->phy.phy_types |= ((u64)abilities->phy_type_ext << 32); + } return status; } -- 2.7.4
[dpdk-dev] [PATCH 04/12] net/i40e/base: add 25G PHY capability support
Add PHY type macros for 25G PHY capabilities. Change data type and bit setting defines for 25G. Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_adminq_cmd.h | 11 ++- drivers/net/i40e/base/i40e_type.h | 6 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 2b7a760..2831593 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -1691,6 +1691,7 @@ enum i40e_aq_phy_type { #define I40E_LINK_SPEED_10GB_SHIFT 0x3 #define I40E_LINK_SPEED_40GB_SHIFT 0x4 #define I40E_LINK_SPEED_20GB_SHIFT 0x5 +#define I40E_LINK_SPEED_25GB_SHIFT 0x6 enum i40e_aq_link_speed { I40E_LINK_SPEED_UNKNOWN = 0, @@ -1698,7 +1699,8 @@ enum i40e_aq_link_speed { I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT), I40E_LINK_SPEED_10GB= (1 << I40E_LINK_SPEED_10GB_SHIFT), I40E_LINK_SPEED_40GB= (1 << I40E_LINK_SPEED_40GB_SHIFT), - I40E_LINK_SPEED_20GB= (1 << I40E_LINK_SPEED_20GB_SHIFT) + I40E_LINK_SPEED_20GB= (1 << I40E_LINK_SPEED_20GB_SHIFT), + I40E_LINK_SPEED_25GB= (1 << I40E_LINK_SPEED_25GB_SHIFT), }; struct i40e_aqc_module_desc { @@ -1833,6 +1835,13 @@ struct i40e_aqc_get_link_status { #define I40E_AQ_LINK_TX_DRAINED0x01 #define I40E_AQ_LINK_TX_FLUSHED0x03 #define I40E_AQ_LINK_FORCED_40G0x10 +/* 25G Error Codes */ +#define I40E_AQ_25G_NO_ERR 0X00 +#define I40E_AQ_25G_NOT_PRESENT0X01 +#define I40E_AQ_25G_NVM_CRC_ERR0X02 +#define I40E_AQ_25G_SBUS_UCODE_ERR 0X03 +#define I40E_AQ_25G_SERDES_UCODE_ERR 0X04 +#define I40E_AQ_25G_NIMB_UCODE_ERR 0X05 u8 loopback; /* use defines from i40e_aqc_set_lb_mode */ __le16 max_frame_size; u8 config; diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index 51abc37..86c072d 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -298,7 +298,7 @@ struct i40e_phy_info { bool get_link_info; enum i40e_media_type media_type; /* all the phy types the NVM is capable of */ - u32 phy_types; + u64 phy_types; }; #define I40E_CAP_PHY_TYPE_SGMII BIT_ULL(I40E_PHY_TYPE_SGMII) @@ -330,6 +330,10 @@ struct i40e_phy_info { #define I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL \ BIT_ULL(I40E_PHY_TYPE_1000BASE_T_OPTICAL) #define I40E_CAP_PHY_TYPE_20GBASE_KR2 BIT_ULL(I40E_PHY_TYPE_20GBASE_KR2) +#define I40E_CAP_PHY_TYPE_25GBASE_KR BIT_ULL(I40E_AQ_PHY_TYPE_EXT_25G_KR + 32) +#define I40E_CAP_PHY_TYPE_25GBASE_CR BIT_ULL(I40E_AQ_PHY_TYPE_EXT_25G_CR + 32) +#define I40E_CAP_PHY_TYPE_25GBASE_SR BIT_ULL(I40E_AQ_PHY_TYPE_EXT_25G_SR + 32) +#define I40E_CAP_PHY_TYPE_25GBASE_LR BIT_ULL(I40E_AQ_PHY_TYPE_EXT_25G_LR + 32) #define I40E_HW_CAP_MAX_GPIO 30 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO0 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C 1 -- 2.7.4
[dpdk-dev] [PATCH 03/12] net/i40e/base: define macros for PHY type cap
Define macros for PHY type capabilities to replace exist enum type. Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_type.h | 60 +++ 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index 5349419..51abc37 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -292,37 +292,6 @@ struct i40e_link_status { #define I40E_MODULE_TYPE_1000BASE_T0x08 }; -enum i40e_aq_capabilities_phy_type { - I40E_CAP_PHY_TYPE_SGMII = BIT(I40E_PHY_TYPE_SGMII), - I40E_CAP_PHY_TYPE_1000BASE_KX = BIT(I40E_PHY_TYPE_1000BASE_KX), - I40E_CAP_PHY_TYPE_10GBASE_KX4 = BIT(I40E_PHY_TYPE_10GBASE_KX4), - I40E_CAP_PHY_TYPE_10GBASE_KR= BIT(I40E_PHY_TYPE_10GBASE_KR), - I40E_CAP_PHY_TYPE_40GBASE_KR4 = BIT(I40E_PHY_TYPE_40GBASE_KR4), - I40E_CAP_PHY_TYPE_XAUI = BIT(I40E_PHY_TYPE_XAUI), - I40E_CAP_PHY_TYPE_XFI = BIT(I40E_PHY_TYPE_XFI), - I40E_CAP_PHY_TYPE_SFI = BIT(I40E_PHY_TYPE_SFI), - I40E_CAP_PHY_TYPE_XLAUI = BIT(I40E_PHY_TYPE_XLAUI), - I40E_CAP_PHY_TYPE_XLPPI = BIT(I40E_PHY_TYPE_XLPPI), - I40E_CAP_PHY_TYPE_40GBASE_CR4_CU= BIT(I40E_PHY_TYPE_40GBASE_CR4_CU), - I40E_CAP_PHY_TYPE_10GBASE_CR1_CU= BIT(I40E_PHY_TYPE_10GBASE_CR1_CU), - I40E_CAP_PHY_TYPE_10GBASE_AOC = BIT(I40E_PHY_TYPE_10GBASE_AOC), - I40E_CAP_PHY_TYPE_40GBASE_AOC = BIT(I40E_PHY_TYPE_40GBASE_AOC), - I40E_CAP_PHY_TYPE_100BASE_TX= BIT(I40E_PHY_TYPE_100BASE_TX), - I40E_CAP_PHY_TYPE_1000BASE_T= BIT(I40E_PHY_TYPE_1000BASE_T), - I40E_CAP_PHY_TYPE_10GBASE_T = BIT(I40E_PHY_TYPE_10GBASE_T), - I40E_CAP_PHY_TYPE_10GBASE_SR= BIT(I40E_PHY_TYPE_10GBASE_SR), - I40E_CAP_PHY_TYPE_10GBASE_LR= BIT(I40E_PHY_TYPE_10GBASE_LR), - I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU = BIT(I40E_PHY_TYPE_10GBASE_SFPP_CU), - I40E_CAP_PHY_TYPE_10GBASE_CR1 = BIT(I40E_PHY_TYPE_10GBASE_CR1), - I40E_CAP_PHY_TYPE_40GBASE_CR4 = BIT(I40E_PHY_TYPE_40GBASE_CR4), - I40E_CAP_PHY_TYPE_40GBASE_SR4 = BIT(I40E_PHY_TYPE_40GBASE_SR4), - I40E_CAP_PHY_TYPE_40GBASE_LR4 = BIT(I40E_PHY_TYPE_40GBASE_LR4), - I40E_CAP_PHY_TYPE_1000BASE_SX = BIT(I40E_PHY_TYPE_1000BASE_SX), - I40E_CAP_PHY_TYPE_1000BASE_LX = BIT(I40E_PHY_TYPE_1000BASE_LX), - I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL= BIT(I40E_PHY_TYPE_1000BASE_T_OPTICAL), - I40E_CAP_PHY_TYPE_20GBASE_KR2 = BIT(I40E_PHY_TYPE_20GBASE_KR2) -}; - struct i40e_phy_info { struct i40e_link_status link_info; struct i40e_link_status link_info_old; @@ -332,6 +301,35 @@ struct i40e_phy_info { u32 phy_types; }; +#define I40E_CAP_PHY_TYPE_SGMII BIT_ULL(I40E_PHY_TYPE_SGMII) +#define I40E_CAP_PHY_TYPE_1000BASE_KX BIT_ULL(I40E_PHY_TYPE_1000BASE_KX) +#define I40E_CAP_PHY_TYPE_10GBASE_KX4 BIT_ULL(I40E_PHY_TYPE_10GBASE_KX4) +#define I40E_CAP_PHY_TYPE_10GBASE_KR BIT_ULL(I40E_PHY_TYPE_10GBASE_KR) +#define I40E_CAP_PHY_TYPE_40GBASE_KR4 BIT_ULL(I40E_PHY_TYPE_40GBASE_KR4) +#define I40E_CAP_PHY_TYPE_XAUI BIT_ULL(I40E_PHY_TYPE_XAUI) +#define I40E_CAP_PHY_TYPE_XFI BIT_ULL(I40E_PHY_TYPE_XFI) +#define I40E_CAP_PHY_TYPE_SFI BIT_ULL(I40E_PHY_TYPE_SFI) +#define I40E_CAP_PHY_TYPE_XLAUI BIT_ULL(I40E_PHY_TYPE_XLAUI) +#define I40E_CAP_PHY_TYPE_XLPPI BIT_ULL(I40E_PHY_TYPE_XLPPI) +#define I40E_CAP_PHY_TYPE_40GBASE_CR4_CU BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4_CU) +#define I40E_CAP_PHY_TYPE_10GBASE_CR1_CU BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU) +#define I40E_CAP_PHY_TYPE_10GBASE_AOC BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC) +#define I40E_CAP_PHY_TYPE_40GBASE_AOC BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) +#define I40E_CAP_PHY_TYPE_100BASE_TX BIT_ULL(I40E_PHY_TYPE_100BASE_TX) +#define I40E_CAP_PHY_TYPE_1000BASE_T BIT_ULL(I40E_PHY_TYPE_1000BASE_T) +#define I40E_CAP_PHY_TYPE_10GBASE_T BIT_ULL(I40E_PHY_TYPE_10GBASE_T) +#define I40E_CAP_PHY_TYPE_10GBASE_SR BIT_ULL(I40E_PHY_TYPE_10GBASE_SR) +#define I40E_CAP_PHY_TYPE_10GBASE_LR BIT_ULL(I40E_PHY_TYPE_10GBASE_LR) +#define I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU BIT_ULL(I40E_PHY_TYPE_10GBASE_SFPP_CU) +#define I40E_CAP_PHY_TYPE_10GBASE_CR1 BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1) +#define I40E_CAP_PHY_TYPE_40GBASE_CR4 BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4) +#define I40E_CAP_PHY_TYPE_40GBASE_SR4 BIT_ULL(I40E_PHY_TYPE_40GBASE_SR4) +#define I40E_CAP_PHY_TYPE_40GBASE_LR4 BIT_ULL(I40E_PHY_TYPE_40GBASE_LR4) +#define I40E_CAP_PHY_TYPE_1000BASE_SX BIT_ULL(I40E_PHY_TYPE_1000BASE_SX) +#define I40E_CAP_PHY_TYPE_1000BASE_LX BIT_ULL(I40E_PHY_TYPE_1000BASE_LX) +#define I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL \ + BIT_ULL
[dpdk-dev] [PATCH 02/12] net/i40e/base: fix UDP packet header
Correct Rx ptype payload layer for non_tunneled ipv6. Fixes: 8db9e2a1b232 ("i40e: base driver") Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index a442067..1de0e39 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -773,7 +773,7 @@ struct i40e_rx_ptype_decoded i40e_ptype_lookup[] = { /* Non Tunneled IPv6 */ I40E_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3), I40E_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3), - I40E_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY3), + I40E_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY4), I40E_PTT_UNUSED_ENTRY(91), I40E_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP, PAY4), I40E_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4), -- 2.7.4
[dpdk-dev] [PATCH 01/12] net/i40e/base: add function to clear default VSI
Add function that help to return the VSI to Promiscuous Unicast mode. Signed-off-by: Zhang Qi --- drivers/net/i40e/base/i40e_common.c| 28 drivers/net/i40e/base/i40e_prototype.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 98ed4b6..a442067 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -2215,6 +2215,34 @@ enum i40e_status_code i40e_aq_set_default_vsi(struct i40e_hw *hw, } /** + * i40e_aq_clear_default_vsi + * @hw: pointer to the hw struct + * @seid: vsi number + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_clear_default_vsi(struct i40e_hw *hw, + u16 seid, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *) + + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(, + i40e_aqc_opc_set_vsi_promiscuous_modes); + + cmd->promiscuous_flags = CPU_TO_LE16(0); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_DEFAULT); + cmd->seid = CPU_TO_LE16(seid); + + status = i40e_asq_send_command(hw, , NULL, 0, cmd_details); + + return status; +} + +/** * i40e_aq_set_vsi_unicast_promiscuous * @hw: pointer to the hw struct * @seid: vsi number diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h index 03dda93..f17636b 100644 --- a/drivers/net/i40e/base/i40e_prototype.h +++ b/drivers/net/i40e/base/i40e_prototype.h @@ -124,6 +124,8 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_clear_default_vsi(struct i40e_hw *hw, u16 vsi_id, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw, bool qualified_modules, bool report_init, struct i40e_aq_get_phy_abilities_resp *abilities, -- 2.7.4
[dpdk-dev] [PATCH 00/12] net/i40e: share code update
The patch enable 25G PHY support, add WoL and proxy configure feature for X722 and other features for all i40e familiy. Zhang Qi (12): net/i40e/base: add function to clear default VSI net/i40e/base: fix UDP packet header net/i40e/base: define macros for PHY type caps net/i40e/base: add 25G PHY capability support net/i40e/base: enable 25G get PHY abilities net/i40e/base: enable wake on LAN for X722 net/i40e/base: enable set/get HMC resource profile net/i40e/base: add multicast magic packet enable flag net/i40e/base: enable proxy cfg cmd for X722 net/i40e: minor changes for clean up net/i40e/base: add function to get SAN MAC address net/i40e/base: add FCoE support drivers/net/i40e/base/i40e_adminq_cmd.h | 132 +++--- drivers/net/i40e/base/i40e_common.c | 78 +++-- drivers/net/i40e/base/i40e_devids.h | 1 - drivers/net/i40e/base/i40e_prototype.h | 3 + drivers/net/i40e/base/i40e_type.h | 295 drivers/net/i40e/i40e_ethdev.c | 1 - 6 files changed, 428 insertions(+), 82 deletions(-) -- 2.7.4