From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: UDP Checksum Date: Thu, 06 Nov 2014 17:15:00 +0100 Message-ID: <545B9E84.2090701@6wind.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit To: Alex Markuze , "dev-VfR2kkLFssw@public.gmane.org" Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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