Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2234429ybi; Thu, 20 Jun 2019 11:19:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy17WS58rh74dAkf220sD3G3fNjw5qxaNg8GFJ7sc2oUZxRjRYvNUC0pElpRJarFnw6ASoE X-Received: by 2002:a63:2a8d:: with SMTP id q135mr13971607pgq.46.1561054780828; Thu, 20 Jun 2019 11:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054780; cv=none; d=google.com; s=arc-20160816; b=zDA2rSj3h8RiOhXioUHXWwomnXWhsiUwnkGUEf7XTwRI7IGwLTgPJ5r3SCsMuQKfAd CJ69Jf1b+o2Uao9UrRWvGHeQ1Q0zDr0IvUDFGx7Kfz0w0/GJhn+sy1hY9rGr2/Yh8oXB Tnjc1bBBA7eR7PWrPAKBkss0u20drag+Q7cjcNizwFOBTzFJT6/sWnKMQuWSuoHS13u5 f8UBTXvzrWB0bBE4CLbWoDYU27ArqKZ1fn+naBmwyM/aQDLB0xlZJnbbtyWvsSX1SzGX ThEawDqikFSAq/cHH32HFdNvZcw1MTIQSzb/kH9GQIRrei0LYTDM6TWdokwBY9CS6BZ4 jzeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=c5KP8jPTeaaqwDw6eQGGAXLzK2AwEUdIyoOH5xo6ieg=; b=Q2t7MtvfHAntQ14fSUhyY6J68DOC1fXiEPvAXFiaXYihwiDvw88ydkkvGfazKeYoV4 YK8TlkKIGgo5pYrbWJgzXWjc/ZuDmiDho+XDaSGMQXxqTz9NVHPvSvZ/dHA9kaIHy/wf HGI3s8dmvR64pqcEzYsAoEluoDgJO4MXVX9UtJRuP98T8CPdRx4sbfr4F8fXnVyuMuh9 w1ZekvzbhMwUwvcLnqVTWWptAeV1Bi1Mn+Gk8k4UE4DQEKyyGVZ4+Cj1ZrjD/gvQg5PE zy/VwWj4BCkfX4ZQHDPQ1Wv3uWA+k0rLw492nU+s46aiOxG2/AWkT7kFcPLMn3R8V5HY uDWQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h36si318125plb.199.2019.06.20.11.19.25; Thu, 20 Jun 2019 11:19:40 -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; 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 S1729476AbfFTSTP (ORCPT + 99 others); Thu, 20 Jun 2019 14:19:15 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:38034 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727349AbfFTSTM (ORCPT ); Thu, 20 Jun 2019 14:19:12 -0400 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23994574AbfFTSTIXLeUG (ORCPT + 1 other); Thu, 20 Jun 2019 20:19:08 +0200 Date: Thu, 20 Jun 2019 19:19:08 +0100 (BST) From: "Maciej W. Rozycki" To: Paul Burton cc: Serge Semin , Ralf Baechle , James Hogan , Serge Semin , Arnd Bergmann , "Vadim V . Vlasov" , "linux-mips@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mips: Remove q-accessors from non-64bit platforms In-Reply-To: <20190620174002.tgayzon7dc5d57fh@pburton-laptop> Message-ID: References: <20190614063341.1672-1-fancer.lancer@gmail.com> <20190620174002.tgayzon7dc5d57fh@pburton-laptop> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Jun 2019, Paul Burton wrote: > So this seems pretty reasonable. Build testing all our defconfigs only > showed up one issue for decstation_defconfig & decstation_r4k_defconfig: > > drivers/net/fddi/defza.c: In function 'fza_reads': > drivers/net/fddi/defza.c:88:17: error: implicit declaration of > function 'readq_relaxed'; did you mean 'readw_relaxed'? > [-Werror=implicit-function-declaration] > #define readq_u readq_relaxed > ^~~~~~~~~~~~~ > drivers/net/fddi/defza.c:126:13: note: in expansion of macro 'readq_u' > *dst++ = readq_u(src++); > ^~~~~~~ > drivers/net/fddi/defza.c: In function 'fza_writes': > drivers/net/fddi/defza.c:92:18: error: implicit declaration of > function 'writeq_relaxed'; did you mean 'writel_relaxed'? > [-Werror=implicit-function-declaration] > #define writeq_u writeq_relaxed > ^~~~~~~~~~~~~~ > drivers/net/fddi/defza.c:151:4: note: in expansion of macro 'writeq_u' > writeq_u(*src++, dst++); > ^~~~~~~~ > CC net/core/scm.o > cc1: some warnings being treated as errors > make[4]: *** [scripts/Makefile.build:279: drivers/net/fddi/defza.o] Error 1 > > These uses of readq_relaxed & writeq_relaxed are both conditional upon > sizeof(unsigned long) == 8, ie. upon CONFIG_64BIT=y so they're not going > to present a runtime issue but we need to provide some implementation of > the *q accessors to keep the compiler happy. > > I see a few options: > > 1) We could just have defza.c include to get > the appropriate declarations, which should then get optimized away by > the compiler anyway & never actually be used. This, definitely. > 2) We could have defza.h #define its readq_u & writeq_u macros > differently for CONFIG_32BIT=y kernels, perhaps using > __compiletime_error to catch any bogus use of them. > > 3) We could do the same in a generic header, though if nobody else has > needed it so far & this is the only place we need it then maybe it's > not worth it. > > So I'm thinking option 2 might be best, as below. Having said that I > don't mind option 1 either - it's simple. Maciej do you have any > preference? The use of 64-bit operations to access option's packet memory, which is true SRAM, i.e. no side effects, is to improve throughput only and there's no need for atomicity here nor also any kind of barriers, except at the conclusion. Splitting 64-bit accesses into 32-bit halves in software would not be a functional error here. I benchmarked it back in the day and the difference was noticeable with actual network transmissions between loops using 32-bit (LW/SW) and 64-bit (LD/SD) accesses respectively, though I may not be able to track down the figures anymore as it must have been some 18 years ago. The performance of the MB ASIC used to interface the R4400 CPU to DRAM and TURBOchannel with the 5000/260 systems was stellar as it was specifically designed with high throughput in mind, as an upgrade to the exiting R3400-based 5000/240 systems (the CPU and the ASIC are both on a daughtercard), though new such machines used to be sold as well. For the record the CPU and TURBOchannel run at 60MHz (40MHz with the R3400) and 25MHz respectively with these systems. Thanks for the heads-up! Maciej