From patchwork Wed Feb 18 13:02:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 44769 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8901521554 for ; Wed, 18 Feb 2015 13:03:06 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf1201804wiw.0 for ; Wed, 18 Feb 2015 05:03:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:references:in-reply-to:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=6+DHLkmRNN2AdBC2+6jnC5Y4d7G4ljea1YlkY1fF768=; b=YdyqakBratOTYGZL2CJcQWnTDMLrHJKdJNW+UZjzHoQOhYcg96aKKH2oIGar4cguCZ GAsKYKKQBOoLJCoxZf5MdPFNkHOmbtiD9SC0zC9WdhBccPpJIa19IU0bI9OcWCoDhXTl T9Mtj5Y30PvS7oXJCPpHf3dalvnVRgH808tbY9IW65utN22pJOV2BbhZRjsFUYOkxAvK /Yg27ZaJ4TWfWCenuDaX/vIkj2Kn855IwAiXy0X+V91bHTSP0kiClLCDqBsRqmrDqNUz m1vIhwQXR5hdo5ItYKH2UCIhql+/vU3m7pqeybDr2QggCMPIPzmLR1Al9MFj+p5WeSL0 zMiw== X-Gm-Message-State: ALoCoQkSpd7tLWvOlJ7S52Vg6pN/A3+uGbLcbA1YOZVaTuPyA34anW+ppjxxM3lW/a6BTgf0wGOa X-Received: by 10.152.43.166 with SMTP id x6mr4262007lal.3.1424264585805; Wed, 18 Feb 2015 05:03:05 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.208 with SMTP id l16ls14155laa.66.gmail; Wed, 18 Feb 2015 05:03:05 -0800 (PST) X-Received: by 10.112.140.168 with SMTP id rh8mr33425602lbb.25.1424264585545; Wed, 18 Feb 2015 05:03:05 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id po2si13339536lbc.18.2015.02.18.05.03.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 05:03:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by labhs14 with SMTP id hs14so991360lab.1 for ; Wed, 18 Feb 2015 05:03:05 -0800 (PST) X-Received: by 10.112.171.168 with SMTP id av8mr33692140lbc.88.1424264585107; Wed, 18 Feb 2015 05:03:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2835423lbj; Wed, 18 Feb 2015 05:03:04 -0800 (PST) X-Received: by 10.236.7.70 with SMTP id 46mr1259467yho.138.1424264583885; Wed, 18 Feb 2015 05:03:03 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id b4si21177219qam.2.2015.02.18.05.03.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Feb 2015 05:03:03 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YO4HJ-0001vL-Dk; Wed, 18 Feb 2015 13:02:57 +0000 Received: from mail-pd0-f174.google.com ([209.85.192.174]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YO4HD-0001sC-Es for lng-odp@lists.linaro.org; Wed, 18 Feb 2015 13:02:51 +0000 Received: by pdjy10 with SMTP id y10so1010588pdj.6 for ; Wed, 18 Feb 2015 05:02:46 -0800 (PST) X-Received: by 10.70.132.129 with SMTP id ou1mr58482469pdb.162.1424264565867; Wed, 18 Feb 2015 05:02:45 -0800 (PST) Received: from bala.local ([117.207.68.20]) by mx.google.com with ESMTPSA id dt10sm13956267pdb.82.2015.02.18.05.02.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 05:02:45 -0800 (PST) Message-ID: <54E48D72.1080208@linaro.org> Date: Wed, 18 Feb 2015 18:32:42 +0530 From: Balasubramanian Manoharan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "lng-odp@lists.linaro.org" References: <1423812716-3148-1-git-send-email-bala.manoharan@linaro.org> In-Reply-To: <1423812716-3148-1-git-send-email-bala.manoharan@linaro.org> X-Forwarded-Message-Id: <1423812716-3148-1-git-send-email-bala.manoharan@linaro.org> X-Topics: Classification patch Subject: [lng-odp] Fwd: [PATCH v1] validation: classification: fix incorrect ipv4 checksum update X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bala.manoharan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Ping -------- Forwarded Message -------- Subject: [PATCH v1] validation: classification: fix incorrect ipv4 checksum update Date: Fri, 13 Feb 2015 15:31:56 +0800 From: bala.manoharan@linaro.org To: lng-odp@lists.linaro.org CC: Balasubramanian Manoharan From: Balasubramanian Manoharan Fixes an issue where ipv4 checksum field was not updated after modifying the src addr of the packet. Signed-off-by: Balasubramanian Manoharan --- test/validation/classification/odp_classification_tests.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 45822d3..a47ad1f 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -221,7 +221,7 @@ odp_packet_t create_packet(bool vlan) seqno = odp_atomic_fetch_inc_u32(&seq); ip->id = odp_cpu_to_be_16(seqno); ip->chksum = 0; - odph_ipv4_csum_update(pkt); + ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt)); offset += ODPH_IPV4HDR_LEN; /* udp */ @@ -403,6 +403,9 @@ void test_cls_pmr_chain(void) ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask); ip->src_addr = odp_cpu_to_be_32(addr); + ip->chksum = 0; + ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt)); + udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL); udp->src_port = odp_cpu_to_be_16(CLS_PMR_CHAIN_SPORT); @@ -418,6 +421,8 @@ void test_cls_pmr_chain(void) ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask); ip->src_addr = odp_cpu_to_be_32(addr); + ip->chksum = 0; + ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt)); enqueue_loop_interface(pkt); pkt = receive_packet(&queue, ODP_TIME_SEC); @@ -728,6 +733,9 @@ void test_pktio_pmr_match_set_cos(void) ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); parse_ipv4_string(CLS_PMR_SET_SADDR, &addr, &mask); ip->src_addr = odp_cpu_to_be_32(addr); + ip->chksum = 0; + ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt)); + udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL); udp->src_port = odp_cpu_to_be_16(CLS_PMR_SET_SPORT); enqueue_loop_interface(pkt);