]> git.droids-corp.org - dpdk.git/commitdiff
net/hinic: fix SCTP checksum error
authorXiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Sat, 31 Oct 2020 03:38:36 +0000 (11:38 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:35:07 +0000 (23:35 +0100)
For SCTP checksum offload, pmd driver does not parse payload offset
info, which may cause hardware calculate SCTP checksum failed.

Fixes: 8c8b61234ffd ("net/hinic: refactor checksum functions")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
drivers/net/hinic/hinic_pmd_tx.c

index 125627e0eeb504252c75eb602051451ea495b824..9d0264e67a8574ee8bf64050806768b263c38c13 100644 (file)
@@ -767,7 +767,8 @@ static inline void hinic_get_pld_offset(struct rte_mbuf *m,
 {
        uint64_t ol_flags = m->ol_flags;
 
-       if ((ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM)
+       if (((ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM) ||
+           ((ol_flags & PKT_TX_L4_MASK) == PKT_TX_SCTP_CKSUM))
                off_info->payload_offset = m->l2_len + m->l3_len;
        else if ((ol_flags & PKT_TX_TCP_CKSUM) || (ol_flags & PKT_TX_TCP_SEG))
                off_info->payload_offset = m->l2_len + m->l3_len +