From owner-svn-src-head@freebsd.org Thu Jun 14 01:15:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6BA7100B792; Thu, 14 Jun 2018 01:15:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6646E8786F; Thu, 14 Jun 2018 01:15:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 465F521560; Thu, 14 Jun 2018 01:15:21 +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 w5E1FLle099591; Thu, 14 Jun 2018 01:15:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5E1FJH6099583; Thu, 14 Jun 2018 01:15:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806140115.w5E1FJH6099583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Jun 2018 01:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335101 - in head: sbin sbin/camcontrol share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sbin sbin/camcontrol share/mk X-SVN-Commit-Revision: 335101 X-SVN-Commit-Repository: base 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.26 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: Thu, 14 Jun 2018 01:15:22 -0000 Author: imp Date: Thu Jun 14 01:15:19 2018 New Revision: 335101 URL: https://svnweb.freebsd.org/changeset/base/335101 Log: NVME support is only for x86 and powerpc64. Implement MK_NVME now that the expression for where NVMe is complicated. Default it to "yes" for x86 and powerpc64 and no everywhere else. Use it in camcontrol to define WITH_NVME for those platforms where we support nvme. This should fix the newly introduced nvme files to camcontrol which were building everywhere. Pointy Hat To: imp Sponsored by: Netflix Modified: head/sbin/Makefile head/sbin/Makefile.amd64 head/sbin/Makefile.i386 head/sbin/Makefile.powerpc64 head/sbin/camcontrol/Makefile head/sbin/camcontrol/camcontrol.c head/share/mk/src.opts.mk Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile Thu Jun 14 01:15:19 2018 (r335101) @@ -82,6 +82,7 @@ SUBDIR.${MK_IPFW}+= natd SUBDIR.${MK_ISCSI}+= iscontrol SUBDIR.${MK_NAND}+= nandfs SUBDIR.${MK_NAND}+= newfs_nandfs +SUBDIR.${MK_NVME}+= nvmecontrol SUBDIR.${MK_OPENSSL}+= decryptcore SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd Modified: head/sbin/Makefile.amd64 ============================================================================== --- head/sbin/Makefile.amd64 Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile.amd64 Thu Jun 14 01:15:19 2018 (r335101) @@ -2,4 +2,3 @@ SUBDIR += bsdlabel SUBDIR += fdisk -SUBDIR += nvmecontrol Modified: head/sbin/Makefile.i386 ============================================================================== --- head/sbin/Makefile.i386 Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile.i386 Thu Jun 14 01:15:19 2018 (r335101) @@ -2,5 +2,4 @@ SUBDIR += bsdlabel SUBDIR += fdisk -SUBDIR += nvmecontrol SUBDIR += sconfig Modified: head/sbin/Makefile.powerpc64 ============================================================================== --- head/sbin/Makefile.powerpc64 Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/Makefile.powerpc64 Thu Jun 14 01:15:19 2018 (r335101) @@ -2,4 +2,3 @@ SUBDIR += bsdlabel SUBDIR += fdisk -SUBDIR += nvmecontrol Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/camcontrol/Makefile Thu Jun 14 01:15:19 2018 (r335101) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=runtime PROG= camcontrol SRCS= camcontrol.c util.c @@ -8,11 +10,13 @@ SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist. .else CFLAGS+= -DMINIMALISTIC .endif +.if ${MK_NVME} != "no" .PATH: ${SRCTOP}/sbin/nvmecontrol -CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol +CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME SRCS+= identify_ext.c nc_util.c .PATH: ${SRCTOP}/sys/dev/nvme SRCS+= nvme_util.c +.endif # This is verboten .if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Jun 14 00:20:55 2018 (r335100) +++ head/sbin/camcontrol/camcontrol.c Thu Jun 14 01:15:19 2018 (r335101) @@ -63,7 +63,9 @@ __FBSDID("$FreeBSD$"); #include #include #include "camcontrol.h" +#ifdef WITH_NVME #include "nvmecontrol_ext.h" +#endif typedef enum { CAM_CMD_NONE = 0x00000000, @@ -281,7 +283,9 @@ static int print_dev_ata(struct device_match_result *d static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr); static int print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr); +#ifdef WITH_NVME static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr); +#endif #ifndef MINIMALISTIC static int testunitready(struct cam_device *device, int task_attr, int retry_count, int timeout, int quiet); @@ -602,12 +606,14 @@ getdevtree(int argc, char **argv, char *combinedopt) skip_device = 1; break; } +#ifdef WITH_NVME } else if (dev_result->protocol == PROTO_NVME) { if (print_dev_nvme(dev_result, &tmpstr[0]) != 0) { skip_device = 1; break; } +#endif } else { sprintf(tmpstr, "<>"); } @@ -763,6 +769,7 @@ print_dev_mmcsd(struct device_match_result *dev_result return (0); } +#ifdef WITH_NVME static int nvme_get_cdata(struct cam_device *dev, struct nvme_controller_data *cdata) { @@ -824,6 +831,7 @@ print_dev_nvme(struct device_match_result *dev_result, cam_close_device(dev); return (0); } +#endif #ifndef MINIMALISTIC static int @@ -2402,6 +2410,7 @@ ataidentify(struct cam_device *device, int retry_count return (0); } +#ifdef WITH_NVME static int nvmeidentify(struct cam_device *device, int retry_count __unused, int timeout __unused) { @@ -2413,10 +2422,12 @@ nvmeidentify(struct cam_device *device, int retry_coun return (0); } +#endif static int identify(struct cam_device *device, int retry_count, int timeout) { +#ifdef WITH_NVME struct ccb_pathinq cpi; if (get_cpi(device, &cpi) != 0) { @@ -2427,6 +2438,7 @@ identify(struct cam_device *device, int retry_count, i if (cpi.protocol == PROTO_NVME) { return (nvmeidentify(device, retry_count, timeout)); } +#endif return (ataidentify(device, retry_count, timeout)); } #endif /* MINIMALISTIC */ @@ -5206,6 +5218,7 @@ cts_print(struct cam_device *device, struct ccb_trans_ "enabled" : "disabled"); } } +#ifdef WITH_NVME if (cts->protocol == PROTO_NVME) { struct ccb_trans_settings_nvme *nvmex = &cts->xport_specific.nvme; @@ -5222,6 +5235,7 @@ cts_print(struct cam_device *device, struct ccb_trans_ nvmex->speed, nvmex->max_speed); } } +#endif } /* Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jun 14 00:20:55 2018 (r335100) +++ head/share/mk/src.opts.mk Thu Jun 14 01:15:19 2018 (r335101) @@ -322,6 +322,13 @@ __DEFAULT_NO_OPTIONS+=CXGBETOOL __DEFAULT_NO_OPTIONS+=MLX5TOOL .endif +# NVME is only x86 and powerpc64 +.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64" +__DEFAULT_YES_OPTIONS+=NVME +.else +__DEFAULT_NO_OPTIONS+=NVME +.endif + .include #