From owner-svn-src-all@FreeBSD.ORG Fri Aug 29 17:14:58 2014 Return-Path: Delivered-To: svn-src-all@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 89AE6F4B; Fri, 29 Aug 2014 17:14:58 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20F8E1A11; Fri, 29 Aug 2014 17:14:57 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s7THEqCw020100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 29 Aug 2014 20:14:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s7THEqCw020100 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s7THEq4q020099; Fri, 29 Aug 2014 20:14:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 29 Aug 2014 20:14:52 +0300 From: Konstantin Belousov To: "Bjoern A. Zeeb" Subject: Re: svn commit: r270806 - head/sys/dev/ixl Message-ID: <20140829171452.GO2737@kib.kiev.ua> References: <201408291240.s7TCe1OQ029986@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W7QQkl7z0febBjsc" Content-Disposition: inline In-Reply-To: <201408291240.s7TCe1OQ029986@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2014 17:14:58 -0000 --W7QQkl7z0febBjsc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. Availability of the prefetch instruction depends on the presence of SSE. 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. 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. > +#else > +#define prefetch(x) > +#endif > =20 > struct i40e_osdep > { --W7QQkl7z0febBjsc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUALULAAoJEJDCuSvBvK1BIhEP+wTTEARsI1gCxSSxmnsadlqb A3atej9Di98tnZ9mFo4EJxRZ0GiYR2b1ksbAWhSC05uZBQA2p3SZnfNchnvV0xuJ //BJiJ2br2Bldv++FZ37kf/HRl4i3lfVpENiDZtaiUGBRUKYQ/rIjMXhhi7rGEgZ Iyio9BXGIBHi+xtB/VQ27cmeyvTLpl7mzj8pPl59n5tGN0UnHcyovYFdKnol8nKz Ho4U7RzJrR/sBgAzxL4Qns+lByWl2lWN4PWJ2nQxFxjQlD7q5xUgmfJJYatq8V60 YyxnosHV0NlWyEzMJYS90SpAEpojamgx1GH/ui50OewekcC3zudXph9rbGIRfSQE BPJOyh0KzXRtn/ljqhPWYse3bvLAcISO1k0CuYXQVz9qjPduq9Ew9nGpUo6uPLju zP6fwwTcYnybCRwHpOA+oJYT20TbHMFRcD2EvSouEBL046qWWSCOyBnWmB7i95ei p/CCLwbB5ML+Kj7bqMX2lCsHT9Si1P2OWOtLLtrv+zJ9tQUceUTkxuYUIT8OM7IN GZUF68VRLFZtcofssC+WERi/KnDwrZYSJDaLEstHVz34OnHeIWSJkSjeVSLEw/s9 vWAFJLSQPNIaNxmN9fyNwEbreLhtFYc25RQXNl6vhXWjDmVMIQ6FqXuWDwA2ymC7 FDEtMKBn8w6hTdVRx2ba =d5nb -----END PGP SIGNATURE----- --W7QQkl7z0febBjsc--