From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp81.ord1c.emailsrvr.com (smtp81.ord1c.emailsrvr.com [108.166.43.81]) by dpdk.org (Postfix) with ESMTP id 746DC8D9B for ; Wed, 28 Oct 2015 12:02:20 +0100 (CET) Received: from smtp3.relay.ord1c.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp3.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 0D25C180480; Wed, 28 Oct 2015 07:02:20 -0400 (EDT) Received: by smtp3.relay.ord1c.emailsrvr.com (Authenticated sender: padam.singh-AT-inventum.net) with ESMTPSA id 01E5B180218; Wed, 28 Oct 2015 07:02:18 -0400 (EDT) X-Sender-Id: padam.singh@inventum.net Received: from [172.16.1.231] ([UNAVAILABLE]. [103.25.205.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:25 (trex/5.4.2); Wed, 28 Oct 2015 11:02:20 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) From: Padam Jeet Singh In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC22BC43AF@SHSMSX101.ccr.corp.intel.com> Date: Wed, 28 Oct 2015 16:32:15 +0530 Content-Transfer-Encoding: quoted-printable Message-Id: <86D29314-5420-4E94-B925-41C1A001548E@inventum.net> References: <9E9D668A-17B5-4047-85B3-13519F898467@inventum.net> <20151028065757.GA4251@mhcomputing.net> <546F571B-8603-4D0E-95B3-6CE5BAD3EE02@inventum.net> <1ED644BD7E0A5F4091CF203DAFB8E4CC22BC432E@SHSMSX101.ccr.corp.intel.com> <38A0599F-BB59-49B6-B4E0-D16E0B95A745@inventum.net> <1ED644BD7E0A5F4091CF203DAFB8E4CC22BC438D@SHSMSX101.ccr.corp.intel.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC22BC43AF@SHSMSX101.ccr.corp.intel.com> To: "Liu, Jijiang" X-Mailer: Apple Mail (2.2070.6) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Wrong TCP Checkum computed by hardware 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: Wed, 28 Oct 2015 11:02:20 -0000 >>=20 > Yes, you are correct, I just noticed you declare it is static, If = possible, send more codes to me, I can help you with this. >>>=20 >>>> Thanks, >>>> Padam >=20 I have the following code: mbuf->ol_flags =3D (uint16_t) (mbuf->ol_flags & (~PKT_TX_OFFLOAD_MASK)); mbuf->ol_flags |=3D PKT_TX_IP_CKSUM; ipv4hdr->hdr_checksum =3D 0; tcphdr =3D (struct tcp_hdr *)(pkt + sizeof(struct ether_hdr) + sizeof(struct = ipv4_hdr)); #ifdef L4CSUM_SW tcphdr->cksum =3D 0; tcphdr->cksum =3D get_ipv4_udptcp_checksum(ipv4hdr, = (uint16_t*)tcphdr); #else mbuf->ol_flags |=3D PKT_TX_TCP_CKSUM; if(!(mbuf->ol_flags & PKT_TX_IPV4)) mbuf->ol_flags |=3D PKT_TX_IPV4; tcphdr->cksum =3D 0; tcphdr->cksum =3D rte_ipv4_phdr_cksum(ipv4hdr); #endif mbuf->pkt.vlan_macip.f.vlan_tci =3D 100; mbuf->ol_flags |=3D PKT_TX_VLAN_PKT; I have added a macro called L4CSUM_SW, if enabled does L4 Checksum = computation in software. When I enable this, the packet received has the = correct TCP checksum. It is important to note that the checksum is being = computed, but is being computed wrong when TX_VLAN, IP_CKSUM and = TCP_CKSUM are enabled. When I do the same test with VLAN removed from the setup, the TCP = checksum computation is correct.=20 The system exhibiting this issue is a Intel(R) Xeon(R) CPU E5-2620 v3 @ = 2.40GHz X 2, with 2 X 82599ES on a PCIe3 bus: 02:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit = SFI/SFP+ Network Connection (rev 01) Flags: bus master, fast devsel, latency 0, IRQ 32 Memory at c7d20000 (64-bit, non-prefetchable) [size=3D128K] Memory at c7d44000 (64-bit, non-prefetchable) [size=3D16K] Capabilities: [40] Power Management version 3 Capabilities: [50] MSI: Enable- Count=3D1/1 Maskable+ 64bit+ Capabilities: [70] MSI-X: Enable+ Count=3D64 Masked- Capabilities: [a0] Express Endpoint, MSI 00 Capabilities: [e0] Vital Product Data Capabilities: [100] Advanced Error Reporting Capabilities: [140] Device Serial Number 00-90-0b-ff-ff-3f-19-d0 Capabilities: [150] Alternative Routing-ID Interpretation (ARI) Capabilities: [160] Single Root I/O Virtualization (SR-IOV) Kernel driver in use: igb_uio Kernel modules: ixgbe