]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sfc: fix IPID endianness in TSOv2
authorEdward Cree <ecree@solarflare.com>
Fri, 3 Mar 2017 15:22:27 +0000 (15:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Mar 2017 18:06:38 +0000 (10:06 -0800)
The value we read from the header is in network byte order, whereas
 EFX_POPULATE_QWORD_* takes values in host byte order (which it then
 converts to little-endian, as MCDI is little-endian).

Fixes: b3818c9f8958 ("sfc: Firmware-Assisted TSO version 2")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef10.c

index 4d88e8532d3ee44ddfa2281fa9989b80ca0b5cf2..c60c2d4c646a89610edd35ef40e6ef337d045d79 100644 (file)
@@ -2183,7 +2183,7 @@ static int efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue,
                /* Modify IPv4 header if needed. */
                ip->tot_len = 0;
                ip->check = 0;
-               ipv4_id = ip->id;
+               ipv4_id = ntohs(ip->id);
        } else {
                /* Modify IPv6 header if needed. */
                struct ipv6hdr *ipv6 = ipv6_hdr(skb);