Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3887540pxb; Mon, 27 Sep 2021 05:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkIGrhgZBd2L37meW6VOWH6C2l7LpEga5Z9YcpTB5utLIT8yReUPdr4c6e8i4FnG7U7/kE X-Received: by 2002:a17:906:14c7:: with SMTP id y7mr3830195ejc.123.1632744190155; Mon, 27 Sep 2021 05:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632744190; cv=none; d=google.com; s=arc-20160816; b=fX736m8+Z9GshFvUzcLg7yPNQpQojayVuGzwDzYLnt8xpAyUUy7VN6AqWlJSXBCehQ 7mcnPTSdD1rwjZlffqkYBrTSKYr+9KvZLBvpEwJeuWiK6lY+wZtqO2YN041dEMDf+IED Se+z9X9rY/7L8YHwq7igc3xVkDiWjsf7tlVSoVKUjUex4Min2ZnBxbf3zZh7ARpHJj1f kYsiQNTVXMCiHvjKMKOzHnovsMDuL4w+6fod0mEZGA3gjZ6INkyjcjzVA8ODJR3+q6o+ dszBNRXOrKlN/LYQJJEcvZ8D1VonFgaGGCuJacUFHdhSImyuoR9XcxGgk2rEpifTKzLK IEvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OO+222/P86uXwx2DUL7XFhBRQH7h34PJA8Pu8TuCXwk=; b=QXwOE1DmqthQU0pWt4Vwd7QPM/CbeIHDJ0TIF3t3yb2ovg2+GaBio4iojEXO6i/C2h DzAu9ro/qZyIEhtovPjD5rIMEnedig0XnOtr/2r6Zdg2BlCGi5A7XFMglmQxetBTjBiL T9FkyqZZkCISbJTWficcdU02y+SAPUKyK8GNkNgk6PvrwIVdxyXjUVd0V39qmBpSvf8K nw9YyJ6XhjGVbrhDg+/+c7s6hWS0doX/PT65No5PFT8hwyDDW5ol8IiaWIqkcrbxO7tX M+iFoqfCvpP9m2UuHD9fUTivU4YzrzjwtYNdHVLj4Zs0B1MZWmWQOK7weMShX5DSH4nE lmKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="ZL/JBEgo"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si18198295ejk.645.2021.09.27.05.02.35; Mon, 27 Sep 2021 05:03:10 -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=@ziepe.ca header.s=google header.b="ZL/JBEgo"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234213AbhI0MAx (ORCPT + 99 others); Mon, 27 Sep 2021 08:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234202AbhI0MAx (ORCPT ); Mon, 27 Sep 2021 08:00:53 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C0FCC061604 for ; Mon, 27 Sep 2021 04:59:15 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id jo30so10928486qvb.3 for ; Mon, 27 Sep 2021 04:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OO+222/P86uXwx2DUL7XFhBRQH7h34PJA8Pu8TuCXwk=; b=ZL/JBEgooXnyCrC3PZPifhJMY7c0Spp/pZ7ZbJcxAvO4SqqgAZ72SQw1SpsFOhGJik r6kco9u/CEuUQUy1UXj0T5NAMwNNub1UrY8miVFHVNQOaPOum8mmcUmWyEvd2tUY6wJZ QORuXO0DHVZ8UTLk/gsT3RRecjE0wI/1WdxQ/ruAihzgIKEkc+tUFVaXQfpeT+ybnk58 Xl8qE1C6CZsFTQ2e+Mg7qtIeT3Soxdg2aqFveBi5376gcp+Rm9rX3sXEoCH5Q7E/2gpy ubMVSOSLdSn3zBhjY6WAI/wlkpGYskTbOdp/Sh7j3/9pEQ/Bk4Epm3qeK+LDMKtKsawt QbYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OO+222/P86uXwx2DUL7XFhBRQH7h34PJA8Pu8TuCXwk=; b=YyOtd5+hGVCiaxp/8Qodv4B6el1tVRrSp06FUP2X02MSUj0qB3SCDBcKf6lMQcP50r KsCnjvNJKjONR17IGm7eGz/Tt0LPNdrG86ELkN+11h92N1gnH6X0mWsVcK7Fm9uYx1pP f9tbyvsj5ICx9HfsWADU0rB3JUVI0NGFThPi735mbJEDgoqzPRazOLXLwl0trbHKCoM7 aLkkU+1R2qYO98gY3BcNQkw8bnYBZHcgBQfq8B1AsgmDk3gQBGUQXB0ITTwARHkSlDiV lDbAHWPGsR507tShjCoRraKIuKytuAyxPv+DVfI+qvVPgyhduEgLSbxfWWpH49iqz86Z pk4w== X-Gm-Message-State: AOAM532m5TOVP9P6+P9Kvt6qyK4zvfbCSstL0NBLVjXcBksZBaabgQDS 4tHwnQOTtnORXHY810Y0IYrVtg== X-Received: by 2002:a0c:cb10:: with SMTP id o16mr23618362qvk.57.1632743954338; Mon, 27 Sep 2021 04:59:14 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id q24sm12708403qkj.77.2021.09.27.04.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 04:59:13 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mUpHt-006Ivp-6R; Mon, 27 Sep 2021 08:59:13 -0300 Date: Mon, 27 Sep 2021 08:59:13 -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: <20210927115913.GA3544071@ziepe.ca> References: <20210926061116.282-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210926061116.282-1-caihuoqing@baidu.com> 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 > --- > drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 20 +++++--------------- > 1 file changed, 5 insertions(+), 15 deletions(-) Given I don't see any dma_sync_single calls for this mapping, isn't this a correctness fix too? Jason