ethdev: get registers width
authorZyta Szpak <zyta.szpak@semihalf.com>
Mon, 4 Jul 2016 11:36:46 +0000 (13:36 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 10 Jul 2016 12:55:42 +0000 (14:55 +0200)
commit001a1c0f98f4e3ac19c26515892e2448a7547c38
tree7aa89b76abf7115098ced53f9e92d31db9e2a8fe
parenta50eb8685508a9540d15d7ea3f0e5533bed12527
ethdev: get registers width

The ethtool app was allocating too little space for 64-bit
registers which resulted in memory corruption.

Removes hard-coded assumption that device registers
are always 32 bits wide. The rte_eth_dev_get_reg_length
and rte_eth_dev_get_reg_info callbacks did not
provide register size to the app in any way while is
needed to allocate correct number of bytes before
retrieving registers using rte_eth_dev_get_reg.

This commit changes rte_eth_dev_get_reg_info so that
it can be used to retrieve both the number of registers
and their width, and removes the now-redundant
rte_eth_dev_get_reg_length.

Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Acked-by: Remy Horton <remy.horton@intel.com>
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/thunderx/nicvf_ethdev.c
drivers/net/thunderx/nicvf_ethdev.h
examples/ethtool/lib/rte_ethtool.c
lib/librte_ether/rte_dev_info.h
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h
lib/librte_ether/rte_ether_version.map