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 C751443355 for ; Fri, 17 Nov 2023 17:23:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C141D42D2E; Fri, 17 Nov 2023 17:23:05 +0100 (CET) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id 98C73402C7 for ; Fri, 17 Nov 2023 17:23:03 +0100 (CET) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-692c02adeefso1990877b3a.3 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=A4XA3+5bIdctD7taxks90uHk/NQi2W9ZCch1KIOTyaCho2mvC8G4k/eQCnN4Sh2n4V M7tT6n2kZ19PZbLh5zqhkf5TlJTaoyZX0N3FYOZqApP3H6L9l6RTtgObpUYFphnyvgnR 6MatMyLqBIDdyGkGSgPFeulYkiTw1DcJW6etSZiCH3cK4Oj0jRiOJ8cfP9RTMlWQN+Jy hoipsWrUdOSSueVQMiZOc0Wd7qgZWvMXNRo+yQtXsEHMmSBg06akw37QoweXwAILMfT7 3PaTEIL4AEXDwPmmPKoRX9/80T/trU6Ok0HehEG9OCmMxHdML4xJ2PP21yyF4WmY8XW8 KTmw== X-Gm-Message-State: AOJu0YxZ5HsZOQu6dFWBFaFiBHTuSHzhvZSTA+nUoZJyIwCzDsA61O+3 R88QSesmOhqDlPEdbuEk1JkwZg== 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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.