From owner-svn-src-head@freebsd.org Tue Mar 7 23:03:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9DE4D0237E; Tue, 7 Mar 2017 23:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A723A1743; Tue, 7 Mar 2017 23:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v27N2xro006885; Tue, 7 Mar 2017 23:02:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v27N2xZG006884; Tue, 7 Mar 2017 23:02:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703072302.v27N2xZG006884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 7 Mar 2017 23:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314888 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 07 Mar 2017 23:03:01 -0000 Author: imp Date: Tue Mar 7 23:02:59 2017 New Revision: 314888 URL: https://svnweb.freebsd.org/changeset/base/314888 Log: cwd10 takes the low 32-bits and cwd11 takes the upper 32-bits of the lba. Rather than do a cast to uint64_t, which clang warns might be unaligned, do the stores 32-bits at a time. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme.h Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Tue Mar 7 22:42:44 2017 (r314887) +++ head/sys/dev/nvme/nvme.h Tue Mar 7 23:02:59 2017 (r314888) @@ -955,7 +955,8 @@ void nvme_ns_rw_cmd(struct nvme_command { cmd->opc = rwcmd; cmd->nsid = nsid; - *(uint64_t *)&cmd->cdw10 = lba; + cmd->cdw10 = lba & 0xffffffffu; + cmd->cdw11 = lba >> 32; cmd->cdw12 = count-1; cmd->cdw13 = 0; cmd->cdw14 = 0;