Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3344774ybl; Mon, 19 Aug 2019 17:08:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3QK/j4b81jcOCMj+E4mIeScL84W3c+oaq3X9EyIKkwpJ3sHjs4TKvHFsmJs5yva8zGMPp X-Received: by 2002:a17:90a:bf82:: with SMTP id d2mr12905155pjs.121.1566259732962; Mon, 19 Aug 2019 17:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566259732; cv=none; d=google.com; s=arc-20160816; b=OvMOdFgY/SjlgCGq6332342RSWdRePc7GeuhunMmJA0eA8+RJziXxmDDsgCEhhpGqZ LDqRsE+r6N7PY5FulRm401kh0Gww9f0oYuC2b4I4TdvtL7k5GtqO8dlogg2JyXBVWawd f7nCU2EmE8V0ZQGGgBiQ7w/3ZmZJ3htdfyENcxIRfT2B691vv4gp7bF9GX/P+B3pmLGi crDRb5Z2Y7HLnqcCkJYr9RstrYH3x/WsOXmpzT2N7DKXzNLctt5mSwhpjjthcM0qjml8 RHucq660ycwL5EeusPOXpSQUZ4B5CfsFYX1osIBEUwYn+cGMz8vLwiGbOVQ/l5dkQ4CF lYcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=XAiAnlHmkO+0jIPS0nCrMqFBgMcioHrpGQSObqqyeas=; b=arhaua8X6ZLMsozAd2HOTr/V99E0w1naC021pNJYbp6niYhWyNbsFoJDQkuCBr+t5X it7EHx/vklUCk9W7mhflAd3jBeU+oyOxTo+qOFK29C6PpgvS5ZjxmIq36jxyJzndnjPp NbaOdueolQaEv/qbGrbRgCEXzM+NvET/PIhd0TLZZAN7FQXkuS9sLIp13+lLJEErT6z+ J4XMm/08WvvKmdvpo1VF6HSMV6dJXE3FtKwJsGoLCc/Xh1fQ+p4ZLXBfwFbiG5gbKnjE ocI39nBZP3qti/QSkFUDy+socRLce0vDN8yb04iikxfXTuCRHF8xVjgooHnYG6E9on1+ fSDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=dfIUq6dd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z190si10682016pgd.303.2019.08.19.17.08.37; Mon, 19 Aug 2019 17:08:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=dfIUq6dd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728809AbfHTAHq (ORCPT + 99 others); Mon, 19 Aug 2019 20:07:46 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:39004 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728741AbfHTAHp (ORCPT ); Mon, 19 Aug 2019 20:07:45 -0400 Received: by mail-qt1-f194.google.com with SMTP id l9so4010193qtu.6 for ; Mon, 19 Aug 2019 17:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=XAiAnlHmkO+0jIPS0nCrMqFBgMcioHrpGQSObqqyeas=; b=dfIUq6ddf9ulKASU6Bv2+Z+qverPNdci02k7EuMkUVkCz1tzrPT2V+peCQB1mSaYn2 WbClo3aQBa1BfkNHVrbwUW9+4yBrOVVxNn+YsIKbgq6VUxYvdz73CgyNgwAxj6PZS5OJ 6JYvvcuEX9N1qMJfiar986WkawCYWvo4FHiHy7AiM8/0h9oRftPVOhvBxSTeWF4NwtEi PWVsa8m13KOJVYNQbzKp+bw38O/l8m3ATDg0lpwP+LdWw3PIL2Oo7j/osajOs2aBlh+6 gS4HOs3nx2YT+WIXvckHc35hK3uAI84RgRaechcT/wEOcLH2DzcowDvWNTiqJIvmRT4W l0Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=XAiAnlHmkO+0jIPS0nCrMqFBgMcioHrpGQSObqqyeas=; b=lpANeWmrJ9Sc9gcxOPI9p1V72yyq9WgdUEvZ70hhUXk3mdsQpGV8ih+1gXTBboJme+ ztiv1S4UmIVRChIYGMOvBP78KUuoiXc0agrxLC62bcrdF+LhpoMN4Ug4gVTUwg+Ve1KA yzcfkWeg0osSnCYD56vFWcSyUr2e6s2fBqboyPe85ZwRnmMvebYVeoJgf3Y4J3/HxQnD vhqlEhMv2xZ6DmeIEZpnnmpHcEsh0Mtc2q0g+cmDTiMWB+gE1ic8O5oSzqHiiQAOzYGu ks0I8rY6g33xH69TDKsT1/lfqDqlat/9Op2FljjzaaXXKwS1le+hMJVs8W0YpxhhsK7f V72g== X-Gm-Message-State: APjAAAU8qmhsgEEpkVSHnEKeuxM/8UCGXZty1Op/MPZDnNZq0wn/UpuZ 5wWS+BRji+LyC+WlSbYt03sXVg== X-Received: by 2002:aed:27c9:: with SMTP id m9mr23137596qtg.322.1566259664507; Mon, 19 Aug 2019 17:07:44 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id a23sm1283772qtj.5.2019.08.19.17.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 17:07:44 -0700 (PDT) Date: Mon, 19 Aug 2019 17:07:35 -0700 From: Jakub Kicinski To: Thomas Bogendoerfer Cc: Jonathan Corbet , Ralf Baechle , Paul Burton , James Hogan , Dmitry Torokhov , Lee Jones , "David S. Miller" , Srinivas Kandagatla , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Jiri Slaby , Evgeniy Polyakov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v5 12/17] net: sgi: ioc3-eth: use dma-direct for dma allocations Message-ID: <20190819170735.13884ec9@cakuba.netronome.com> In-Reply-To: <20190819163144.3478-13-tbogendoerfer@suse.de> References: <20190819163144.3478-1-tbogendoerfer@suse.de> <20190819163144.3478-13-tbogendoerfer@suse.de> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Aug 2019 18:31:35 +0200, Thomas Bogendoerfer wrote: > @@ -1386,18 +1427,24 @@ static netdev_tx_t ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) > unsigned long b2 = (data | 0x3fffUL) + 1UL; > unsigned long s1 = b2 - data; > unsigned long s2 = data + len - b2; > + dma_addr_t d; > > desc->cmd = cpu_to_be32(len | ETXD_INTWHENDONE | > ETXD_B1V | ETXD_B2V | w0); > desc->bufcnt = cpu_to_be32((s1 << ETXD_B1CNT_SHIFT) | > (s2 << ETXD_B2CNT_SHIFT)); > - desc->p1 = cpu_to_be64(ioc3_map(skb->data, 1)); > - desc->p2 = cpu_to_be64(ioc3_map((void *)b2, 1)); > + d = dma_map_single(ip->dma_dev, skb->data, s1, DMA_TO_DEVICE); You'll need to check the DMA address with dma_mapping_error(dev, addr), otherwise static checkers will get upset. > + desc->p1 = cpu_to_be64(ioc3_map(d, PCI64_ATTR_PREF)); > + d = dma_map_single(ip->dma_dev, (void *)b2, s1, DMA_TO_DEVICE); > + desc->p2 = cpu_to_be64(ioc3_map(d, PCI64_ATTR_PREF));