From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: [PATCH RFC 10/11] testpmd: modify source address to validate checksum calculation Date: Fri, 9 May 2014 16:50:37 +0200 Message-ID: <1399647038-15095-11-git-send-email-olivier.matz@6wind.com> References: <1399647038-15095-1-git-send-email-olivier.matz@6wind.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1399647038-15095-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Always modify the source address of the packet in order to validate the calculation of the checksums (L3 or L4). This was already done for IPv4 software checksum, add it for IPv4 hw checksum and IPv6. Signed-off-by: Olivier Matz --- app/test-pmd/csumonly.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 9caad8f..e93d75f 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -310,6 +310,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) if (tx_ol_flags & PKT_TX_IP_CKSUM) { /* HW checksum */ + ipv4_hdr->src_addr--; ol_flags |= PKT_TX_IP_CKSUM; } else { @@ -373,6 +374,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) unsigned char *) + l2_len); l3_len = sizeof(struct ipv6_hdr) ; l4_proto = ipv6_hdr->proto; + ipv6_hdr->src_addr[3]--; if (l4_proto == IPPROTO_UDP) { udp_hdr = (struct udp_hdr*) (rte_pktmbuf_mtod(mb, -- 1.9.2