Bug 1286 - ipv4_hdr->total_length shoud convert to host byte order
Summary: ipv4_hdr->total_length shoud convert to host byte order
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: testpmd (show other bugs)
Version: unspecified
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Zhang Yuying
URL:
Depends on:
Blocks:
 
Reported: 2023-09-07 05:13 CEST by Renyong Wan
Modified: 2023-09-08 09:16 CEST (History)
3 users (show)



Attachments

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 */
		}
	}
```

Note You need to log in before you can comment on or make changes to this bug.