[dpdk-dev] [PATCH] net/thunderx: Convert ThunderX VNIC PMD to new offload API

Shahaf Shuler shahafs at mellanox.com
Tue Jan 16 14:50:14 CET 2018


Friday, January 12, 2018 8:34 PM, Ferruh Yigit:
> On 1/3/2018 1:12 PM, maciej.czekaj at caviumnetworks.com wrote:
> > From: Maciej Czekaj <maciej.czekaj at caviumnetworks.com>
> >
> > This patch removes all references to old-style offload API replacing
> > them with new offload flags.
> >
> > Signed-off-by: Maciej Czekaj <maciej.czekaj at caviumnetworks.com>
> 
> <...>
> 
> >
> >  	dev_info->default_txconf = (struct rte_eth_txconf) {
> >  		.tx_free_thresh = NICVF_DEFAULT_TX_FREE_THRESH,
> > -		.txq_flags =
> > -			ETH_TXQ_FLAGS_NOMULTSEGS  |
> > -			ETH_TXQ_FLAGS_NOREFCOUNT  |
> > -			ETH_TXQ_FLAGS_NOMULTMEMP  |
> > -			ETH_TXQ_FLAGS_NOVLANOFFL  |
> > -			ETH_TXQ_FLAGS_NOXSUMSCTP,
> > +		.txq_flags = ETH_TXQ_FLAGS_IGNORE,
> 
> I am not sure about this, Shahafs may comment better, shouldn't application
> decide to set "ETH_TXQ_FLAGS_IGNORE" or not, instead of having this in
> default configuration?

Yes Ferruh is correct here.
The ETH_TXQ_FLAGS_IGNORE should be set by application to notify the lower layer it is using the new Tx offloads API and therefore not to take into consideration the txq flags configuration.

PMD is not allowed to set it. 
Whether the PMD moved to the new API or not is agnostic to the application, and abstracted by helper functions on ethdev layer.

> 
> <...>
> 
> > +	if ((conf_tx_offloads & tx_offload_capa) != conf_tx_offloads) {
> > +		PMD_INIT_LOG(ERR, "Some Tx offloads are not supported "
> > +		      "requested 0x%lx supported 0x%lx\n",
> > +		      conf_tx_offloads, tx_offload_capa);
> 
> This is broken for 32bits, using PRIx64 instead of "lx" makes your code more
> portable.


More information about the dev mailing list