From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AB07C77B61 for ; Thu, 27 Apr 2023 21:09:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344079AbjD0VJE (ORCPT ); Thu, 27 Apr 2023 17:09:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbjD0VJD (ORCPT ); Thu, 27 Apr 2023 17:09:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F9992D7C for ; Thu, 27 Apr 2023 14:09:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 09FE960D56 for ; Thu, 27 Apr 2023 21:09:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6125C433D2; Thu, 27 Apr 2023 21:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682629741; bh=1QvjlFfVtL2z4WPFwTrUuUvaBYlzYhUXrBKD8dfg96o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Ge9dnI77Nf4angeeHSCsMLBTnQQA2Njtlm7gkS7+DiRqisNH3381S/B1+lsgXu7kp N6GiDN/Os2xh03GObrnyLpc+V4NlxR60EkVKktnHtFoAtPWxxRrMXcmpV4TO4e7YUQ plNuxugsi9Hkqwxhn3Q61kYx/VZnaPjDfEXy3hiGWOV5ijETEks67uZQ3Ol6kNEe1w WTl8XnnxCMghpyNU1im7SXrzqqppuTP1DYbzQzFi18y5IGRcZKuXZGtlobSKVfSQqi hgMDvQrEYvM2LjpAewjBx51T6iqTkHyDuVWBt8IouxVZC+BZRbIGYFc8Di/PZJlxlm HqqoPY/t2B2eA== Message-ID: <0fa1d0a7-172e-12ca-99c5-d4cf25f2bfef@kernel.org> Date: Thu, 27 Apr 2023 15:08:59 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH net] tcp: fix skb_copy_ubufs() vs BIG TCP Content-Language: en-US To: Eric Dumazet , "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com, Xin Long , Willem de Bruijn , Coco Li References: <20230427192404.315287-1-edumazet@google.com> From: David Ahern In-Reply-To: <20230427192404.315287-1-edumazet@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 4/27/23 1:24 PM, Eric Dumazet wrote: > David Ahern reported crashes in skb_copy_ubufs() caused by TCP tx zerocopy > using hugepages, and skb length bigger than ~68 KB. > > skb_copy_ubufs() assumed it could copy all payload using up to > MAX_SKB_FRAGS order-0 pages. > > This assumption broke when BIG TCP was able to put up to 512 KB per skb. Just an FYI - the problem was triggered at 128kB. > > We did not hit this bug at Google because we use CONFIG_MAX_SKB_FRAGS=45 > and limit gso_max_size to 180000. > > A solution is to use higher order pages if needed. > > Fixes: 7c4e983c4f3c ("net: allow gso_max_size to exceed 65536") > Reported-by: David Ahern > Link: https://lore.kernel.org/netdev/c70000f6-baa4-4a05-46d0-4b3e0dc1ccc8@gmail.com/T/ > Signed-off-by: Eric Dumazet > Cc: Xin Long > Cc: Willem de Bruijn > Cc: Coco Li > --- > net/core/skbuff.c | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) > Reviewed-by: David Ahern Tested-by: David Ahern Thanks, Eric. With ConnectX-6's connected back-to-back and S/W only settings (max GRO, GSO size and 9000 MTU) able to hit ~160G with both IPv4 and IPv6. I added nr_frags to the net_dev_xmit to verify various permutations; no issues with the patch.