net/ice: fix TCP checksum offload
authorHaiyue Wang <haiyue.wang@intel.com>
Tue, 28 Jul 2020 13:42:03 +0000 (21:42 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 29 Jul 2020 22:41:23 +0000 (00:41 +0200)
The L4LEN field of the Descriptor Header Offset for TCP should be the
real length including the TCP options.

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_rxtx.c

index cc3139042e57138c614437624c164563c1a80ddd..ddf6a93fb2526dc13b027f1180cd7f37ba9c6237 100644 (file)
@@ -2234,7 +2234,7 @@ ice_txd_enable_checksum(uint64_t ol_flags,
        switch (ol_flags & PKT_TX_L4_MASK) {
        case PKT_TX_TCP_CKSUM:
                *td_cmd |= ICE_TX_DESC_CMD_L4T_EOFT_TCP;
-               *td_offset |= (sizeof(struct rte_tcp_hdr) >> 2) <<
+               *td_offset |= (tx_offload.l4_len >> 2) <<
                              ICE_TX_DESC_LEN_L4_LEN_S;
                break;
        case PKT_TX_SCTP_CKSUM: