[dpdk-dev] [PATCH v5 1/2] ethdev: remove get_reg_length callback
Zyta Szpak
zr at semihalf.com
Mon Jul 4 13:34:54 CEST 2016
Very good point.. this one and the other :)
THere comes fixed version.
2016-07-04 12:38 GMT+02:00 Remy Horton <remy.horton at intel.com>:
>
> +++ 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.
>
--
Zyta Szpak
Software Development Engineer
Semihalf sp. z o.o.
ul. Krakusa 11
30-535 Kraków
More information about the dev
mailing list