From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 808939113 for ; Wed, 31 May 2017 10:16:56 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id b84so110281521wmh.0 for ; Wed, 31 May 2017 01:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=TpMlZ3J1Hl9Y+e9JbnMAkmvwxfVwSczustrx2HVAMgg=; b=Itba99eY2JEZ81iBMqZvK4x1wP0F9CsvByJmrpgk4KtsAK23h4apstBafuvJvuCv+A YM5Z8/T9DbT4ME3Y7XHItIi1szITl5fl1EAk0SxzVkakhrRlIEJri4NVgqnAkuPzZEX+ kdp/lly9W94E7Pm+SuoswIzT5Bvtj9zJsuG97bV1ZthQ2gGZkm7NJNbHYhTmTysgtjRe bBi59pbQYipFcG/EVtEqwtJCLS90j/6y9N6th3LGh0eLewRkS5V1Pj2q5VofxgGFIzN0 yfW7gxQTmGj2f+StFX3u7ijil65v1HtMmngYShDIUwFQFCkPj5d+foS86FrquUmyRoo/ fOHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=TpMlZ3J1Hl9Y+e9JbnMAkmvwxfVwSczustrx2HVAMgg=; b=CQw6XcQjp9YdHMG4RYmjgsXsjZVoQR0xLonttE0BPOohdNg96OEtN+KzaYswaU/NI3 mbi+wxAyOMCGGG+AXYGLP2pM+TpDXn1EF1nRl/PKkGADvJ+90VEWmc2e/BhVlRrKqbEy kb7X7ungNd0fLbKSDt2bQExmIjNnKSPnMQ7Delx0VG7ScpuB3HSnRxPN46Zja8ZfWxrd aMfKFR9fKL/8UrFu86uotFnfznJLYB/6440DPEzTJf4vMM/qKXMCTlzRZG6C1BpE8Cjr P9BUIc4jDw1mnrjIM0/8/yrnvT5DaoIWvwu0tQd6LQD8sM33VazKHTbdkq2nAhTr1HST /N2w== X-Gm-Message-State: AODbwcCpDVHu3cxgSSra11n7KPl1GsYLm6r6cmw8qaxOb0JWJONpuUfm KG3Hw0RpemLxKsdy/ZBKIP41deXht3gKUgE= X-Received: by 10.80.182.89 with SMTP id c25mr20225515ede.55.1496218615665; Wed, 31 May 2017 01:16:55 -0700 (PDT) MIME-Version: 1.0 Sender: castet.j@gmail.com Received: by 10.80.151.16 with HTTP; Wed, 31 May 2017 01:16:55 -0700 (PDT) From: Julien Castets Date: Wed, 31 May 2017 10:16:55 +0200 X-Google-Sender-Auth: 0Q8YYyp9RT0ps2m7Xx4EHELBAZ8 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: [dpdk-users] Invalid TCP/UDP checksum for IPV4 packets X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 08:16:56 -0000 I had a running application on DPDK 2.2.0 which offloads IP/TCP/UDP checksums to the NIC. A few days ago, I started the migration to 17.02 and started to see invalid TCP/UDP checksum. I called the new API rte_eth_tx_prepare() but checksums were still invalid. After digging for a few hours in DPDK source code, I discovered the flag PKT_TX_IPV4 needs to be set in ol_flags. Basically, the function rte_net_intel_cksum_flags_prepare of rte_net.h (http://dpdk.org/doc/api/rte__net_8h_source.html) does the following: if (offload TCP checksum flag is set) { if (PKT_TX_IPV4 in ol_flags) { // compute ipv4 checksum } else { // compute ipv6 checksum } } Because I didn't set PKT_TX_IPV4 in ol_flags, I was going into the "else" clause and the checksum was computed as if my packet was an IPV6 packet. Don't you think it would be preferable to assert instead of considering a non-explicitely-declared-IPV4-packet as being an IPV6 packet? -- Julien Castets +33 (0)6.85.20.10.03