Date: Sat, 19 Nov 2016 21:46:13 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308869 - head/sbin/nvmecontrol Message-ID: <201611192146.uAJLkDP5094317@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sat Nov 19 21:46:13 2016 New Revision: 308869 URL: https://svnweb.freebsd.org/changeset/base/308869 Log: i386 turns out to not have __uint128_t. So confusingly use 64-bit math instead. Since we're little endian, we can get away with it. Also, since the counters in quesitons would require billions of iops for tens of billions of seconds to overflow, and since such data rates are unlikely for people using i386 for a while, that's OK. The fastest cards today can't do even a million IOPs. Noticed by: dim@ Sponsored by: Netflix, Inc Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Sat Nov 19 21:10:46 2016 (r308868) +++ head/sbin/nvmecontrol/logpage.c Sat Nov 19 21:46:13 2016 (r308869) @@ -75,10 +75,18 @@ kv_lookup(const struct kv_name *kv, size } /* - * 128-bit integer augments to standard values + * 128-bit integer augments to standard values. On i386 this + * doesn't exist, so we use 64-bit values. The 128-bit counters + * are crazy anyway, since for this purpose, you'd need a + * billion IOPs for billions of seconds to overflow them. + * So, on 32-bit i386, you'll get truncated values. */ #define UINT128_DIG 39 +#ifdef __i386__ +typedef uint64_t uint128_t; +#else typedef __uint128_t uint128_t; +#endif static inline uint128_t to128(void *p)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611192146.uAJLkDP5094317>