[dpdk-dev] [PATCH] examples/ethtool: include case for 64-bit registers
Remy Horton
remy.horton at intel.com
Fri May 20 10:25:43 CEST 2016
Morning,
On 11/05/2016 11:48, zr at semihalf.com wrote:
> From: Zyta Szpak <zyta.szpak at semihalf.com>
>
> rte_eth_dev_get_reg_length and rte_eth_dev_get_reg callbacks
> do not provide register size to the app in any way. Example assuming
> they are 32-bit wide always allocates not enough memory if the
> registers are 64-bit wide. It results in memory corruption.
> This commit is a quick fix to make enough room for 64-bit
> register values when this returned value is given to malloc.
[..]
This is a loose end that needs to be fixed but my feeling is that it
ought to be done via querying the driver rather than overstating
register bank size. My suggestion would be to add something like
get_reg_wordsize to struct eth_dev_ops and then to use sizeof(uint32) as
fallback for drivers that don't implement the callback.
Regards,
..Rémy
More information about the dev
mailing list