[dpdk-dev] [PATCH 1/3] fm10k: enable FTAG based forwarding

Wang, Xiao W xiao.w.wang at intel.com
Tue Feb 2 11:03:15 CET 2016



> -----Original Message-----
> From: Qiu, Michael
> Sent: Tuesday, February 2, 2016 11:07 AM
> To: Wang, Xiao W <xiao.w.wang at intel.com>; Chen, Jing D
> <jing.d.chen at intel.com>
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/3] fm10k: enable FTAG based forwarding
> 
> On 1/25/2016 4:08 PM, Wang Xiao W wrote:
> > This patch enables reading sglort info into mbuf for RX and inserting
> > an FTAG at the beginning of the packet for TX. The vlan_tci_outer
> > field selected from rte_mbuf structure for sglort is not used in fm10k now.
> > In FTAG based forwarding mode, the switch will forward packets
> > according to glort info in FTAG rather than mac and vlan table.
> >
> > To activate this feature, user needs to turn
> > ``CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD``
> > to y in common_linuxapp or common_bsdapp. Currently this feature is
> > supported only on PF, because FM10K_PFVTCTL register is read-only for VF.
> >
> > Signed-off-by: Wang Xiao W <xiao.w.wang at intel.com>
> > ---
> >  config/common_bsdapp               |  1 +
> >  config/common_linuxapp             |  1 +
> >  drivers/net/fm10k/fm10k_ethdev.c   |  8 ++++++++
> >  drivers/net/fm10k/fm10k_rxtx.c     | 17 +++++++++++++++++
> >  drivers/net/fm10k/fm10k_rxtx_vec.c |  9 +++++++++
> >  5 files changed, 36 insertions(+)
> >
> > diff --git a/config/common_bsdapp b/config/common_bsdapp index
> > ed7c31c..451f81a 100644
> > --- a/config/common_bsdapp
> > +++ b/config/common_bsdapp
> > @@ -208,6 +208,7 @@ CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX=n
> >  CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX_FREE=n
> >  CONFIG_RTE_LIBRTE_FM10K_DEBUG_DRIVER=n
> >  CONFIG_RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=y
> > +CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD=n
> >
> >  #
> >  # Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD diff --git
> > a/config/common_linuxapp b/config/common_linuxapp index
> > 74bc515..c928bce 100644
> > --- a/config/common_linuxapp
> > +++ b/config/common_linuxapp
> > @@ -207,6 +207,7 @@ CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX_FREE=n
> >  CONFIG_RTE_LIBRTE_FM10K_DEBUG_DRIVER=n
> >  CONFIG_RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=y
> >  CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR=y
> > +CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD=n
> >
> >  #
> >  # Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD diff --git
> > a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
> > index e4aed94..cc8317f 100644
> > --- a/drivers/net/fm10k/fm10k_ethdev.c
> > +++ b/drivers/net/fm10k/fm10k_ethdev.c
> > @@ -668,6 +668,14 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)
> >  			PMD_INIT_LOG(ERR, "failed to disable queue %d", i);
> >  			return -1;
> >  		}
> > +#ifdef RTE_LIBRTE_FM10K_FTAG_FWD
> > +		/* Enable use of FTAG bit in TX descriptor, PFVTCTL
> > +		 * register is read-only for VF.
> > +		 */
> > +		if (hw->mac.type == fm10k_mac_pf)
> > +			FM10K_WRITE_REG(hw, FM10K_PFVTCTL(i),
> > +
> 	FM10K_PFVTCTL_FTAG_DESC_ENABLE);
> 
> So here if somebody enable FTAG, when compile, but he use VF, what will
> happen? We'd better to give a error message when he try to use VF with FTAG.
> 
> Thanks,
> Michael

Yes, we'd better to give an error message and return failure in this use case, I'll
rework the patch. Thanks for your comment. 

Best Regards,
Wang, Xiao W


More information about the dev mailing list