From patchwork Mon Feb 6 20:11:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 53483 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2440590wrn; Mon, 6 Feb 2023 12:18:10 -0800 (PST) X-Google-Smtp-Source: AK7set8zwn+Btgnhbc1Mqhu1nq2g+dh1JuXv479nzbS2k8fj7YTftQvzKFfYHxmtO5hIVy1MqVdO X-Received: by 2002:a05:6a21:328e:b0:bf:58d1:ce99 with SMTP id yt14-20020a056a21328e00b000bf58d1ce99mr15090139pzb.24.1675714689675; Mon, 06 Feb 2023 12:18:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675714689; cv=pass; d=google.com; s=arc-20160816; b=S4MOAZK2el+Rf0N3w3+XSkhSrIkgt6eGvKH343+Ae88bvoTuJO+LZHUd+1gC0aPGya MH0MHgL9qzhNi50sZ01abYFd2aK2QXM+IJQyMg4kRw8wS7pnWHp93wrwLK0+7/JIXSqy IfCCbbzTEN74p9mO7oTeSg7u+gETKQrBAdHevQp6OKMf+zopxbjBJIj3mhx6li99x1O1 DTlHkQvp4idwrEzHP+ETX2ZdI1IQtpVkezgetXqhlVSn3Qf8zoey3JUC1uXuwpTtPapX 6UhTep/60dqqqFV216eFb36jh8vZC9V5e54hVhVTitr/dWgw8avTeESAc4Pevq3TAvQ9 XVuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Kyfb0hce+mSZKTzOiOV7UL6r0/baGHq/9l02z4uxB+Q=; b=Vvt7rVlabBIcvM81PncdVASlKrFo1ytuvVAwD7mRcvMIWRtJe7TBopBf+TNuB8DTz3 cjlDoncabxh0DiWYy/HLn2BNQYC3L15OZ5Q2AhJFCH6Is1sLPXm4MnXGIH2elL0BwV/B MCPCD/hbBp9IbjjTtXmwMOMPCnaPCq9X7KX9wOssVqJdptE3XIKi7+lgb5FUiStzIhM2 66At1KWLmRvSAtjvqKgxO836qhfpx09w/uuuDHIAJOdMEUK3TIFPHcRGHma8daghDdYt OE+jzPMrHl8iEPiyiBGv3v+oNbuFnT2mp2KVGx9f/Zf0FBYwiJunCnNAbVdoXYocsK5V 0FYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=XQnIub5N; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg11-20020a17090b300b00b00230e25a2d45si716839pjb.26.2023.02.06.12.17.56; Mon, 06 Feb 2023 12:18:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=XQnIub5N; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbjBFUNb (ORCPT + 99 others); Mon, 6 Feb 2023 15:13:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjBFUN3 (ORCPT ); Mon, 6 Feb 2023 15:13:29 -0500 Received: from DM6FTOPR00CU001-vft-obe.outbound.protection.outlook.com (mail-cusazon11020020.outbound.protection.outlook.com [52.101.61.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7A901E1FF; Mon, 6 Feb 2023 12:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dYAzGtgS3n6tCMP2USQwBcpyvxFVHUoHzDzL6vsdc+HkifJFYcDQYtdF8NMsO/iZA1FRpUfw7vd1NgrF4AwLmCVsUJy2+VwOd5/IWG2uiBEBporRz5f/F9wjG5K2OCIiPbGIvFRJYUrZNa0LIof6DfctJpDKNgWebMJQjL2ZcdHhQwhp+Bii4a8OTNbIqvho7UCTAY8OufMsY5f5UR/H3R8H90Mt0X0uAMmypGyopxiB4R7PH49adpafk0hjGgrHX1YY2SUE54X7myTeFFkaNcXqhF3I3A39vE5D76VJyPauTHDBXEg9eAAjKbyaUWCVRRdbUy1VTbSV2nkjFkBi0Q== 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=Kyfb0hce+mSZKTzOiOV7UL6r0/baGHq/9l02z4uxB+Q=; b=DrbIlqdAb+63OGAFf2DyPODl/8X7I5o9+rUp3+X99wdeUHJMVmBtz9r5y4UJiuVp3+Pq7/o2ka1Rz+UOhhn7MpCZp9Jgi8pJScxpMbuGCIHk298Ilh2qNyv72g946utDiOGCzE155Z3zOCtKWxoDn4Vi40eeZk896z3O8JQ4ra9P7aXE7sXhqUk+0RD+aimhYd4FZTLgTK0Ncfo2BIl+xkqwSCUOLGDxmHFcdt0PD0YtSa5P57mfezzbCUrzAqUTxa5H5W8iTBsV4kFJQUKsZEBhjfJHT1mFc7WkpEWs4SWV/MuLfvDNpunPW7c+Q/K6zbP0kOccvUNnsBZckjX1Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kyfb0hce+mSZKTzOiOV7UL6r0/baGHq/9l02z4uxB+Q=; b=XQnIub5NQNcU2rmkDVTORS6/C3WTfRMBqxteJRvZkHzMIAgMmRcafYNVk6MhNkbo3TjWw23mTmYPh2owFnquNRTYVYFuXVeN1v5K8YMTckt+CVdwYhp2cbF0fSRZBwiis1vi0Dl/w1XOIv5UjcZkpLPpK2TV3eOn52JmGb7hQeo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1370.namprd21.prod.outlook.com (2603:10b6:5:16b::28) by DS0PR21MB3863.namprd21.prod.outlook.com (2603:10b6:8:122::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.1; Mon, 6 Feb 2023 20:13:25 +0000 Received: from DM6PR21MB1370.namprd21.prod.outlook.com ([fe80::ef06:2e2c:3620:46a7]) by DM6PR21MB1370.namprd21.prod.outlook.com ([fe80::ef06:2e2c:3620:46a7%6]) with mapi id 15.20.6086.007; Mon, 6 Feb 2023 20:13:25 +0000 From: Michael Kelley To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mikelley@microsoft.com, stable@vger.kernel.org Subject: [PATCH net 1/1] hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC Date: Mon, 6 Feb 2023 12:11:57 -0800 Message-Id: <1675714317-48577-1-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-ClientProxiedBy: MW4PR03CA0097.namprd03.prod.outlook.com (2603:10b6:303:b7::12) To DM6PR21MB1370.namprd21.prod.outlook.com (2603:10b6:5:16b::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR21MB1370:EE_|DS0PR21MB3863:EE_ X-MS-Office365-Filtering-Correlation-Id: c66eaea9-826e-4d68-4b43-08db087e9a40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GOpJIY5VQ1c0k0V3Fp0acZ1NOCns2SWiaih/SyFotY0VC9dDkUrSzcfMNVceXCFTIu0zmelhvMVn04JQh3eF/V7DG/cVJCFYwhuwbzMQKagDKAQ7aY8nXfGNs1ptJ0ZVT3sTQlk6KP+Z8geE2LUyPe/VNJ76a2Apq+Sa91aCVijPgB6O2STBPZDjjQ1gf472SFkbIANILqvNjjpXFTl3MBKitBPaLsKIp0dah/ZHOC07U4kasbHiw86X1WqjRsvKcyL4eFZ4HwgHuo6fIM7ZJLHma42Krp8YV3rqbn1gzgl0y7IPcFr40u4EJdMpktWHPBG6UqmcE/PfHN8AQW7ehFgtYYiTm0Bh2fmDcqfDxpfsFpyZ+RUlqQ/S77rv2oWImWEUtjlS5EwzZ7wLAK5BmMdlMquQgh+KVDJpOSBEXTiQQ2jRZtJM9zPnfoa7AnEsCS41H8GusGZxEyziNdul1Hz0r1HnMDUl9Y4+1fFkVzOKfptGRCMpTMgs6EoTXHULTb7PBn5JxtHt5ecGhdYNj1gcoXIDtldkPOztwRI9Eqo0AUczuTEx3Kl6wUpBSnSQXX19YIv1IU+nCWH/Fg3FoQHRohsuOKS9uejH6v+lEdRFWdE25BHNtcqB4nKOSbfoUa1vqBkM5YZO+hCo8w1z9uMy78NC6lYCP8Ljhy62XcHUELxMujjfnJae3ZWilJF/JdOsHAV4KhqVpNy5Pp0G/OGy5aS7FpriDNKKa59DvVBh3DEZgsT0pbE8Ty6/yj8T26VA6q6d9hfhQEc/hRAyqiTX1uKFuU3ofOlOGvVsZbA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR21MB1370.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(366004)(376002)(136003)(346002)(39860400002)(451199018)(5660300002)(6506007)(41300700001)(86362001)(6512007)(6666004)(26005)(186003)(4744005)(38100700002)(478600001)(8936002)(52116002)(2906002)(66946007)(66476007)(8676002)(83380400001)(66556008)(4326008)(2616005)(6486002)(82960400001)(38350700002)(966005)(82950400001)(36756003)(10290500003)(921005)(316002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ovd/OdiP410segRK/SBesVa0EbcfiRaGOT5SEs9gnH8YhUcrzVX/yq5gnnn62yzFnVj2JMzSJzA68wAf6YGqJ9nGg5Q0zgWxuIZiUZiDnky1y9bCOhk4k20kPQb+1jydnPrRVr7ElE8uZ+zuM5QlKkTqWKgvFvmW3r2jidFrxkyPQW0NpQUMyYgsteFTkafGYKaW34FegWFr2UVOvQdEppwgVCTh/gF8UW/WnyWdNFsxVrQj1pOse3yvgCiwNp0KYIpewFXTP3vrPm71eFFZML4yk8Fnwmjapv7vKQH5GMDewIwR0f1uzojeiZMHT4XRP0RIFxvClzxSf7ylGf8Q4A/+Ds4NpNQ1KRtSdl5SOsOJjRmqYHnPlgwTZxtSObqoKa6xRDxYRlEluZo/whLXqb7x/eEuRh/tLd0fe5yi1oJe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un3lCsPySli3WeuTSN/rcHSa76LEQkaOm7+v+9tJ2PMq2yvWwV7pgwlMzVwf9WyVN8Ul8dagGdyAviBQ+QVBQdODsgPvF2VWVKz88aHsZV08+8MVzqNE5yg== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c66eaea9-826e-4d68-4b43-08db087e9a40 X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1370.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 20:13:25.1425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3jtIQUI4om8WfpZq3M2jLDv6LD0XWultO1JLSRQ/xLi56r6Z8z6+wRF5j8/iPVfKKwz9d5ibBn3A/wUPTATBkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR21MB3863 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757114206643919415?= X-GMAIL-MSGID: =?utf-8?q?1757114206643919415?= Memory allocations in the network transmit path must use GFP_ATOMIC so they won't sleep. Reported-by: Paolo Abeni Link: https://lore.kernel.org/lkml/8a4d08f94d3e6fe8b6da68440eaa89a088ad84f9.camel@redhat.com/ Fixes: 846da38de0e8 ("net: netvsc: Add Isolation VM support for netvsc driver") Cc: stable@vger.kernel.org Signed-off-by: Michael Kelley --- drivers/net/hyperv/netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index e02d1e3..79f4e13 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -1034,7 +1034,7 @@ static int netvsc_dma_map(struct hv_device *hv_dev, packet->dma_range = kcalloc(page_count, sizeof(*packet->dma_range), - GFP_KERNEL); + GFP_ATOMIC); if (!packet->dma_range) return -ENOMEM;