Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1360364lqh; Mon, 6 May 2024 05:43:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW032amOTPBIG+Lw0aB1bvwdqkiWyK9iCEAtIS/fg58H1m3pVNMj/e62ajO20CON7T+ym2HatVYGQDrhXauxA1pEbmnaCZeWcQLleuFgQ== X-Google-Smtp-Source: AGHT+IHApyzc04MEo7GkTNUnf278tM863O4HMNbwEvy+UWKQvpy1nAauheUMop4XhPpD5lB8Vcvf X-Received: by 2002:a0c:e807:0:b0:6a0:fb8e:2845 with SMTP id y7-20020a0ce807000000b006a0fb8e2845mr22713310qvn.11.1714999399070; Mon, 06 May 2024 05:43:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714999399; cv=pass; d=google.com; s=arc-20160816; b=K3Lb921jlQFI2RY/eYo2nDq2pXYIOYxbvDQlB2zxBSoso1IfFQr29VLvIHspW5XAih DJrnX3Fy84hrcw5KgDaVPC+9BY9CYVcK5s5c5QYO05aZNuBBMqpKyGlmHiqXBWe5HJQZ Ox6RL4s8LkfYB621yOQY1aPKktfX13xyMEPW34pzsiKa4WFlEs5+KeDmHkF8bsRQxKnb S59pleFZrSchP09wbPUZP6UExEAOLBpgFu6SHLKVmIP98b31hfYjZ648j8cyapz17iMx H8i3KSRJzLR/OL/07OsVgnvwPW3wzmIsp25sY4CDIjhjzOVSSBA8J6lcuOWFf2LbS1Mn pRDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=anw714zKyXDK460Ivdwt+n1g4c7F+zM3eSbBt2Nf1dc=; fh=/z9Yu9UTi1haWuHrKkxUeYGhUQmLkH2M/0kTeS18L00=; b=z4LnNGx00gaSM9DT/xn/3Go1jpf6JjIgRHK5DbyhB74BE4lpm9C8EMF12dOPP0fALg k73FEdDbxVvXEFHCRHjUF4aptiACbbCLyvAyXuTaBIFfrYwSg71Quoi3GB25xMZHIfOT ddCpnTOcB+sDJVzsXt08/wu/Kl8uTmhEjUvQCRq7viqOrpCbsnJsSxbqVkpzgCh0O55Z 7zPW7Ew0xnivn+rs7VDb4njs0K3XSKyvC7ns2+Q/NB0KkTxvcb+81j/VzoUP/1ASXCKF RQCNqbFxxwS1eERxKFQndJ6i30H6U9fZs/NB5mDYyxeaajWwtgcHMg7cH1IJx20ad5sn y9CA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=zQYtVdkN; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-169829-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169829-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gu12-20020a056214260c00b006a0f8740c70si9320925qvb.490.2024.05.06.05.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 05:43:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169829-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=@google.com header.s=20230601 header.b=zQYtVdkN; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-169829-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169829-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 8F1411C2323B for ; Mon, 6 May 2024 12:43:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5040E4EB45; Mon, 6 May 2024 12:43:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="zQYtVdkN" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 EB5522555B for ; Mon, 6 May 2024 12:43:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714999386; cv=none; b=iIws3W9/IYfcEOSvsHcaELnNX46xSfqQxq0isVlKKh2/slg2DJfVlSkeGHRzE/EU98w+6Gw5CLetEwAkNE53CDXQxHmpVVAkfVhcwTQfYxHoiCe0MG5JVrArSle2IkDmWFhfLeOUSPFz1tce4Oli5iHYeh7R3ME0lLTzrZo1/hc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714999386; c=relaxed/simple; bh=cfs2ycVTEkuQ3cfqr5nM6QWK12nCn6P1/OxUfMj1naY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DmRxx4ttFxHuShuOqLe8LSORilQgeJLNiz5dNndzS7UneIqs5ACEqsrfV+7uWn/xsiFGiRBUPmaRjJYBRgeFhLByz57uMEHEioXYCAhXP+IRYQ+QjFPC7Jc/SEHxcrshwcF3XkvuVpZT7exV619aMDbHZQO+86Wy4yE1x7S9IoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=zQYtVdkN; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-572aad902baso15601a12.0 for ; Mon, 06 May 2024 05:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714999383; x=1715604183; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=anw714zKyXDK460Ivdwt+n1g4c7F+zM3eSbBt2Nf1dc=; b=zQYtVdkNN/svr3RnSO3xhBgUkkc/Fywb6Daf7Efb0r+JWfIRzGi/DDs4PWq6GO5exj wxEI8qVva3WZ1ZztB6MQgufHiru2fCpkbYO+hQSZXQJtcKNvbxoX1hsGyqTvnY04YJmq 8dMOcJf1ttNIGbWxrHtxbAIi8IFCVdrCmMbplbwWMbTiXomw6dxiH1ZTQnL84SasN+02 iHehrxU9LY/P9azdjr6gu2oALreGE3YaHV1C5YytC137bXhUrXF5ZqHPnl0Rj37XLl/e cPWxUMfXSeHhImTc5a2gMETZ9uEbXhgVjqHHX8XjQlfZ0wZwS0lzJikNLDno5IQ6Fy4a 91Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999383; x=1715604183; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=anw714zKyXDK460Ivdwt+n1g4c7F+zM3eSbBt2Nf1dc=; b=pxFj8FnVlP1B2MOvlBSv5nLC8GiRww2ZFmXjXzgQfXAvtgz8wUj8y8mNz+j6i2jK+5 vHp8ASQ5csQdacBoe3z/XggVySGnmu2tySneFdpa08rLJBMA6if5SjY1Nv37EXY0dmqd cl7Pve/4vpTi+Cqqyx6vf7aELAav1N8FZ1c6vmxYMIl1Ideta/Z/6OLzW43wtfuQtg5t FPeZDV4gFdigpN/JcgsSksJ8iVTNkLBCKy9AQTp+KSxrAY78RtKYZ6mJSsl0VJMDd1lG oEg1cZrEo9Cw3BXwLU6QnotKRU2kqlKck5xCW7Q9j7mjw4UhR8Wctok6Nhn5EXGGb08p IB/Q== X-Forwarded-Encrypted: i=1; AJvYcCUIf8T+nh2aZTW8s8obPUcwx2t7sDgNq8wscaTSsk/bhqbv2BfYENKd0A4zyFi126im/KSFdEilTcvKQkmTSjPb3/22pmazG8XwxwLn X-Gm-Message-State: AOJu0YwUMX5XBE4zcMOq+62z8KnaHY8fOTPFKWWyCfFLSptn689hlhT+ 3PmA+wUslssNon9tQFMlD2w01icK5oCvtoPDg5urTIae4xZO5PmR6GIzK+Zl0NNsX+RkvV8+nWa afhzWWRNikRQFonb4Q/0bKlHv00dTSaVj+kyP X-Received: by 2002:a05:6402:1bcc:b0:572:a1b1:1f97 with SMTP id 4fb4d7f45d1cf-572e26945c5mr234715a12.1.1714999382503; Mon, 06 May 2024 05:43:02 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240506120400.712629-1-horatiu.vultur@microchip.com> In-Reply-To: From: Eric Dumazet Date: Mon, 6 May 2024 14:42:51 +0200 Message-ID: Subject: Re: [PATCH net] net: tcp: Update the type of scaling_ratio To: Horatiu Vultur Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, soheil@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 6, 2024 at 2:35=E2=80=AFPM Eric Dumazet w= rote: > > On Mon, May 6, 2024 at 2:04=E2=80=AFPM Horatiu Vultur > wrote: > > > > It was noticed the following issue that sometimes the scaling_ratio was > > getting a value of 0, meaning that window space was having a value of 0= , > > so then the tcp connection was stopping. > > The reason why the scaling_ratio was getting a value of 0 is because > > when it was calculated, it was truncated from a u64 to a u8. So for > > example if it scaling_ratio was supposed to be 256 it was getting a > > value of 0. > > The fix consists in chaning the type of scaling_ratio from u8 to u16. > > > > Fixes: dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale") > > Signed-off-by: Horatiu Vultur > > --- > > This is a wrong patch. We need to fix the root cause instead. > > By definition, skb->len / skb->truesize must be < 1 > > If not, a driver is lying to us and this is quite bad. > > Please take a look at the following patch for a real fix. > > 4ce62d5b2f7aecd4900e7d6115588ad7f9acccca net: usb: ax88179_178a: stop > lying about skb->truesize Remaining buggy drivers would be these USB drivers: drivers/net/usb/aqc111.c:1154: new_skb->truesize =3D SKB_TRUESIZE(new_skb->len); drivers/net/usb/smsc75xx.c:2237: skb->truesize =3D size + sizeof(struct sk_buff); drivers/net/usb/smsc75xx.c:2256: ax_skb->truesize =3D size + sizeof(struct sk_buff); drivers/net/usb/smsc95xx.c:1873: skb->truesize =3D size + sizeof(struct sk_buff); drivers/net/usb/smsc95xx.c:1891: ax_skb->truesize =3D size + sizeof(struct sk_buff); drivers/net/usb/sr9700.c:424: skb->truesize =3D len + sizeof(struct sk_buff); drivers/net/usb/sr9700.c:436: sr_skb->truesize =3D len + sizeof(struct sk_buff);