[1/1] app/test: fix TCP header initialization

Message ID 20210330132328.796774-1-lance.richardson@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [1/1] app/test: fix TCP header initialization |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Lance Richardson March 30, 2021, 1:23 p.m. UTC
  Initialize TCP data offset field with TCP header length, this
field is used to derive L4 header length and by hardware to
validate a TCP header.

Fixes: 41f72ec94074 ("test: add packet burst generator functions")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
---
 app/test/packet_burst_generator.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ferruh Yigit April 8, 2021, 4:07 p.m. UTC | #1
On 3/30/2021 2:23 PM, Lance Richardson wrote:
> Initialize TCP data offset field with TCP header length, this
> field is used to derive L4 header length and by hardware to
> validate a TCP header.
> 
> Fixes: 41f72ec94074 ("test: add packet burst generator functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit April 9, 2021, 10:44 a.m. UTC | #2
On 4/8/2021 5:07 PM, Ferruh Yigit wrote:
> On 3/30/2021 2:23 PM, Lance Richardson wrote:
>> Initialize TCP data offset field with TCP header length, this
>> field is used to derive L4 header length and by hardware to
>> validate a TCP header.
>>
>> Fixes: 41f72ec94074 ("test: add packet burst generator functions")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 8b390853a2..0fd7290b0e 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -117,6 +117,7 @@  initialize_tcp_header(struct rte_tcp_hdr *tcp_hdr, uint16_t src_port,
 	memset(tcp_hdr, 0, sizeof(struct rte_tcp_hdr));
 	tcp_hdr->src_port = rte_cpu_to_be_16(src_port);
 	tcp_hdr->dst_port = rte_cpu_to_be_16(dst_port);
+	tcp_hdr->data_off = (sizeof(struct rte_tcp_hdr) << 2) & 0xF0;
 
 	return pkt_len;
 }