From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id CB8692E89 for ; Thu, 6 Nov 2014 17:05:41 +0100 (CET) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XmPlA-0007Ye-Ml; Thu, 06 Nov 2014 17:18:12 +0100 Message-ID: <545B9E84.2090701@6wind.com> Date: Thu, 06 Nov 2014 17:15:00 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Alex Markuze , "dev@dpdk.org" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] UDP Checksum 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: Thu, 06 Nov 2014 16:05:41 -0000 Hello, On 11/06/2014 05:05 PM, Alex Markuze wrote: > I'm seeing "UDP: bad checksum." messages(dmesg) for packets sent by my dpdk > app to a socket on a remote machine. > Looking at the packets the scum value is set, its just not what wireshark > expects. > > When sending I'm setting these fields in the egress packets. > > pkt->pkt.vlan_macip.f.l2_len = sizeof(struct ether_hdr); > > pkt->pkt.vlan_macip.f.l3_len = sizeof(struct ipv4_hdr); > > pkt->ol_flags |= (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK); > //PKT_TX_OFFLOAD_MASK; I think you need to do: pkt->pkt.vlan_macip.f.l2_len = sizeof(struct ether_hdr); pkt->pkt.vlan_macip.f.l3_len = sizeof(struct ipv4_hdr); pkt->ol_flags |= (PKT_TX_IP_CKSUM | PKT_TX_UDP_CKSUM); ipv4_hdr->hdr_checksum = 0; udp_hdr->dgram_cksum = 0; udp_hdr->dgram_cksum = get_ipv4_psd_sum(ipv4_hdr); /* see csumonly.c */ Regards, Olivier