[dpdk-dev] [PATCH 14/39] examples/ip_reassembly: convert to new ethdev offloads API

Ananyev, Konstantin konstantin.ananyev at intel.com
Mon Dec 11 16:03:41 CET 2017


Hi Shahaf,


> +		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
> +		    port_conf.rxmode.offloads) {
> +			printf("Some Rx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.rxmode.offloads,
> +			       dev_info.rx_offload_capa);
> +			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
> +		}
> +		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
> +		    port_conf.txmode.offloads) {
> +			printf("Some Tx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.txmode.offloads,
> +			       dev_info.tx_offload_capa);
> +			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
> +		}

Sort of generic question regarding most examples - wouldn't it be better to do rte_exit() if device doesn't
support the offloads we expect instead of masking off unsupported offloads and continue?
Konstantin 

>  		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
>  					    &port_conf);


More information about the dev mailing list