net/i40e: implement new Rx checksum flag
authorXiao Wang <xiao.w.wang@intel.com>
Tue, 6 Sep 2016 01:27:32 +0000 (09:27 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 13 Oct 2016 23:41:39 +0000 (01:41 +0200)
Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
drivers/net/i40e/i40e_rxtx.c

index a297c65..7ae7d9f 100644 (file)
@@ -142,8 +142,14 @@ i40e_rxd_error_to_pkt_flags(uint64_t qword)
                return flags;
        if (unlikely(error_bits & (1 << I40E_RX_DESC_ERROR_IPE_SHIFT)))
                flags |= PKT_RX_IP_CKSUM_BAD;
+       else
+               flags |= PKT_RX_IP_CKSUM_GOOD;
+
        if (unlikely(error_bits & (1 << I40E_RX_DESC_ERROR_L4E_SHIFT)))
                flags |= PKT_RX_L4_CKSUM_BAD;
+       else
+               flags |= PKT_RX_L4_CKSUM_GOOD;
+
        if (unlikely(error_bits & (1 << I40E_RX_DESC_ERROR_EIPE_SHIFT)))
                flags |= PKT_RX_EIP_CKSUM_BAD;