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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CCBDC4345F for ; Sun, 28 Apr 2024 13:07:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D074E404CC; Sun, 28 Apr 2024 13:07:30 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GrtTHTFzStht; Sun, 28 Apr 2024 13:07:30 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org E3C2340504 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1714309650; bh=kC9nvysfg+MnEZelPTpf4i0NA9qXrLb5T1xFL2WZcco=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=xWcFJ00rrajGrIM9IBB9Bq2UDSSlgcsYnPZRSwwZUVvkQSHyOFgHG/shQsPYbEMTb G1XI6a8niPPat3ASSqSUY/E2nd5wyoH+ZJ7TldDUNeHg6cdHyUp2RRqzFZ1gEU3tmx UWvq7jWIbD5fEcdvKexHf5REGAEb9dJQQJx3t4KMhW44mC/3omFv0muQzeVbDUaqUD KcCp/uXDIAaOqzZQ4W/fOvS2cT90vIYuj8KjbD4Nenj/CAcyG2NL7hMaj7m+Bp19XE 6dSlipFJ9nZcC4aUS0j+QUAKyO6fcR26wzrmqxvj13EThI2trg+Uq7vGjEGbJBHqMf 2+gicHmNmc8SA== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id E3C2340504; Sun, 28 Apr 2024 13:07:29 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B42361BF3AF for ; Sun, 28 Apr 2024 13:07:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9EDDB400FE for ; Sun, 28 Apr 2024 13:07:28 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YPg20UlAtrrX for ; Sun, 28 Apr 2024 13:07:27 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2604:1380:40e1:4800::1; helo=sin.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 0C063400D9 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0C063400D9 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0C063400D9 for ; Sun, 28 Apr 2024 13:07:26 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 87152CE021B; Sun, 28 Apr 2024 13:07:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E3CCC113CC; Sun, 28 Apr 2024 13:07:19 +0000 (UTC) Date: Sun, 28 Apr 2024 14:05:47 +0100 From: Simon Horman To: Corinna Vinschen Message-ID: <20240428130547.GV516117@kernel.org> References: <20240423134731.918157-1-vinschen@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240423134731.918157-1-vinschen@redhat.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714309642; bh=9yyE8eKKUc/4RgJtB91ozG6CzRgB3As3mCsWRI33/p8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r/guf0pdPIsuUe0cpmgz5Sa/Tenb1I0LoY3zNdoDXGIfG6OEQiZ80sJwWn/8B2wx/ 4vM4xurlTQWZYLbMQ6906XXRVQqPAPx2SCGLYWo5ptROnX9dASaf9+szPiymGckRj3 YJ9rvucBXr9Q3BiaW69uVmgT3YtzZxQC8fX1LnBqPFSjRAUVf0Uktl9gmwOkR+F57J aRkpk72IcQEzyujKFfxh86eHPDU4/vwJdD7CQmBTRQypYQvDuqKDO7DGpvCHZRFRbt zS2D45/U/6Yn8W9OpZkRE0AlR5LfDCHxoUyMmAoMqr04nVcLnyAx+Cb2LgtTwDV50w kWwUWzzd7HqSQ== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=r/guf0pd Subject: Re: [Intel-wired-lan] [PATCH net v2] igb: cope with large MAX_SKB_FRAGS X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Xing , Tony Nguyen , netdev@vger.kernel.org, Nikolay Aleksandrov , linux-kernel@vger.kernel.org, Eric Dumazet , intel-wired-lan@lists.osuosl.org, Jakub Kicinski , Paolo Abeni , "David S . Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, Apr 23, 2024 at 03:47:31PM +0200, Corinna Vinschen wrote: > From: Paolo Abeni > > Sabrina reports that the igb driver does not cope well with large > MAX_SKB_FRAG values: setting MAX_SKB_FRAG to 45 causes payload > corruption on TX. > > An easy reproducer is to run ssh to connect to the machine. With > MAX_SKB_FRAGS=17 it works, with MAX_SKB_FRAGS=45 it fails. > > The root cause of the issue is that the driver does not take into > account properly the (possibly large) shared info size when selecting > the ring layout, and will try to fit two packets inside the same 4K > page even when the 1st fraglist will trump over the 2nd head. > > Address the issue forcing the driver to fit a single packet per page, > leaving there enough room to store the (currently) largest possible > skb_shared_info. > > Fixes: 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAG") nit: The trailing "S" in the subject for the fixes tag seems to have been lost. Fixes: 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAGS") > Reported-by: Jan Tluka > Reported-by: Jirka Hladky > Reported-by: Sabrina Dubroca > Tested-by: Sabrina Dubroca > Tested-by: Corinna Vinschen > Signed-off-by: Paolo Abeni ... From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF2D16BFBD; Sun, 28 Apr 2024 13:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714309643; cv=none; b=oAKW3KIlag5Kk8l3qMgCPmlAZVCq4NEY6jVZngsFyznimnKL6lDlldI69pmGofkK1CFRsZM0v5H6FMmkgzkwpDjEWLUr/99vT4VqAcmjVCIfLdguAK0jDC9CGAoT6c0E2XvMaD/CqTQlSfnsMcHU8l29l+FFMc5lKj50ZHU+pA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714309643; c=relaxed/simple; bh=9yyE8eKKUc/4RgJtB91ozG6CzRgB3As3mCsWRI33/p8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=M8qqNEJ1SS5an+zUmMI8whw9LtmAMYwLH4BQhwM5K3qYH1i7B6T9SuYKFyjUNkc967b1dYv32k8lo/k6RXSqfTTlQpb2VHJrcpTYxQN2xDZFP5m1S6yuP1DDP3Nrudpbehamp3yLlvEk7UoORflN9ooZ6r/1Iax37AFcYwGENEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r/guf0pd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r/guf0pd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E3CCC113CC; Sun, 28 Apr 2024 13:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714309642; bh=9yyE8eKKUc/4RgJtB91ozG6CzRgB3As3mCsWRI33/p8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r/guf0pdPIsuUe0cpmgz5Sa/Tenb1I0LoY3zNdoDXGIfG6OEQiZ80sJwWn/8B2wx/ 4vM4xurlTQWZYLbMQ6906XXRVQqPAPx2SCGLYWo5ptROnX9dASaf9+szPiymGckRj3 YJ9rvucBXr9Q3BiaW69uVmgT3YtzZxQC8fX1LnBqPFSjRAUVf0Uktl9gmwOkR+F57J aRkpk72IcQEzyujKFfxh86eHPDU4/vwJdD7CQmBTRQypYQvDuqKDO7DGpvCHZRFRbt zS2D45/U/6Yn8W9OpZkRE0AlR5LfDCHxoUyMmAoMqr04nVcLnyAx+Cb2LgtTwDV50w kWwUWzzd7HqSQ== Date: Sun, 28 Apr 2024 14:05:47 +0100 From: Simon Horman To: Corinna Vinschen Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Nikolay Aleksandrov , Jason Xing , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S . Miller" , Tony Nguyen , Jesse Brandeburg Subject: Re: [PATCH net v2] igb: cope with large MAX_SKB_FRAGS Message-ID: <20240428130547.GV516117@kernel.org> References: <20240423134731.918157-1-vinschen@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240423134731.918157-1-vinschen@redhat.com> On Tue, Apr 23, 2024 at 03:47:31PM +0200, Corinna Vinschen wrote: > From: Paolo Abeni > > Sabrina reports that the igb driver does not cope well with large > MAX_SKB_FRAG values: setting MAX_SKB_FRAG to 45 causes payload > corruption on TX. > > An easy reproducer is to run ssh to connect to the machine. With > MAX_SKB_FRAGS=17 it works, with MAX_SKB_FRAGS=45 it fails. > > The root cause of the issue is that the driver does not take into > account properly the (possibly large) shared info size when selecting > the ring layout, and will try to fit two packets inside the same 4K > page even when the 1st fraglist will trump over the 2nd head. > > Address the issue forcing the driver to fit a single packet per page, > leaving there enough room to store the (currently) largest possible > skb_shared_info. > > Fixes: 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAG") nit: The trailing "S" in the subject for the fixes tag seems to have been lost. Fixes: 3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAGS") > Reported-by: Jan Tluka > Reported-by: Jirka Hladky > Reported-by: Sabrina Dubroca > Tested-by: Sabrina Dubroca > Tested-by: Corinna Vinschen > Signed-off-by: Paolo Abeni ...