From owner-svn-src-head@FreeBSD.ORG Fri Aug 29 17:31:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D05699D; Fri, 29 Aug 2014 17:31:35 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E17E1B96; Fri, 29 Aug 2014 17:31:35 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B778625D387C; Fri, 29 Aug 2014 17:31:32 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 7A085C77087; Fri, 29 Aug 2014 17:31:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id RjTt8ZWQSQQz; Fri, 29 Aug 2014 17:31:29 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:bd32:216a:c6e2:8d] (unknown [IPv6:fde9:577b:c1a9:4410:bd32:216a:c6e2:8d]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 32580C77086; Fri, 29 Aug 2014 17:31:27 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r270806 - head/sys/dev/ixl From: "Bjoern A. Zeeb" In-Reply-To: <20140829171452.GO2737@kib.kiev.ua> Date: Fri, 29 Aug 2014 17:31:21 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201408291240.s7TCe1OQ029986@svn.freebsd.org> <20140829171452.GO2737@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2014 17:31:35 -0000 On 29 Aug 2014, at 17:14 , Konstantin Belousov = wrote: > On Fri, Aug 29, 2014 at 12:40:01PM +0000, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Fri Aug 29 12:40:01 2014 >> New Revision: 270806 >> URL: http://svnweb.freebsd.org/changeset/base/270806 >>=20 >> Log: >> Properly handle prefetch only for amd64 and i386 as we do elsewhere. >>=20 >> In general theraven is right that we should factr this out and = provide >> a general and per-arch implementation that everything can use. >>=20 >> MFC after: 3 days >> X-MFC with: r270755 >>=20 >> Modified: >> head/sys/dev/ixl/i40e_osdep.h >>=20 >> Modified: head/sys/dev/ixl/i40e_osdep.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/dev/ixl/i40e_osdep.h Fri Aug 29 11:18:54 2014 = (r270805) >> +++ head/sys/dev/ixl/i40e_osdep.h Fri Aug 29 12:40:01 2014 = (r270806) >> @@ -137,11 +137,15 @@ struct i40e_spinlock { >>=20 >> #define le16_to_cpu=20 >>=20 >> +#if defined(__amd64__) || defined(i386) >> static __inline >> void prefetch(void *x) >> { >> __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); >> } > This only fix the build failure, but the code is still somewhat wrong. >=20 > Availability of the prefetch instruction depends on the presence of = SSE. We have quite a few of these as-are in the tree already; I guess they = all need fixing. > Althought it is probably impossible to find a machine where the = intended > hardware can operate and which does not support SSE _currently_, I am > not sure that it is wise to hard-code SSE instructions in the i386 > kernel. >=20 > Might be, a change of the compilation test from both amd64 and i386 to > just amd64 is due. I doubt that anybody would use 40Gb with 32bit OS, > and even if somebody does, that the performace is at the stake in > this case. >=20 I think going with David=92s suggestion to do the right thing and = centralise them somewhere so everything can use it is the proper way = forward. I think there=92s also a __builtin_prefetch(). >> +#else >> +#define prefetch(x) >> +#endif >>=20 >> struct i40e_osdep >> { =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983