From patchwork Wed Mar 8 13:17:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 13165746 X-Patchwork-Delegate: kuba@kernel.org 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 3566BC678D5 for ; Wed, 8 Mar 2023 13:22:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231747AbjCHNWL (ORCPT ); Wed, 8 Mar 2023 08:22:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbjCHNVm (ORCPT ); Wed, 8 Mar 2023 08:21:42 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2043.outbound.protection.outlook.com [40.107.244.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D2D613DC3 for ; Wed, 8 Mar 2023 05:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ji1lZtHtI3ZRaFWbQsC5VUpYQ1uNkCOrOUtO5AclsffLSQV3bCjYhW5KspHqL044f8TxrrIY/vaScxCb079sA7SFltTU5PpJk2Q44z0I3qO++WiW9+oBLrZLKid/wHIdYGX16nbIsdzH4yIOKb2ctIIzy+YgEznqe5hQg2Km1IgUdgcr0XMoU5OLkVG2PIA92O3WgXSuCWfMhi0KwSCJ6bdg2ufMh1VhCp7AjiGrck3FqT959pLo9NHC77WdIv/klkKw+tzCiufAFZaQa3pYZ2xDwTXNBUWc6WnQaYzJEbuEBsjp7JBEHQNjQxlIOJAbzozWoDHt3lyD2IyNzFqt9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=icJVeZjoUz/yDW2sSE7+pGoFOhel9IVL4Xk/O9lfBxo=; b=CANVv3jOmY0ND61xOTRlKbmcQaKlqbLBvNYMGAKUDG2vkQwr4DgTF/wmIHfxN4JXu1oR7PLdmDoQ8Yq+J+Wr6EXmzuEdtHNyelaP8qp4N98CeXWInmXhCqoOZt/e9FsVJH/PpQZ8ubqwKyftaF2VOoTul0FlnD7yyI+JG3fM6vVeyzJHMN+jgJV506dGted+7xE53i/r+EjgW10RrjNenxBbkJhe6+2iDOJRRxS0I2XfM1VtfJd0nsDmUEnwlxzvFxxskWGgRA1bhtEH1n2zSSqqGYBBeoRltFcFl7Ly6gf8LfUMdaHuZUjhu1dXKNudEPiq8iJHc7Sguv13SBhxEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=icJVeZjoUz/yDW2sSE7+pGoFOhel9IVL4Xk/O9lfBxo=; b=D7Re2MDrLbAoKrfOiLGgkoYdSIdARfs3IXqj7TyllPzAW3YNZjGHkqCrEgaULFVkqnM3019X6/b4xqGYZWTIKPs9cMU6G2xJ/KnFA3qyFfvi2ZvAQf/tITwINEXVnZovy6yl3LQA5JG5OnKszBJsbkrdmO8QAOwUo1Neb5/cP6lHc5U83/lNscYE3AxvAED2DrZARF0px/EN/DUWjG481voW36BE0DfIcA1f2FZPXqJf3Z6BDtiprv492bhkGihfh4Ofmw4Xm6u7aw11z+3WLfX/WPyPHV/AZGwlAMihQ0YKXJH4yl4s7Qzif5rYBQKqSP9WTwItqg9I7LKeD32VNw== Received: from CYZPR20CA0013.namprd20.prod.outlook.com (2603:10b6:930:a2::13) by SA1PR12MB6947.namprd12.prod.outlook.com (2603:10b6:806:24e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Wed, 8 Mar 2023 13:17:17 +0000 Received: from CY4PEPF0000C97F.namprd02.prod.outlook.com (2603:10b6:930:a2:cafe::75) by CYZPR20CA0013.outlook.office365.com (2603:10b6:930:a2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Wed, 8 Mar 2023 13:17:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CY4PEPF0000C97F.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.13 via Frontend Transport; Wed, 8 Mar 2023 13:17:16 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 8 Mar 2023 05:17:05 -0800 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 8 Mar 2023 05:17:04 -0800 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Wed, 8 Mar 2023 05:17:03 -0800 From: Gal Pressman To: "David S. Miller" , Jakub Kicinski CC: , Eric Dumazet , Paolo Abeni , Gal Pressman , Tariq Toukan Subject: [PATCH net-next v2 1/2] skbuff: Replace open-coded skb_propagate_pfmemalloc()s Date: Wed, 8 Mar 2023 15:17:19 +0200 Message-ID: <20230308131720.2103611-2-gal@nvidia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230308131720.2103611-1-gal@nvidia.com> References: <20230308131720.2103611-1-gal@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C97F:EE_|SA1PR12MB6947:EE_ X-MS-Office365-Filtering-Correlation-Id: b5415cf3-b255-48d6-8450-08db1fd7707a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IL3vZIIwqhw/u4gxWwzMxfwE6w4EUuaEHu9o7zEncJ50ge/20i9yJ6eHXE6JCxLNrBlPyKroevOlC7QNL4pSey23rmjlohhkN0z26Wsct463xeMpAWQBer5IJjQs67C5Roz2siZZwfHzoJAlyPIyb8IaG8qZ0WN4/xx4oKcDSZ4Xe8L4Q6lCLw3KRgIy5QP+tUL62URFbaXnasXesOBjuTlKNb8LHJzM10PUQFGz+vKl2ecPuez/h0GjO2AwdeDZcSjZ0bx/QDoy5LFnZAPvc7hzGSsehLGl+nvcmCyAjXosSSIcsx2raXBVSuYLFYbO4+4doJ6eVX/rZ4oSXk+DNVFk5LYq+nCqFOKiG7zFEhnVuHI4T3T4SjNUzLO6/a+kZGdPQ5gLjrB8UBo0ppnMLhSGLqamj/8pnKoYACMCDOxyD5yLdZGqe0ct/wkQn454TE/yHuuak560fW8bAlcX4fnauj0Dc1PmxqnK9eSdQujkl6DaQhvU127ggkYatgHrpIw0XFxmfGO71ore+uO9sNhZu45+5o51BTShWKx5zObF0Tdpt0Rq2KAPQzt4J+5GUJ/Iy3Oyltx9Nv0ydvG+Ziyj11Lsg4HTiViZ0GkC4odNUE/bwUyYhHgg7TjmFHSd09bUTIbVl1rRyBuZZaL/ecpBOGurzgMgP/Pq+2zhaGC5w6eGeyDIeVPosHZQFRUndvhueLatsMJ9tZ18M4V7zQ== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199018)(46966006)(36840700001)(40470700004)(1076003)(26005)(110136005)(54906003)(40480700001)(36860700001)(478600001)(5660300002)(336012)(36756003)(40460700003)(107886003)(6666004)(4744005)(86362001)(7636003)(8936002)(356005)(7696005)(82310400005)(2906002)(70586007)(70206006)(8676002)(4326008)(426003)(47076005)(186003)(316002)(83380400001)(2616005)(41300700001)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2023 13:17:16.7626 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5415cf3-b255-48d6-8450-08db1fd7707a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000C97F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6947 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use skb_propagate_pfmemalloc() in build_skb()/build_skb_around() instead of open-coding it. Reviewed-by: Tariq Toukan Signed-off-by: Gal Pressman Reviewed-by: Simon Horman --- net/core/skbuff.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index eb7d33b41e71..5c1a65cc2f39 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -422,8 +422,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size) if (skb && frag_size) { skb->head_frag = 1; - if (page_is_pfmemalloc(virt_to_head_page(data))) - skb->pfmemalloc = 1; + skb_propagate_pfmemalloc(virt_to_head_page(data), skb); } return skb; } @@ -445,8 +444,7 @@ struct sk_buff *build_skb_around(struct sk_buff *skb, if (frag_size) { skb->head_frag = 1; - if (page_is_pfmemalloc(virt_to_head_page(data))) - skb->pfmemalloc = 1; + skb_propagate_pfmemalloc(virt_to_head_page(data), skb); } return skb; } From patchwork Wed Mar 8 13:17:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 13165745 X-Patchwork-Delegate: kuba@kernel.org 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 71E7EC64EC4 for ; Wed, 8 Mar 2023 13:22:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231710AbjCHNV7 (ORCPT ); Wed, 8 Mar 2023 08:21:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231733AbjCHNVi (ORCPT ); Wed, 8 Mar 2023 08:21:38 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2080.outbound.protection.outlook.com [40.107.244.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 943C0C9C26 for ; Wed, 8 Mar 2023 05:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=esmF4rZu7CRwlzZhQqi+2EfSDv5Z2K2JZJKAaA2/otLp1Zj5LOpuVNGR0w8y3Lw6nicJFa/JDRS1/u9hkqdOGC+cRpnBmY/YedBqI76aQNOQR22LQRzLjSSPIywFAQb07W7+bxIz53HWBOaw62rM88zR/0apq0XYUNV/6OgVy/TjQ2cjXHXzrJQIcTJCbk6Q5OY8abcFQ5zUhnfGPtBKKg2mKNpNcngmTxymaYaFL4qeyHsimKNyXavP1imtunbMpDth9hSbXN+MUDK4Tq+WG2p169ugvh1dWf94mmS4Di0BQffGJ+9htzmL6Z1CWRiNyED4mVjrY0Sdcr25Y2F28Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QzFKz2TmUtecj3TKnqfrZTFTTVLYV08oOd15e/FcDpg=; b=a8vIvUhovHPWBSJerPX1tr8qOEfYuPDLcU6Bb5ijXJBcwJoShdO2mLAKnaRr+3f+9s63POi3augxD+85FOW6awyZzbIBTmFun9rpyslAy/M405lPzIJpYeTYs9AnHVKyjibq+MdXnQ6/IEwpzxxPBpan+ReQRBeaVShrOf6v1NNUJDwRXo8A2lVHhY7eIF38pRhbndiD1hsmL4q54BFvdvFa/8VOXL+PY2ER4G0oqllB27KG8DlkXIz4enB51qLMphSS03JxnVXLbKLWZAscgUpeEcE3DcT5M0Mcjz3fi9q68Vk6jN+E6vVWzk7rXpQrlsfUOce0S/p5CnikfqecGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QzFKz2TmUtecj3TKnqfrZTFTTVLYV08oOd15e/FcDpg=; b=hxMj2grTL/rGsXn1XuCK2eTh0neHCR/x6de1rN476bQquxHy+tcduXbDGrTkx/aiiKmgFNwUEvN6O/Lj9AjRrg8XwIneDul+kQYitw0YUXRbefNul3S21uqONB3L+R6MJjJ2TvYWh4u7clFENygKdkYfI6ZIgx25xIdfUZcvo7sXGvJptSWLpJm+eFCzzYJpttn5HlO9f7MvG1vV84wjpoAKuRQm1cD3PcBSiHq8B2PoJ/0J9FkTrTIDUIiBipdBuD1GuwO5RnunzQPTvznnn4CxP2fbEHaRI14e7KeHSs4BCmWXh80js8k3V3urM2yFC0ioDP9oYKfB31U1IqKrjQ== Received: from CY5PR15CA0040.namprd15.prod.outlook.com (2603:10b6:930:1b::35) by DM4PR12MB5986.namprd12.prod.outlook.com (2603:10b6:8:69::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Wed, 8 Mar 2023 13:17:19 +0000 Received: from CY4PEPF0000C981.namprd02.prod.outlook.com (2603:10b6:930:1b:cafe::ac) by CY5PR15CA0040.outlook.office365.com (2603:10b6:930:1b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Wed, 8 Mar 2023 13:17:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CY4PEPF0000C981.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.13 via Frontend Transport; Wed, 8 Mar 2023 13:17:19 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 8 Mar 2023 05:17:07 -0800 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 8 Mar 2023 05:17:07 -0800 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Wed, 8 Mar 2023 05:17:05 -0800 From: Gal Pressman To: "David S. Miller" , Jakub Kicinski CC: , Eric Dumazet , Paolo Abeni , Gal Pressman , Tariq Toukan , Larysa Zaremba Subject: [PATCH net-next v2 2/2] skbuff: Add likely to skb pointer in build_skb() Date: Wed, 8 Mar 2023 15:17:20 +0200 Message-ID: <20230308131720.2103611-3-gal@nvidia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230308131720.2103611-1-gal@nvidia.com> References: <20230308131720.2103611-1-gal@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C981:EE_|DM4PR12MB5986:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ff1cce6-0cba-4670-8b66-08db1fd7720f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: McKCp2nKFRUqcucbHc1qCRV8cDmQ2gJ2CM2mLUl8IZbDVinXmcYVl5SjwAZoSdC9UkuVnYITNj4IxzNMxFLiJSCQalZq+37wluH7vJtP+w81QhajUGD7rUUVC4eEF3+1wcqS6ALQtJmsJ+Onom2pZQjU87dd8M3eXygW+jgCPyhTagH4RjaWKA4Qv/fxXMb8RkKtXQ0ubfYHYYFwVdh7u0Qa/h2g/fXJvGyN+2dwc1jsoAWL0SZcuj4dIFw6Fz33BA5mQxcGaLZ/RehnyQJ3TKnA3/1q7k+eBfkPmILvBFnxadLhcoyS6k/XSY10XY/tcJF1C1y4/USQvTuUNYP3wSO3+O7ZBBmGMoWELIS6NUGhJ1Jbcenzy3x0SVObZY9q/zcRiluOyxyWkDTq57zACrF1FxLdFR5a5nDg2RNK5XinpKiB/mymMHNhKhWckDDMufEz/CO5aMkN4QThZEazprqIi/qag+ORANDEi3dulQq2Ah6FtN96LvOw2spnC0zXsDzTFlBTuQfUBTTcaCQruUzHUmN0mWO/j3zNZkDKwCSql7Gl4xW7qF8BbfKBsJaN/oKDcikSjQn/tT0InicbTWM+7ZfyxTCTi6sCphyAvsn37FDC/tsqsux/M54zq6dgqe0RMBuofjgbmIBYZwLwSxwxynzqLzk+5DoKHP8cE8qBslmnbIKC7tJvwEMwDbC3anDHT8DWt8pWZGMliTlztA== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199018)(36840700001)(40470700004)(46966006)(70206006)(40480700001)(36756003)(4326008)(8936002)(70586007)(8676002)(4744005)(41300700001)(2906002)(5660300002)(86362001)(82740400003)(7636003)(36860700001)(6666004)(7696005)(356005)(26005)(1076003)(316002)(54906003)(478600001)(110136005)(82310400005)(83380400001)(426003)(47076005)(40460700003)(336012)(2616005)(186003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2023 13:17:19.4014 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ff1cce6-0cba-4670-8b66-08db1fd7720f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000C981.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5986 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Similarly to napi_build_skb(), it is likely the skb allocation in build_skb() succeeded. frag_size != 0 is also likely, as stated in __build_skb_around(). Reviewed-by: Tariq Toukan Signed-off-by: Gal Pressman Reviewed-by: Larysa Zaremba Reviewed-by: Simon Horman --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 5c1a65cc2f39..34df1aa0584b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -420,7 +420,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size) { struct sk_buff *skb = __build_skb(data, frag_size); - if (skb && frag_size) { + if (likely(skb && frag_size)) { skb->head_frag = 1; skb_propagate_pfmemalloc(virt_to_head_page(data), skb); }