Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp297994lqe; Sat, 6 Apr 2024 01:25:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNV9J7/ttcJKs8jMpspWbhCUD6igHzEUJ1mFxSqYC54AfY0L1xrh4vmXh5FoC1ycT1vX6zB6kWGP5Tk7ROwYHaQzqcnmsVu3SgFYtQVg== X-Google-Smtp-Source: AGHT+IGsBTjhFTCXjCPWklkmgfEo1tgtp1Pm5K7ibnwsO7oSVfRrmvpWWS3jBt22CvW4SCBdtWKo X-Received: by 2002:a05:620a:4043:b0:789:e8e8:f674 with SMTP id i3-20020a05620a404300b00789e8e8f674mr4489853qko.30.1712391931325; Sat, 06 Apr 2024 01:25:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712391931; cv=pass; d=google.com; s=arc-20160816; b=E0nyxkGmHNrU/1QRiUhPqgCwQVQ3+jkr8x69P6S3NZLjtU86p940xqMMvNlSCCFoA7 3Lb2hLrGRnAfbJlAVVn4PT2bseqMgTWL5r7lGSY3OYbKj+wL8TFjlvKIBYPyXdyKn/uy Yg151TXu/1a4oaictgxWUXW7XO8XoeF72tGf2FB+fIPEy7mH/o7cOY8b4YYwhOjAMURO 2nj2kkUPKDWW37mSOmssiqMOkAY2j1MofU+VTRZ2Ly7sQqkCDCmWLkEMlIr9ZXMCvXRZ 75yKIOcRpVgLb8eUvq462saqW5mF1uDggBUC29w8XIbteCBYX9cgZ+JD4R39A4mvXHjf HHWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=QBJNfaYHzuiXuMZUpgDPs9xtiQNCWuPWeZpuB9UBK3o=; fh=oBrqieNBwo7eCBTB43fmYzs+aYJ/no+gdZQtTDRpfFs=; b=ibZbkNA3R3uhvoM5GASAGtCIpszrEhYKBPt2zLIOh94SObtblPu+G1dw+pKsTjsXoW Hm/w3P17xKKt7dbWiRDOPAx7hmTe4V7RzzjHm/9vLoOXkxUPV82ctuKIxQOUJHWej7o4 IYfbqFEo7ZHXmH2gjAKpCJS4lNBZPXBCttorBayWpHRUAcoimfRaJypO4mDZwvMp9O10 jCU9jCXfaFPZgOqWTlUmITLy4UmcpWbJea6GAgKG3j7bx1UyfHzA2IuxMrvtlBEgUAI0 wf0oFPlIjXyIHB755tQ9fvBC6WsXtIvdPcX6GJRAjhNAMrrf5q6vRBs7wv8q0GiGyPZr hDYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=RQXFG31G; arc=pass (i=1 dkim=pass dkdomain=daynix-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-133856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133856-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w17-20020ae9e511000000b0078d17ece511si3617125qkf.573.2024.04.06.01.25.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 01:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=RQXFG31G; arc=pass (i=1 dkim=pass dkdomain=daynix-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-133856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133856-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 10D471C21522 for ; Sat, 6 Apr 2024 08:25:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E08824B2A; Sat, 6 Apr 2024 08:25:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.b="RQXFG31G" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AED8A200D2 for ; Sat, 6 Apr 2024 08:25:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712391923; cv=none; b=T64PE3Uk33t3fQtP5H69BuU16zo55FBZTvRq4BQD8BgcOGp7R+186i5hCqbjuopOCi4sUSTm92UDENa0utC/qRwetoJ4caCsqW2YtKOxiIJgWyX5C+5sS2BrWTHe5xgWy3W75Gc0fm258rAvUfafeyW+pg1ycFY0MgqVCjuMDC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712391923; c=relaxed/simple; bh=Yp70LyV42TC86owiqwUo+ei2yFC/VLhbCv0icbZUJFE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sjGS0ncEmp8ku4bX8vQyUihquM5RadbFyzbPf5fLKkhn+5NL1EuVdQkiVyH8OUJ1zXDOC6KriliIFE0mqiGKsD97dXTKgIi9+FbDq8jgwL3en57bjIAVpPNXlGr4i9enpVxYBy8DHlkpwNBpo5rr+pB21qqJGKDfnv9PmH008os= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=daynix.com; spf=none smtp.mailfrom=daynix.com; dkim=pass (2048-bit key) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.b=RQXFG31G; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=daynix.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=daynix.com Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4162ffb97a2so10602735e9.3 for ; Sat, 06 Apr 2024 01:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1712391920; x=1712996720; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QBJNfaYHzuiXuMZUpgDPs9xtiQNCWuPWeZpuB9UBK3o=; b=RQXFG31GJAWymDTWNhTKADUAB9uLWMTl6XLDZsCjsq48E0qlICb8X5ZIYM+ZFvPxY+ 2iTmDH2B1OdN9K8TMnnATglFXoHTbTWRzBWWDkwJ3o+vYAyxonhSKaU2L6EFlUFJMeVk 5eKsxULDCoQlQLghZy2H4tfZ62ywrUO4qnvkpTZCbil65UKBTo1Nk6cLNBkuuNAfi7ba dnIVBhElxMmNSPRnwBE1OAan/2MXAgTo7UfQp1MkFaMFcRlS+vyE/6rw/Mn/VpWuJp3N JETK06m6C8UTxZxjVMsd1Cg6mpJZwgChIcsqmUAK8gs32cNQoI7Ugv32HgdBYOXF7rHr ++ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712391920; x=1712996720; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QBJNfaYHzuiXuMZUpgDPs9xtiQNCWuPWeZpuB9UBK3o=; b=mvfBm0D/AIrbPhaP3L2GAlcpOC2Fs/QmRVCDNcJKIfUGK9OqRc+apGpqnL52829Dv8 FeeSZiJnrLnL1rTBE3ZhUC9ck7TSKMlE8KuI8mt4djETfWDQYKW/x+xztftB41Yb4zrt /2j+9cDQ8OXuYklW2c3sgO2si+QmYxKyT+YycmxrdEmULbqbLkfYYLnE1J4Dzxa9aMsw iBKgSi40ScE0wMmVjxRjJnxCiFwBeDd3RiU4avilg6mApl1KAeVn9U1U/2rYm7Risj7u yf2lua3rGlTliNr/LF+YjDvSmkb+TpEERlPlIAUOvosAtwiIZwTeINEhJmgBudf5XVKQ jCOQ== X-Forwarded-Encrypted: i=1; AJvYcCVxPG80O4xCF1csqNglWMF+ZxOvLp4hppAN1KgoUce1/ZxQLcSTA0jQfN78CHVjvAhF6fXYngsRdD7u4A793RfboI6SNkGitmwlnMOF X-Gm-Message-State: AOJu0YxTsH6tRvVrCwRBst/IcBnNBxEQMygPduKBM+24eTQdEg46T6aE aSiy5NqoTbdiZG4pmVHoltk0lk+UukpQ7Za99DxNMEDzRVO6mjQRpqxH152AiYw= X-Received: by 2002:a05:600c:1c13:b0:416:3de5:1364 with SMTP id j19-20020a05600c1c1300b004163de51364mr437857wms.18.1712391919991; Sat, 06 Apr 2024 01:25:19 -0700 (PDT) Received: from f1.redhat.com ([2a06:c701:46c7:8900:15f8:24e1:258e:dbd5]) by smtp.gmail.com with ESMTPSA id g11-20020a05600c310b00b00416244a53b8sm5794220wmo.4.2024.04.06.01.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 01:25:19 -0700 (PDT) From: Yuri Benditovich To: willemdebruijn.kernel@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: yan@daynix.com, andrew@daynix.com Subject: [PATCH] net: change maximum number of UDP segments to 128 Date: Sat, 6 Apr 2024 11:25:13 +0300 Message-Id: <20240406082513.78692-1-yuri.benditovich@daynix.com> X-Mailer: git-send-email 2.34.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Earlier commit fc8b2a619469378 ("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation") added check of potential number of UDP segment vs UDP_MAX_SEGMENTS in linux/virtio_net.h. After this change certification test of USO guest-to-guest transmit on Windows driver for virtio-net device fails, for example with packet size of ~64K and mss of 536 bytes. In general the USO should not be more restrictive than TSO. Indeed, in case of unreasonably small mss a lot of segments can cause queue overflow and packet loss on the destination. Limit of 128 segments is good for any practical purpose, with minimal meaningful mss of 536 the maximal UDP packet will be divided to ~120 segments. Signed-off-by: Yuri Benditovich --- include/linux/udp.h | 2 +- tools/testing/selftests/net/udpgso.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/udp.h b/include/linux/udp.h index 3748e82b627b..7e75ccdf25fe 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -108,7 +108,7 @@ struct udp_sock { #define udp_assign_bit(nr, sk, val) \ assign_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags, val) -#define UDP_MAX_SEGMENTS (1 << 6UL) +#define UDP_MAX_SEGMENTS (1 << 7UL) #define udp_sk(ptr) container_of_const(ptr, struct udp_sock, inet.sk) diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c index 1d975bf52af3..85b3baa3f7f3 100644 --- a/tools/testing/selftests/net/udpgso.c +++ b/tools/testing/selftests/net/udpgso.c @@ -34,7 +34,7 @@ #endif #ifndef UDP_MAX_SEGMENTS -#define UDP_MAX_SEGMENTS (1 << 6UL) +#define UDP_MAX_SEGMENTS (1 << 7UL) #endif #define CONST_MTU_TEST 1500 -- 2.34.3