From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id AD3A3B0BC for ; Fri, 9 May 2014 16:51:01 +0200 (CEST) Received: by mail-wi0-f169.google.com with SMTP id hi2so2633849wib.0 for ; Fri, 09 May 2014 07:51:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bhzCL8Bx3i1e6RW7Pn0Qb5mkCAEdq24a4rsbtzhvW7o=; b=mKwuTpDZrLh03y3rn5D4vqrMfOdT6nPzSkgA+eTTp45LHRtAAU+SfRssGHNGSZSL4W /W5dwzcPLInxztTQEujFBBzdkEq8JlNercht9wLsyQAlrRibzhNy0jTZyYqacisX04d7 loagvYS/iFK1NF1scNqzebTZuiMgPwnbqGEx41tRWOBKXNNKyseZpKplbr7PnAKKNQR5 fWI+s2pIUEYZg5eAR6g1Qc25bNJ8gEbHFJzJ7C1TqTpIPByBBTS6QGPo6rs75ybv/viT 10NJd+1RMo87g5S7sV/u2iN6mCzTfsC48GE+0rOkqFiLnLHzT42Rev5VFn/StGY4nPJZ ChFg== X-Gm-Message-State: ALoCoQmtuUH1OKs/2gbis+sZ5Q7CRMkP5XoH8i23PeQtGSTF+3L8MkSuqk8/AqtV8djDHK3+l0Y/ X-Received: by 10.180.8.136 with SMTP id r8mr3733864wia.60.1399647068127; Fri, 09 May 2014 07:51:08 -0700 (PDT) Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id c2sm5744122wja.18.2014.05.09.07.51.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 May 2014 07:51:07 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Date: Fri, 9 May 2014 16:50:37 +0200 Message-Id: <1399647038-15095-11-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1399647038-15095-1-git-send-email-olivier.matz@6wind.com> References: <1399647038-15095-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH RFC 10/11] testpmd: modify source address to validate checksum calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 14:51:02 -0000 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