[dpdk-dev,[PATCH,v2] 13/13] virtio_ethdev : fix format specifier error for 64bit addr case
Commit Message
fix format specifier for func virtio_resource_init_by_ioports.
%04hx-%04hx couldn't read 64bit address correctly that lead to wrong value in
%mem_resource[0].addr / len; result in testpmd failure.
For example, so to read this address 00001040-0000105f; default format-specifier
could read 0-0 that lead to below error on arm64/ThunderX
Unhandled fault: alignment fault (0x92000021) at 0x0000007fb5040002
Signed-off-by: Santosh Shukla <sshukla@mvista.com>
Signed-off-by: Rakesh Krishnamurhty <rakeshk@mvista.com>
---
drivers/net/virtio/virtio_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1169,7 +1169,7 @@ static int virtio_resource_init_by_ioports(struct rte_pci_device *pci_dev)
while (*ptr && isspace(*ptr))
ptr++;
- sscanf(ptr, "%04hx-%04hx", &start, &end);
+ sscanf(ptr, "%hx-%hx", &start, &end);
size = end - start + 1;
break;