> -----Original Message----- > From: Richardson, Bruce > Sent: Tuesday, May 1, 2018 2:53 PM > To: Ananyev, Konstantin <konstantin.anan...@intel.com> > Cc: Xing, Beilei <beilei.x...@intel.com>; Zhang, Qi Z <qi.z.zh...@intel.com>; > dev@dpdk.org; Yigit, Ferruh <ferruh.yi...@intel.com> > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix Tx fn selection when using new > ethdev offloads > > On Tue, May 01, 2018 at 02:24:39PM +0100, Ananyev, Konstantin wrote: > > Hi Bruce, > > > > > > > > The Tx function selection code in the driver only used the older txq > > > flags values to check whether the scalar or vector functions should be > > > used. This caused performance regressions with testpmd io-fwd as the > > > scalar path rather than the vector one was being used in the default > > > case. Fix this by changing the code to take account of new offloads and > > > deleting the defines used for the old ones. > > > > > > Fixes: 7497d3e2f777 ("net/i40e: convert to new Tx offloads API") > > > > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > > > --- > > > drivers/net/i40e/i40e_rxtx.c | 45 > > > +++++++++++++++++++++++--------------------- > > > 1 file changed, 24 insertions(+), 21 deletions(-) > > > > > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > > > index ec1ce54ca..c523af575 100644 > > > --- a/drivers/net/i40e/i40e_rxtx.c > > > +++ b/drivers/net/i40e/i40e_rxtx.c > > > @@ -40,9 +40,6 @@ > > > /* Base address of the HW descriptor ring should be 128B aligned. */ > > > #define I40E_RING_BASE_ALIGN 128 > > > > > > -#define I40E_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \ > > > - ETH_TXQ_FLAGS_NOOFFLOADS) > > > - > > > #define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | I40E_TX_DESC_CMD_RS) > > > > > > #ifdef RTE_LIBRTE_IEEE1588 > > > @@ -70,6 +67,12 @@ > > > #define I40E_TX_OFFLOAD_NOTSUP_MASK \ > > > (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) > > > > > > +static const uint64_t i40e_simple_ol_mask = (DEV_TX_OFFLOAD_MULTI_SEGS | > > > + DEV_TX_OFFLOAD_VLAN_INSERT | > > > + DEV_TX_OFFLOAD_SCTP_CKSUM | > > > + DEV_TX_OFFLOAD_UDP_CKSUM | > > > + DEV_TX_OFFLOAD_TCP_CKSUM); > > > + > > > > Seems incomplete. > > From i40e_ethdev.c full-featured tx supports: > > dev_info->tx_offload_capa = > > DEV_TX_OFFLOAD_VLAN_INSERT | > > DEV_TX_OFFLOAD_QINQ_INSERT | > > DEV_TX_OFFLOAD_IPV4_CKSUM | > > DEV_TX_OFFLOAD_UDP_CKSUM | > > DEV_TX_OFFLOAD_TCP_CKSUM | > > DEV_TX_OFFLOAD_SCTP_CKSUM | > > DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | > > DEV_TX_OFFLOAD_TCP_TSO | > > DEV_TX_OFFLOAD_VXLAN_TNL_TSO | > > DEV_TX_OFFLOAD_GRE_TNL_TSO | > > DEV_TX_OFFLOAD_IPIP_TNL_TSO | > > DEV_TX_OFFLOAD_GENEVE_TNL_TSO; > > > > So we probably need the same here plus multiseg. > > BTW, it is really strange that we don't have multiseg in tx_offload_capa. > > Should be present I think. > > Might be worse to create a new define for it, or just use > > dev_info->tx_offload_capa directly. > > Konstantin > > > Thinking about this more, it seems that right now we don't need a masks at > all. Any bits set in the offloads is going to cause us to use the scalar > path or to error out with an invalid offload requested. Yes, it's not > future-proofed in that it will need to be changed if we do end up > supporting some offloads with the vector path in future, but then the same > problem would occur if we just re-use the advertised capabilities too, like > you suggest. > > Therefore I think for V2 we'll just check for a non-zero offloads value.
Ok by me. Konstantin