[dpdk-dev] [PATCH 4/4] net/ixgbe: convert to new Tx offloads API

Dai, Wei wei.dai at intel.com
Mon Mar 19 07:24:42 CET 2018


Hi, Konstantin
Thanks for your feedback.

> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Thursday, March 15, 2018 7:19 AM
> To: Dai, Wei <wei.dai at intel.com>; Lu, Wenzhuo <wenzhuo.lu at intel.com>
> Cc: dev at dpdk.org
> Subject: RE: [PATCH 4/4] net/ixgbe: convert to new Tx offloads API
> 
> 
> > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h
> > b/drivers/net/ixgbe/ixgbe_rxtx.h index 30095fa..d7f0535 100644
> > --- a/drivers/net/ixgbe/ixgbe_rxtx.h
> > +++ b/drivers/net/ixgbe/ixgbe_rxtx.h
> > @@ -223,6 +223,7 @@ struct ixgbe_tx_queue {
> >  	uint8_t             hthresh;       /**< Host threshold register. */
> >  	uint8_t             wthresh;       /**< Write-back threshold reg.
> */
> >  	uint32_t txq_flags; /**< Holds flags for this TXq */
> > +	uint64_t offloads; /**< Tx offload flags of DEV_TX_OFFLOAD_* */
> >  	uint32_t            ctx_curr;      /**< Hardware context states.
> */
> >  	/** Hardware context0 history. */
> >  	struct ixgbe_advctx_info ctx_cache[IXGBE_CTX_NUM]; @@ -254,6
> +255,12
> > @@ struct ixgbe_txq_ops {  #define IXGBE_SIMPLE_FLAGS
> > ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \
> >  			    ETH_TXQ_FLAGS_NOOFFLOADS)
> >
> > +#define IXGBE_SIMPLE_TX_OFFLOAD_FLAGS
> ((uint64_t)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)
> 
> 
> Hmm and why IP_CKSUM, TSO, OUTER_IP_CKSUM, etc. is not included into
> that macro?
> In fact do you really need that?
> As I understand right now vector TX doesn't support any offloads, so
> tx_offload != 0, should be enough for tx function selection, right?
> Konstanitn
In this patch, IXGBE_SIMPLE_TX_OFFLOAD_FLAGS is just a reverse transform of
IXGBE_SIMPLE_FLAGS which is used in old offload API.
Yes, current vector Tx doesn't support any offloads.
I will use tx_offload==0 following your guide.
> 
> > +
> >  /*
> >   * Populate descriptors with the following info:
> >   * 1.) buffer_addr = phys_addr + headroom @@ -307,6 +314,7 @@
> > uint16_t ixgbe_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf
> **tx_pkts,
> >  				    uint16_t nb_pkts);
> >  int ixgbe_txq_vec_setup(struct ixgbe_tx_queue *txq);
> >
> > +uint64_t ixgbe_get_tx_port_offlaods(struct rte_eth_dev *dev);
> >  uint64_t ixgbe_get_rx_queue_offloads(struct rte_eth_dev *dev);
> > uint64_t ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev);
> >
> > --
> > 2.7.5



More information about the dev mailing list