From nobody Thu Aug 7 03:00:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4byBjt2TJ9z63cDq; Thu, 07 Aug 2025 03:00:34 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4byBjt1ykJz46v0; Thu, 07 Aug 2025 03:00:34 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754535634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=niRl1lWoIJ4Rkv6A8Y+yTUkgq3HajRXysVsfOwIKCxM=; b=U/nPANpzhA5uABzAc3kOaWWmepWlRTEanVL7zhdToew0XPI5DyVLOULSnmegRs7NaelreO 5QrDm1TQlDGuHjCIf1oQ2lVnuJwWRZbGKbS3fuwb0TA7Bt6niTv9KCJir/4pS/qBBn92/h fsBpkyQO0uUN+dPRI7MLpGxIZYlSqqhyhnOxYIXP7bKbm8U7/naTsOsbqPtj0TR6g4QA32 zpHGMHOsKgXZWIePP4VeQ4EDZOSDUACePT8XKHnuS8u2hFHFZQHKAPFW2l53uUH82ld9B0 pcpYVnCxOjngXhX/SJS4bx6dRN7e7cDl3O2ycXkEjWNdmhnO+ju2hpSDQYyHAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754535634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=niRl1lWoIJ4Rkv6A8Y+yTUkgq3HajRXysVsfOwIKCxM=; b=xK9DhnjpqB70qQKLHo5IT076YV6JmyZTktg7CBDGFpKQve2u948BodGwRMqedAri6C++sX Oe32unr3yTuKrrCmdllCHM+NrfFtxCum+sorwC4KmTtqeFPKo5DPIEm7xdrookWq/y4zcG t8zzEbTgUzaiaESl89Ni9emRtlAyARePQrcE6iMnHpeLTY8wNGgikVETh+AboJbFcioBew gqnQBj3gsWEzKEwmYePWOLMyU58xpq/ft3vQGUhSjdz11C2yUHwWGFq1rmn5ftDPhdRYpW uO/bxSHeYACnhfl5qQZEr9daWtZIVQsSa9mmzp/F7b+d0Vv7n9Si5vn83CCBXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754535634; a=rsa-sha256; cv=none; b=P8bq6rwMt2+wKyUQqRDSh0IwLDhNRJLkGBdt/7bqiETDCLtqvWXpqnmdvZYLHaWKiu+Znq VQBxSXXGOwS9CTAjN2w8CFAtO5f25hXsF+BR2UY0VXMB+rzUSAxTpEEOLjEZ7Y2lxVyOiF Tu2dvLiPb3sQqGI2l2MBX4TxU6gfuAyx0wVOfPbnOjildATSO/FuSFEobW84BsDwLJEpse 1STzTlf3ebN4Eq5Ru0beYbU1QU2gQb1w6Uw31N9H97P8m0db7ZwlbeyXBt6ePuPk7YqGIz cHdlMsalCo8105LAg8Tj7gBxE2GBwN7Q03iJiMrX4uSzspUtR+B277n1WGHkFQ== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4byBjq6Q1mznK2; Thu, 07 Aug 2025 03:00:31 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: bcb298fa9e23 - main - sctp, tcp, udp: improve deferred computation of checksums From: Zhenlei Huang In-Reply-To: Date: Thu, 7 Aug 2025 11:00:23 +0800 Cc: Michael Tuexen , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202508010817.5718HZM6067171@gitrepo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3696.120.41.1.10) > On Aug 7, 2025, at 6:35 AM, Gleb Smirnoff wrote: >=20 > Michael, >=20 > On Fri, Aug 01, 2025 at 08:17:35AM +0000, Michael Tuexen wrote: > M> When the SCTP, TCP, or UDP implementation send a packet, it = does not > M> compute the corresponding checksum but defers that. The network = layer > M> will determine whether the network interface selected for the = packet > M> has the requested capability and computes the checksum in = software, > M> if the selected network interface doesn't have the requested > M> capability. > M> Do this not only for packets being sent by the local SCTP, TCP, > M> and UDP stack, but also when forwarding packets. Furthermore, = when > M> such packets are delivered to a local SCTP, TCP, or UDP stack, = do not > M> compute or validate the checksum, since such packets never have = been on > M> the wire. > M> This allows to support checksum offloading also in the case of = local > M> virtual machines or jails. > M> Support for epair, vtnet, and tap interfaces will be added in > M> separate commits. >=20 > Not a request for any action, but a general comment on the topic. >=20 > Imagine we are developing an IP stack from scratch for modern = computers. Most > NICs do hardware checksumming, large fraction of installations run in > containers/VMs and communicate via virtual interfaces. With modern = reality we > would probably do not do any checksumming in the stack at all, just = completely > ignore the checksum field. It would always be obligation of the NIC = driver to > care about the checksums. The existing software checksumming code = would be > just a library that drivers for legacy hardware call. Local traffic = won't set > and won't check checksums neither any related flags. I have ever had the same idea, but that requires lots of modification to = in-tree drivers and I finally abort. Think it twice, maybe a new driver flag say `IFF_CSUM_OFFLOAD` is needed = to indicate the driver is capable to delay calculating the checksums, and = eventually all drivers are converted and tested. >=20 > --=20 > Gleb Smirnoff Best regards, Zhenlei