net: aquantia: fix rx checksum offload bits
authorDmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Tue, 27 Nov 2018 14:51:17 +0000 (14:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Nov 2018 21:18:45 +0000 (13:18 -0800)
The last set of csum offload fixes had a leak:

Checksum enabled status bits from rx descriptor were incorrectly
interpreted. Consequently all the other valid logic worked on zero bits.
That caused rx checksum offloads never to trigger.

Tested by dumping rx descriptors and validating resulting csum_level.

Reported-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Fixes: ad703c2b9127f ("net: aquantia: invalid checksumm offload implementation")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c

index f02592f43fe36f3af460672746ade204d1f574fb..a7e853fa43c24a07e719ef3a31b216df07fefafb 100644 (file)
@@ -674,7 +674,7 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self,
 
                rx_stat = (0x0000003CU & rxd_wb->status) >> 2;
 
-               is_rx_check_sum_enabled = (rxd_wb->type) & (0x3U << 19);
+               is_rx_check_sum_enabled = (rxd_wb->type >> 19) & 0x3U;
 
                pkt_type = 0xFFU & (rxd_wb->type >> 4);