Bug 1286

Summary: ipv4_hdr->total_length shoud convert to host byte order
Product: DPDK Reporter: Renyong Wan (wanry)
Component: testpmdAssignee: Zhang Yuying (yuying.zhang)
Status: UNCONFIRMED ---    
Severity: normal CC: aman.deep.singh, wanry, yuying.zhang
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Renyong Wan 2023-09-07 05:13:29 CEST
The code making sure sctp payload be multiple of 4 to determin TX_SCP_CKSUM in process_inner_cksums() of csumonly.c should convert ipv4_hdr->total_length to host byte order. The following is the code segment.

```
	} else if (info->l4_proto == IPPROTO_SCTP) {
		sctp_hdr = (struct rte_sctp_hdr *)
			((char *)l3_hdr + info->l3_len);
		/* sctp payload must be a multiple of 4 to be
		 * offloaded */
		if ((tx_offloads & RTE_ETH_TX_OFFLOAD_SCTP_CKSUM) &&
			((ipv4_hdr->total_length & 0x3) == 0)) {
			ol_flags |= RTE_MBUF_F_TX_SCTP_CKSUM;
		} else {
			sctp_hdr->cksum = 0;
			/* XXX implement CRC32c, example available in
			 * RFC3309 */
		}
	}
```