[dpdk-dev] [PATCH 7/7] app/testpmd: rework for displaying different size of RX descriptors

Thomas Monjalon thomas.monjalon at 6wind.com
Fri Jun 20 16:34:35 CEST 2014


2014-06-20 14:14, Helin Zhang:
> i40e supports 16 and 32 bytes RX descriptors which can be configured.
> It needs to check the driver type and the configuration to determine
> if 16 or 32 bytes RX descriptors is being used, for reading and
> displaying the different sizes of RX descriptors.
[...]
> +	if (strstr(dev_info.driver_name, "i40e") != NULL) { /* i40e */
> +#ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC

Do we need to handle i40e case if RTE_LIBRTE_I40E_16BYTE_RX_DESC is defined?

[simplified diff follows]
>  #else
> +		struct igb_ring_desc_16_bytes *ring =
> +			(struct igb_ring_desc_16_bytes *)ring_mz->addr;
>  
> +		ring_rxd_display_dword(rte_le_to_cpu_64(\
> +				ring[desc_id].lo_dword));
> +		ring_rxd_display_dword(rte_le_to_cpu_64(\
> +				ring[desc_id].hi_dword));
>  #endif
> +	} else { /* not i40e */
> +		struct igb_ring_desc_16_bytes *ring =
> +			(struct igb_ring_desc_16_bytes *)ring_mz->addr;
> +
> +		ring_rxd_display_dword(rte_le_to_cpu_64(\
> +				ring[desc_id].lo_dword));
> +		ring_rxd_display_dword(rte_le_to_cpu_64(\
> +				ring[desc_id].hi_dword));
> +	}

You could factorize these 2 cases.

-- 
Thomas


More information about the dev mailing list