[dpdk-dev] [PATCH v5 1/2] ethdev: remove get_reg_length callback

Remy Horton remy.horton at intel.com
Mon Jul 4 12:38:39 CEST 2016


> +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
> @@ -934,7 +934,15 @@ static int cxgbe_get_regs(struct rte_eth_dev *eth_dev,
>  	struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private);
>  	struct adapter *adapter = pi->adapter;
>
> -	regs->length = cxgbe_get_regs_len(eth_dev);
> +	if (regs->data == NULL) {
> +		regs->length = cxgbe_get_regs_len(eth_dev);
> +		regs->width = sizeof(uint32_t);
> +		regs->version = CHELSIO_CHIP_VERSION(adapter->params.chip) |
> +			(CHELSIO_CHIP_RELEASE(adapter->params.chip) << 10) |
> +			(1 << 16);
> +		return 0;
> +	}
> +
>  	regs->version = CHELSIO_CHIP_VERSION(adapter->params.chip) |
>  			(CHELSIO_CHIP_RELEASE(adapter->params.chip) << 10) |
>  			(1 << 16);

Code duplication..

Rest looks ok and passed a quick compile test. Might need to keep an eye 
out for other driver changes.


More information about the dev mailing list