cxgb4vf: don't offload Rx checksums for IPv6 fragments
authorHariprasad Shenai <hariprasad@chelsio.com>
Tue, 13 Sep 2016 08:09:24 +0000 (13:39 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Sep 2016 23:37:41 +0000 (19:37 -0400)
The checksum provided by the device doesn't include the L3 headers,
as IPv6 expects

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4vf/sge.c

index c8fd4f8..f3ed9ce 100644 (file)
@@ -1648,14 +1648,15 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
 
        if (csum_ok && !pkt->err_vec &&
            (be32_to_cpu(pkt->l2info) & (RXF_UDP_F | RXF_TCP_F))) {
-               if (!pkt->ip_frag)
+               if (!pkt->ip_frag) {
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
-               else {
+                       rxq->stats.rx_cso++;
+               } else if (pkt->l2info & htonl(RXF_IP_F)) {
                        __sum16 c = (__force __sum16)pkt->csum;
                        skb->csum = csum_unfold(c);
                        skb->ip_summed = CHECKSUM_COMPLETE;
+                       rxq->stats.rx_cso++;
                }
-               rxq->stats.rx_cso++;
        } else
                skb_checksum_none_assert(skb);