From patchwork Fri Oct 10 09:22:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weilong Chen X-Patchwork-Id: 38545 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 EDC21205D8 for ; Fri, 10 Oct 2014 09:24:33 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf567412wiv.8 for ; Fri, 10 Oct 2014 02:24:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=nAFsUfM4EsWaPxQyn1ENNTUqqpT748DXPu+cWyNghcU=; b=Bftp8thUNjmWdnyIHQJI6gSbP4huov2WVdKZEIsh0GFYTDXXQRthjI4DVIE645B0AV 11XccI9MfJavjSu8Dp/XjuSB1nFez/XzFn4kJg0MKyQwN5Jy+cyMBBVN3LqFeD1kTO5g ouWQP/6CSBEC3tarB2aveDCqm41nAhCiFC12LfafYJfdBAG1lXiDND0t0lbC99Zivo9Z Yt60aFeLe6orKBOQLWx82No/ZFVbgTkCVlQJexLOwgWO8l1uDOiOJaGKp4feIkwfSsz1 LSZoiPIG8TZt0j36ZzDXFcF0lqkOrKGVw99V2bhF9Vw7Ykkn/EFzs2w5/0Pzpi71huF0 wq+g== X-Gm-Message-State: ALoCoQloTj8XXBx+VUMN5LQv+OdMGblQsA9VW3NK7oqCx5IN2Lg9gY9N8Jpt5Scw+9cS0U70ePEZ X-Received: by 10.112.145.136 with SMTP id su8mr691993lbb.9.1412933073068; Fri, 10 Oct 2014 02:24:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.8 with SMTP id lk8ls199924lac.17.gmail; Fri, 10 Oct 2014 02:24:32 -0700 (PDT) X-Received: by 10.152.23.69 with SMTP id k5mr3458888laf.70.1412933072916; Fri, 10 Oct 2014 02:24:32 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx.google.com with ESMTPS id ty1si8112377lbb.111.2014.10.10.02.24.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 02:24:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id hs14so2806737lab.31 for ; Fri, 10 Oct 2014 02:24:32 -0700 (PDT) X-Received: by 10.152.28.167 with SMTP id c7mr3321863lah.27.1412933072819; Fri, 10 Oct 2014 02:24:32 -0700 (PDT) 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.84.229 with SMTP id c5csp388172lbz; Fri, 10 Oct 2014 02:24:32 -0700 (PDT) X-Received: by 10.224.119.197 with SMTP id a5mr6280803qar.104.1412933071601; Fri, 10 Oct 2014 02:24:31 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id s6si10012263qas.82.2014.10.10.02.24.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 02:24:31 -0700 (PDT) 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 1XcWQl-0000m3-5M; Fri, 10 Oct 2014 09:24:11 +0000 Received: from mail-pd0-f175.google.com ([209.85.192.175]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XcWQe-0000lv-P7 for lng-odp@lists.linaro.org; Fri, 10 Oct 2014 09:24:04 +0000 Received: by mail-pd0-f175.google.com with SMTP id v10so1347957pde.34 for ; Fri, 10 Oct 2014 02:23:58 -0700 (PDT) X-Received: by 10.70.96.145 with SMTP id ds17mr3917083pdb.1.1412933038815; Fri, 10 Oct 2014 02:23:58 -0700 (PDT) Received: from localhost.localdomain ([183.247.163.231]) by mx.google.com with ESMTPSA id kk7sm2919760pab.31.2014.10.10.02.23.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 02:23:57 -0700 (PDT) From: Weilong Chen To: lng-odp@lists.linaro.org Date: Fri, 10 Oct 2014 17:22:28 +0800 Message-Id: <1412932948-5914-1-git-send-email-weilong.chen@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Topics: patch Subject: [lng-odp] [PATCH] Init ip header's frag_offset to 0. 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: , MIME-Version: 1.0 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: weilong.chen@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.44 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 The receive check frag_offset to find if the packet's frags. We should make sure this field is 0. Signed-off-by: Weilong Chen --- example/generator/odp_generator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 6055324..421fe8e 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -203,6 +203,7 @@ static void pack_udp_pkt(odp_buffer_t obuf) ip->proto = ODPH_IPPROTO_UDP; seq = odp_atomic_fetch_add_u64(&counters.seq, 1) % 0xFFFF; ip->id = odp_cpu_to_be_16(seq); + ip->frag_offset = 0; ip->chksum = 0; odph_ipv4_csum_update(pkt); /* udp */ @@ -260,6 +261,7 @@ static void pack_icmp_pkt(odp_buffer_t obuf) ip->proto = ODPH_IPPROTO_ICMP; seq = odp_atomic_fetch_add_u64(&counters.seq, 1) % 0xffff; ip->id = odp_cpu_to_be_16(seq); + ip->frag_offset = 0; ip->chksum = 0; odph_ipv4_csum_update(pkt); /* icmp */