ibmvnic: Convert vnic server reported statistics to cpu endian
authorJohn Allen <jallen@linux.vnet.ibm.com>
Wed, 2 Aug 2017 21:45:28 +0000 (16:45 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Aug 2017 16:33:06 +0000 (09:33 -0700)
The vnic server reports the statistics buffer in big endian format and must
be converted to cpu endian in order to be displayed correctly on little
endian lpars.

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index b45ade6123a44202acd273aa23b820e760992e50..ea0ff2841a1f5b8acf8d2935899a8fc162ee7a03 100644 (file)
@@ -1807,7 +1807,8 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
        wait_for_completion(&adapter->stats_done);
 
        for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++)
-               data[i] = IBMVNIC_GET_STAT(adapter, ibmvnic_stats[i].offset);
+               data[i] = be64_to_cpu(IBMVNIC_GET_STAT(adapter,
+                                               ibmvnic_stats[i].offset));
 
        for (j = 0; j < adapter->req_tx_queues; j++) {
                data[i] = adapter->tx_stats_buffers[j].packets;