From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 949AD6895 for ; Mon, 19 May 2014 15:56:59 +0200 (CEST) Received: by mail-wg0-f47.google.com with SMTP id x12so7985240wgg.30 for ; Mon, 19 May 2014 06:57: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=lgHKp7V8UrkcKqfmJLgT35zRra1rR6lxPkKcZZUgRu7bCpY9bMCL+ePYnulhAPM7dH C/6SrqjeS2hy/KRy3l04S3qe9BCkRhouljJlAGv7Ss/PsyFTlLMToYitZkJWVNxqLgiy 0p2zC/7Ysk0yYD1v9GRNGpYJ1fkfVK4l/QVwx+aslc74qLzuXrKo+ATopQhZgMKj7Hh1 NysFyYIg8EEeYoFlf5hhKQXOJ3/TYQsi7RYIUMy+XESgDHkbs82cb7NIt5mx08aqplnX cMPSzUqaqujt1lrfJhW/y4BKD0TwCcJrnPk7RLtMu6YX6JAPd7hpaa5E29aUK46JTuX+ 4dog== X-Gm-Message-State: ALoCoQlkW4wP483ElXnDHv/o+10sVzX94m+gVkI1ESmVYLMvICYleJi1BLtKuzqzNSlxvvtPM2OA X-Received: by 10.180.13.113 with SMTP id g17mr13376208wic.48.1400507828574; Mon, 19 May 2014 06:57:08 -0700 (PDT) Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id t18sm15201828wiv.16.2014.05.19.06.57.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 May 2014 06:57:07 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Date: Mon, 19 May 2014 15:56:23 +0200 Message-Id: <1400507789-18453-12-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1400507789-18453-1-git-send-email-olivier.matz@6wind.com> References: <1400507789-18453-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH v2 11/17] 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: Mon, 19 May 2014 13:57:00 -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