From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A348043355; Fri, 17 Nov 2023 17:23:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 929C742830; Fri, 17 Nov 2023 17:23:04 +0100 (CET) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id 8BA8F402EA for ; Fri, 17 Nov 2023 17:23:03 +0100 (CET) Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-5bd6ac9833fso1550785a12.0 for ; Fri, 17 Nov 2023 08:23:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1700238183; x=1700842983; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ogP8I8ucnu3AcSZkzJxAwDodfg8/nrSH1hsPhhw/5s0=; b=Bk+SPhvcK+h8bQv4fMK9BaMsdxYz2yWDe8XZvj4i1BROEVFERkTxQ2dKi5gIwtcczZ 9CLt2SiZfU8IwUEUcbGYT0uLtzXwTLZXVUKbq1d4i8Hy9pMRdSAWWodOX/4TrvXXv1sA aHXlsFOgaYcbm1wQ2sh3C+GWKzs6xFDFbzK20WNYrtakZizCvDMdGgishfGteyuNlR0s o5/IRh3nG5MRGJ2WB7m79lNYmyE+h/sKQgXgvj6ayhYjJUAVGt/VWVI5Hxr6L32RJIFG yqLlL7gD/M56jr82gGkLP6mFx66KAyb/LCko8QViUOGYakvIXmJns0t/urBIUjfloVsC yTRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700238183; x=1700842983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ogP8I8ucnu3AcSZkzJxAwDodfg8/nrSH1hsPhhw/5s0=; b=NEoGtpLH25pQnPs/bf92o1cUL7LSUF/G3YUhfYLJZS38uvCFVihuZgDmhlryMkTMqa zltWOw/eJ268aeuCMiKkczci0Pnrmxqk0KmhAt67hTSkeC4bn+I72fVeBpLizhV5q/Lq MJirCBadU9P/fiKSfzO5AEhjxarZZmVljjKdeMYY5lXBOxcMxjlnT/YEaSjEOjL28T3p EQhY0bB4Ag2r2IsYOQK/zVy7vYgBrVKQzU/KKsQYq1CFemRlJc0UTsDxU3zT6YJm9K+k 4k83h9WLkOZd2rbS+Fd8B9ylYLY5fZX6ynfSOtiVVN4PTvjaelxX+cBWEkz+fsJ6ixBZ Z/Rw== X-Gm-Message-State: AOJu0YziodJ/NXrxcb/9LD+H4qk3H9EpUBkr0XTAAyqzP5MrQLagmzAl q6/IRQES2BMxTSniWUOJGSAyNw== X-Google-Smtp-Source: AGHT+IECROAxkKVDdShMlrYX4EkXEml65xHReB+YORGp+1PXmmCo6YyRe7HsT/fA3ii/j/PnbU+aBQ== X-Received: by 2002:a05:6a20:86a1:b0:187:3b1f:219c with SMTP id k33-20020a056a2086a100b001873b1f219cmr7305133pze.10.1700238182823; Fri, 17 Nov 2023 08:23:02 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id s21-20020a056a0008d500b006b2677d3685sm1581975pfu.207.2023.11.17.08.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:23:02 -0800 (PST) Date: Fri, 17 Nov 2023 08:23:00 -0800 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: "Ferruh Yigit" , "Kaiwen Deng" , , , , , "Aman Singh" , "Yuying Zhang" , "Olivier Matz" , "Pablo de Lara" Subject: Re: [PATCH] app/test-pmd: fix L4 checksum with padding data Message-ID: <20231117082300.12063a30@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F03B@smartserver.smartshare.dk> References: <20230804082849.533059-1-kaiwenx.deng@intel.com> <892f0567-e1ee-4283-9726-5db1dd92c2cb@amd.com> <20231116145817.78eb0954@hermes.local> <7a41467c-c863-4ea1-bf7c-9206bf56aa34@amd.com> <20231116192857.0d49ec5b@hermes.local> <1effba02-7a4c-47bd-8097-a158832c45d7@amd.com> <98CBD80474FA8B44BF855DF32C47DC35E9F03B@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 17 Nov 2023 13:11:50 +0100 Morten Br=C3=B8rup wrote: > > rte_ipv4_udptcp_cksum_mbuf() and rte_ipv6_udptcp_cksum_mbuf() are > > inline > > functions, unfortunately we can't version them. > >=20 > > But those functions already gets IP header as parameter, can't we use > > IP > > header to get the payload size? If so this can be fixed without > > updating > > API. =20 >=20 > If rte_ipv4_udptcp_cksum_mbuf() - or any other function in the DPDK Netwo= rk Headers library - includes Ethernet padding (which may be non-zero) when= calculating the TCP/UDP checksum of an IPv4 packet, it is a bug, and must = be fixed there. >=20 > Our test cases should use random padding to catch bugs like this. >=20 > And I just realized that Ethernet padding may be added to any IP packet, = so don't assume that this bug only applies to small packets. Agree. And test code needs lots more header checks it is way too trusting t= hat mbuf is valid.