Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2572784pxb; Tue, 12 Oct 2021 09:13:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8m6uGYkf8I6smRlgWC+5hI2enJ/QepuZpHT2xwHzqTVlsNDfovSObK6INf+3lHmdtdhB8 X-Received: by 2002:a17:90a:b112:: with SMTP id z18mr7007233pjq.198.1634055239512; Tue, 12 Oct 2021 09:13:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1634055239; cv=pass; d=google.com; s=arc-20160816; b=RG2y64H2CqDETWfPCSG1c9B3kB/LLMD5dI0vk/qKdmLyFcC0M5uoRojHvy9v1T0ixT 00mYcdm/5UO+pP9p6NQaOyVohQXp0FfXja7xsL8PRr6k+mHQRCKQQIicXP6CyZ5mxoLD RjprxI3umzo+H7Cu/GlbqtEfkOpKm6ZLDReWrK9Aa/kTMM2TFWwtVPsVR4SgLjWQjV6s iRiA2rMLvrN/aTlu9/pjfBXo17L+iwMqUGEz8PzIciPcHYY5e/fcE6qntkSsmgw0LUVP r+RQo/g/vYtQykPBDDKvnsaCgJmK6qBXzv8hGsoV1afYvQ5Qk/LJ9tTReWP+44FtVqds t7RQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=huBNme4xIeb4HvmBfu356fi+QNDw4d9bH/IvCvIh79M=; b=LWmE6AD7sCRpeEU8R9zTF7DSUNIcLmF+/lcykd4AzaFivFJSnGTrf/r67q7SQF4zc2 ZwwfTCTV0/SIzVYlXFD0VB0osTvXTlMNxK1woif7oBj0RDsENIdoTlzXQ28J5xttMd94 Pnae75fbPNm+wB+EXezInJ3SU9/LV6eFjuCBlioJSl52FkZlrw9D44acfpssJibkfbt8 LSppMtKUNetfU/vJ7mZQmMO8WGgx2q1lgvGStAFxXRGOvLHvN7M5sCPOPmK37avlnQ5C 1jixdP1XRPGZSqWPJeoFwGXAnG2tczpkTuK4EJAeYoox5LCCoL6pKWTGcrHbIPEQJuMK n6+Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="uU1/ucXo"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gi1si4129175pjb.187.2021.10.12.09.13.46; Tue, 12 Oct 2021 09:13:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="uU1/ucXo"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbhJLQNR (ORCPT + 99 others); Tue, 12 Oct 2021 12:13:17 -0400 Received: from mail-dm6nam10on2062.outbound.protection.outlook.com ([40.107.93.62]:50944 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229495AbhJLQNQ (ORCPT ); Tue, 12 Oct 2021 12:13:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQsK7RiMRU5PmO3C8ywzhmpAABM8+1Q2TLkWIH+vyTuuf+gbx+b/gzLXyVODGUKguwW3N5mlwsDvyajbzg1ObxtO1ZK9rFAROUvlvJxf/G0BDvUPzUn20lkWFV5TUP1DbDrVteCX95LxNQ1FphB1fqXwegkzNkzJtIzMzk1UMIEaIRwsRi8bpLF3uOtwERgXKz3d23Yz7Sp5zGA5qoVaTatVbV9TkkXGGabXEpYZ+IdR80A67KE4u1qLisHqGlBoVK8+BR1rMvN27NCt2N5Sv69i4qYLCaypBB8l4Cykk4fXPTOx258RgJcuqOBgavStWCMODj69yI8M3bspo53viw== 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=huBNme4xIeb4HvmBfu356fi+QNDw4d9bH/IvCvIh79M=; b=eB5DdoYvWb3yThjo9k36aFPuhBNqBM6DZwEQeJmjQkN7tHK5U7dluBbbhmTLrX6rgxVX+kqX2LmTi0jlZzdtM48oyio+OgaiKBrGQiDRoo9VNuXoT3UgDO41NP1GJzaLadyc+rU3aPhj+UCWqxxJVizr1PHauav0cgumW5PE7frFeDermLI+ftMIlrLGte70bJVamXx98fb/gDyVGMgV33KrWxGBHSdLKaycf4zjKvpZRRPMuInx8BcRZ50BpVaSKdXpgniyQiKvCJ8xeHp9B5+jBn8ZZsaXXT3boWFKbqaurccydbZtxGYLqwNdPe+tCwEuUGgWeYiaRBtUYTHvsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=huBNme4xIeb4HvmBfu356fi+QNDw4d9bH/IvCvIh79M=; b=uU1/ucXoOJLmOAQGZhn14B/w09NtglG2xrkqjRi3mAWsaoKjpDYD//DakZUbVZw5AkpFMqqCRjrXrLP7twQN1GoLn5vGBuvPxGiEnerm5Xl42sbEU30d7MtnxdWMvaP9LuzR5s/3+UrYloyYZ+QP1L/L7uRNMBPIvEqQAD1EkD6GXLl8GFnHML0y7yY6DCWyrdvcbF5bGOAOBld35i/zCf4FZmS9QleAZlHkH+NtPHrJXtnm/oHaYznjYupmniE8NiMShs4DGgtn+Ux4WTwOdsdbnxLt1CmzAF9d/Q9053z1R7txqY/gdaTUMe/PJkv/xT9uHYf7YnpB8pBKtvX6wQ== Authentication-Results: baidu.com; dkim=none (message not signed) header.d=none;baidu.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5192.namprd12.prod.outlook.com (2603:10b6:208:311::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Tue, 12 Oct 2021 16:11:13 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95%6]) with mapi id 15.20.4608.014; Tue, 12 Oct 2021 16:11:13 +0000 Date: Tue, 12 Oct 2021 13:11:12 -0300 From: Jason Gunthorpe To: Cai Huoqing Cc: Lijun Ou , Weihang Li , Doug Ledford , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RDMA/hns: Use dma_alloc_coherent() instead of kmalloc/dma_map_single() Message-ID: <20211012161112.GA3375648@nvidia.com> References: <20210926061116.282-1-caihuoqing@baidu.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210926061116.282-1-caihuoqing@baidu.com> X-ClientProxiedBy: MN2PR01CA0002.prod.exchangelabs.com (2603:10b6:208:10c::15) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 Received: from mlx.ziepe.ca (142.162.113.129) by MN2PR01CA0002.prod.exchangelabs.com (2603:10b6:208:10c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Tue, 12 Oct 2021 16:11:13 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1maKMy-00EAAe-9A; Tue, 12 Oct 2021 13:11:12 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af997a5e-6170-4333-229f-08d98d9ae983 X-MS-TrafficTypeDiagnostic: BL1PR12MB5192: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q8pyZoqqP4hrJAD8xUmQVtPnd1seEnkEmgJOIUwm59ru/QPNWMkzIVrFTENKYsIM70wZ7S8TOGiYY19s/g9wl3UnPM7KdH7Aghd+iJ4jLFW7QfZ/nWxPcOKmBSiu9sbhECNQHThNZ9ju3ZzKuwzayD63CqoZVE75UiL9gXbzhm1iaq3aZoeY6iDyrpUmaWk7eDw2+j1dlAYmyIttU71j7oBcBNUXaZ7Ntyciiur57eAN1FXm7D3P01c0Y2yt6qEzhkw+S6ZwwA4arjjDCmjdPPzWXKTf+s0yJ4jBTyMqUTIiaRjAbCYZxEBv4DNHlQjpFJRyf6NBylWGdZXjSBWDW1T4amy3Wlh6InjWc+sZB+02s7k46JwetcEDTQ8SM6Pmi/c5GO41mVyQ0zAuynIodB0q3Riu3YdJVs8dHj8AXEb08Y80D7HOcoIW20Y8s51AIKjvLQvXm5mqepyz6qjcDTue67m4wfVxPSMkWWGUtCE/BI5GSzVAcxCoBrx5AP8TBOELcnEOsJekNYPKp1oiBGGqdBkKN6qgMYsyNUwQGdGoTs+vZzx0Ocuj5iabZLu5QE1q0isKZBQp3LheR904Jm//u779bBgAVG0vUgHPXIzrWUbI5Au9BPdJxZ9ZkV52XyRBydf4Hd03M9rO6zIQSw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5506.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(83380400001)(426003)(186003)(4326008)(508600001)(26005)(4744005)(9786002)(2906002)(66946007)(9746002)(2616005)(33656002)(86362001)(6916009)(8936002)(54906003)(1076003)(66556008)(5660300002)(38100700002)(36756003)(8676002)(316002)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pRq5LC3afz2P2ERNfR3sVfaqZviAO16k2gJWQwnhTYJGoQCRk9tGohSM8hgq?= =?us-ascii?Q?5Py10tfKnwvAmTVSvqSIy31tPXwxyF4OFHB38SY9VSX+dNYWvEyYeRDPmbAV?= =?us-ascii?Q?bU+1F0YHdeMlprC6H4SFw3LSB7SFSimkVXhOuiBgvOntm0U43bUE9CY0t0qY?= =?us-ascii?Q?lqy+auhvYsY8hf8lHkb6obfjNoeeOB+3yPYlCeVap6NYgCccaKCOoTjNoIpv?= =?us-ascii?Q?Pb6ydVWFiiKQssmu87BSADSdKg1Z3w6apxgv/oB28p777BULm+akhkU7YwnM?= =?us-ascii?Q?rSMH3VSIEbHHR6L1F/w2h4gzwgmbpCF/Iu5HG3cIGMONJPW5JCKooaMsiVFP?= =?us-ascii?Q?zpCXZvtKxh9/bufvgAFhZ3/GsYHmRTTMnYbaq+3a1tUcGv7zxgXKAwwpGdQ8?= =?us-ascii?Q?+xZTsB6D8wqxkxp7rHBKgyhlzKQF2Hyh3KhgODJZBIa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zjL+MAuTv20S4JlTuxmQWeQ=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: af997a5e-6170-4333-229f-08d98d9ae983 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2021 16:11:13.5295 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ntA9lK7hd5X52D94JmlpNH/5LFABYnGOUxD5fh8lsvxm55ySW2zO3KqEpyvGkJ/Z X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5192 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 26, 2021 at 02:11:15PM +0800, Cai Huoqing wrote: > Replacing kmalloc/kfree/dma_map_single/dma_unmap_single() > with dma_alloc_coherent/dma_free_coherent() helps to reduce > code size, and simplify the code, and coherent DMA will not > clear the cache every time. > > Signed-off-by: Cai Huoqing > Reviewed-by: Wenpeng Liang > Tested-by: Wenpeng Liang > --- > drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 20 +++++--------------- > 1 file changed, 5 insertions(+), 15 deletions(-) Applied to for-next, thanks Jason