From owner-svn-src-stable-11@freebsd.org Sun Dec 30 04:31:52 2018 Return-Path: Delivered-To: svn-src-stable-11@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 03EFB143B003; Sun, 30 Dec 2018 04:31:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1006D7D9; Sun, 30 Dec 2018 04:31:51 +0000 (UTC) (envelope-from cy@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 913401DC57; Sun, 30 Dec 2018 04:31:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU4Vp7s093856; Sun, 30 Dec 2018 04:31:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4VpKc093855; Sun, 30 Dec 2018 04:31:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300431.wBU4VpKc093855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342606 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E1006D7D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Dec 2018 04:31:52 -0000 Author: cy Date: Sun Dec 30 04:31:51 2018 New Revision: 342606 URL: https://svnweb.freebsd.org/changeset/base/342606 Log: MFC r341279: Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ is defined in net/if.h, therefore the condition is never met and confusing to those who follow. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:25:48 2018 (r342605) +++ stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) @@ -1400,10 +1400,6 @@ typedef struct tcpiphdr tcpiphdr_t; #undef ICMP_MAXTYPE #define ICMP_MAXTYPE 18 -#ifndef IFNAMSIZ -#define IFNAMSIZ 16 -#endif - #ifndef LOG_FTP # define LOG_FTP (11<<3) #endif From owner-svn-src-stable-11@freebsd.org Sun Dec 30 04:37:50 2018 Return-Path: Delivered-To: svn-src-stable-11@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 B70D3143B264; Sun, 30 Dec 2018 04:37:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 525396DB44; Sun, 30 Dec 2018 04:37:50 +0000 (UTC) (envelope-from cy@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 3EF4F1DDB1; Sun, 30 Dec 2018 04:37:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU4boKY094199; Sun, 30 Dec 2018 04:37:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4bnUb094196; Sun, 30 Dec 2018 04:37:49 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300437.wBU4bnUb094196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342607 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 525396DB44 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Dec 2018 04:37:51 -0000 Author: cy Date: Sun Dec 30 04:37:49 2018 New Revision: 342607 URL: https://svnweb.freebsd.org/changeset/base/342607 Log: MFC r342377: Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9) framework is available. pfil(9) has been in FreeBSD since FreeBSD 5 and according to svn log was first committed to HEAD in 2000, therefore it is safe to say the check is no longer needed in FreeBSD. pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF). Therefore it is safe to say that it is supported by every NetBSD system today. The framework also exists in illumos. As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and at some point in the future illumos too, and as all three platforms have pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_fil.h stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_compat.h stable/12/sys/contrib/ipfilter/netinet/ip_fil.h stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:37:49 2018 (r342607) @@ -146,7 +146,6 @@ struct ether_addr { # define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) # define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# define NETBSD_PF # else # include # endif /* _KERNEL */ Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:37:49 2018 (r342607) @@ -1435,22 +1435,6 @@ typedef struct ipftune { # define CDEV_MAJOR 79 #endif -/* - * Post NetBSD 1.2 has the PFIL interface for packet filters. This turns - * on those hooks. We don't need any special mods in non-IP Filter code - * with this! - */ -#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \ - (defined(NetBSD1_2) && NetBSD1_2 > 1) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 500043)) -# if (defined(NetBSD) && NetBSD >= 199905) -# define PFIL_HOOKS -# endif -# ifdef PFIL_HOOKS -# define NETBSD_PF -# endif -#endif - #ifdef _KERNEL # define FR_VERBOSE(verb_pr) # define FR_DEBUG(verb_pr) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:31:51 2018 (r342606) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:37:49 2018 (r342607) @@ -97,9 +97,7 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { #define V_ipfmain VNET(ipfmain) # include -# if defined(NETBSD_PF) # include -# endif /* NETBSD_PF */ static eventhandler_tag ipf_arrivetag, ipf_departtag; #if 0 @@ -1336,14 +1334,11 @@ ipf_inject(fin, m) } int ipf_pfil_unhook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -#ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); if (ph_inet != NULL) pfil_remove_hook((void *)ipf_check_wrapper, NULL, @@ -1354,20 +1349,16 @@ int ipf_pfil_unhook(void) { pfil_remove_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -#endif return (0); } int ipf_pfil_hook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -# ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); # ifdef USE_INET6 ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); @@ -1388,7 +1379,6 @@ int ipf_pfil_hook(void) { pfil_add_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -# endif return (0); } From owner-svn-src-stable-11@freebsd.org Sun Dec 30 04:42:03 2018 Return-Path: Delivered-To: svn-src-stable-11@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 E5140143B44B; Sun, 30 Dec 2018 04:42:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC556E037; Sun, 30 Dec 2018 04:42:02 +0000 (UTC) (envelope-from cy@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 7DE6A1DE3A; Sun, 30 Dec 2018 04:42:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU4g2ck099147; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4g236099146; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300442.wBU4g236099146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342608 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CC556E037 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Dec 2018 04:42:03 -0000 Author: cy Date: Sun Dec 30 04:42:01 2018 New Revision: 342608 URL: https://svnweb.freebsd.org/changeset/base/342608 Log: MFC r342547: Remove another empty #ifdef block. This empty block also exists in the upstream HEAD. Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:37:49 2018 (r342607) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:42:01 2018 (r342608) @@ -4266,8 +4266,6 @@ copyoutptr(softc, src, dst, size) } return error; } -#ifdef _KERNEL -#endif /* ------------------------------------------------------------------------ */ From owner-svn-src-stable-11@freebsd.org Sun Dec 30 15:21:30 2018 Return-Path: Delivered-To: svn-src-stable-11@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 501AB142B798; Sun, 30 Dec 2018 15:21:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA64B89456; Sun, 30 Dec 2018 15:21:29 +0000 (UTC) (envelope-from kib@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 20B8424D6D; Sun, 30 Dec 2018 15:21:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUFLPob034169; Sun, 30 Dec 2018 15:21:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFLP7a034168; Sun, 30 Dec 2018 15:21:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301521.wBUFLP7a034168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342623 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 342623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA64B89456 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Dec 2018 15:21:30 -0000 Author: kib Date: Sun Dec 30 15:21:25 2018 New Revision: 342623 URL: https://svnweb.freebsd.org/changeset/base/342623 Log: MFC r342381: Allocate v_object for the new snapshot vnode. Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Sun Dec 30 15:20:35 2018 (r342622) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Sun Dec 30 15:21:25 2018 (r342623) @@ -300,6 +300,7 @@ restart: return (error); } vp = nd.ni_vp; + vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); devvp = ITODEVVP(ip); From owner-svn-src-stable-11@freebsd.org Sun Dec 30 15:20:36 2018 Return-Path: Delivered-To: svn-src-stable-11@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 487E5142B651; Sun, 30 Dec 2018 15:20:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF31F890E0; Sun, 30 Dec 2018 15:20:35 +0000 (UTC) (envelope-from kib@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 C5F9824C2B; Sun, 30 Dec 2018 15:20:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUFKZXJ033344; Sun, 30 Dec 2018 15:20:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFKZq6033343; Sun, 30 Dec 2018 15:20:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301520.wBUFKZq6033343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342622 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 342622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF31F890E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Dec 2018 15:20:36 -0000 Author: kib Date: Sun Dec 30 15:20:35 2018 New Revision: 342622 URL: https://svnweb.freebsd.org/changeset/base/342622 Log: MFC r342380: Properly test for vmio buffer in bnoreuselist(). Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Sun Dec 30 15:17:57 2018 (r342621) +++ stable/11/sys/kern/vfs_subr.c Sun Dec 30 15:20:35 2018 (r342622) @@ -1773,7 +1773,7 @@ again: * reused. Dirty buffers will have the hint applied once * they've been written. */ - if (bp->b_vp->v_object != NULL) + if ((bp->b_flags & B_VMIO) != 0) bp->b_flags |= B_NOREUSE; brelse(bp); BO_RLOCK(bo); From owner-svn-src-stable-11@freebsd.org Mon Dec 31 03:53:34 2018 Return-Path: Delivered-To: svn-src-stable-11@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 298C9141FB33; Mon, 31 Dec 2018 03:53:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C404B84EDE; Mon, 31 Dec 2018 03:53:33 +0000 (UTC) (envelope-from cy@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 B817351AB; Mon, 31 Dec 2018 03:53:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV3rXWb039173; Mon, 31 Dec 2018 03:53:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV3rXMJ039172; Mon, 31 Dec 2018 03:53:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812310353.wBV3rXMJ039172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 31 Dec 2018 03:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342641 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C404B84EDE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 03:53:34 -0000 Author: cy Date: Mon Dec 31 03:53:33 2018 New Revision: 342641 URL: https://svnweb.freebsd.org/changeset/base/342641 Log: MFC r342385: Remove an empty #if block. The interesting thing is that looking through Darren's commit logs, the line containing an extern ppsratecheck() definition was removed from the v5-1-RELEASE branch but not from HEAD (I have taken his CVS tree and converted it to GIT). There is a commit adding an additional #if defined to the empty block. I can only assume that this was intentional for something later. Looking through HEAD the extern ppsratecheck() is there. However if we put it back it would conflict with a static ppsratecheck() definition in fil.c when building ipftest. Therefore we remove this empty block. ppsratecheck() is a function in the FreeBSD kernel. However ipftest cannot call the ppsratecheck() in the kernel. Therefore one exists in fil.c for use when building the userland ipftest utility which approximates the packet filter in userland for testing of ipfilter rules against packets captured with tcpdump. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:08:01 2018 (r342640) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:53:33 2018 (r342641) @@ -1813,9 +1813,6 @@ extern int ipf_resolvefunc __P((ipf_main_softc_t *, vo extern void *ipf_resolvenic __P((ipf_main_softc_t *, char *, int)); extern int ipf_send_icmp_err __P((int, fr_info_t *, int)); extern int ipf_send_reset __P((fr_info_t *)); -#if (defined(__FreeBSD_version) && (__FreeBSD_version < 501000)) || \ - !defined(_KERNEL) || defined(linux) -#endif extern void ipf_apply_timeout __P((ipftq_t *, u_int)); extern ipftq_t *ipf_addtimeoutqueue __P((ipf_main_softc_t *, ipftq_t **, u_int)); From owner-svn-src-stable-11@freebsd.org Mon Dec 31 11:05:39 2018 Return-Path: Delivered-To: svn-src-stable-11@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 A6E2E142F782; Mon, 31 Dec 2018 11:05:39 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46FB9946F4; Mon, 31 Dec 2018 11:05:39 +0000 (UTC) (envelope-from mr@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 26D2D99D6; Mon, 31 Dec 2018 11:05:39 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVB5cjC065946; Mon, 31 Dec 2018 11:05:38 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVB5c0X065945; Mon, 31 Dec 2018 11:05:38 GMT (envelope-from mr@FreeBSD.org) Message-Id: <201812311105.wBVB5c0X065945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Mon, 31 Dec 2018 11:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342647 - stable/11/etc/periodic/daily X-SVN-Group: stable-11 X-SVN-Commit-Author: mr X-SVN-Commit-Paths: stable/11/etc/periodic/daily X-SVN-Commit-Revision: 342647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46FB9946F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 11:05:39 -0000 Author: mr Date: Mon Dec 31 11:05:38 2018 New Revision: 342647 URL: https://svnweb.freebsd.org/changeset/base/342647 Log: Merge forgotten r318577 to close PR. PR: 217622 Modified: stable/11/etc/periodic/daily/800.scrub-zfs Modified: stable/11/etc/periodic/daily/800.scrub-zfs ============================================================================== --- stable/11/etc/periodic/daily/800.scrub-zfs Mon Dec 31 10:59:30 2018 (r342646) +++ stable/11/etc/periodic/daily/800.scrub-zfs Mon Dec 31 11:05:38 2018 (r342647) @@ -71,7 +71,7 @@ case "$daily_scrub_zfs_enable" in # Now minus last scrub (both in seconds) converted to days. _scrub_diff=$(expr -e \( $(date +%s) - \ - $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24) + $(date -j -v -70M -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24) if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then echo " skipping scrubbing of pool '${pool}':" echo " last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days" From owner-svn-src-stable-11@freebsd.org Mon Dec 31 11:10:03 2018 Return-Path: Delivered-To: svn-src-stable-11@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 81466142F82D; Mon, 31 Dec 2018 11:10:03 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F51D9486E; Mon, 31 Dec 2018 11:10:03 +0000 (UTC) (envelope-from vmaffione@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 E83F799DE; Mon, 31 Dec 2018 11:10:02 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVBA2mg066298; Mon, 31 Dec 2018 11:10:02 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVBA2E8066297; Mon, 31 Dec 2018 11:10:02 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812311110.wBVBA2E8066297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 31 Dec 2018 11:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342648 - stable/11/sys/dev/netmap X-SVN-Group: stable-11 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/11/sys/dev/netmap X-SVN-Commit-Revision: 342648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F51D9486E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 11:10:03 -0000 Author: vmaffione Date: Mon Dec 31 11:10:02 2018 New Revision: 342648 URL: https://svnweb.freebsd.org/changeset/base/342648 Log: MFC r342368, r342369 netmap: fix bug in netmap_poll() optimization The bug was introduced by r339639, although it is present in the upstream netmap code since 2015. It is due to resetting the want_rx variable to POLLIN, rather than resetting it to POLLIN|POLLRDNORM. It only affects select(), which uses POLLRDNORM. poll() is not affected, because it uses POLLIN. Also, it only affects FreeBSD, because Linux skips the optimization implemented by the piece of code where the bug occurs. To check if txsync can be skipped, it is necessary to look for unseen TX space. However, this means comparing ring->cur against ring->tail, rather than ring->head against ring->tail (like nm_ring_empty() does). Sponsored by: Sunny Valley Networks Modified: stable/11/sys/dev/netmap/netmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/netmap/netmap.c ============================================================================== --- stable/11/sys/dev/netmap/netmap.c Mon Dec 31 11:05:38 2018 (r342647) +++ stable/11/sys/dev/netmap/netmap.c Mon Dec 31 11:10:02 2018 (r342648) @@ -3293,28 +3293,38 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM * that we must call nm_os_selrecord() unconditionally. */ if (want_tx) { - enum txrx t = NR_TX; - for (i = priv->np_qfirst[t]; want[t] && i < priv->np_qlast[t]; i++) { + const enum txrx t = NR_TX; + for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - /* XXX compare ring->cur and kring->tail */ - if (!nm_ring_empty(kring->ring)) { + if (kring->ring->cur != kring->ring->tail) { + /* Some unseen TX space is available, so what + * we don't need to run txsync. */ revents |= want[t]; - want[t] = 0; /* also breaks the loop */ + want[t] = 0; + break; } } } if (want_rx) { - enum txrx t = NR_RX; - want_rx = 0; /* look for a reason to run the handlers */ + const enum txrx t = NR_RX; + int rxsync_needed = 0; + for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - if (kring->ring->cur == kring->ring->tail /* try fetch new buffers */ - || kring->rhead != kring->ring->head /* release buffers */) { - want_rx = 1; + if (kring->ring->cur == kring->ring->tail + || kring->rhead != kring->ring->head) { + /* There are no unseen packets on this ring, + * or there are some buffers to be returned + * to the netmap port. We therefore go ahead + * and run rxsync. */ + rxsync_needed = 1; + break; } } - if (!want_rx) - revents |= events & (POLLIN | POLLRDNORM); /* we have data */ + if (!rxsync_needed) { + revents |= want_rx; + want_rx = 0; + } } #endif From owner-svn-src-stable-11@freebsd.org Mon Dec 31 22:09:11 2018 Return-Path: Delivered-To: svn-src-stable-11@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 42805141BA2C; Mon, 31 Dec 2018 22:09:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD5828722F; Mon, 31 Dec 2018 22:09:10 +0000 (UTC) (envelope-from jhb@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 D0DB818B88; Mon, 31 Dec 2018 22:09:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVM9A7E031769; Mon, 31 Dec 2018 22:09:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVM9A4C031766; Mon, 31 Dec 2018 22:09:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201812312209.wBVM9A4C031766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 31 Dec 2018 22:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342656 - in stable: 11/sys/x86/include 11/sys/x86/x86 11/sys/x86/xen 12/sys/x86/include 12/sys/x86/x86 12/sys/x86/xen X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/x86/include 11/sys/x86/x86 11/sys/x86/xen 12/sys/x86/include 12/sys/x86/x86 12/sys/x86/xen X-SVN-Commit-Revision: 342656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD5828722F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 22:09:11 -0000 Author: jhb Date: Mon Dec 31 22:09:08 2018 New Revision: 342656 URL: https://svnweb.freebsd.org/changeset/base/342656 Log: MFC 340460: Convert the number of MSI IRQs on x86 from a constant to a tunable. The number of MSI IRQs still defaults to 512, but it can now be changed at boot time via the machdep.num_msi_irqs tunable. Relnotes: yes Modified: stable/11/sys/x86/include/intr_machdep.h stable/11/sys/x86/x86/msi.c stable/11/sys/x86/xen/xen_intr.c stable/11/sys/x86/xen/xen_msi.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/x86/include/intr_machdep.h stable/12/sys/x86/x86/msi.c stable/12/sys/x86/xen/xen_intr.c stable/12/sys/x86/xen/xen_msi.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/x86/include/intr_machdep.h ============================================================================== --- stable/11/sys/x86/include/intr_machdep.h Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/include/intr_machdep.h Mon Dec 31 22:09:08 2018 (r342656) @@ -56,11 +56,11 @@ * the minimum IRQ value for MSI interrupts to attempt to leave 255 * unused since 255 is used in PCI to indicate an invalid INTx IRQ. */ -#define NUM_MSI_INTS 512 #define MINIMUM_MSI_INT 256 extern u_int first_msi_irq; extern u_int num_io_irqs; +extern u_int num_msi_irqs; /* * Default base address for MSI messages on x86 platforms. Modified: stable/11/sys/x86/x86/msi.c ============================================================================== --- stable/11/sys/x86/x86/msi.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/x86/msi.c Mon Dec 31 22:09:08 2018 (r342656) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,6 +152,10 @@ struct pic msi_pic = { u_int first_msi_irq; +u_int num_msi_irqs = 512; +SYSCTL_UINT(_machdep, OID_AUTO, num_msi_irqs, CTLFLAG_RDTUN, &num_msi_irqs, 0, + "Number of IRQs reserved for MSI and MSI-X interrupts"); + #ifdef SMP /** * Xen hypervisors prior to 4.6.0 do not properly handle updates to @@ -329,8 +334,13 @@ msi_init(void) } #endif + if (num_msi_irqs == 0) + return; + first_msi_irq = max(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; msi_enabled = 1; intr_register_pic(&msi_pic); @@ -344,7 +354,7 @@ msi_create_source(void) u_int irq; mtx_lock(&msi_lock); - if (msi_last_irq >= NUM_MSI_INTS) { + if (msi_last_irq >= num_msi_irqs) { mtx_unlock(&msi_lock); return; } @@ -385,7 +395,7 @@ again: /* Try to find 'count' free IRQs. */ cnt = 0; - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -404,7 +414,7 @@ again: /* Do we need to create some new sources? */ if (cnt < count) { /* If we would exceed the max, give up. */ - if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) { + if (i + (count - cnt) > first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (ENXIO); @@ -580,7 +590,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) #ifdef ACPI_DMAR if (!msi->msi_msix) { for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 && - i < first_msi_irq + NUM_MSI_INTS; i++) { + i < first_msi_irq + num_msi_irqs; i++) { if (i == msi->msi_irq) continue; msi1 = (struct msi_intsrc *)intr_lookup_source(i); @@ -627,7 +637,7 @@ again: mtx_lock(&msi_lock); /* Find a free IRQ. */ - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -640,7 +650,7 @@ again: } /* Are all IRQs in use? */ - if (i == first_msi_irq + NUM_MSI_INTS) { + if (i == first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } Modified: stable/11/sys/x86/xen/xen_intr.c ============================================================================== --- stable/11/sys/x86/xen/xen_intr.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/xen/xen_intr.c Mon Dec 31 22:09:08 2018 (r342656) @@ -689,6 +689,8 @@ void xen_intr_alloc_irqs(void) { + if (num_io_irqs > UINT_MAX - NR_EVENT_CHANNELS) + panic("IRQ allocation overflow (num_msi_irqs too high?)"); first_evtchn_irq = num_io_irqs; num_io_irqs += NR_EVENT_CHANNELS; } Modified: stable/11/sys/x86/xen/xen_msi.c ============================================================================== --- stable/11/sys/x86/xen/xen_msi.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/xen/xen_msi.c Mon Dec 31 22:09:08 2018 (r342656) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,7 +58,9 @@ xen_msi_init(void) MPASS(num_io_irqs > 0); first_msi_irq = min(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; mtx_init(&msi_lock, "msi", NULL, MTX_DEF); } @@ -73,7 +76,7 @@ xen_msi_alloc(device_t dev, int count, int maxcount, i mtx_lock(&msi_lock); /* If we would exceed the max, give up. */ - if ((msi_last_irq + count) > NUM_MSI_INTS) { + if (msi_last_irq + count > num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } From owner-svn-src-stable-11@freebsd.org Tue Jan 1 00:42:54 2019 Return-Path: Delivered-To: svn-src-stable-11@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 3C8111421122; Tue, 1 Jan 2019 00:42:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3FF38C764; Tue, 1 Jan 2019 00:42:53 +0000 (UTC) (envelope-from delphij@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 C2D0E1A647; Tue, 1 Jan 2019 00:42:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x010grpI017435; Tue, 1 Jan 2019 00:42:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010gpMj017427; Tue, 1 Jan 2019 00:42:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901010042.x010gpMj017427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Jan 2019 00:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342664 - in stable/11: . share/examples/drivers share/examples/etc share/examples/mdoc X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: . share/examples/drivers share/examples/etc share/examples/mdoc X-SVN-Commit-Revision: 342664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3FF38C764 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 00:42:54 -0000 Author: delphij Date: Tue Jan 1 00:42:51 2019 New Revision: 342664 URL: https://svnweb.freebsd.org/changeset/base/342664 Log: MFC r333391 (imp): Remove 'All Rights Reserved' from the collection copyright and templates. Modified: stable/11/COPYRIGHT stable/11/share/examples/drivers/make_device_driver.sh stable/11/share/examples/drivers/make_pseudo_driver.sh stable/11/share/examples/etc/bsd-style-copyright stable/11/share/examples/mdoc/POSIX-copyright stable/11/share/examples/mdoc/example.1 stable/11/share/examples/mdoc/example.3 stable/11/share/examples/mdoc/example.4 stable/11/share/examples/mdoc/example.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/COPYRIGHT ============================================================================== --- stable/11/COPYRIGHT Tue Jan 1 00:35:26 2019 (r342663) +++ stable/11/COPYRIGHT Tue Jan 1 00:42:51 2019 (r342664) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2018 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2018 The FreeBSD Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/11/share/examples/drivers/make_device_driver.sh ============================================================================== --- stable/11/share/examples/drivers/make_device_driver.sh Tue Jan 1 00:35:26 2019 (r342663) +++ stable/11/share/examples/drivers/make_device_driver.sh Tue Jan 1 00:42:51 2019 (r342664) @@ -115,7 +115,6 @@ fi cat >${TOP}/dev/${1}/${1}.c <${TOP}/dev/${1}/${1}.c < Delivered-To: svn-src-stable-11@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 F1593142122D; Tue, 1 Jan 2019 00:48:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 977238C9A5; Tue, 1 Jan 2019 00:48:26 +0000 (UTC) (envelope-from delphij@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 847221A649; Tue, 1 Jan 2019 00:48:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x010mQQD017868; Tue, 1 Jan 2019 00:48:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010mQtx017866; Tue, 1 Jan 2019 00:48:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901010048.x010mQtx017866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Jan 2019 00:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342665 - in stable/11: . sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: . sys/sys X-SVN-Commit-Revision: 342665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 977238C9A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 00:48:27 -0000 Author: delphij Date: Tue Jan 1 00:48:25 2019 New Revision: 342665 URL: https://svnweb.freebsd.org/changeset/base/342665 Log: MFC r342661: Happy New Year 2019! Modified: stable/11/COPYRIGHT stable/11/sys/sys/copyright.h Directory Properties: stable/11/ (props changed) Modified: stable/11/COPYRIGHT ============================================================================== --- stable/11/COPYRIGHT Tue Jan 1 00:42:51 2019 (r342664) +++ stable/11/COPYRIGHT Tue Jan 1 00:48:25 2019 (r342665) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2018 The FreeBSD Project. +Copyright (c) 1992-2019 The FreeBSD Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/11/sys/sys/copyright.h ============================================================================== --- stable/11/sys/sys/copyright.h Tue Jan 1 00:42:51 2019 (r342664) +++ stable/11/sys/sys/copyright.h Tue Jan 1 00:48:25 2019 (r342665) @@ -34,7 +34,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2018 The FreeBSD Project.\n" + "Copyright (c) 1992-2019 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-stable-11@freebsd.org Tue Jan 1 10:05:14 2019 Return-Path: Delivered-To: svn-src-stable-11@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 19BE014329CD; Tue, 1 Jan 2019 10:05:14 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA8EB8D754; Tue, 1 Jan 2019 10:05:13 +0000 (UTC) (envelope-from philip@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 ABAF520806; Tue, 1 Jan 2019 10:05:13 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x01A5D4H010993; Tue, 1 Jan 2019 10:05:13 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01A5Cah010987; Tue, 1 Jan 2019 10:05:12 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201901011005.x01A5Cah010987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 1 Jan 2019 10:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342668 - stable/11/contrib/tzdata X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/contrib/tzdata X-SVN-Commit-Revision: 342668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA8EB8D754 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 10:05:14 -0000 Author: philip Date: Tue Jan 1 10:05:12 2019 New Revision: 342668 URL: https://svnweb.freebsd.org/changeset/base/342668 Log: MFC r342613: Import tzdata 2018h MFC r342644: Import tzdata 2018i Modified: stable/11/contrib/tzdata/Makefile stable/11/contrib/tzdata/NEWS stable/11/contrib/tzdata/africa stable/11/contrib/tzdata/asia stable/11/contrib/tzdata/australasia stable/11/contrib/tzdata/leapseconds stable/11/contrib/tzdata/leapseconds.awk stable/11/contrib/tzdata/northamerica stable/11/contrib/tzdata/theory.html stable/11/contrib/tzdata/version stable/11/contrib/tzdata/ziguard.awk stable/11/contrib/tzdata/zone.tab stable/11/contrib/tzdata/zone1970.tab Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/Makefile ============================================================================== --- stable/11/contrib/tzdata/Makefile Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/Makefile Tue Jan 1 10:05:12 2019 (r342668) @@ -380,15 +380,18 @@ AWK= awk # is typically nicer if it works. KSHELL= /bin/bash +# Name of curl , used for HTML validation. +CURL= curl + # The path where SGML DTDs are kept and the catalog file(s) to use when -# validating. The default should work on both Debian and Red Hat. +# validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 SGML_CATALOG_FILES= \ $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat -# The name, arguments and environment of a program to validate your web pages. +# The name, arguments and environment of a program to validate HTML 4.01. # See for a validator, and # for a validation library. # Set VALIDATE=':' if you do not have such a program. @@ -488,6 +491,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -799,9 +803,15 @@ check_tzs: $(TZS) $(TZS_NEW) fi touch $@ -# This checks only the HTML 4.01 strict page. -# To check the the other pages, use . -check_web: tz-how-to.html +check_web: $(CHECK_WEB_PAGES) +check_tz-art.html: tz-art.html +check_tz-link.html: tz-link.html +check_tz-art.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ +check_tz-how-to.html: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html touch $@ @@ -1068,7 +1078,7 @@ zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_time_t_alternatives -.PHONY: check_zishrink +.PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right public Modified: stable/11/contrib/tzdata/NEWS ============================================================================== --- stable/11/contrib/tzdata/NEWS Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/NEWS Tue Jan 1 10:05:12 2019 (r342668) @@ -1,14 +1,103 @@ News for the tz database +Release 2018i - 2018-12-30 11:05:43 -0800 + + Briefly: + São Tomé and Príncipe switches from +01 to +00 on 2019-01-01. + + Changes to future timestamps + + Due to a change in government, São Tomé and Príncipe switches back + from +01 to +00 on 2019-01-01 at 02:00. (Thanks to Vadim + Nasardinov and Michael Deckers.) + + +Release 2018h - 2018-12-23 17:59:32 -0800 + + Briefly: + Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21. + New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move. + Metlakatla, Alaska observes PST this winter only. + Guess Morocco will continue to adjust clocks around Ramadan. + Add predictions for Iran from 2038 through 2090. + + Changes to future timestamps + + Guess that Morocco will continue to fall back just before and + spring forward just after Ramadan, the practice since 2012. + (Thanks to Maamar Abdelkader.) This means Morocco will observe + negative DST during Ramadan in main and vanguard formats, and in + rearguard format it stays in the +00 timezone and observes + ordinary DST in all months other than Ramadan. As before, extend + this guesswork to the year 2037. As a consequence, Morocco is + scheduled to observe three DST transitions in some Gregorian years + (e.g., 2033) due to the mismatch between the Gregorian and Islamic + calendars. + + The table of exact transitions for Iranian DST has been extended. + It formerly cut off before the year 2038 in a nod to 32-bit time_t. + It now cuts off before 2091 as there is doubt about how the Persian + calendar will treat 2091. This change predicts DST transitions in + 2038-9, 2042-3, and 2046-7 to occur one day later than previously + predicted. As before, post-cutoff transitions are approximated. + + Changes to past and future timestamps + + Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to + +05 on 2018-12-21. This is a zone split as Qostanay (aka + Kostanay) did not switch, so create a zone Asia/Qostanay. + + Metlakatla moved from Alaska to Pacific standard time on 2018-11-04. + It did not change clocks that day and remains on -08 this winter. + (Thanks to Ryan Stanley.) It will revert to the usual Alaska + rules next spring, so this change affects only timestamps + from 2018-11-04 through 2019-03-10. + + Change to past timestamps + + Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00, + not 00:00. I transcribed the time incorrectly from Shanks. + (Thanks to Phake Nick.) + + Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00. + (Thanks to Phake Nick.) + + Guam observed DST irregularly from 1959 through 1977. + (Thanks to Phake Nick.) + + Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on + 10-01 changed standard time to +08:30 (not +08). Its transition + back to +08 after WWII was on 1945-09-15, not the previous day. + Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT). + (Thanks to Phake Nick, Steve Allen, and Joseph Myers.) Also, + its 1952 fallback was on 11-02 (not 10-25). + + This release contains many changes to timestamps before 1946 due + to Japanese possession or occupation of Pacific/Chuuk, + Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, + Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei. + (Thanks to Phake Nick.) + + Assume that the Spanish East Indies was like the Philippines and + observed American time until the end of 1844. This affects + Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei. + + Changes to past tm_isdst flags + + For the recent Morocco change, the tm_isdst flag should be 1 from + 2018-10-27 00:00 to 2018-10-28 03:00. (Thanks to Michael Deckers.) + Give a URL to the official decree. (Thanks to Matt Johnson.) + + Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: - Morocco switches to permanent +01 on 2018-10-27. + Morocco switches to permanent +01 on 2018-10-28. Changes to future timestamps - Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, - so its clocks will not fall back on 2018-10-28 as previously scheduled. + Morocco switches from +00/+01 to permanent +01 effective 2018-10-28, + so its clocks will not fall back as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) Changes to code @@ -119,7 +208,7 @@ Release 2018f - 2018-10-18 00:14:18 -0700 localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last - transition (or for all time stamps if there are no transitions), + transition (or for all timestamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, Modified: stable/11/contrib/tzdata/africa ============================================================================== --- stable/11/contrib/tzdata/africa Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/africa Tue Jan 1 10:05:12 2019 (r342668) @@ -847,8 +847,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # From Mohamed Essedik Najd (2018-10-26): # Today, a Moroccan government council approved the perpetual addition # of 60 minutes to the regular Moroccan timezone. -# From Brian Inglis (2018-10-26): -# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le +# From Matt Johnson (2018-10-28): +# http://www.sgg.gov.ma/Portals/1/BO/2018/BO_6720-bis_Ar.pdf +# +# From Maamar Abdelkader (2018-11-01): +# We usually move clocks back the previous week end and come back to the +1 +# the week end after.... The government does not announce yet the decision +# about this temporary change. But it s 99% sure that it will be the case, +# as in previous years. An unofficial survey was done these days, showing +# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan +# +# From Paul Eggert (2018-11-01): +# For now, guess that Morocco will fall back at 03:00 the last Sunday +# before Ramadan, and spring forward at 02:00 the first Sunday after +# Ramadan, as this has been the practice since 2012. To implement this, +# transition dates for 2019 through 2037 were determined by running the +# following program under GNU Emacs 26.1. +# (let ((islamic-year 1440)) +# (require 'cal-islam) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - @@ -892,13 +925,53 @@ Rule Morocco 2017 only - May 21 3:00 0 - Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - Rule Morocco 2018 only - Jun 17 2:00 1:00 - +Rule Morocco 2019 only - May 5 3:00 -1:00 - +Rule Morocco 2019 only - Jun 9 2:00 0 - +Rule Morocco 2020 only - Apr 19 3:00 -1:00 - +Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2021 only - Apr 11 3:00 -1:00 - +Rule Morocco 2021 only - May 16 2:00 0 - +Rule Morocco 2022 only - Mar 27 3:00 -1:00 - +Rule Morocco 2022 only - May 8 2:00 0 - +Rule Morocco 2023 only - Mar 19 3:00 -1:00 - +Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2024 only - Mar 10 3:00 -1:00 - +Rule Morocco 2024 only - Apr 14 2:00 0 - +Rule Morocco 2025 only - Feb 23 3:00 -1:00 - +Rule Morocco 2025 only - Apr 6 2:00 0 - +Rule Morocco 2026 only - Feb 15 3:00 -1:00 - +Rule Morocco 2026 only - Mar 22 2:00 0 - +Rule Morocco 2027 only - Feb 7 3:00 -1:00 - +Rule Morocco 2027 only - Mar 14 2:00 0 - +Rule Morocco 2028 only - Jan 23 3:00 -1:00 - +Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2029 only - Jan 14 3:00 -1:00 - +Rule Morocco 2029 only - Feb 18 2:00 0 - +Rule Morocco 2029 only - Dec 30 3:00 -1:00 - +Rule Morocco 2030 only - Feb 10 2:00 0 - +Rule Morocco 2030 only - Dec 22 3:00 -1:00 - +Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Dec 14 3:00 -1:00 - +Rule Morocco 2032 only - Jan 18 2:00 0 - +Rule Morocco 2032 only - Nov 28 3:00 -1:00 - +Rule Morocco 2033 only - Jan 9 2:00 0 - +Rule Morocco 2033 only - Nov 20 3:00 -1:00 - +Rule Morocco 2033 only - Dec 25 2:00 0 - +Rule Morocco 2034 only - Nov 5 3:00 -1:00 - +Rule Morocco 2034 only - Dec 17 2:00 0 - +Rule Morocco 2035 only - Oct 28 3:00 -1:00 - +Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 -1:00 - +Rule Morocco 2036 only - Nov 23 2:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 -1:00 - +Rule Morocco 2037 only - Nov 15 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Western Sahara # @@ -913,8 +986,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Mozambique # @@ -1071,10 +1144,20 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 +# From Vadim Nasardinov (2018-12-29): +# São Tomé and Príncipe is about to do the following on Jan 1, 2019: +# https://www.stp-press.st/2018/12/05/governo-jesus-ja-decidiu-repor-hora-legal-sao-tomense/ +# +# From Michael Deckers (2018-12-30): +# https://www.legis-palop.org/download.jsp?idFile=102818 +# ... [The legal time of the country, which coincides with universal +# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.] + Zone Africa/Sao_Tome 0:26:56 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 - 1:00 - WAT + 1:00 - WAT 2019 Jan 1 02:00 + 0:00 - GMT # Senegal # See Africa/Abidjan. Modified: stable/11/contrib/tzdata/asia ============================================================================== --- stable/11/contrib/tzdata/asia Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/asia Tue Jan 1 10:05:12 2019 (r342668) @@ -586,12 +586,82 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # obtained from # http://www.hko.gov.hk/gts/time/Summertime.htm -# From Arthur David Olson (2009-10-28): +# From Phake Nick (2018-10-27): +# According to Singaporean newspaper +# http://eresources.nlb.gov.sg/newspapers/Digitised/Article/singfreepresswk19041102-1.2.37 +# the day that Hong Kong start using GMT+8 should be Oct 30, 1904. +# +# From Paul Eggert (2018-11-17): +# Hong Kong had a time ball near the Marine Police Station, Tsim Sha Tsui. +# "The ball was raised manually each day and dropped at exactly 1pm +# (except on Sundays and Government holidays)." +# Dyson AD. From Time Ball to Atomic Clock. Hong Kong Government. 1983. +# +# "From 1904 October 30 the time-ball at Hong Kong has been dropped by order +# of the Governor of the Colony at 17h 0m 0s G.M.T., which is 23m 18s.14 in +# advance of 1h 0m 0s of Hong Kong mean time." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 +# +# From Joseph Myers (2018-11-18): +# An astronomer before 1925 referring to GMT would have been using the old +# astronomical convention where the day started at noon, not midnight. +# +# From Steve Allen (2018-11-17): +# Meteorological Observations made at the Hongkong Observatory in the year 1904 +# page 4 +# ... the log of drop times in Table II shows that on Sunday 1904-10-30 the +# ball was dropped. So that looks like a special case drop for the sake +# of broadcasting the new local time. +# +# From Phake Nick (2018-11-18): +# According to The Hong Kong Weekly Press, 1904-10-29, p.324, the +# governor of Hong Kong at the time stated that "We are further desired to +# make it known that the change will be effected by firing the gun and by the +# dropping of the Ball at 23min. 18sec. before one." +# From Paul Eggert (2018-11-18): +# See for this; unfortunately Flash is required. + +# From Phake Nick (2018-10-26): +# I went to check microfilm records stored at Hong Kong Public Library.... +# on September 30 1941, according to Ta Kung Pao (Hong Kong edition), it was +# stated that fallback would occur on the next day (the 1st)'s "03:00 am (Hong +# Kong Time 04:00 am)" and the clock will fall back for a half hour. (03:00 +# probably refer to the time commonly used in mainland China at the time given +# the paper's background) ... the sunrise/sunset time given by South China +# Morning Post for October 1st was indeed moved by half an hour compares to +# before. After that, in December, the battle to capture Hong Kong started and +# the library doesn't seems to have any record stored about press during that +# period of time. Some media resumed publication soon after that within the +# same month, but there were not much information about time there. Later they +# started including a radio program guide when they restored radio service, +# explicitly mentioning it use Tokyo standard time, and later added a note +# saying it's half an hour ahead of the old Hong Kong standard time, and it +# also seems to indicate that Hong Kong was not using GMT+8 when it was +# captured by Japan. +# +# Image of related sections on newspaper: +# * 1941-09-30, Ta Kung Pao (Hong Kong), "Winter Time start tomorrow". +# https://i.imgur.com/6waY51Z.jpg (Chinese) +# * 1941-09-29, South China Morning Post, Information on sunrise/sunset +# time and other things for September 30 and October 1. +# https://i.imgur.com/kCiUR78.jpg +# * 1942-02-05. The Hong Kong News, Radio Program Guide. +# https://i.imgur.com/eVvDMzS.jpg +# * 1941-06-14. Hong Kong Daily Press, Daylight Saving from 3am Tomorrow. +# https://i.imgur.com/05KkvtC.png +# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. +# https://i.imgur.com/dge4kFJ.png +# Also, the Liberation day of Hong Kong after WWII which British rule +# over the territory resumed was August 30, 1945, which I think should +# be the termination date for the use of JST in the territory.... + +# From Paul Eggert (2018-11-17): # Here are the dates given at -# http://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2009-10-28: +# https://www.hko.gov.hk/gts/time/Summertime.htm +# as of 2014-06-19: # Year Period -# 1941 1 Apr to 30 Sep +# 1941 15 Jun to 30 Sep # 1942 Whole year # 1943 Whole year # 1944 Whole year @@ -602,7 +672,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct # 1951 1 Apr to 28 Oct -# 1952 6 Apr to 25 Oct +# 1952 6 Apr to 2 Nov # 1953 5 Apr to 1 Nov # 1954 21 Mar to 31 Oct # 1955 20 Mar to 6 Nov @@ -631,25 +701,25 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1978 Nil # 1979 13 May to 21 Oct # 1980 to Now Nil -# The page does not give start or end times of day. -# The page does not give a start date for 1942. -# The page does not givw an end date for 1945. -# The Japanese occupation of Hong Kong began on 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-15. -# For lack of anything better, use start of those days as the transition times. +# The page does not give times of day for transitions, +# or dates for the 1942 and 1945 transitions. +# The Japanese occupation of Hong Kong began 1941-12-25. +# The Japanese surrender of Hong Kong was signed 1945-09-16; see: +# Heaver S. The days after the Pacific war ended: unsettling times +# in Hong Kong. Post Magazine. 2016-06-13. +# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong +# For lack of anything better, use start of those days as the +# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1941 only - Apr 1 3:30 1:00 S -Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1946 only - Apr 20 3:30 1:00 S Rule HK 1946 only - Dec 1 3:30 0 - Rule HK 1947 only - Apr 13 3:30 1:00 S Rule HK 1947 only - Dec 30 3:30 0 - Rule HK 1948 only - May 2 3:30 1:00 S Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 only - Oct 25 3:30 0 - +Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S -Rule HK 1953 only - Nov 1 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S Rule HK 1954 only - Oct 31 3:30 0 - Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - @@ -659,9 +729,11 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 - 8:00 HK HK%sT 1941 Dec 25 - 9:00 - JST 1945 Sep 15 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 + 8:00 - HKT 1941 Jun 15 3:30 + 8:00 1:00 HKST 1941 Oct 1 4:00 + 8:30 - HKT 1941 Dec 25 + 9:00 - JST 1945 Sep 16 8:00 HK HK%sT ############################################################################### @@ -1057,6 +1129,16 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # India +# British astronomer Henry Park Hollis disliked India Standard Time's offset: +# "A new time system has been proposed for India, Further India, and Burmah. +# The scheme suggested is that the times of the meridians 5½ and 6½ hours +# east of Greenwich should be adopted in these territories. No reason is +# given why hourly meridians five hours and six hours east should not be +# chosen; a plan which would bring the time of India into harmony with +# that of almost the whole of the civilised world." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 + # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic # https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ # (2015-12-22): @@ -1227,12 +1309,65 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # leap year calculation involved. There has never been any serious # plan to change that law.... # -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2018-11-30): # Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter. -# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates, -# stopping after 2037 when 32-bit time_t's overflow. -# That cal-persia used Birashk's approximation, which disagrees with the solar -# calendar predictions for the year 2025, so I corrected those dates by hand. +# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" +# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's +# cal-persia implementation of Birashk's approximation, which in the +# 2008-2087 range disagrees with the the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), +# so the following code special-case those years. See Table 15.1, page 264, of: +# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: +# The Ultimate Edition, Cambridge University Press (2018). +# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition +# Page 258, footnote 2, of this book says there is some dispute over what will +# happen in 2091 (and some other years after that), so this code +# stops in 2087, as 2088 and 2089 agree with the "max" rule below. +# (cl-loop +# initially (require 'cal-persia) +# with first-persian-year = 1387 +# with last-persian-year = 1466 +# ;; Exceptional years in the above range, +# ;; from Reingold & Dershowitz Table 15.1, page 264: +# with exceptional-persian-years = '(1404 1437) +# with range-start = nil +# for persian-year from first-persian-year to last-persian-year +# do +# (let* +# ((exceptional-year-offset +# (if (member persian-year exceptional-persian-years) 1 0)) +# (beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 persian-year)) +# exceptional-year-offset)) +# (end-dst-absolute +# (+ (calendar-persian-to-absolute (list 6 30 persian-year)) +# exceptional-year-offset)) +# (next-year-beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year))) +# (if (member (1+ persian-year) exceptional-persian-years) 1 0))) +# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute)) +# (end-dst (calendar-gregorian-from-absolute end-dst-absolute)) +# (next-year-beg-dst (calendar-gregorian-from-absolute +# next-year-beg-dst-absolute)) +# (year (calendar-extract-year beg-dst)) +# (range-end (if range-start year "only"))) +# (setq range-start (or range-start year)) +# (when (or (/= (calendar-extract-day beg-dst) +# (calendar-extract-day next-year-beg-dst)) +# (= persian-year last-persian-year)) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month beg-dst) t) +# (calendar-extract-day beg-dst))) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month end-dst) t) +# (calendar-extract-day end-dst))) +# (setq range-start nil)))) # # From Oscar van Vlijmen (2005-03-30), writing about future # discrepancies between cal-persia and the Iranian calendar: @@ -1267,61 +1402,113 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 - -Rule Iran 1978 only - Oct 21 0:00 0 - -Rule Iran 1979 only - Sep 19 0:00 0 - -Rule Iran 1980 only - Sep 23 0:00 0 - -Rule Iran 1991 only - May 3 0:00 1:00 - -Rule Iran 1992 1995 - Mar 22 0:00 1:00 - -Rule Iran 1991 1995 - Sep 22 0:00 0 - -Rule Iran 1996 only - Mar 21 0:00 1:00 - -Rule Iran 1996 only - Sep 21 0:00 0 - -Rule Iran 1997 1999 - Mar 22 0:00 1:00 - -Rule Iran 1997 1999 - Sep 22 0:00 0 - -Rule Iran 2000 only - Mar 21 0:00 1:00 - -Rule Iran 2000 only - Sep 21 0:00 0 - -Rule Iran 2001 2003 - Mar 22 0:00 1:00 - -Rule Iran 2001 2003 - Sep 22 0:00 0 - -Rule Iran 2004 only - Mar 21 0:00 1:00 - -Rule Iran 2004 only - Sep 21 0:00 0 - -Rule Iran 2005 only - Mar 22 0:00 1:00 - -Rule Iran 2005 only - Sep 22 0:00 0 - -Rule Iran 2008 only - Mar 21 0:00 1:00 - -Rule Iran 2008 only - Sep 21 0:00 0 - -Rule Iran 2009 2011 - Mar 22 0:00 1:00 - -Rule Iran 2009 2011 - Sep 22 0:00 0 - -Rule Iran 2012 only - Mar 21 0:00 1:00 - -Rule Iran 2012 only - Sep 21 0:00 0 - -Rule Iran 2013 2015 - Mar 22 0:00 1:00 - -Rule Iran 2013 2015 - Sep 22 0:00 0 - -Rule Iran 2016 only - Mar 21 0:00 1:00 - -Rule Iran 2016 only - Sep 21 0:00 0 - -Rule Iran 2017 2019 - Mar 22 0:00 1:00 - -Rule Iran 2017 2019 - Sep 22 0:00 0 - -Rule Iran 2020 only - Mar 21 0:00 1:00 - -Rule Iran 2020 only - Sep 21 0:00 0 - -Rule Iran 2021 2023 - Mar 22 0:00 1:00 - -Rule Iran 2021 2023 - Sep 22 0:00 0 - -Rule Iran 2024 only - Mar 21 0:00 1:00 - -Rule Iran 2024 only - Sep 21 0:00 0 - -Rule Iran 2025 2027 - Mar 22 0:00 1:00 - -Rule Iran 2025 2027 - Sep 22 0:00 0 - -Rule Iran 2028 2029 - Mar 21 0:00 1:00 - -Rule Iran 2028 2029 - Sep 21 0:00 0 - -Rule Iran 2030 2031 - Mar 22 0:00 1:00 - -Rule Iran 2030 2031 - Sep 22 0:00 0 - -Rule Iran 2032 2033 - Mar 21 0:00 1:00 - -Rule Iran 2032 2033 - Sep 21 0:00 0 - -Rule Iran 2034 2035 - Mar 22 0:00 1:00 - -Rule Iran 2034 2035 - Sep 22 0:00 0 - +Rule Iran 1978 1980 - Mar 20 24:00 1:00 - +Rule Iran 1978 only - Oct 20 24:00 0 - +Rule Iran 1979 only - Sep 18 24:00 0 - +Rule Iran 1980 only - Sep 22 24:00 0 - +Rule Iran 1991 only - May 2 24:00 1:00 - +Rule Iran 1992 1995 - Mar 21 24:00 1:00 - +Rule Iran 1991 1995 - Sep 21 24:00 0 - +Rule Iran 1996 only - Mar 20 24:00 1:00 - +Rule Iran 1996 only - Sep 20 24:00 0 - +Rule Iran 1997 1999 - Mar 21 24:00 1:00 - +Rule Iran 1997 1999 - Sep 21 24:00 0 - +Rule Iran 2000 only - Mar 20 24:00 1:00 - +Rule Iran 2000 only - Sep 20 24:00 0 - +Rule Iran 2001 2003 - Mar 21 24:00 1:00 - +Rule Iran 2001 2003 - Sep 21 24:00 0 - +Rule Iran 2004 only - Mar 20 24:00 1:00 - +Rule Iran 2004 only - Sep 20 24:00 0 - +Rule Iran 2005 only - Mar 21 24:00 1:00 - +Rule Iran 2005 only - Sep 21 24:00 0 - +Rule Iran 2008 only - Mar 20 24:00 1:00 - +Rule Iran 2008 only - Sep 20 24:00 0 - +Rule Iran 2009 2011 - Mar 21 24:00 1:00 - +Rule Iran 2009 2011 - Sep 21 24:00 0 - +Rule Iran 2012 only - Mar 20 24:00 1:00 - +Rule Iran 2012 only - Sep 20 24:00 0 - +Rule Iran 2013 2015 - Mar 21 24:00 1:00 - +Rule Iran 2013 2015 - Sep 21 24:00 0 - +Rule Iran 2016 only - Mar 20 24:00 1:00 - +Rule Iran 2016 only - Sep 20 24:00 0 - +Rule Iran 2017 2019 - Mar 21 24:00 1:00 - +Rule Iran 2017 2019 - Sep 21 24:00 0 - +Rule Iran 2020 only - Mar 20 24:00 1:00 - +Rule Iran 2020 only - Sep 20 24:00 0 - +Rule Iran 2021 2023 - Mar 21 24:00 1:00 - +Rule Iran 2021 2023 - Sep 21 24:00 0 - +Rule Iran 2024 only - Mar 20 24:00 1:00 - +Rule Iran 2024 only - Sep 20 24:00 0 - +Rule Iran 2025 2027 - Mar 21 24:00 1:00 - +Rule Iran 2025 2027 - Sep 21 24:00 0 - +Rule Iran 2028 2029 - Mar 20 24:00 1:00 - +Rule Iran 2028 2029 - Sep 20 24:00 0 - +Rule Iran 2030 2031 - Mar 21 24:00 1:00 - +Rule Iran 2030 2031 - Sep 21 24:00 0 - +Rule Iran 2032 2033 - Mar 20 24:00 1:00 - +Rule Iran 2032 2033 - Sep 20 24:00 0 - +Rule Iran 2034 2035 - Mar 21 24:00 1:00 - +Rule Iran 2034 2035 - Sep 21 24:00 0 - +Rule Iran 2036 2037 - Mar 20 24:00 1:00 - +Rule Iran 2036 2037 - Sep 20 24:00 0 - +Rule Iran 2038 2039 - Mar 21 24:00 1:00 - +Rule Iran 2038 2039 - Sep 21 24:00 0 - +Rule Iran 2040 2041 - Mar 20 24:00 1:00 - +Rule Iran 2040 2041 - Sep 20 24:00 0 - +Rule Iran 2042 2043 - Mar 21 24:00 1:00 - +Rule Iran 2042 2043 - Sep 21 24:00 0 - +Rule Iran 2044 2045 - Mar 20 24:00 1:00 - +Rule Iran 2044 2045 - Sep 20 24:00 0 - +Rule Iran 2046 2047 - Mar 21 24:00 1:00 - +Rule Iran 2046 2047 - Sep 21 24:00 0 - +Rule Iran 2048 2049 - Mar 20 24:00 1:00 - +Rule Iran 2048 2049 - Sep 20 24:00 0 - +Rule Iran 2050 2051 - Mar 21 24:00 1:00 - +Rule Iran 2050 2051 - Sep 21 24:00 0 - +Rule Iran 2052 2053 - Mar 20 24:00 1:00 - +Rule Iran 2052 2053 - Sep 20 24:00 0 - +Rule Iran 2054 2055 - Mar 21 24:00 1:00 - +Rule Iran 2054 2055 - Sep 21 24:00 0 - +Rule Iran 2056 2057 - Mar 20 24:00 1:00 - +Rule Iran 2056 2057 - Sep 20 24:00 0 - +Rule Iran 2058 2059 - Mar 21 24:00 1:00 - +Rule Iran 2058 2059 - Sep 21 24:00 0 - +Rule Iran 2060 2062 - Mar 20 24:00 1:00 - +Rule Iran 2060 2062 - Sep 20 24:00 0 - +Rule Iran 2063 only - Mar 21 24:00 1:00 - +Rule Iran 2063 only - Sep 21 24:00 0 - +Rule Iran 2064 2066 - Mar 20 24:00 1:00 - +Rule Iran 2064 2066 - Sep 20 24:00 0 - +Rule Iran 2067 only - Mar 21 24:00 1:00 - +Rule Iran 2067 only - Sep 21 24:00 0 - +Rule Iran 2068 2070 - Mar 20 24:00 1:00 - +Rule Iran 2068 2070 - Sep 20 24:00 0 - +Rule Iran 2071 only - Mar 21 24:00 1:00 - +Rule Iran 2071 only - Sep 21 24:00 0 - +Rule Iran 2072 2074 - Mar 20 24:00 1:00 - +Rule Iran 2072 2074 - Sep 20 24:00 0 - +Rule Iran 2075 only - Mar 21 24:00 1:00 - +Rule Iran 2075 only - Sep 21 24:00 0 - +Rule Iran 2076 2078 - Mar 20 24:00 1:00 - +Rule Iran 2076 2078 - Sep 20 24:00 0 - +Rule Iran 2079 only - Mar 21 24:00 1:00 - +Rule Iran 2079 only - Sep 21 24:00 0 - +Rule Iran 2080 2082 - Mar 20 24:00 1:00 - +Rule Iran 2080 2082 - Sep 20 24:00 0 - +Rule Iran 2083 only - Mar 21 24:00 1:00 - +Rule Iran 2083 only - Sep 21 24:00 0 - +Rule Iran 2084 2086 - Mar 20 24:00 1:00 - +Rule Iran 2084 2086 - Sep 20 24:00 0 - +Rule Iran 2087 only - Mar 21 24:00 1:00 - +Rule Iran 2087 only - Sep 21 24:00 0 - # -# The following rules are approximations starting in the year 2038. -# These are the best post-2037 approximations available, given the -# restrictions of a single rule using a Gregorian-based data format. +# The following rules are approximations starting in the year 2088. +# These are the best post-2088 approximations available, given the +# restrictions of a single rule using ordinary Gregorian dates. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 - -Rule Iran 2036 max - Sep 21 0:00 0 - +Rule Iran 2088 max - Mar 20 24:00 1:00 - +Rule Iran 2088 max - Sep 20 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1691,7 +1878,9 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT -# Since 1938, all Japanese possessions have been like Asia/Tokyo. +# Since 1938, all Japanese possessions have been like Asia/Tokyo, +# except that Truk (Chuuk), Ponape (Pohnpei), and Jaluit (Kosrae) did not +# switch from +10 to +09 until 1941-04-01; see the 'australasia' file. # Jordan # @@ -1981,8 +2170,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in # the third time belt (before 1930 this means +03). -# From Paul Eggert (2016-12-06): -# The tables below reflect Golosunov's remarks, with exceptions as noted. +# From Alexander Konzurovski (2018-12-20): +# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from +# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is +# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language). # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -1996,8 +2187,6 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-A 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) -# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); -# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2008,21 +2197,22 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 -# The following zone is like Asia/Qyzylorda except for being one -# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for -# Qostanay are unclear partly because of the 1997 Turgai -# reorganization, so this zone is commented out for now. -#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 -# 4:00 - +04 1930 Jun 21 -# 5:00 - +05 1981 Apr 1 -# 5:00 1:00 +06 1981 Oct 1 -# 6:00 - +06 1982 Apr 1 -# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s -# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s -# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s -# 6:00 - +06 + 6:00 - +06 2018 Dec 21 0:00 + 5:00 - +05 # +# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# The 1991/2 rules are unclear partly because of the 1997 Turgai +# reorganization. +Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Apr 1 + 5:00 1:00 +06 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s + 6:00 - +06 + # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 @@ -2116,21 +2306,43 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # started at June 1 in that year. For another example, the article in # 1988 said that DST started at 2:00 AM in that year. +# From Phake Nick (2018-10-27): +# 1. According to official announcement from Korean government, the DST end +# date in South Korea should be +# 1955-09-08 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027977557 +# 1956-09-29 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027978341 +# 1957-09-21 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027979690#3 +# 1958-09-20 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027981189 +# 1959-09-19 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027982974#2 +# 1960-09-17 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0028044104 +# ... +# 2.... https://namu.wiki/w/대한민국%20표준시 ... [says] +# when Korea was using GMT+8:30 as standard time, the international +# aviation/marine/meteorological industry in the country refused to +# follow and continued to use GMT+9:00 for interoperability. + + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1948 only - Jun 1 0:00 1:00 D -Rule ROK 1948 only - Sep 13 0:00 0 S -Rule ROK 1949 only - Apr 3 0:00 1:00 D -Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S -Rule ROK 1950 only - Apr 1 0:00 1:00 D -Rule ROK 1951 only - May 6 0:00 1:00 D -Rule ROK 1955 only - May 5 0:00 1:00 D -Rule ROK 1955 only - Sep 9 0:00 0 S -Rule ROK 1956 only - May 20 0:00 1:00 D -Rule ROK 1956 only - Sep 30 0:00 0 S -Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D -Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 12 24:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sat>=7 24:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 8 24:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 29 24:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sat>=17 24:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # From Paul Eggert (2016-08-23): # The Korean Wikipedia entry gives the following sources for UT offsets: @@ -2920,6 +3132,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # no information # Philippines + +# From Paul Eggert (2018-11-18): +# The Spanish initially used American (west-of-Greenwich) time. +# It is unknown what time Manila kept when the British occupied it from +# 1762-10-06 through 1764-04; for now assume it kept American time. # On 1844-08-16, Narciso Clavería, governor-general of the # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's @@ -3005,8 +3222,8 @@ Link Asia/Qatar Asia/Bahrain # going to run on Higgins Time.' And so, until last year, it did." See: # Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. # http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm -# newspapers.com says a similar story about Higgins was published in the Port -# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# Also see: Antar EN. Arabian flying is confusing. +# Port Angeles (WA) Evening News. 1965-03-10. page 3. # # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics Modified: stable/11/contrib/tzdata/australasia ============================================================================== --- stable/11/contrib/tzdata/australasia Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/australasia Tue Jan 1 10:05:12 2019 (r342668) @@ -402,10 +402,44 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete # it is uninhabited. # Guam + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf +Rule Guam 1959 only - Jun 27 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-61-5-Revocation-of-Daylight-Saving-Time-and-Restoratio.pdf +Rule Guam 1961 only - Jan 29 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-67-13-Guam-Daylight-Savings-Time.pdf +Rule Guam 1967 only - Sep 1 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-69-2-Repeal-of-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jan 26 0:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-69-10-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jun 22 2:00 1:00 D +Rule Guam 1969 only - Aug 31 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-70-10-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-70-30-End-of-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-71-5-Guam-Daylight-Savings-Time.pdf +Rule Guam 1970 1971 - Apr lastSun 2:00 1:00 D +Rule Guam 1970 1971 - Sep Sun>=1 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-73-28.-Guam-Day-light-Saving-Time.pdf +Rule Guam 1973 only - Dec 16 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-74-7-Guam-Daylight-Savings-Time-Rescinded.pdf +Rule Guam 1974 only - Feb 24 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-76-13-Daylight-Savings-Time.pdf +Rule Guam 1976 only - May 26 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-76-25-Revocation-of-E.O.-76-13.pdf +Rule Guam 1976 only - Aug 22 2:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-77-4-Daylight-Savings-Time.pdf +Rule Guam 1977 only - Apr 24 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-77-18-Guam-Standard-Time.pdf +Rule Guam 1977 only - Aug 28 2:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana - 10:00 - GST 2000 Dec 23 # Guam + 10:00 - GST 1941 Dec 10 # Guam + 9:00 - +09 1944 Jul 31 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time Link Pacific/Guam Pacific/Saipan # N Mariana Is @@ -427,31 +461,56 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901 # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Majuro 11:24:48 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 -Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 - 12:00 - +12 +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Jan 30 + 11:00 - +11 1969 Oct + 12:00 - +12 +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Feb 6 + 11:00 - +11 1969 Oct + -12:00 - -12 1993 Aug 20 24:00 + 12:00 - +12 # Micronesia # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Chuuk 10:07:08 - LMT 1901 - 10:00 - +10 -Zone Pacific/Pohnpei 10:32:52 - LMT 1901 # Kolonia - 11:00 - +11 -Zone Pacific/Kosrae 10:51:56 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 +Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31 + 10:07:08 - LMT 1901 + 10:00 - +10 1914 Oct + 9:00 - +09 1919 Feb 1 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 10:00 - +10 +Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia + 10:32:52 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 +Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 + 10:51:56 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 1969 Oct + 12:00 - +12 1999 + 11:00 - +11 # Nauru # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Mar 15 - 9:00 - +09 1944 Aug 15 - 11:30 - +1130 1979 May + 11:30 - +1130 1942 Aug 29 + 9:00 - +09 1945 Sep 8 + 11:30 - +1130 1979 Feb 10 2:00 12:00 - +12 # New Caledonia @@ -552,8 +611,9 @@ Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror - 9:00 - +09 +Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror + 8:57:56 - LMT 1901 + 9:00 - +09 # Papua New Guinea *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Wed Jan 2 15:13:09 2019 Return-Path: Delivered-To: svn-src-stable-11@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 9D9AD1423A8B; Wed, 2 Jan 2019 15:13:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD4B90384; Wed, 2 Jan 2019 15:13:09 +0000 (UTC) (envelope-from cy@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 2D7B6B580; Wed, 2 Jan 2019 15:13:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02FD9NU045542; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FD9J9045541; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901021513.x02FD9J9045541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 2 Jan 2019 15:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342685 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FD4B90384 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 15:13:09 -0000 Author: cy Date: Wed Jan 2 15:13:08 2019 New Revision: 342685 URL: https://svnweb.freebsd.org/changeset/base/342685 Log: MFC r342596: Remove duplicate include of sys/mbuf.h. Reported by: Trond Endrest Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:01:55 2019 (r342684) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:13:08 2019 (r342685) @@ -39,7 +39,6 @@ static const char rcsid[] = "@(#)$Id$"; # include # include # include -# include #include # include # include From owner-svn-src-stable-11@freebsd.org Wed Jan 2 16:28:58 2019 Return-Path: Delivered-To: svn-src-stable-11@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 E567214272CC; Wed, 2 Jan 2019 16:28:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85F9B94415; Wed, 2 Jan 2019 16:28:57 +0000 (UTC) (envelope-from markj@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 69EA7C378; Wed, 2 Jan 2019 16:28:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02GSvfx082590; Wed, 2 Jan 2019 16:28:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GSuY3082587; Wed, 2 Jan 2019 16:28:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021628.x02GSuY3082587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342691 - in stable/11/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Commit-Revision: 342691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85F9B94415 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 16:28:58 -0000 Author: markj Date: Wed Jan 2 16:28:56 2019 New Revision: 342691 URL: https://svnweb.freebsd.org/changeset/base/342691 Log: MFC r342182: Remove UMS support code from radeonkms. Deleted: stable/11/sys/dev/drm2/radeon/r300_cmdbuf.c stable/11/sys/dev/drm2/radeon/r600_blit.c stable/11/sys/dev/drm2/radeon/r600_cp.c stable/11/sys/dev/drm2/radeon/radeon_cp.c stable/11/sys/dev/drm2/radeon/radeon_ioc32.c stable/11/sys/dev/drm2/radeon/radeon_state.c Modified: stable/11/sys/dev/drm2/radeon/r600_blit_kms.c stable/11/sys/dev/drm2/radeon/r600_cs.c stable/11/sys/dev/drm2/radeon/radeon_irq.c stable/11/sys/modules/drm2/radeonkms/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm2/radeon/r600_blit_kms.c ============================================================================== --- stable/11/sys/dev/drm2/radeon/r600_blit_kms.c Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/dev/drm2/radeon/r600_blit_kms.c Wed Jan 2 16:28:56 2019 (r342691) @@ -35,6 +35,39 @@ __FBSDID("$FreeBSD$"); #include "r600_blit_shaders.h" #include "radeon_blit_common.h" +/* 23 bits of float fractional data */ +#define I2F_FRAC_BITS 23 +#define I2F_MASK ((1 << I2F_FRAC_BITS) - 1) + +/* + * Converts unsigned integer into 32-bit IEEE floating point representation. + * Will be exact from 0 to 2^24. Above that, we round towards zero + * as the fractional bits will not fit in a float. (It would be better to + * round towards even as the fpu does, but that is slower.) + * + * Moved from r600_blit.c after that file was removed. + */ +__pure uint32_t int2float(uint32_t x) +{ + uint32_t msb, exponent, fraction; + + /* Zero is special */ + if (!x) return 0; + + /* Get location of the most significant bit */ + msb = fls(x); + + /* + * Use a rotate instead of a shift because that works both leftwards + * and rightwards due to the mod(32) behaviour. This means we don't + * need to check to see if we are above 2^24 or not. + */ + fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK; + exponent = (127 + msb) << I2F_FRAC_BITS; + + return fraction + exponent; +} + /* emits 21 on rv770+, 23 on r600 */ static void set_render_target(struct radeon_device *rdev, int format, Modified: stable/11/sys/dev/drm2/radeon/r600_cs.c ============================================================================== --- stable/11/sys/dev/drm2/radeon/r600_cs.c Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/dev/drm2/radeon/r600_cs.c Wed Jan 2 16:28:56 2019 (r342691) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); static int r600_cs_packet_next_reloc_mm(struct radeon_cs_parser *p, struct radeon_cs_reloc **cs_reloc); -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc); typedef int (*next_reloc_t)(struct radeon_cs_parser*, struct radeon_cs_reloc**); static next_reloc_t r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_mm; #ifdef FREEBSD_WIP /* FreeBSD: to please GCC 4.2. */ @@ -885,53 +883,6 @@ static int r600_cs_packet_next_reloc_mm(struct radeon_ } /** - * r600_cs_packet_next_reloc_nomm() - parse next packet which should be reloc packet3 - * @parser: parser structure holding parsing context. - * @data: pointer to relocation data - * @offset_start: starting offset - * @offset_mask: offset mask (to align start offset on) - * @reloc: reloc informations - * - * Check next packet is relocation packet3, do bo validation and compute - * GPU offset using the provided start. - **/ -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc) -{ - struct radeon_cs_chunk *relocs_chunk; - struct radeon_cs_packet p3reloc; - unsigned idx; - int r; - - if (p->chunk_relocs_idx == -1) { - DRM_ERROR("No relocation chunk !\n"); - return -EINVAL; - } - *cs_reloc = NULL; - relocs_chunk = &p->chunks[p->chunk_relocs_idx]; - r = r600_cs_packet_parse(p, &p3reloc, p->idx); - if (r) { - return r; - } - p->idx += p3reloc.count + 2; - if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) { - DRM_ERROR("No packet3 for relocation for packet at %d.\n", - p3reloc.idx); - return -EINVAL; - } - idx = radeon_get_ib_value(p, p3reloc.idx + 1); - if (idx >= relocs_chunk->length_dw) { - DRM_ERROR("Relocs at %d after relocations chunk end %d !\n", - idx, relocs_chunk->length_dw); - return -EINVAL; - } - *cs_reloc = p->relocs; - (*cs_reloc)->lobj.gpu_offset = (u64)relocs_chunk->kdata[idx + 3] << 32; - (*cs_reloc)->lobj.gpu_offset |= relocs_chunk->kdata[idx + 0]; - return 0; -} - -/** * r600_cs_packet_next_is_pkt3_nop() - test if next packet is packet3 nop for reloc * @parser: parser structure holding parsing context. * @@ -2456,105 +2407,6 @@ int r600_cs_parse(struct radeon_cs_parser *p) free(p->track, DRM_MEM_DRIVER); p->track = NULL; return 0; -} - -static int r600_cs_parser_relocs_legacy(struct radeon_cs_parser *p) -{ - if (p->chunk_relocs_idx == -1) { - return 0; - } - p->relocs = malloc(sizeof(struct radeon_cs_reloc), - DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (p->relocs == NULL) { - return -ENOMEM; - } - return 0; -} - -/** - * cs_parser_fini() - clean parser states - * @parser: parser structure holding parsing context. - * @error: error number - * - * If error is set than unvalidate buffer, otherwise just free memory - * used by parsing context. - **/ -static void r600_cs_parser_fini(struct radeon_cs_parser *parser, int error) -{ - unsigned i; - - free(parser->relocs, DRM_MEM_DRIVER); - for (i = 0; i < parser->nchunks; i++) { - free(parser->chunks[i].kdata, DRM_MEM_DRIVER); - if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) { - free(parser->chunks[i].kpage[0], DRM_MEM_DRIVER); - free(parser->chunks[i].kpage[1], DRM_MEM_DRIVER); - } - } - free(parser->chunks, DRM_MEM_DRIVER); - free(parser->chunks_array, DRM_MEM_DRIVER); - free(parser->track, DRM_MEM_DRIVER); -} - -int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp, - unsigned family, u32 *ib, int *l) -{ - struct radeon_cs_parser parser; - struct radeon_cs_chunk *ib_chunk; - struct r600_cs_track *track; - int r; - - /* initialize tracker */ - track = malloc(sizeof(*track), DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (track == NULL) - return -ENOMEM; - r600_cs_track_init(track); - r600_cs_legacy_get_tiling_conf(dev, &track->npipes, &track->nbanks, &track->group_size); - /* initialize parser */ - memset(&parser, 0, sizeof(struct radeon_cs_parser)); - parser.filp = filp; - parser.dev = dev->dev; - parser.rdev = NULL; - parser.family = family; - parser.track = track; - parser.ib.ptr = ib; - r = radeon_cs_parser_init(&parser, data); - if (r) { - DRM_ERROR("Failed to initialize parser !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = r600_cs_parser_relocs_legacy(&parser); - if (r) { - DRM_ERROR("Failed to parse relocation !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - /* Copy the packet into the IB, the parser will read from the - * input memory (cached) and write to the IB (which can be - * uncached). */ - ib_chunk = &parser.chunks[parser.chunk_ib_idx]; - parser.ib.length_dw = ib_chunk->length_dw; - *l = parser.ib.length_dw; - r = r600_cs_parse(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = radeon_cs_finish_pages(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r600_cs_parser_fini(&parser, r); - return r; -} - -void r600_cs_legacy_init(void) -{ - r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_nomm; } /* Modified: stable/11/sys/dev/drm2/radeon/radeon_irq.c ============================================================================== --- stable/11/sys/dev/drm2/radeon/radeon_irq.c Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/dev/drm2/radeon/radeon_irq.c Wed Jan 2 16:28:56 2019 (r342691) @@ -221,41 +221,6 @@ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS) return IRQ_HANDLED; } -static int radeon_emit_irq(struct drm_device * dev) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - unsigned int ret; - RING_LOCALS; - - atomic_inc(&dev_priv->swi_emitted); - ret = atomic_read(&dev_priv->swi_emitted); - - BEGIN_RING(4); - OUT_RING_REG(RADEON_LAST_SWI_REG, ret); - OUT_RING_REG(RADEON_GEN_INT_STATUS, RADEON_SW_INT_FIRE); - ADVANCE_RING(); - COMMIT_RING(); - - return ret; -} - -static int radeon_wait_irq(struct drm_device * dev, int swi_nr) -{ - drm_radeon_private_t *dev_priv = - (drm_radeon_private_t *) dev->dev_private; - int ret = 0; - - if (RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr) - return 0; - - dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; - - DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ, - RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr); - - return ret; -} - u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc) { drm_radeon_private_t *dev_priv = dev->dev_private; @@ -281,52 +246,6 @@ u32 radeon_get_vblank_counter(struct drm_device *dev, else return RADEON_READ(RADEON_CRTC2_CRNT_FRAME); } -} - -/* Needs the lock as it touches the ring. - */ -int radeon_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_emit_t *emit = data; - int result; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - LOCK_TEST_WITH_RETURN(dev, file_priv); - - result = radeon_emit_irq(dev); - - if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { - DRM_ERROR("copy_to_user\n"); - return -EFAULT; - } - - return 0; -} - -/* Doesn't need the hardware lock. - */ -int radeon_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_wait_t *irqwait = data; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - return radeon_wait_irq(dev, irqwait->irq_seq); } /* drm_dma.h hooks Modified: stable/11/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- stable/11/sys/modules/drm2/radeonkms/Makefile Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/modules/drm2/radeonkms/Makefile Wed Jan 2 16:28:56 2019 (r342691) @@ -25,7 +25,6 @@ SRCS += \ radeon_clocks.c \ radeon_combios.c \ radeon_connectors.c \ - radeon_cp.c \ radeon_cs.c \ radeon_cursor.c \ radeon_device.c \ @@ -50,7 +49,6 @@ SRCS += \ radeon_ring.c \ radeon_sa.c \ radeon_semaphore.c \ - radeon_state.c \ radeon_test.c \ radeon_ttm.c \ atom.c \ @@ -61,7 +59,6 @@ SRCS += \ r100.c \ r200.c \ r300.c \ - r300_cmdbuf.c \ r420.c \ rs400.c \ rs600.c \ @@ -70,10 +67,8 @@ SRCS += \ r520.c \ r600.c \ r600_audio.c \ - r600_blit.c \ r600_blit_kms.c \ r600_blit_shaders.c \ - r600_cp.c \ r600_cs.c \ r600_hdmi.c \ rv770.c \ @@ -92,10 +87,6 @@ radeon_acpi= radeon_acpi.c #radeon_atpx_handler= radeon_atpx_handler.c .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -radeon_ioc32= radeon_ioc32.c -.endif - #radeon_prime.c #--radeon_trace_points.c @@ -116,6 +107,4 @@ SRCS += \ CFLAGS+= -I${SRCTOP}/sys/dev/drm2/radeon -CWARNFLAGS.radeon_cp.c= -Wno-unused-value -CWARNFLAGS.r600_cp.c= -Wno-unused-value CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-stable-11@freebsd.org Wed Jan 2 19:11:51 2019 Return-Path: Delivered-To: svn-src-stable-11@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 BD5B3142D598; Wed, 2 Jan 2019 19:11:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 625BA6C099; Wed, 2 Jan 2019 19:11:51 +0000 (UTC) (envelope-from jhb@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 53CF7E0DB; Wed, 2 Jan 2019 19:11:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02JBp04071014; Wed, 2 Jan 2019 19:11:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02JBpAL071012; Wed, 2 Jan 2019 19:11:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901021911.x02JBpAL071012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 19:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342704 - in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Commit-Revision: 342704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 625BA6C099 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 19:11:52 -0000 Author: jhb Date: Wed Jan 2 19:11:49 2019 New Revision: 342704 URL: https://svnweb.freebsd.org/changeset/base/342704 Log: MFC 341800: Don't report stale signal information in ptrace_lwpinfo. Once a signal's siginfo was copied to 'td_si' as part of the signal exchange in issignal(), it was never cleared. This caused future thread events that are reported as SIGTRAP events without signal information to report the stale siginfo in 'td_si'. For example, if a debugger created a new process and used SIGSTOP to stop it after PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI with the SIGSTOP siginfo in pl_siginfo. This broke 'catch syscall' in current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP indicates a breakpoint or single step trap. Modified: stable/11/sys/kern/kern_sig.c stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_sig.c stable/10/tests/sys/kern/ptrace_test.c stable/12/sys/kern/kern_sig.c stable/12/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/11/sys/kern/kern_sig.c Wed Jan 2 19:11:49 2019 (r342704) @@ -2858,6 +2858,8 @@ issignal(struct thread *td) sig = ptracestop(td, sig, &ksi); mtx_lock(&ps->ps_mtx); + td->td_si.si_signo = 0; + /* * Keep looking if the debugger discarded or * replaced the signal. Modified: stable/11/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/11/tests/sys/kern/ptrace_test.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/11/tests/sys/kern/ptrace_test.c Wed Jan 2 19:11:49 2019 (r342704) @@ -3772,6 +3772,78 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_different_thread, tc) } #endif +/* + * Verify that PT_LWPINFO doesn't return stale siginfo. + */ +ATF_TC_WITHOUT_HEAD(ptrace__PT_LWPINFO_stale_siginfo); +ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + raise(SIGABRT); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next stop should report the SIGABRT in the child body. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGABRT); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGABRT); + + /* + * Continue the process ignoring the signal, but enabling + * syscall traps. + */ + ATF_REQUIRE(ptrace(PT_SYSCALL, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should report a system call entry from + * exit(). PL_FLAGS_SI should not be set. + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_SI) == 0); + + /* Disable syscall tracing and continue the child to let it exit. */ + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + events &= ~PTRACE_SYSCALL; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -3831,6 +3903,7 @@ ATF_TP_ADD_TCS(tp) #if defined(HAVE_BREAKPOINT) && defined(SKIP_BREAK) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif + ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); return (atf_no_error()); } From owner-svn-src-stable-11@freebsd.org Wed Jan 2 19:48:19 2019 Return-Path: Delivered-To: svn-src-stable-11@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 EF545142E437; Wed, 2 Jan 2019 19:48:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9260A6D618; Wed, 2 Jan 2019 19:48:18 +0000 (UTC) (envelope-from jhb@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 78E5CE652; Wed, 2 Jan 2019 19:48:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02JmIeV086962; Wed, 2 Jan 2019 19:48:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02JmIaQ086960; Wed, 2 Jan 2019 19:48:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901021948.x02JmIaQ086960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 19:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342706 - stable/11/usr.bin/ktrdump X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.bin/ktrdump X-SVN-Commit-Revision: 342706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9260A6D618 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 19:48:19 -0000 Author: jhb Date: Wed Jan 2 19:48:17 2019 New Revision: 342706 URL: https://svnweb.freebsd.org/changeset/base/342706 Log: MFC 339620: Add a "live" mode to ktrdump. Support a "live" mode in ktrdump enabled via the -l flag. In this mode, ktrdump polls the kernel's trace buffer periodically (currently hardcoded as a 50 millisecond interval) and dumps any newly added entries. Fancier logic for the timeout (e.g. a command line option or some kind of backoff based on the time since the last entry) can be added later as the need arises. Note that this does not include the capsicum fixes from the original commit since ktrdump in stable/11 is not capsicum-ized. Modified: stable/11/usr.bin/ktrdump/ktrdump.8 stable/11/usr.bin/ktrdump/ktrdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ktrdump/ktrdump.8 ============================================================================== --- stable/11/usr.bin/ktrdump/ktrdump.8 Wed Jan 2 19:46:01 2019 (r342705) +++ stable/11/usr.bin/ktrdump/ktrdump.8 Wed Jan 2 19:48:17 2019 (r342706) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2015 +.Dd October 22, 2018 .Dt KTRDUMP 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd print kernel ktr trace buffer .Sh SYNOPSIS .Nm -.Op Fl cfqrtH +.Op Fl cflqrtH .Op Fl i Ar ktrfile .Op Fl M Ar core .Op Fl N Ar system @@ -47,6 +47,9 @@ The following options are available: .Bl -tag -width ".Fl i Ar ktrfile" .It Fl c Print the CPU number that each entry was logged from. +.It Fl l +Poll the kernel ktr trace buffer periodically dumping any new events after +each poll. .It Fl f Print the file and line number that each entry was logged from. .It Fl q Modified: stable/11/usr.bin/ktrdump/ktrdump.c ============================================================================== --- stable/11/usr.bin/ktrdump/ktrdump.c Wed Jan 2 19:46:01 2019 (r342705) +++ stable/11/usr.bin/ktrdump/ktrdump.c Wed Jan 2 19:48:17 2019 (r342706) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #define SBUFLEN 128 #define USAGE \ - "usage: ktrdump [-cfqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" + "usage: ktrdump [-cflqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" static void usage(void); @@ -62,6 +62,7 @@ static struct nlist nl[] = { static int cflag; static int fflag; +static int lflag; static int Mflag; static int Nflag; static int qflag; @@ -106,7 +107,7 @@ main(int ac, char **av) * Parse commandline arguments. */ out = stdout; - while ((c = getopt(ac, av, "cfqrtHe:i:m:M:N:o:")) != -1) + while ((c = getopt(ac, av, "cflqrtHe:i:m:M:N:o:")) != -1) switch (c) { case 'c': cflag = 1; @@ -126,6 +127,9 @@ main(int ac, char **av) if ((in = open(optarg, O_RDONLY)) == -1) err(1, "%s", optarg); break; + case 'l': + lflag = 1; + break; case 'M': case 'm': if (strlcpy(corefile, optarg, sizeof(corefile)) @@ -226,15 +230,29 @@ main(int ac, char **av) fprintf(out, "\n"); } + tlast = -1; /* * Now tear through the trace buffer. + * + * In "live" mode, find the oldest entry (first non-NULL entry + * after index2) and walk forward. Otherwise, start with the + * most recent entry and walk backwards. */ if (!iflag) { - i = index - 1; - if (i < 0) - i = entries - 1; + if (lflag) { + i = index2 + 1 % entries; + while (buf[i].ktr_desc == NULL && i != index) { + i++; + if (i == entries) + i = 0; + } + } else { + i = index - 1; + if (i < 0) + i = entries - 1; + } } - tlast = -1; +dump_entries: for (;;) { if (buf[i].ktr_desc == NULL) break; @@ -306,14 +324,40 @@ next: if ((c = *p++) == '\0') * 'index2' were in flux while the KTR buffer was * being copied to userspace we don't dump them. */ - if (i == index2) - break; - if (--i < 0) - i = entries - 1; + if (lflag) { + if (++i == entries) + i = 0; + if (i == index) + break; + } else { + if (i == index2) + break; + if (--i < 0) + i = entries - 1; + } } else { if (++i == entries) break; } + } + + /* + * In "live" mode, poll 'ktr_idx' periodically and dump any + * new entries since our last pass through the ring. + */ + if (lflag && !iflag) { + while (index == index2) { + usleep(50 * 1000); + if (kvm_read(kd, nl[2].n_value, &index2, + sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + } + i = index; + index = index2; + if (kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1 || + kvm_read(kd, nl[2].n_value, &index2, sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + goto dump_entries; } return (0); From owner-svn-src-stable-11@freebsd.org Wed Jan 2 20:49:42 2019 Return-Path: Delivered-To: svn-src-stable-11@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 D9BD914301C4; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1696FB85; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@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 6F50EF0CF; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02Knggb018053; Wed, 2 Jan 2019 20:49:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02KngeN018052; Wed, 2 Jan 2019 20:49:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901022049.x02KngeN018052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 20:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342708 - in stable: 11/usr.bin/truss 12/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.bin/truss 12/usr.bin/truss X-SVN-Commit-Revision: 342708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D1696FB85 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 20:49:43 -0000 Author: jhb Date: Wed Jan 2 20:49:41 2019 New Revision: 342708 URL: https://svnweb.freebsd.org/changeset/base/342708 Log: MFC 341802: Validate the string size parameter passed to -s. Use strtonum() to reject negative sizes instead of core dumping. PR: 232206 Modified: stable/11/usr.bin/truss/main.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.bin/truss/main.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.bin/truss/main.c ============================================================================== --- stable/11/usr.bin/truss/main.c Wed Jan 2 20:31:15 2019 (r342707) +++ stable/11/usr.bin/truss/main.c Wed Jan 2 20:49:41 2019 (r342708) @@ -69,6 +69,7 @@ main(int ac, char **av) struct trussinfo *trussinfo; char *fname; char **command; + const char *errstr; pid_t pid; int c; @@ -116,7 +117,9 @@ main(int ac, char **av) fname = optarg; break; case 's': /* Specified string size */ - trussinfo->strsize = atoi(optarg); + trussinfo->strsize = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "maximum string size is %s: %s", errstr, optarg); break; case 'S': /* Don't trace signals */ trussinfo->flags |= NOSIGS; From owner-svn-src-stable-11@freebsd.org Wed Jan 2 23:57:39 2019 Return-Path: Delivered-To: svn-src-stable-11@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 24DCE14356B2; Wed, 2 Jan 2019 23:57:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0D9976201; Wed, 2 Jan 2019 23:57:38 +0000 (UTC) (envelope-from jhb@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 B23091913D; Wed, 2 Jan 2019 23:57:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02Nvc4H016774; Wed, 2 Jan 2019 23:57:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02NvcHU016773; Wed, 2 Jan 2019 23:57:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901022357.x02NvcHU016773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 23:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342709 - in stable: 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Commit-Revision: 342709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0D9976201 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 23:57:39 -0000 Author: jhb Date: Wed Jan 2 23:57:37 2019 New Revision: 342709 URL: https://svnweb.freebsd.org/changeset/base/342709 Log: MFC 339894: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector. Modified: stable/11/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.bin/procstat/procstat_auxv.c ============================================================================== --- stable/11/usr.bin/procstat/procstat_auxv.c Wed Jan 2 20:49:41 2019 (r342708) +++ stable/11/usr.bin/procstat/procstat_auxv.c Wed Jan 2 23:57:37 2019 (r342709) @@ -179,6 +179,12 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ prefix, "AT_TIMEKEEP", auxv[i].a_un.a_ptr); break; #endif +#ifdef AT_EHDRFLAGS + case AT_EHDRFLAGS: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EHDRFLAGS/%#lx}\n", + prefix, "AT_EHDRFLAGS", (u_long)auxv[i].a_un.a_val); + break; +#endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", prefix, auxv[i].a_type, auxv[i].a_un.a_val); From owner-svn-src-stable-11@freebsd.org Thu Jan 3 01:39:24 2019 Return-Path: Delivered-To: svn-src-stable-11@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 22DCB14386FD; Thu, 3 Jan 2019 01:39:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA95582B29; Thu, 3 Jan 2019 01:39:23 +0000 (UTC) (envelope-from jhb@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 AEA761A28D; Thu, 3 Jan 2019 01:39:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x031dNW6071182; Thu, 3 Jan 2019 01:39:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x031dNdN071181; Thu, 3 Jan 2019 01:39:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901030139.x031dNdN071181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Jan 2019 01:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342712 - in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Commit-Revision: 342712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA95582B29 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 01:39:24 -0000 Author: jhb Date: Thu Jan 3 01:39:22 2019 New Revision: 342712 URL: https://svnweb.freebsd.org/changeset/base/342712 Log: MFC 339899: Make battery emptying rate available as sysctl variable. Curiously, the in-kernel routines always use the design voltage to convert from mA to mW, but acpiconf in userland uses the current voltage. As a result, this can report a different mW rate than acpiconf. Modified: stable/11/sys/dev/acpica/acpi_battery.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/acpica/acpi_battery.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/11/sys/dev/acpica/acpi_battery.c Thu Jan 3 01:01:03 2019 (r342711) +++ stable/11/sys/dev/acpica/acpi_battery.c Thu Jan 3 01:39:22 2019 (r342712) @@ -487,6 +487,11 @@ acpi_battery_init(void) "remaining time in minutes"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), + OID_AUTO, "rate", CTLTYPE_INT | CTLFLAG_RD, + &acpi_battery_battinfo.rate, 0, acpi_battery_sysctl, "I", + "present rate in mW"); + SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, + SYSCTL_CHILDREN(acpi_battery_sysctl_tree), OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RD, &acpi_battery_battinfo.state, 0, acpi_battery_sysctl, "I", "current status flags"); From owner-svn-src-stable-11@freebsd.org Thu Jan 3 07:45:53 2019 Return-Path: Delivered-To: svn-src-stable-11@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 E728C141B86B; Thu, 3 Jan 2019 07:45:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F7708E7A4; Thu, 3 Jan 2019 07:45:52 +0000 (UTC) (envelope-from kadesai@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 806A81E2EC; Thu, 3 Jan 2019 07:45:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x037jq0R065022; Thu, 3 Jan 2019 07:45:52 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x037jq3t065020; Thu, 3 Jan 2019 07:45:52 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030745.x037jq3t065020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 07:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342716 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 342716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F7708E7A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 07:45:53 -0000 Author: kadesai Date: Thu Jan 3 07:45:52 2019 New Revision: 342716 URL: https://svnweb.freebsd.org/changeset/base/342716 Log: MFC r342059-r342069 r342059 This patch will add support for next generation(SAS3.5) of Tri mode(SAS, SATA, NVMe) MegaRAID adapters. r342060 This patch will add support for new Dynamic RaidMap to have different sizes for different number of supported VDs for SAS3.5 MegaRAID adapters. r342061 This patch will add support for divert bitmap in RAID map. Divert bitmap is supported for SAS3.5 adapters only. r342062 This patch will add new interface to support more than 256 JBODs. r342063 Detect sequential Write IOs and pass the hint that it is part of sequential stream to help HBA Firmware do the Full Stripe Writes. For read IOs on certain RAID volumes like Read Ahead volumes,this will help driver to send it to Firmware even if the IOs can potentially be sent to hardware directly (called fast path) bypassing firmware. Design: 8 streams are maintained per RAID volume as per the combined firmware/driver design. When there is no stream detected the LRU stream is used for next potential stream and LRU/MRU map is updated to make this as MRU stream. Every time a stream is detected the MRU map is updated to make the current stream as MRU stream. r342064 To improve RAID 1/10 Write performance, OS drivers need to issue the required Write IOs as Fast Path IOs (after the appropriate checks allowing Fast Path to be used) to the appropriate physical drives (translated from the OS logical IO) and wait for all Write IOs to complete. Design: A write IO on RAID volume will be examined if it can be sent in Fast Path based on IO size and starting LBA and ending LBA falling on to a Physical Drive boundary. If the underlying RAID volume is a RAID 1/10, driver issues two fast path write IOs one for each corresponding physical drive after computing the corresponding start LBA for each physical drive. Both write IOs will have the same payload and are posted to HW such that replies land in the same reply queue. If there are no resources available for sending two IOs, driver will send the original IO from upper layer to RAID volume through the Firmware. When both IOs are completed by HW, the resources will be released and SCSI IO completion handler will be called. r342065 This patch will add support for new DCMD to get PD information and a single data structure to specify LD and JBOD. r342066 This patch will add support for NVME PRPs creation by driver for fastpath capable IOs. NVME specification supports specific type of scatter gather list called as PRP (Physical Region Page) for IO data buffers. Since NVME drive is connected behind SAS3.5 tri-mode adapter, MegaRAID driver/firmware has to convert OS SGLs in native NVMe PRP format. For IOs sent to firmware, MegaRAID firmware does this job of OS SGLs to PRP translation and send PRPs to backend NVME device. For fastpath IOs, driver will do this OS SGLs to PRP translation. r342067 Change IOC INIT wait time to 180 secs to keep it inline with timeout used by internal DCMDs. r342068 This patch will increase debug level as current logging level has very minimal prints and even few important messages will not get logged. r342069 Driver version upgrade 07.708.02.00-fbsd Modified: stable/11/sys/dev/mrsas/mrsas.c stable/11/sys/dev/mrsas/mrsas.h stable/11/sys/dev/mrsas/mrsas_cam.c stable/11/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 07:42:32 2019 (r342715) +++ stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 07:45:52 2019 (r342716) @@ -90,6 +90,8 @@ static void mrsas_update_ext_vd_details(struct mrsas_s static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); +static void +mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id); static struct mrsas_softc * mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg); @@ -141,9 +143,6 @@ void mrsas_free_ctlr_info_cmd(struct mrsas_softc *sc); void mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd, u_int8_t status); -void -mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, - u_int8_t extStatus); struct mrsas_mfi_cmd *mrsas_get_mfi_cmd(struct mrsas_softc *sc); MRSAS_REQUEST_DESCRIPTOR_UNION *mrsas_build_mpt_cmd @@ -167,7 +166,13 @@ mrsas_get_request_desc(struct mrsas_softc *sc, extern int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); static int mrsas_alloc_evt_log_info_cmd(struct mrsas_softc *sc); static void mrsas_free_evt_log_info_cmd(struct mrsas_softc *sc); +void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); +void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, + union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus, + u_int32_t data_length, u_int8_t *sense); + + SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); /* @@ -190,6 +195,12 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_INTRUDER_24, 0xffff, 0xffff, "AVAGO Intruder_24 SAS Controller"}, {0x1000, MRSAS_CUTLASS_52, 0xffff, 0xffff, "AVAGO Cutlass_52 SAS Controller"}, {0x1000, MRSAS_CUTLASS_53, 0xffff, 0xffff, "AVAGO Cutlass_53 SAS Controller"}, + {0x1000, MRSAS_VENTURA, 0xffff, 0xffff, "AVAGO Ventura SAS Controller"}, + {0x1000, MRSAS_CRUSADER, 0xffff, 0xffff, "AVAGO Crusader SAS Controller"}, + {0x1000, MRSAS_HARPOON, 0xffff, 0xffff, "AVAGO Harpoon SAS Controller"}, + {0x1000, MRSAS_TOMCAT, 0xffff, 0xffff, "AVAGO Tomcat SAS Controller"}, + {0x1000, MRSAS_VENTURA_4PORT, 0xffff, 0xffff, "AVAGO Ventura_4Port SAS Controller"}, + {0x1000, MRSAS_CRUSADER_4PORT, 0xffff, 0xffff, "AVAGO Crusader_4Port SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -436,7 +447,16 @@ mrsas_setup_sysctl(struct mrsas_softc *sc) OID_AUTO, "block_sync_cache", CTLFLAG_RW, &sc->block_sync_cache, 0, "Block SYNC CACHE at driver. "); - + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "stream detection", CTLFLAG_RW, + &sc->drv_stream_detection, 0, + "Disable/Enable Stream detection. "); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "prp_count", CTLFLAG_RD, + &sc->prp_count.val_rdonly, 0, "Number of IOs for which PRPs are built"); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "SGE holes", CTLFLAG_RD, + &sc->sge_holes.val_rdonly, 0, "Number of IOs with holes in SGEs"); } /* @@ -451,12 +471,14 @@ mrsas_get_tunables(struct mrsas_softc *sc) char tmpstr[80]; /* XXX default to some debugging for now */ - sc->mrsas_debug = MRSAS_FAULT; + sc->mrsas_debug = + (MRSAS_FAULT | MRSAS_OCR | MRSAS_INFO | MRSAS_TRACE | MRSAS_AEN); sc->mrsas_io_timeout = MRSAS_IO_TIMEOUT; sc->mrsas_fw_fault_check_delay = 1; sc->reset_count = 0; sc->reset_in_progress = 0; sc->block_sync_cache = 0; + sc->drv_stream_detection = 1; /* * Grab the global variables. @@ -815,7 +837,7 @@ static int mrsas_attach(device_t dev) { struct mrsas_softc *sc = device_get_softc(dev); - uint32_t cmd, bar, error; + uint32_t cmd, error; memset(sc, 0, sizeof(struct mrsas_softc)); @@ -830,7 +852,14 @@ mrsas_attach(device_t dev) (sc->device_id == MRSAS_CUTLASS_52) || (sc->device_id == MRSAS_CUTLASS_53)) { sc->mrsas_gen3_ctrl = 1; - } + } else if ((sc->device_id == MRSAS_VENTURA) || + (sc->device_id == MRSAS_CRUSADER) || + (sc->device_id == MRSAS_HARPOON) || + (sc->device_id == MRSAS_TOMCAT) || + (sc->device_id == MRSAS_VENTURA_4PORT) || + (sc->device_id == MRSAS_CRUSADER_4PORT)) { + sc->is_ventura = true; + } mrsas_get_tunables(sc); @@ -845,9 +874,12 @@ mrsas_attach(device_t dev) cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); - bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4); + /* For Ventura system registers are mapped to BAR0 */ + if (sc->is_ventura) + sc->reg_res_id = PCIR_BAR(0); /* BAR0 offset */ + else + sc->reg_res_id = PCIR_BAR(1); /* BAR1 offset */ - sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */ if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &(sc->reg_res_id), RF_ACTIVE)) == NULL) { @@ -866,6 +898,7 @@ mrsas_attach(device_t dev) mtx_init(&sc->mpt_cmd_pool_lock, "mrsas_mpt_cmd_pool_lock", NULL, MTX_DEF); mtx_init(&sc->mfi_cmd_pool_lock, "mrsas_mfi_cmd_pool_lock", NULL, MTX_DEF); mtx_init(&sc->raidmap_lock, "mrsas_raidmap_lock", NULL, MTX_DEF); + mtx_init(&sc->stream_lock, "mrsas_stream_lock", NULL, MTX_DEF); /* Intialize linked list */ TAILQ_INIT(&sc->mrsas_mpt_cmd_list_head); @@ -873,6 +906,8 @@ mrsas_attach(device_t dev) mrsas_atomic_set(&sc->fw_outstanding, 0); mrsas_atomic_set(&sc->target_reset_outstanding, 0); + mrsas_atomic_set(&sc->prp_count, 0); + mrsas_atomic_set(&sc->sge_holes, 0); sc->io_cmds_highwater = 0; @@ -932,6 +967,7 @@ attach_fail_fw: mtx_destroy(&sc->mpt_cmd_pool_lock); mtx_destroy(&sc->mfi_cmd_pool_lock); mtx_destroy(&sc->raidmap_lock); + mtx_destroy(&sc->stream_lock); attach_fail: if (sc->reg_res) { bus_release_resource(sc->mrsas_dev, SYS_RES_MEMORY, @@ -946,6 +982,7 @@ attach_fail: static void mrsas_ich_startup(void *arg) { + int i = 0; struct mrsas_softc *sc = (struct mrsas_softc *)arg; /* @@ -981,6 +1018,13 @@ mrsas_ich_startup(void *arg) /* Enable Interrupts */ mrsas_enable_intr(sc); + /* Call DCMD get_pd_info for all system PDs */ + for (i = 0; i < MRSAS_MAX_PD; i++) { + if ((sc->target_list[i].target_id != 0xffff) && + sc->pd_info_mem) + mrsas_get_pd_info(sc, sc->target_list[i].target_id); + } + /* Initiate AEN (Asynchronous Event Notification) */ if (mrsas_start_aen(sc)) { device_printf(sc->mrsas_dev, "Error: AEN registration FAILED !!! " @@ -1054,6 +1098,14 @@ mrsas_detach(device_t dev) mrsas_flush_cache(sc); mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); mrsas_disable_intr(sc); + + if (sc->is_ventura && sc->streamDetectByLD) { + for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) + free(sc->streamDetectByLD[i], M_MRSAS); + free(sc->streamDetectByLD, M_MRSAS); + sc->streamDetectByLD = NULL; + } + mrsas_cam_detach(sc); mrsas_teardown_intr(sc); mrsas_free_mem(sc); @@ -1065,6 +1117,7 @@ mrsas_detach(device_t dev) mtx_destroy(&sc->mpt_cmd_pool_lock); mtx_destroy(&sc->mfi_cmd_pool_lock); mtx_destroy(&sc->raidmap_lock); + mtx_destroy(&sc->stream_lock); /* Wait for all the semaphores to be released */ while (sema_value(&sc->ioctl_count_sema) != MRSAS_MAX_IOCTL_CMDS) @@ -1094,7 +1147,7 @@ void mrsas_free_mem(struct mrsas_softc *sc) { int i; - u_int32_t max_cmd; + u_int32_t max_fw_cmds; struct mrsas_mfi_cmd *mfi_cmd; struct mrsas_mpt_cmd *mpt_cmd; @@ -1182,6 +1235,16 @@ mrsas_free_mem(struct mrsas_softc *sc) bus_dma_tag_destroy(sc->evt_detail_tag); /* + * Free PD info memory + */ + if (sc->pd_info_phys_addr) + bus_dmamap_unload(sc->pd_info_tag, sc->pd_info_dmamap); + if (sc->pd_info_mem != NULL) + bus_dmamem_free(sc->pd_info_tag, sc->pd_info_mem, sc->pd_info_dmamap); + if (sc->pd_info_tag != NULL) + bus_dma_tag_destroy(sc->pd_info_tag); + + /* * Free MFI frames */ if (sc->mfi_cmd_list) { @@ -1196,9 +1259,9 @@ mrsas_free_mem(struct mrsas_softc *sc) /* * Free MPT internal command list */ - max_cmd = sc->max_fw_cmds; + max_fw_cmds = sc->max_fw_cmds; if (sc->mpt_cmd_list) { - for (i = 0; i < max_cmd; i++) { + for (i = 0; i < max_fw_cmds; i++) { mpt_cmd = sc->mpt_cmd_list[i]; bus_dmamap_destroy(sc->data_tag, mpt_cmd->data_dmamap); free(sc->mpt_cmd_list[i], M_MRSAS); @@ -1538,14 +1601,14 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M Mpi2ReplyDescriptorsUnion_t *desc; MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR *reply_desc; MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; - struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mpt_cmd *cmd_mpt, *r1_cmd = NULL; struct mrsas_mfi_cmd *cmd_mfi; - u_int8_t reply_descript_type; + u_int8_t reply_descript_type, *sense; u_int16_t smid, num_completed; u_int8_t status, extStatus; union desc_value desc_val; PLD_LOAD_BALANCE_INFO lbinfo; - u_int32_t device_id; + u_int32_t device_id, data_length; int threshold_reply_count = 0; #if TM_DEBUG MR_TASK_MANAGE_REQUEST *mr_tm_req; @@ -1573,8 +1636,10 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M cmd_mpt = sc->mpt_cmd_list[smid - 1]; scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; - status = scsi_io_req->RaidContext.status; - extStatus = scsi_io_req->RaidContext.exStatus; + status = scsi_io_req->RaidContext.raid_context.status; + extStatus = scsi_io_req->RaidContext.raid_context.exStatus; + sense = cmd_mpt->sense; + data_length = scsi_io_req->DataLength; switch (scsi_io_req->Function) { case MPI2_FUNCTION_SCSI_TASK_MGMT: @@ -1590,16 +1655,45 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M case MPI2_FUNCTION_SCSI_IO_REQUEST: /* Fast Path IO. */ device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; + /* R1 load balancing for READ */ if (cmd_mpt->load_balance == MRSAS_LOAD_BALANCE_FLAG) { mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[cmd_mpt->pd_r1_lb]); cmd_mpt->load_balance &= ~MRSAS_LOAD_BALANCE_FLAG; } /* Fall thru and complete IO */ case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: - mrsas_map_mpt_cmd_status(cmd_mpt, status, extStatus); - mrsas_cmd_done(sc, cmd_mpt); - scsi_io_req->RaidContext.status = 0; - scsi_io_req->RaidContext.exStatus = 0; + if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { + mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, + extStatus, data_length, sense); + mrsas_cmd_done(sc, cmd_mpt); + } else { + /* + * If the peer Raid 1/10 fast path failed, + * mark IO as failed to the scsi layer. + * Overwrite the current status by the failed status + * and make sure that if any command fails, + * driver returns fail status to CAM. + */ + cmd_mpt->cmd_completed = 1; + r1_cmd = cmd_mpt->peer_cmd; + if (r1_cmd->cmd_completed) { + if (r1_cmd->io_request->RaidContext.raid_context.status != MFI_STAT_OK) { + status = r1_cmd->io_request->RaidContext.raid_context.status; + extStatus = r1_cmd->io_request->RaidContext.raid_context.exStatus; + data_length = r1_cmd->io_request->DataLength; + sense = r1_cmd->sense; + } + r1_cmd->ccb_ptr = NULL; + if (r1_cmd->callout_owner) { + callout_stop(&r1_cmd->cm_callout); + r1_cmd->callout_owner = false; + } + mrsas_release_mpt_cmd(r1_cmd); + mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, + extStatus, data_length, sense); + mrsas_cmd_done(sc, cmd_mpt); + } + } mrsas_atomic_dec(&sc->fw_outstanding); break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ @@ -1648,7 +1742,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M */ if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) { if (sc->msix_enable) { - if (sc->mrsas_gen3_ctrl) + if (sc->msix_combined) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1669,7 +1763,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M /* Clear response interrupt */ if (sc->msix_enable) { - if (sc->mrsas_gen3_ctrl) { + if (sc->msix_combined) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1692,40 +1786,41 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M * CCB. */ void -mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, u_int8_t extStatus) +mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, union ccb *ccb_ptr, u_int8_t status, + u_int8_t extStatus, u_int32_t data_length, u_int8_t *sense) { struct mrsas_softc *sc = cmd->sc; u_int8_t *sense_data; switch (status) { case MFI_STAT_OK: - cmd->ccb_ptr->ccb_h.status = CAM_REQ_CMP; + ccb_ptr->ccb_h.status = CAM_REQ_CMP; break; case MFI_STAT_SCSI_IO_FAILED: case MFI_STAT_SCSI_DONE_WITH_ERROR: - cmd->ccb_ptr->ccb_h.status = CAM_SCSI_STATUS_ERROR; - sense_data = (u_int8_t *)&cmd->ccb_ptr->csio.sense_data; + ccb_ptr->ccb_h.status = CAM_SCSI_STATUS_ERROR; + sense_data = (u_int8_t *)&ccb_ptr->csio.sense_data; if (sense_data) { /* For now just copy 18 bytes back */ - memcpy(sense_data, cmd->sense, 18); - cmd->ccb_ptr->csio.sense_len = 18; - cmd->ccb_ptr->ccb_h.status |= CAM_AUTOSNS_VALID; + memcpy(sense_data, sense, 18); + ccb_ptr->csio.sense_len = 18; + ccb_ptr->ccb_h.status |= CAM_AUTOSNS_VALID; } break; case MFI_STAT_LD_OFFLINE: case MFI_STAT_DEVICE_NOT_FOUND: - if (cmd->ccb_ptr->ccb_h.target_lun) - cmd->ccb_ptr->ccb_h.status |= CAM_LUN_INVALID; + if (ccb_ptr->ccb_h.target_lun) + ccb_ptr->ccb_h.status |= CAM_LUN_INVALID; else - cmd->ccb_ptr->ccb_h.status |= CAM_DEV_NOT_THERE; + ccb_ptr->ccb_h.status |= CAM_DEV_NOT_THERE; break; case MFI_STAT_CONFIG_SEQ_MISMATCH: - cmd->ccb_ptr->ccb_h.status |= CAM_REQUEUE_REQ; + ccb_ptr->ccb_h.status |= CAM_REQUEUE_REQ; break; default: device_printf(sc->mrsas_dev, "FW cmd complete status %x\n", status); - cmd->ccb_ptr->ccb_h.status = CAM_REQ_CMP_ERR; - cmd->ccb_ptr->csio.scsi_status = status; + ccb_ptr->ccb_h.status = CAM_REQ_CMP_ERR; + ccb_ptr->csio.scsi_status = status; } return; } @@ -1741,8 +1836,8 @@ mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_ static int mrsas_alloc_mem(struct mrsas_softc *sc) { - u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, - chain_frame_size, evt_detail_size, count; + u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, chain_frame_size, + evt_detail_size, count, pd_info_size; /* * Allocate parent DMA tag @@ -1912,6 +2007,7 @@ mrsas_alloc_mem(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Cannot load sense buf memory\n"); return (ENOMEM); } + /* * Allocate for Event detail structure */ @@ -1942,7 +2038,39 @@ mrsas_alloc_mem(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Cannot load Event detail buffer memory\n"); return (ENOMEM); } + /* + * Allocate for PD INFO structure + */ + pd_info_size = sizeof(struct mrsas_pd_info); + if (bus_dma_tag_create(sc->mrsas_parent_tag, + 1, 0, + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, + NULL, NULL, + pd_info_size, + 1, + pd_info_size, + BUS_DMA_ALLOCNOW, + NULL, NULL, + &sc->pd_info_tag)) { + device_printf(sc->mrsas_dev, "Cannot create PD INFO tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->pd_info_tag, (void **)&sc->pd_info_mem, + BUS_DMA_NOWAIT, &sc->pd_info_dmamap)) { + device_printf(sc->mrsas_dev, "Cannot alloc PD INFO buffer memory\n"); + return (ENOMEM); + } + bzero(sc->pd_info_mem, pd_info_size); + if (bus_dmamap_load(sc->pd_info_tag, sc->pd_info_dmamap, + sc->pd_info_mem, pd_info_size, mrsas_addr_cb, + &sc->pd_info_phys_addr, BUS_DMA_NOWAIT)) { + device_printf(sc->mrsas_dev, "Cannot load PD INFO buffer memory\n"); + return (ENOMEM); + } + + /* * Create a dma tag for data buffers; size will be the maximum * possible I/O size (280kB). */ @@ -2147,15 +2275,25 @@ mrsas_init_fw(struct mrsas_softc *sc) u_int32_t max_sectors_1; u_int32_t max_sectors_2; u_int32_t tmp_sectors; - u_int32_t scratch_pad_2; + u_int32_t scratch_pad_2, scratch_pad_3, scratch_pad_4; int msix_enable = 0; int fw_msix_count = 0; + int i, j; /* Make sure Firmware is ready */ ret = mrsas_transition_to_ready(sc, ocr); if (ret != SUCCESS) { return (ret); } + if (sc->is_ventura) { + scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); +#if VD_EXT_DEBUG + device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); +#endif + sc->maxRaidMapSize = ((scratch_pad_3 >> + MR_MAX_RAID_MAP_SIZE_OFFSET_SHIFT) & + MR_MAX_RAID_MAP_SIZE_MASK); + } /* MSI-x index 0- reply post host index register */ sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET; /* Check if MSI-X is supported while in ready state */ @@ -2177,6 +2315,15 @@ mrsas_init_fw(struct mrsas_softc *sc) >> MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT) + 1; fw_msix_count = sc->msix_vectors; + if ((sc->mrsas_gen3_ctrl && (sc->msix_vectors > 8)) || + (sc->is_ventura && (sc->msix_vectors > 16))) + sc->msix_combined = true; + /* + * Save 1-15 reply post index + * address to local memory Index 0 + * is already saved from reg offset + * MPI2_REPLY_POST_HOST_INDEX_OFFSET + */ for (loop = 1; loop < MR_MAX_MSIX_REG_ARRAY; loop++) { sc->msix_reg_offset[loop] = @@ -2199,10 +2346,28 @@ mrsas_init_fw(struct mrsas_softc *sc) "Online CPU %d Current MSIX <%d>\n", fw_msix_count, mp_ncpus, sc->msix_vectors); } + /* + * MSI-X host index 0 is common for all adapter. + * It is used for all MPT based Adapters. + */ + if (sc->msix_combined) { + sc->msix_reg_offset[0] = + MPI2_SUP_REPLY_POST_HOST_INDEX_OFFSET; + } if (mrsas_init_adapter(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Adapter initialize Fail.\n"); return (1); } + + if (sc->is_ventura) { + scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_4)); + if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) + sc->nvme_page_size = 1 << (scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK); + + device_printf(sc->mrsas_dev, "NVME page size\t: (%d)\n", sc->nvme_page_size); + } + /* Allocate internal commands for pass-thru */ if (mrsas_alloc_mfi_cmds(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); @@ -2230,6 +2395,9 @@ mrsas_init_fw(struct mrsas_softc *sc) if (sc->use_seqnum_jbod_fp) device_printf(sc->mrsas_dev, "FW supports JBOD Map \n"); + if (sc->support_morethan256jbod) + device_printf(sc->mrsas_dev, "FW supports JBOD Map Ext \n"); + if (mrsas_setup_raidmap(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Error: RAID map setup FAILED !!! " "There seems to be some problem in the controller\n" @@ -2237,6 +2405,12 @@ mrsas_init_fw(struct mrsas_softc *sc) } megasas_setup_jbod_map(sc); + + memset(sc->target_list, 0, + MRSAS_MAX_TM_TARGETS * sizeof(struct mrsas_target)); + for (i = 0; i < MRSAS_MAX_TM_TARGETS; i++) + sc->target_list[i].target_id = 0xffff; + /* For pass-thru, get PD/LD list and controller info */ memset(sc->pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); @@ -2249,6 +2423,30 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Get LD lsit failed.\n"); return (1); } + + if (sc->is_ventura && sc->drv_stream_detection) { + sc->streamDetectByLD = malloc(sizeof(PTR_LD_STREAM_DETECT) * + MAX_LOGICAL_DRIVES_EXT, M_MRSAS, M_NOWAIT); + if (!sc->streamDetectByLD) { + device_printf(sc->mrsas_dev, + "unable to allocate stream detection for pool of LDs\n"); + return (1); + } + for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) { + sc->streamDetectByLD[i] = malloc(sizeof(LD_STREAM_DETECT), M_MRSAS, M_NOWAIT); + if (!sc->streamDetectByLD[i]) { + device_printf(sc->mrsas_dev, "unable to allocate stream detect by LD\n"); + for (j = 0; j < i; ++j) + free(sc->streamDetectByLD[j], M_MRSAS); + free(sc->streamDetectByLD, M_MRSAS); + sc->streamDetectByLD = NULL; + return (1); + } + memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); + sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; + } + } + /* * Compute the max allowed sectors per IO: The controller info has * two limits on max sectors. Driver should use the minimum of these @@ -2298,25 +2496,26 @@ int mrsas_init_adapter(struct mrsas_softc *sc) { uint32_t status; - u_int32_t max_cmd, scratch_pad_2; + u_int32_t scratch_pad_2; int ret; int i = 0; /* Read FW status register */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); - /* Get operational params from status register */ sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK; /* Decrement the max supported by 1, to correlate with FW */ sc->max_fw_cmds = sc->max_fw_cmds - 1; - max_cmd = sc->max_fw_cmds; + sc->max_scsi_cmds = sc->max_fw_cmds - + (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS); /* Determine allocation size of command frames */ - sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16) * 2; - sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * max_cmd; + sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2; + sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * sc->max_fw_cmds; sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); - sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (max_cmd + 1)); + sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* @@ -2334,15 +2533,17 @@ mrsas_init_adapter(struct mrsas_softc *sc) ((scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_MASK) >> 5) * MEGASAS_256K_IO; - sc->chain_frames_alloc_sz = sc->max_chain_frame_sz * max_cmd; + sc->chain_frames_alloc_sz = sc->max_chain_frame_sz * sc->max_fw_cmds; sc->max_sge_in_main_msg = (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE - offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL)) / 16; sc->max_sge_in_chain = sc->max_chain_frame_sz / sizeof(MPI2_SGE_IO_UNION); sc->max_num_sge = sc->max_sge_in_main_msg + sc->max_sge_in_chain - 2; - mrsas_dprint(sc, MRSAS_INFO, "Avago Debug: MAX sge 0x%X MAX chain frame size 0x%X \n", - sc->max_num_sge, sc->max_chain_frame_sz); + mrsas_dprint(sc, MRSAS_INFO, + "max sge: 0x%x, max chain frame size: 0x%x, " + "max fw cmd: 0x%x\n", sc->max_num_sge, + sc->max_chain_frame_sz, sc->max_fw_cmds); /* Used for pass thru MFI frame (DCMD) */ sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; @@ -2441,7 +2642,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) struct mrsas_init_frame *init_frame; pMpi2IOCInitRequest_t IOCInitMsg; MRSAS_REQUEST_DESCRIPTOR_UNION req_desc; - u_int8_t max_wait = MRSAS_IOC_INIT_WAIT_TIME; + u_int8_t max_wait = MRSAS_INTERNAL_CMD_WAIT_TIME; bus_addr_t phys_addr; int i, retcode = 0; u_int32_t scratch_pad_2; @@ -2469,6 +2670,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); + IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; init_frame->cmd = MFI_CMD_INIT; @@ -2476,7 +2678,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if (sc->mrsas_gen3_ctrl) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -2545,14 +2747,14 @@ int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) { int i, j; - u_int32_t max_cmd, count; + u_int32_t max_fw_cmds, count; struct mrsas_mpt_cmd *cmd; pMpi2ReplyDescriptorsUnion_t reply_desc; u_int32_t offset, chain_offset, sense_offset; bus_addr_t io_req_base_phys, chain_frame_base_phys, sense_base_phys; u_int8_t *io_req_base, *chain_frame_base, *sense_base; - max_cmd = sc->max_fw_cmds; + max_fw_cmds = sc->max_fw_cmds; sc->req_desc = malloc(sc->request_alloc_sz, M_MRSAS, M_NOWAIT); if (!sc->req_desc) { @@ -2566,13 +2768,14 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) * Allocate the dynamic array first and then allocate individual * commands. */ - sc->mpt_cmd_list = malloc(sizeof(struct mrsas_mpt_cmd *) * max_cmd, M_MRSAS, M_NOWAIT); + sc->mpt_cmd_list = malloc(sizeof(struct mrsas_mpt_cmd *) * max_fw_cmds, + M_MRSAS, M_NOWAIT); if (!sc->mpt_cmd_list) { device_printf(sc->mrsas_dev, "Cannot alloc memory for mpt_cmd_list.\n"); return (ENOMEM); } - memset(sc->mpt_cmd_list, 0, sizeof(struct mrsas_mpt_cmd *) * max_cmd); - for (i = 0; i < max_cmd; i++) { + memset(sc->mpt_cmd_list, 0, sizeof(struct mrsas_mpt_cmd *) * max_fw_cmds); + for (i = 0; i < max_fw_cmds; i++) { sc->mpt_cmd_list[i] = malloc(sizeof(struct mrsas_mpt_cmd), M_MRSAS, M_NOWAIT); if (!sc->mpt_cmd_list[i]) { @@ -2590,7 +2793,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) chain_frame_base_phys = (bus_addr_t)sc->chain_frame_phys_addr; sense_base = (u_int8_t *)sc->sense_mem; sense_base_phys = (bus_addr_t)sc->sense_phys_addr; - for (i = 0; i < max_cmd; i++) { + for (i = 0; i < max_fw_cmds; i++) { cmd = sc->mpt_cmd_list[i]; offset = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * i; chain_offset = sc->max_chain_frame_sz * i; @@ -2598,6 +2801,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) memset(cmd, 0, sizeof(struct mrsas_mpt_cmd)); cmd->index = i + 1; cmd->ccb_ptr = NULL; + cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; callout_init_mtx(&cmd->cm_callout, &sc->sim_lock, 0); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; cmd->sc = sc; @@ -2949,13 +3153,27 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese mtx_unlock(&sc->sim_lock); for (i = 0; i < sc->max_fw_cmds; i++) { mpt_cmd = sc->mpt_cmd_list[i]; + + if (mpt_cmd->peer_cmd) { + mrsas_dprint(sc, MRSAS_OCR, + "R1 FP command [%d] - (mpt_cmd) %p, (peer_cmd) %p\n", + i, mpt_cmd, mpt_cmd->peer_cmd); + } + if (mpt_cmd->ccb_ptr) { - ccb = (union ccb *)(mpt_cmd->ccb_ptr); - ccb->ccb_h.status = CAM_SCSI_BUS_RESET; - mrsas_cmd_done(sc, mpt_cmd); - mrsas_atomic_dec(&sc->fw_outstanding); + if (mpt_cmd->callout_owner) { + ccb = (union ccb *)(mpt_cmd->ccb_ptr); + ccb->ccb_h.status = CAM_SCSI_BUS_RESET; + mrsas_cmd_done(sc, mpt_cmd); + } else { + mpt_cmd->ccb_ptr = NULL; + mrsas_release_mpt_cmd(mpt_cmd); + } } } + + mrsas_atomic_set(&sc->fw_outstanding, 0); + mtx_lock(&sc->sim_lock); status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set, @@ -3088,6 +3306,13 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese megasas_setup_jbod_map(sc); + if (sc->is_ventura && sc->streamDetectByLD) { + for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) { + memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); + sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; + } + } + mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; @@ -3172,7 +3397,7 @@ mrsas_complete_outstanding_ioctls(struct mrsas_softc * if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT) { for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_mptmfi_passthru(sc, cmd_mfi, - cmd_mpt->io_request->RaidContext.status); + cmd_mpt->io_request->RaidContext.raid_context.status); } } } @@ -3339,6 +3564,9 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) sc->use_seqnum_jbod_fp = sc->ctrl_info->adapterOperations3.useSeqNumJbodFP; + sc->support_morethan256jbod = + sc->ctrl_info->adapterOperations4.supportPdMapTargetId; + sc->disableOnlineCtrlReset = sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; @@ -3362,8 +3590,10 @@ dcmd_timeout: static void mrsas_update_ext_vd_details(struct mrsas_softc *sc) { + u_int32_t ventura_map_sz = 0; sc->max256vdSupport = - sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + /* Below is additional check to address future FW enhancement */ if (sc->ctrl_info->max_lds > 64) sc->max256vdSupport = 1; @@ -3380,20 +3610,33 @@ mrsas_update_ext_vd_details(struct mrsas_softc *sc) sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; } - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->drv_supported_vd_count - 1)); + if (sc->maxRaidMapSize) { + ventura_map_sz = sc->maxRaidMapSize * + MR_MIN_MAP_SIZE; + sc->current_map_sz = ventura_map_sz; + sc->max_map_sz = ventura_map_sz; + } else { + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); + if (sc->max256vdSupport) + sc->current_map_sz = sc->new_map_sz; + else + sc->current_map_sz = sc->old_map_sz; + } - sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); - - if (sc->max256vdSupport) - sc->current_map_sz = sc->new_map_sz; - else - sc->current_map_sz = sc->old_map_sz; + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP_ALL); +#if VD_EXT_DEBUG + device_printf(sc->mrsas_dev, "sc->maxRaidMapSize 0x%x \n", + sc->maxRaidMapSize); + device_printf(sc->mrsas_dev, + "new_map_sz = 0x%x, old_map_sz = 0x%x, " + "ventura_map_sz = 0x%x, current_map_sz = 0x%x " + "fusion->drv_map_sz =0x%x, size of driver raid map 0x%lx \n", + sc->new_map_sz, sc->old_map_sz, ventura_map_sz, + sc->current_map_sz, sc->drv_map_sz, sizeof(MR_DRV_RAID_MAP_ALL)); +#endif } /* @@ -3591,7 +3834,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, st io_req = mpt_cmd->io_request; - if (sc->mrsas_gen3_ctrl) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -4106,7 +4349,114 @@ mrsas_sync_map_info(struct mrsas_softc *sc) return (retcode); } +/* Input: dcmd.opcode - MR_DCMD_PD_GET_INFO + * dcmd.mbox.s[0] - deviceId for this physical drive + * dcmd.sge IN - ptr to returned MR_PD_INFO structure + * Desc: Firmware return the physical drive info structure + * + */ +static void +mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) +{ + int retcode; + u_int8_t do_ocr = 1; + struct mrsas_mfi_cmd *cmd; + struct mrsas_dcmd_frame *dcmd; + + cmd = mrsas_get_mfi_cmd(sc); + + if (!cmd) { + device_printf(sc->mrsas_dev, + "Cannot alloc for get PD info cmd\n"); + return; + } + dcmd = &cmd->frame->dcmd; + + memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); + memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); + + dcmd->mbox.s[0] = device_id; + dcmd->cmd = MFI_CMD_DCMD; + dcmd->cmd_status = 0xFF; + dcmd->sge_count = 1; + dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->timeout = 0; + dcmd->pad_0 = 0; + dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); + dcmd->opcode = MR_DCMD_PD_GET_INFO; + dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; + dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); + + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + + if (retcode == ETIMEDOUT) + goto dcmd_timeout; + + sc->target_list[device_id].interface_type = + sc->pd_info_mem->state.ddf.pdType.intf; + + do_ocr = 0; + +dcmd_timeout: + + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + + if (!sc->mask_interrupts) + mrsas_release_mfi_cmd(cmd); +} + /* + * mrsas_add_target: Add target ID of system PD/VD to driver's data structure. + * sc: Adapter's soft state + * target_id: Unique target id per controller(managed by driver) + * for system PDs- target ID ranges from 0 to (MRSAS_MAX_PD - 1) + * for VDs- target ID ranges from MRSAS_MAX_PD to MRSAS_MAX_TM_TARGETS + * return: void + * Descripton: This function will be called whenever system PD or VD is created. + */ +static void mrsas_add_target(struct mrsas_softc *sc, + u_int16_t target_id) +{ + sc->target_list[target_id].target_id = target_id; + + device_printf(sc->mrsas_dev, + "%s created target ID: 0x%x\n", + (target_id < MRSAS_MAX_PD ? "System PD" : "VD"), + (target_id < MRSAS_MAX_PD ? target_id : (target_id - MRSAS_MAX_PD))); + /* + * If interrupts are enabled, then only fire DCMD to get pd_info + * for system PDs + */ + if (!sc->mask_interrupts && sc->pd_info_mem && + (target_id < MRSAS_MAX_PD)) + mrsas_get_pd_info(sc, target_id); + +} + +/* + * mrsas_remove_target: Remove target ID of system PD/VD from driver's data structure. + * sc: Adapter's soft state + * target_id: Unique target id per controller(managed by driver) + * for system PDs- target ID ranges from 0 to (MRSAS_MAX_PD - 1) + * for VDs- target ID ranges from MRSAS_MAX_PD to MRSAS_MAX_TM_TARGETS + * return: void + * Descripton: This function will be called whenever system PD or VD is deleted + */ +static void mrsas_remove_target(struct mrsas_softc *sc, + u_int16_t target_id) +{ + sc->target_list[target_id].target_id = 0xffff; + device_printf(sc->mrsas_dev, + "%s deleted target ID: 0x%x\n", + (target_id < MRSAS_MAX_PD ? "System PD" : "VD"), + (target_id < MRSAS_MAX_PD ? target_id : (target_id - MRSAS_MAX_PD))); +} + +/* * mrsas_get_pd_list: Returns FW's PD list structure input: * Adapter soft state * @@ -4182,8 +4532,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) pd_addr->scsiDevType; sc->local_pd_list[pd_addr->deviceId].driveState = MR_PD_STATE_SYSTEM; + if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) + mrsas_add_target(sc, pd_addr->deviceId); pd_addr++; } + for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { + if ((sc->local_pd_list[pd_index].driveState != + MR_PD_STATE_SYSTEM) && + (sc->target_list[pd_index].target_id != + 0xffff)) { + mrsas_remove_target(sc, pd_index); + } + } /* * Use mutext/spinlock if pd_list component size increase more than * 32 bit. @@ -4215,7 +4575,7 @@ dcmd_timeout: static int mrsas_get_ld_list(struct mrsas_softc *sc) { - int ld_list_size, retcode = 0, ld_index = 0, ids = 0; + int ld_list_size, retcode = 0, ld_index = 0, ids = 0, drv_tgt_id; u_int8_t do_ocr = 1; struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; @@ -4277,11 +4637,21 @@ mrsas_get_ld_list(struct mrsas_softc *sc) sc->CurLdCount = ld_list_mem->ldCount; memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { + ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; + drv_tgt_id = ids + MRSAS_MAX_PD; if (ld_list_mem->ldList[ld_index].state != 0) { - ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; sc->ld_ids[ids] = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; + if (sc->target_list[drv_tgt_id].target_id == + 0xffff) + mrsas_add_target(sc, drv_tgt_id); + } else { + if (sc->target_list[drv_tgt_id].target_id != + 0xffff) + mrsas_remove_target(sc, + drv_tgt_id); } } + do_ocr = 0; } dcmd_timeout: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Thu Jan 3 07:59:52 2019 Return-Path: Delivered-To: svn-src-stable-11@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 023F0141BF4E; Thu, 3 Jan 2019 07:59:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7E18EE70; Thu, 3 Jan 2019 07:59:51 +0000 (UTC) (envelope-from kadesai@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 8DDAF1E4A4; Thu, 3 Jan 2019 07:59:51 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x037xpmd070521; Thu, 3 Jan 2019 07:59:51 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x037xpPO070520; Thu, 3 Jan 2019 07:59:51 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030759.x037xpPO070520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 07:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342718 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 342718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B7E18EE70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 07:59:52 -0000 Author: kadesai Date: Thu Jan 3 07:59:51 2019 New Revision: 342718 URL: https://svnweb.freebsd.org/changeset/base/342718 Log: MFC r342079 Compilation failure on ppc and mips due to Revision 342066. Adding extra memset on chain frame. Modified: stable/11/sys/dev/mrsas/mrsas_cam.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 07:56:19 2019 (r342717) +++ stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 07:59:51 2019 (r342718) @@ -1578,7 +1578,8 @@ static void mrsas_build_prp_nvme(struct mrsas_mpt_cmd struct mrsas_softc *sc = cmd->sc; int sge_len, offset, num_prp_in_chain = 0; pMpi25IeeeSgeChain64_t main_chain_element, ptr_first_sgl, sgl_ptr; - u_int64_t *ptr_sgl, *ptr_sgl_phys; + u_int64_t *ptr_sgl; + bus_addr_t ptr_sgl_phys; u_int64_t sge_addr; u_int32_t page_mask, page_mask_result, i = 0; u_int32_t first_prp_len; @@ -1601,14 +1602,15 @@ static void mrsas_build_prp_nvme(struct mrsas_mpt_cmd */ page_mask = mr_nvme_pg_size - 1; ptr_sgl = (u_int64_t *) cmd->chain_frame; - ptr_sgl_phys = (u_int64_t *) cmd->chain_frame_phys_addr;; + ptr_sgl_phys = cmd->chain_frame_phys_addr; + memset(ptr_sgl, 0, sc->max_chain_frame_sz); /* Build chain frame element which holds all PRPs except first*/ main_chain_element = (pMpi25IeeeSgeChain64_t) ((u_int8_t *)sgl_ptr + sizeof(MPI25_IEEE_SGE_CHAIN64)); - main_chain_element->Address = (u_int64_t) ptr_sgl_phys; + main_chain_element->Address = cmd->chain_frame_phys_addr; main_chain_element->NextChainOffset = 0; main_chain_element->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | IEEE_SGE_FLAGS_SYSTEM_ADDR | From owner-svn-src-stable-11@freebsd.org Thu Jan 3 08:04:16 2019 Return-Path: Delivered-To: svn-src-stable-11@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 2CFA9141E556; Thu, 3 Jan 2019 08:04:16 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D39108F3E5; Thu, 3 Jan 2019 08:04:15 +0000 (UTC) (envelope-from kadesai@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 C640C1E661; Thu, 3 Jan 2019 08:04:15 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0384F88075625; Thu, 3 Jan 2019 08:04:15 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0384FRr075621; Thu, 3 Jan 2019 08:04:15 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030804.x0384FRr075621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 08:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342720 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 342720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D39108F3E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 08:04:16 -0000 Author: kadesai Date: Thu Jan 3 08:04:14 2019 New Revision: 342720 URL: https://svnweb.freebsd.org/changeset/base/342720 Log: MFC r342537-r342540 r342537 This patch will add support for latest generation MegaRAID adapters- Aero(39xx). Driver will throw a warning message when a Configurable secure type controller is encountered. r342538 This patch will add support for 32 bit atomic request descriptor for Aero adapters. For Aero adapters- 1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs. 2. Driver will use 64 bit request descriptor to fire IOC INIT. 3. If Aero firmware supports 32 bit atomic descriptor, then only driver will use it otherwise driver will use 64 bit request descriptor. For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 bit request descriptors only. r342539 Problem statement: Due to hardware errata in Aero controllers, reads to certain fusion registers could intermittently return all zeroes. This behavior is transient in nature and subsequent reads will return valid value. Fix: For Aero controllers, any read will retry the read operations from certain registers for maximum three times, if read returns zero. r342540 Driver version upgrade. Modified: stable/11/sys/dev/mrsas/mrsas.c stable/11/sys/dev/mrsas/mrsas.h stable/11/sys/dev/mrsas/mrsas_cam.c stable/11/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 08:04:14 2019 (r342720) @@ -95,6 +95,8 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t de static struct mrsas_softc * mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg); +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, @@ -171,6 +173,9 @@ void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus, u_int32_t data_length, u_int8_t *sense); +void +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi); SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); @@ -201,6 +206,14 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_TOMCAT, 0xffff, 0xffff, "AVAGO Tomcat SAS Controller"}, {0x1000, MRSAS_VENTURA_4PORT, 0xffff, 0xffff, "AVAGO Ventura_4Port SAS Controller"}, {0x1000, MRSAS_CRUSADER_4PORT, 0xffff, 0xffff, "AVAGO Crusader_4Port SAS Controller"}, + {0x1000, MRSAS_AERO_10E0, 0xffff, 0xffff, "BROADCOM AERO-10E0 SAS Controller"}, + {0x1000, MRSAS_AERO_10E1, 0xffff, 0xffff, "BROADCOM AERO-10E1 SAS Controller"}, + {0x1000, MRSAS_AERO_10E2, 0xffff, 0xffff, "BROADCOM AERO-10E2 SAS Controller"}, + {0x1000, MRSAS_AERO_10E3, 0xffff, 0xffff, "BROADCOM AERO-10E3 SAS Controller"}, + {0x1000, MRSAS_AERO_10E4, 0xffff, 0xffff, "BROADCOM AERO-10E4 SAS Controller"}, + {0x1000, MRSAS_AERO_10E5, 0xffff, 0xffff, "BROADCOM AERO-10E5 SAS Controller"}, + {0x1000, MRSAS_AERO_10E6, 0xffff, 0xffff, "BROADCOM AERO-10E6 SAS Controller"}, + {0x1000, MRSAS_AERO_10E7, 0xffff, 0xffff, "BROADCOM AERO-10E7 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -261,6 +274,22 @@ mrsas_write(struct cdev *dev, struct uio *uio, int iof return (0); } +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset) +{ + u_int32_t i = 0, ret_val; + + if (sc->is_aero) { + do { + ret_val = mrsas_read_reg(sc, offset); + i++; + } while(ret_val == 0 && i < 3); + } else + ret_val = mrsas_read_reg(sc, offset); + + return ret_val; +} + /* * Register Read/Write Functions * @@ -321,7 +350,7 @@ mrsas_clear_intr(struct mrsas_softc *sc) u_int32_t status; /* Read received interrupt */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_intr_status)); /* Not our interrupt, so just return */ if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) @@ -845,20 +874,37 @@ mrsas_attach(device_t dev) sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + switch (sc->device_id) { + case MRSAS_INVADER: + case MRSAS_FURY: + case MRSAS_INTRUDER: + case MRSAS_INTRUDER_24: + case MRSAS_CUTLASS_52: + case MRSAS_CUTLASS_53: sc->mrsas_gen3_ctrl = 1; - } else if ((sc->device_id == MRSAS_VENTURA) || - (sc->device_id == MRSAS_CRUSADER) || - (sc->device_id == MRSAS_HARPOON) || - (sc->device_id == MRSAS_TOMCAT) || - (sc->device_id == MRSAS_VENTURA_4PORT) || - (sc->device_id == MRSAS_CRUSADER_4PORT)) { + break; + case MRSAS_VENTURA: + case MRSAS_CRUSADER: + case MRSAS_HARPOON: + case MRSAS_TOMCAT: + case MRSAS_VENTURA_4PORT: + case MRSAS_CRUSADER_4PORT: sc->is_ventura = true; + break; + case MRSAS_AERO_10E1: + case MRSAS_AERO_10E5: + device_printf(dev, "Adapter is in configurable secure mode\n"); + case MRSAS_AERO_10E2: + case MRSAS_AERO_10E6: + sc->is_aero = true; + break; + case MRSAS_AERO_10E0: + case MRSAS_AERO_10E3: + case MRSAS_AERO_10E4: + case MRSAS_AERO_10E7: + device_printf(dev, "Adapter is in non-secure mode\n"); + return SUCCESS; + } mrsas_get_tunables(sc); @@ -874,8 +920,8 @@ mrsas_attach(device_t dev) cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); - /* For Ventura system registers are mapped to BAR0 */ - if (sc->is_ventura) + /* For Ventura/Aero system registers are mapped to BAR0 */ + if (sc->is_ventura || sc->is_aero) sc->reg_res_id = PCIR_BAR(0); /* BAR0 offset */ else sc->reg_res_id = PCIR_BAR(1); /* BAR1 offset */ @@ -1099,7 +1145,7 @@ mrsas_detach(device_t dev) mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); mrsas_disable_intr(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) free(sc->streamDetectByLD[i], M_MRSAS); free(sc->streamDetectByLD, M_MRSAS); @@ -2285,8 +2331,8 @@ mrsas_init_fw(struct mrsas_softc *sc) if (ret != SUCCESS) { return (ret); } - if (sc->is_ventura) { - scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); + if (sc->is_ventura || sc->is_aero) { + scratch_pad_3 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); #if VD_EXT_DEBUG device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); #endif @@ -2297,10 +2343,10 @@ mrsas_init_fw(struct mrsas_softc *sc) /* MSI-x index 0- reply post host index register */ sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET; /* Check if MSI-X is supported while in ready state */ - msix_enable = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; + msix_enable = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; if (msix_enable) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* Check max MSI-X vectors */ @@ -2316,7 +2362,7 @@ mrsas_init_fw(struct mrsas_softc *sc) fw_msix_count = sc->msix_vectors; if ((sc->mrsas_gen3_ctrl && (sc->msix_vectors > 8)) || - (sc->is_ventura && (sc->msix_vectors > 16))) + ((sc->is_ventura || sc->is_aero) && (sc->msix_vectors > 16))) sc->msix_combined = true; /* * Save 1-15 reply post index @@ -2359,8 +2405,8 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura) { - scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + if (sc->is_ventura || sc->is_aero) { + scratch_pad_4 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_4)); if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) sc->nvme_page_size = 1 << (scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK); @@ -2424,7 +2470,7 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura && sc->drv_stream_detection) { + if ((sc->is_ventura || sc->is_aero) && sc->drv_stream_detection) { sc->streamDetectByLD = malloc(sizeof(PTR_LD_STREAM_DETECT) * MAX_LOGICAL_DRIVES_EXT, M_MRSAS, M_NOWAIT); if (!sc->streamDetectByLD) { @@ -2501,7 +2547,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) int i = 0; /* Read FW status register */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK; @@ -2516,7 +2562,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, @@ -2654,7 +2700,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) } if (!sc->block_sync_cache) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); sc->fw_sync_cache_support = (scratch_pad_2 & MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; @@ -2678,7 +2724,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -2703,7 +2749,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) mrsas_disable_intr(sc); mrsas_dprint(sc, MRSAS_OCR, "Issuing IOC INIT command to FW.\n"); - mrsas_fire_cmd(sc, req_desc.addr.u.low, req_desc.addr.u.high); + mrsas_write_64bit_req_desc(sc, req_desc.addr.u.low, req_desc.addr.u.high); /* * Poll response timer to wait for Firmware response. While this @@ -2729,6 +2775,15 @@ mrsas_ioc_init(struct mrsas_softc *sc) retcode = 1; } + if (sc->is_aero) { + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + sc->atomic_desc_support = (scratch_pad_2 & + MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET) ? 1 : 0; + device_printf(sc->mrsas_dev, "FW supports atomic descriptor: %s\n", + sc->atomic_desc_support ? "Yes" : "No"); + } + mrsas_free_ioc_cmd(sc); return (retcode); } @@ -2828,16 +2883,13 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) } /* - * mrsas_fire_cmd: Sends command to FW + * mrsas_write_64bit_req_dsc: Writes 64 bit request descriptor to FW * input: Adapter softstate - * request descriptor address low - * request descriptor address high - * - * This functions fires the command to Firmware by writing to the - * inbound_low_queue_port and inbound_high_queue_port. + * request descriptor address low + * request descriptor address high */ void -mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi) { mtx_lock(&sc->pci_lock); @@ -2849,6 +2901,26 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_d } /* + * mrsas_fire_cmd: Sends command to FW + * input: Adapter softstate + * request descriptor address low + * request descriptor address high + * + * This functions fires the command to Firmware by writing to the + * inbound_low_queue_port and inbound_high_queue_port. + */ +void +mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi) +{ + if (sc->atomic_desc_support) + mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), + req_desc_lo); + else + mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); +} + +/* * mrsas_transition_to_ready: Move FW to Ready state input: * Adapter instance soft state * @@ -2866,7 +2938,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int u_int32_t cur_state; u_int32_t abs_state, curr_abs_state; - val = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + val = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = val & MFI_STATE_MASK; max_wait = MRSAS_RESET_WAIT_TIME; @@ -2874,7 +2946,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int device_printf(sc->mrsas_dev, "Waiting for FW to come to ready state\n"); while (fw_state != MFI_STATE_READY) { - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); switch (fw_state) { case MFI_STATE_FAULT: device_printf(sc->mrsas_dev, "FW is in FAULT state!!\n"); @@ -2902,7 +2974,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int mrsas_disable_intr(sc); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_RESET_FLAGS); for (i = 0; i < max_wait * 1000; i++) { - if (mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)) & 1) + if (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, doorbell)) & 1) DELAY(1000); else break; @@ -2940,9 +3012,9 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int * The cur_state should not last for more than max_wait secs */ for (i = 0; i < (max_wait * 1000); i++) { - fw_state = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK); - curr_abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + curr_abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); if (abs_state == curr_abs_state) DELAY(1000); @@ -3017,7 +3089,7 @@ mrsas_ocr_thread(void *arg) "Hardware critical error", __func__); break; } - fw_status = mrsas_read_reg(sc, + fw_status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset || @@ -3176,7 +3248,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese mtx_lock(&sc->sim_lock); - status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + status_reg = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); abs_state = status_reg & MFI_STATE_MASK; reset_adapter = status_reg & MFI_RESET_ADAPTER; @@ -3206,12 +3278,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese MPI2_WRSEQ_6TH_KEY_VALUE); /* Check that the diag write enable (DRWE) bit is on */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (!(host_diag & HOST_DIAG_WRITE_ENABLE)) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 100) { mrsas_dprint(sc, MRSAS_OCR, @@ -3228,12 +3300,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese DELAY(3000 * 1000); /* Make sure reset adapter bit is cleared */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (host_diag & HOST_DIAG_RESET_ADAPTER) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 1000) { mrsas_dprint(sc, MRSAS_OCR, @@ -3244,13 +3316,13 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese if (host_diag & HOST_DIAG_RESET_ADAPTER) continue; - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; retry = 0; while ((abs_state <= MFI_STATE_FW_INIT) && (retry++ < 1000)) { DELAY(100 * 1000); - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; } if (abs_state <= MFI_STATE_FW_INIT) { @@ -3306,7 +3378,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese megasas_setup_jbod_map(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) { memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; @@ -3425,7 +3497,7 @@ mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_i goto out; } /* Check if firmware is in fault state */ - fw_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT) { mrsas_dprint(sc, MRSAS_OCR, @@ -3834,7 +3906,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, st io_req = mpt_cmd->io_request; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: stable/11/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.h Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas.h Thu Jan 3 08:04:14 2019 (r342720) @@ -91,7 +91,16 @@ __FBSDID("$FreeBSD$"); #define MRSAS_TOMCAT 0x0017 #define MRSAS_VENTURA_4PORT 0x001B #define MRSAS_CRUSADER_4PORT 0x001C +#define MRSAS_AERO_10E0 0x10E0 +#define MRSAS_AERO_10E1 0x10E1 +#define MRSAS_AERO_10E2 0x10E2 +#define MRSAS_AERO_10E3 0x10E3 +#define MRSAS_AERO_10E4 0x10E4 +#define MRSAS_AERO_10E5 0x10E5 +#define MRSAS_AERO_10E6 0x10E6 +#define MRSAS_AERO_10E7 0x10E7 + /* * Firmware State Defines */ @@ -110,7 +119,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "07.708.02.00-fbsd" +#define MRSAS_VERSION "07.709.01.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 @@ -1250,7 +1259,7 @@ typedef struct _mrsas_register_set { u_int32_t inbound_high_queue_port; /* 00C4h */ - u_int32_t reserved_5; /* 00C8h */ + u_int32_t inbound_single_queue_port; /* 00C8h */ u_int32_t res_6[11]; /* CCh */ u_int32_t host_diag; u_int32_t seq_offset; @@ -2307,6 +2316,8 @@ struct mrsas_ctrl_info { */ #define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 +#define MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET (1 << 24) + /* * FW reports the maximum of number of commands that it can accept (maximum * commands that can be outstanding) at any time. The driver must report a @@ -3355,7 +3366,9 @@ struct mrsas_softc { u_int32_t nvme_page_size; boolean_t is_ventura; + boolean_t is_aero; boolean_t msix_combined; + boolean_t atomic_desc_support; u_int16_t maxRaidMapSize; /* Non dma-able memory. Driver local copy. */ Modified: stable/11/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 08:04:14 2019 (r342720) @@ -868,7 +868,7 @@ mrsas_build_ldio_rw(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (FAIL); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1072,7 +1072,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp cmd->request_desc->SCSIIO.MSIxIndex = sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { if (sc->streamDetectByLD) { mtx_lock(&sc->stream_lock); mrsas_stream_detect(sc, cmd, &io_info); @@ -1122,7 +1122,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp io_request->RaidContext.raid_context.regLockFlags |= (MR_RL_FLAGS_GRANT_DESTINATION_CUDA | MR_RL_FLAGS_SEQ_NUM_ENABLE); - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.nseg = 0x1; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; @@ -1140,14 +1140,14 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; cmd->pd_r1_lb = io_info.pd_after_lb; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.spanArm = io_info.span_arm; else io_request->RaidContext.raid_context.spanArm = io_info.span_arm; } else cmd->load_balance = 0; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) cmd->r1_alt_dev_handle = io_info.r1_alt_dev_handle; else cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; @@ -1171,7 +1171,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp (MR_RL_FLAGS_GRANT_DESTINATION_CPU0 | MR_RL_FLAGS_SEQ_NUM_ENABLE); io_request->RaidContext.raid_context.nseg = 0x1; - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; io_request->RaidContext.raid_context_g35.nseg = 0x1; @@ -1230,7 +1230,7 @@ mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1295,7 +1295,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs device_id + 255; io_request->RaidContext.raid_context.configSeqNum = pd_sync->seq[device_id].seqNum; io_request->DevHandle = pd_sync->seq[device_id].devHandle; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; else io_request->RaidContext.raid_context.regLockFlags |= @@ -1343,7 +1343,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs * Because the NON RW cmds will now go via FW Queue * and not the Exception queue */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; cmd->request_desc->SCSIIO.RequestFlags = @@ -1360,7 +1360,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1523,7 +1523,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd io_request = cmd->io_request; sgl_ptr = (pMpi25IeeeSgeChain64_t)&io_request->SGL; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1534,7 +1534,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd sgl_ptr->Address = segs[i].ds_addr; sgl_ptr->Length = segs[i].ds_len; sgl_ptr->Flags = 0; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1544,7 +1544,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd (nseg > sc->max_sge_in_main_msg)) { pMpi25IeeeSgeChain64_t sg_chain; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1553,7 +1553,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd } else cmd->io_request->ChainOffset = sc->chain_offset_io_request; sg_chain = sgl_ptr; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: stable/11/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas_fp.c Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas_fp.c Thu Jan 3 08:04:14 2019 (r342720) @@ -983,7 +983,7 @@ mr_spanset_get_phy_params(struct mrsas_softc *sc, u_in } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; @@ -1190,7 +1190,7 @@ MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_ * if FP possible, set the SLUD bit in regLockFlags for * ventura */ - else if ((sc->is_ventura) && !isRead && + else if ((sc->is_ventura || sc->is_aero) && !isRead && (raid->writeMode == MR_RL_WRITE_BACK_MODE) && (raid->level <= 1) && raid->capability.fpCacheBypassCapable) { ((RAID_CONTEXT_G35 *) pRAID_Context)->routingFlags.bits.sld = 1; @@ -1729,7 +1729,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; From owner-svn-src-stable-11@freebsd.org Thu Jan 3 09:24:38 2019 Return-Path: Delivered-To: svn-src-stable-11@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 A7CF41421FA1; Thu, 3 Jan 2019 09:24:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE396B990; Thu, 3 Jan 2019 09:24:38 +0000 (UTC) (envelope-from hselasky@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 356481F425; Thu, 3 Jan 2019 09:24:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039Ock0018452; Thu, 3 Jan 2019 09:24:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039Ocad018451; Thu, 3 Jan 2019 09:24:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030924.x039Ocad018451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342723 - stable/11/sys/dev/sound/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/usb X-SVN-Commit-Revision: 342723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CE396B990 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 09:24:39 -0000 Author: hselasky Date: Thu Jan 3 09:24:37 2019 New Revision: 342723 URL: https://svnweb.freebsd.org/changeset/base/342723 Log: MFC r342456: Fix reading of USB sample rate descriptor for SPL Crimson Rev 1. Read first one entry, then try to read the full rate descriptor table. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/usb/uaudio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/11/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:23:35 2019 (r342722) +++ stable/11/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:24:37 2019 (r342723) @@ -1518,7 +1518,8 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i { struct usb_device_request req; usb_error_t error; - uint8_t data[255]; +#define UAUDIO20_MAX_RATES 32 /* we support at maxium 32 rates */ + uint8_t data[2 + UAUDIO20_MAX_RATES * 12]; uint16_t actlen; uint16_t rates; uint16_t x; @@ -1530,19 +1531,57 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i req.bRequest = UA20_CS_RANGE; USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); USETW2(req.wIndex, clockid, iface_no); - USETW(req.wLength, 255); + /* + * Assume there is at least one rate to begin with, else some + * devices might refuse to return the USB descriptor: + */ + USETW(req.wLength, (2 + 1 * 12)); - error = usbd_do_request_flags(udev, NULL, &req, data, + error = usbd_do_request_flags(udev, NULL, &req, data, USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); - if (error != 0 || actlen < 2) - return (USB_ERR_INVAL); + if (error != 0 || actlen < 2) { + /* + * Likely the descriptor doesn't fit into the supplied + * buffer. Try using a larger buffer and see if that + * helps: + */ + rates = MIN(UAUDIO20_MAX_RATES, (255 - 2) / 12); + error = USB_ERR_INVAL; + } else { + rates = UGETW(data); - rates = data[0] | (data[1] << 8); + if (rates > UAUDIO20_MAX_RATES) { + DPRINTF("Too many rates truncating to %d\n", UAUDIO20_MAX_RATES); + rates = UAUDIO20_MAX_RATES; + error = USB_ERR_INVAL; + } else if (rates > 1) { + DPRINTF("Need to read full rate descriptor\n"); + error = USB_ERR_INVAL; + } + } + + if (error != 0) { + /* + * Try to read full rate descriptor. + */ + actlen = (2 + rates * 12); + + USETW(req.wLength, actlen); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = UGETW(data); + } + actlen = (actlen - 2) / 12; if (rates > actlen) { - DPRINTF("Too many rates\n"); + DPRINTF("Too many rates truncating to %d\n", actlen); rates = actlen; } From owner-svn-src-stable-11@freebsd.org Thu Jan 3 09:27:36 2019 Return-Path: Delivered-To: svn-src-stable-11@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 5F8C2142225B; Thu, 3 Jan 2019 09:27:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0D1F6BE4E; Thu, 3 Jan 2019 09:27:35 +0000 (UTC) (envelope-from hselasky@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 DDC291F42E; Thu, 3 Jan 2019 09:27:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039RZKx018813; Thu, 3 Jan 2019 09:27:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039RZPL018812; Thu, 3 Jan 2019 09:27:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030927.x039RZPL018812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342726 - in stable/11/sys/dev/usb: . quirk X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . quirk X-SVN-Commit-Revision: 342726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0D1F6BE4E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 09:27:36 -0000 Author: hselasky Date: Thu Jan 3 09:27:35 2019 New Revision: 342726 URL: https://svnweb.freebsd.org/changeset/base/342726 Log: MFC r342549: Add USB quirk for SPL Crimson Rev 1. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/11/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:26:45 2019 (r342725) +++ stable/11/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:27:35 2019 (r342726) @@ -525,6 +525,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206), + USB_QUIRK(PLOYTEC, SPL_CRIMSON_1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* * Quirks for manufacturers which USB devices does not respond Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Thu Jan 3 09:26:45 2019 (r342725) +++ stable/11/sys/dev/usb/usbdevs Thu Jan 3 09:27:35 2019 (r342726) @@ -489,6 +489,7 @@ vendor ASAHIOPTICAL 0x0a17 Asahi Optical vendor BOCASYSTEMS 0x0a43 Boca Systems vendor SHANTOU 0x0a46 ShanTou vendor MEDIAGEAR 0x0a48 MediaGear +vendor PLOYTEC 0x0a4a Ploytec GmbH vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor MEDELI 0x0a67 Medeli @@ -3584,6 +3585,9 @@ product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U + +/* Ploytec GmbH */ +product PLOYTEC SPL_CRIMSON_1 0xc150 SPL Crimson Revision 1 /* PLX products */ product PLX TESTBOARD 0x9060 test board From owner-svn-src-stable-11@freebsd.org Fri Jan 4 00:06:31 2019 Return-Path: Delivered-To: svn-src-stable-11@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 B11EA143C097; Fri, 4 Jan 2019 00:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51DCE6FCCA; Fri, 4 Jan 2019 00:06:31 +0000 (UTC) (envelope-from jhb@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 322A328B08; Fri, 4 Jan 2019 00:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0406VJu092921; Fri, 4 Jan 2019 00:06:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0406VvF092920; Fri, 4 Jan 2019 00:06:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901040006.x0406VvF092920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 4 Jan 2019 00:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342750 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 342750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51DCE6FCCA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 00:06:31 -0000 Author: jhb Date: Fri Jan 4 00:06:30 2019 New Revision: 342750 URL: https://svnweb.freebsd.org/changeset/base/342750 Log: MFC 340021: Assert that reclaim_tx_descs() is always making forward progress. Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Thu Jan 3 23:06:05 2019 (r342749) +++ stable/11/sys/dev/cxgbe/t4_sge.c Fri Jan 4 00:06:30 2019 (r342750) @@ -4694,6 +4694,9 @@ reclaim_tx_descs(struct sge_txq *txq, u_int n) KASSERT(can_reclaim >= ndesc, ("%s: unexpected number of credits: %d, %d", __func__, can_reclaim, ndesc)); + KASSERT(ndesc != 0, + ("%s: descriptor with no credits: cidx %d", + __func__, eq->cidx)); for (m = txsd->m; m != NULL; m = nextpkt) { nextpkt = m->m_nextpkt; From owner-svn-src-stable-11@freebsd.org Fri Jan 4 01:19:24 2019 Return-Path: Delivered-To: svn-src-stable-11@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 B8139143DA6F; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9B771B70; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@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 54374296AE; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x041JOkr030401; Fri, 4 Jan 2019 01:19:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x041JOkU030400; Fri, 4 Jan 2019 01:19:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901040119.x041JOkU030400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 4 Jan 2019 01:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342751 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 342751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F9B771B70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 01:19:25 -0000 Author: jhb Date: Fri Jan 4 01:19:23 2019 New Revision: 342751 URL: https://svnweb.freebsd.org/changeset/base/342751 Log: MFC 340022: Add support for port unit wiring to cxgbe(4). - Add a bus_child_location_str method to the nexus drivers that prints out 'port=N' as the location string exported via devinfo and the '%location' sysctl node. - We can't use a bus_hint_device_unit to wire the unit numbers of devices with a fixed devclass as the device gets assigned a unit in make_device() before the device creator can set softc, etc. Instead, when adding a child device, use a helper function much like a bus_hint_device_unit method to look for wiring hints or to return -1 to let the system choose a unit number. This function requires an "at" hint for the port pointing to the nexus device and a "port" hint listing the port number. For example: hint.cxl.4.at="t5nex0" hint.cxl.4.port="0" wires cxl4 to the first port on the t5nex0 adapter. Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Fri Jan 4 00:06:30 2019 (r342750) +++ stable/11/sys/dev/cxgbe/t4_main.c Fri Jan 4 01:19:23 2019 (r342751) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); static int t4_probe(device_t); static int t4_attach(device_t); static int t4_detach(device_t); +static int t4_child_location_str(device_t, device_t, char *, size_t); static int t4_ready(device_t); static int t4_read_port_device(device_t, int, device_t *); static device_method_t t4_methods[] = { @@ -92,6 +93,8 @@ static device_method_t t4_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -151,6 +154,8 @@ static device_method_t t5_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -184,6 +189,8 @@ static device_method_t t6_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -846,6 +853,24 @@ t4_init_devnames(struct adapter *sc) } static int +t4_ifnet_unit(struct adapter *sc, struct port_info *pi) +{ + const char *parent, *name; + long value; + int line, unit; + + line = 0; + parent = device_get_nameunit(sc->dev); + name = sc->names->ifnet_name; + while (resource_find_dev(&line, name, &unit, "at", parent) == 0) { + if (resource_long_value(name, unit, "port", &value) == 0 && + value == pi->port_id) + return (unit); + } + return (-1); +} + +static int t4_attach(device_t dev) { struct adapter *sc; @@ -1040,7 +1065,8 @@ t4_attach(device_t dev) pi->flags |= FIXED_IFMEDIA; PORT_UNLOCK(pi); - pi->dev = device_add_child(dev, sc->names->ifnet_name, -1); + pi->dev = device_add_child(dev, sc->names->ifnet_name, + t4_ifnet_unit(sc, pi)); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -1238,6 +1264,16 @@ done: t4_sysctls(sc); return (rc); +} + +static int +t4_child_location_str(device_t bus, device_t dev, char *buf, size_t buflen) +{ + struct port_info *pi; + + pi = device_get_softc(dev); + snprintf(buf, buflen, "port=%d", pi->port_id); + return (0); } static int From owner-svn-src-stable-11@freebsd.org Fri Jan 4 02:20:35 2019 Return-Path: Delivered-To: svn-src-stable-11@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 CC9EA143F0C9; Fri, 4 Jan 2019 02:20:35 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66AED739F0; Fri, 4 Jan 2019 02:20:35 +0000 (UTC) (envelope-from dab@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 4005F2A0BD; Fri, 4 Jan 2019 02:20:35 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042KZ4P062439; Fri, 4 Jan 2019 02:20:35 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042KYo5062437; Fri, 4 Jan 2019 02:20:34 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901040220.x042KYo5062437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 02:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342752 - stable/11/sys/dev/asmc X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/dev/asmc X-SVN-Commit-Revision: 342752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66AED739F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 02:20:36 -0000 Author: dab Date: Fri Jan 4 02:20:34 2019 New Revision: 342752 URL: https://svnweb.freebsd.org/changeset/base/342752 Log: MFC r342171: asmc: Add support for mid-2011 Macmini 5,2 PR: 225911 Submitted by: trev Reported by: trev Modified: stable/11/sys/dev/asmc/asmc.c stable/11/sys/dev/asmc/asmcvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/asmc/asmc.c ============================================================================== --- stable/11/sys/dev/asmc/asmc.c Fri Jan 4 01:19:23 2019 (r342751) +++ stable/11/sys/dev/asmc/asmc.c Fri Jan 4 02:20:34 2019 (r342752) @@ -263,6 +263,15 @@ struct asmc_model asmc_models[] = { ASMC_MM31_TEMPS, ASMC_MM31_TEMPNAMES, ASMC_MM31_TEMPDESCS }, + /* The Mac Mini 5,2 has no SMS */ + { + "Macmini5,2", "Apple SMC Mac Mini 5,2", + NULL, NULL, NULL, + ASMC_FAN_FUNCS2, + NULL, NULL, NULL, + ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS + }, + /* Idem for the MacPro */ { "MacPro2", "Apple SMC Mac Pro (8-core)", Modified: stable/11/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 01:19:23 2019 (r342751) +++ stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 02:20:34 2019 (r342752) @@ -337,6 +337,41 @@ struct asmc_softc { "Northbridge Proximity Temperature", \ "Wireless Module Proximity Temperature", } +#define ASMC_MM52_TEMPS { "TA0P", "TA1P", \ + "TC0D", "TC0P", \ + "TG0D", "TG1D", \ + "TG0P", "TG0M", \ + "TI0P", \ + "TM0S", "TMBS", \ + "TM0P", "TP0P", \ + "TPCD", "Tp0C", \ + "TW0P", NULL } + +#define ASMC_MM52_TEMPNAMES { "ambient_air_proximity", "ambient_cpu_pch_wireless_dimm", \ + "cpu_die", "cpu_proximity", \ + "gpu_diode1", "gpu_diode2", \ + "gpu_proximity", "gpu_integrated_switcher", \ + "thunderbolt_proximity", \ + "memory_slot1", "memory_slot2", \ + "memory_proximity", "pch_controller_proximity", \ + "pch_controller_die", "pwr_supply", \ + "wireless_proximity", } + +#define ASMC_MM52_TEMPDESCS { "Ambient Air Proximity Temperature", \ + "Combo Ambient CPU PCH Wireless DIMM Temperature", \ + "CPU Die Temperature", "CPU Proximity Temperature", \ + "GPU Diode 1 Temperature" , "GPU Diode 2 Temperature", \ + "GPU Proximity Temperature", \ + "Integrated Graphics/GPU Switcher Temperature", \ + "Thunderbolt Proximity Temperature", \ + "Memory Slot 1 Temperature", \ + "Memory Slot 2 Temperature", \ + "Memory Slots Proximity Temperature", \ + "Platform Controller Hub Proximity Temperature", \ + "Platform Controller Hub Die Temperature", \ + "Power Supply Temperature", \ + "Wireless Module Proximity Temperature", } + #define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ From owner-svn-src-stable-11@freebsd.org Fri Jan 4 02:50:19 2019 Return-Path: Delivered-To: svn-src-stable-11@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 36039143FEF7; Fri, 4 Jan 2019 02:50:19 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B614A75111; Fri, 4 Jan 2019 02:50:18 +0000 (UTC) (envelope-from dab@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 AAA7D2A5AC; Fri, 4 Jan 2019 02:50:18 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042oI34078447; Fri, 4 Jan 2019 02:50:18 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042oIlt078445; Fri, 4 Jan 2019 02:50:18 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901040250.x042oIlt078445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 02:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342755 - stable/11/sys/dev/asmc X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/dev/asmc X-SVN-Commit-Revision: 342755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B614A75111 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 02:50:19 -0000 Author: dab Date: Fri Jan 4 02:50:18 2019 New Revision: 342755 URL: https://svnweb.freebsd.org/changeset/base/342755 Log: MFC r342218: asmc: Add support for MacPro1,1 PR: 203431 Submitted by: jjr@alisa.org & holindho@saunalahti.fi Reported by: jjr@alisa.org Modified: stable/11/sys/dev/asmc/asmc.c stable/11/sys/dev/asmc/asmcvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/asmc/asmc.c ============================================================================== --- stable/11/sys/dev/asmc/asmc.c Fri Jan 4 02:48:43 2019 (r342754) +++ stable/11/sys/dev/asmc/asmc.c Fri Jan 4 02:50:18 2019 (r342755) @@ -272,13 +272,22 @@ struct asmc_model asmc_models[] = { ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS }, - /* Idem for the MacPro */ + /* Idem for the Mac Pro "Quad Core" (original) */ { + "MacPro1,1", "Apple SMC Mac Pro (Quad Core)", + NULL, NULL, NULL, + ASMC_FAN_FUNCS, + NULL, NULL, NULL, + ASMC_MP1_TEMPS, ASMC_MP1_TEMPNAMES, ASMC_MP1_TEMPDESCS + }, + + /* Idem for the Mac Pro (8-core) */ + { "MacPro2", "Apple SMC Mac Pro (8-core)", NULL, NULL, NULL, ASMC_FAN_FUNCS, NULL, NULL, NULL, - ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS + ASMC_MP2_TEMPS, ASMC_MP2_TEMPNAMES, ASMC_MP2_TEMPDESCS }, /* Idem for the MacPro 2010*/ Modified: stable/11/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 02:48:43 2019 (r342754) +++ stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 02:50:18 2019 (r342755) @@ -372,7 +372,70 @@ struct asmc_softc { "Power Supply Temperature", \ "Wireless Module Proximity Temperature", } -#define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP1_TEMPS { "TA0P", \ + "TCAH", "TCBH", \ + "TC0P", "TC0C", "TC1C", \ + "TC2C", "TC3C", "THTG", \ + "TH0P", "TH1P", \ + "TH2P", "TH3P", \ + "TM0P", "TM1P", "TM2P", \ + "TM8P", "TM9P", "TMAP", \ + "TM0S", "TM1S", "TM2P", "TM3S", \ + "TM8S", "TM9S", "TMAS", "TMBS", \ + "TN0H", "TS0C", \ + "Tp0C", "Tp1C", "Tv0S", "Tv1S", NULL } + +#define ASMC_MP1_TEMPNAMES { "ambient", \ + "cpu_a_heatsink", "cpu_b_heatsink", \ + "cpu_a_proximity", "cpu_core0", "cpu_core1", \ + "cpu_core2", "cpu_core3", "THTG", \ + "hdd_bay0", "hdd_bay1", \ + "hdd_bay2", "hdd_bay3", \ + "memory_card_a_proximity0", \ + "memory_card_a_proximity1", \ + "memory_card_a_proximity2", \ + "memory_card_b_proximity0", \ + "memory_card_b_proximity1", \ + "memory_card_b_proximity2", \ + "memory_card_a_slot0", \ + "memory_card_a_slot1", \ + "memory_card_a_slot2", \ + "memory_card_a_slot3", \ + "memory_card_b_slot0", \ + "memory_card_b_slot1", \ + "memory_card_b_slot2", \ + "memory_card_b_slot3", \ + "mch_heatsink", "expansion_slots", \ + "power_supply_loc0", "power_supply_loc1", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP1_TEMPDESCS { "Ambient Air", \ + "CPU A Heatsink", "CPU B Heatsink", \ + "CPU A Proximity", \ + "CPU Core 1", "CPU Core 2", \ + "CPU Core 3", "CPU Core 4", "THTG", \ + "Hard Drive Bay 1", "Hard Drive Bay 2", \ + "Hard Drive Bay 3", "Hard Drive Bay 4", \ + "Memory Riser A, Proximity 1", \ + "Memory Riser A, Proximity 2", \ + "Memory Riser A, Proximity 3", \ + "Memory Riser B, Proximity 1", \ + "Memory Riser B, Proximity 2", \ + "Memory Riser B, Proximity 3", \ + "Memory Riser A, Slot 1", \ + "Memory Riser A, Slot 2", \ + "Memory Riser A, Slot 3", \ + "Memory Riser A, Slot 4", \ + "Memory Riser B, Slot 1", \ + "Memory Riser B, Slot 2", \ + "Memory Riser B, Slot 3", \ + "Memory Riser B, Slot 4", \ + "MCH Heatsink", "Expansion Slots", \ + "Power Supply, Location 1", \ + "Power Supply, Location 2", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP2_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -381,7 +444,7 @@ struct asmc_softc { "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ NULL } -#define ASMC_MP_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -389,7 +452,7 @@ struct asmc_softc { "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } -#define ASMC_MP_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ From owner-svn-src-stable-11@freebsd.org Sat Jan 5 00:42:31 2019 Return-Path: Delivered-To: svn-src-stable-11@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 23FBB14403B2; Sat, 5 Jan 2019 00:42:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEB598C46C; Sat, 5 Jan 2019 00:42:30 +0000 (UTC) (envelope-from kib@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 B11688924; Sat, 5 Jan 2019 00:42:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x050gUqe069014; Sat, 5 Jan 2019 00:42:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x050gUMu069013; Sat, 5 Jan 2019 00:42:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901050042.x050gUMu069013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Jan 2019 00:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342781 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 342781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEB598C46C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 00:42:31 -0000 Author: kib Date: Sat Jan 5 00:42:30 2019 New Revision: 342781 URL: https://svnweb.freebsd.org/changeset/base/342781 Log: MFC r342595: For hw.{physmem,realmem,usermem} MIBs, clamp instead of truncating. Modified: stable/11/sys/kern/kern_mib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mib.c ============================================================================== --- stable/11/sys/kern/kern_mib.c Sat Jan 5 00:38:22 2019 (r342780) +++ stable/11/sys/kern/kern_mib.c Sat Jan 5 00:42:30 2019 (r342781) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -173,35 +174,45 @@ SYSCTL_PROC(_kern, KERN_ARND, arandom, static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p; - val = ctob(physmem); + p = SIZE_T_MAX >> PAGE_SHIFT; + if (physmem < p) + p = physmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "LU", ""); + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) { - u_long val; - val = ctob(realmem); + u_long val, p; + + p = SIZE_T_MAX >> PAGE_SHIFT; + if (realmem < p) + p = realmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_realmem, "LU", ""); + 0, 0, sysctl_hw_realmem, "LU", ""); + static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p, p1; - val = ctob(physmem - vm_cnt.v_wire_count); + p1 = physmem - vm_cnt.v_wire_count; + p = SIZE_T_MAX >> PAGE_SHIFT; + if (p1 < p) + p = p1; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "LU", ""); + 0, 0, sysctl_hw_usermem, "LU", ""); SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); From owner-svn-src-stable-11@freebsd.org Sat Jan 5 19:32:50 2019 Return-Path: Delivered-To: svn-src-stable-11@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 0C004141E9A4; Sat, 5 Jan 2019 19:32:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A612E8FBC5; Sat, 5 Jan 2019 19:32:49 +0000 (UTC) (envelope-from marius@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 983251D161; Sat, 5 Jan 2019 19:32:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05JWns8065186; Sat, 5 Jan 2019 19:32:49 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05JWnLr065183; Sat, 5 Jan 2019 19:32:49 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201901051932.x05JWnLr065183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Jan 2019 19:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342789 - stable/11/sys/dev/e1000 X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/e1000 X-SVN-Commit-Revision: 342789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A612E8FBC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 19:32:50 -0000 Author: marius Date: Sat Jan 5 19:32:48 2019 New Revision: 342789 URL: https://svnweb.freebsd.org/changeset/base/342789 Log: MFC: r336610 (partial), r339207, r339267 - Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR remain intact as intended in igb_init_dmac(). [1] - Fix igb corrupting checksums with BPF and VLAN In stable/11, this merely syncs the code with head as the problem was introduced with r311849 in the latter and then fixed by r339207 with a different approach than the code used pre-r311849 and in stable/11. - Use mbuf defines to construct csum offload masks rather than literals Reported by: Coverity CID: 1304929 [1] Modified: stable/11/sys/dev/e1000/if_em.h stable/11/sys/dev/e1000/if_igb.c stable/11/sys/dev/e1000/if_lem.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/if_em.h ============================================================================== --- stable/11/sys/dev/e1000/if_em.h Sat Jan 5 16:05:39 2019 (r342788) +++ stable/11/sys/dev/e1000/if_em.h Sat Jan 5 19:32:48 2019 (r342789) @@ -277,7 +277,7 @@ #define EM_MSIX_LINK 0x01000000 /* For 82574 use */ #define ETH_ZLEN 60 #define ETH_ADDR_LEN 6 -#define CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ +#define CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ /* * 82574 has a nonstandard address for EIAC Modified: stable/11/sys/dev/e1000/if_igb.c ============================================================================== --- stable/11/sys/dev/e1000/if_igb.c Sat Jan 5 16:05:39 2019 (r342788) +++ stable/11/sys/dev/e1000/if_igb.c Sat Jan 5 19:32:48 2019 (r342789) @@ -2957,7 +2957,7 @@ igb_init_dmac(struct adapter *adapter, u32 pba) dmac = pba - 10; reg = E1000_READ_REG(hw, E1000_DMACR); reg &= ~E1000_DMACR_DMACTHR_MASK; - reg = ((dmac << E1000_DMACR_DMACTHR_SHIFT) + reg |= ((dmac << E1000_DMACR_DMACTHR_SHIFT) & E1000_DMACR_DMACTHR_MASK); /* transition to L0x or L1 if available..*/ @@ -3908,7 +3908,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, int ehdrlen, ip_hlen = 0; u16 etype; u8 ipproto = 0; - int offload = TRUE; int ctxd = txr->next_avail_desc; u16 vtag = 0; @@ -3916,9 +3915,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, if (mp->m_pkthdr.csum_flags & CSUM_TSO) return (igb_tso_setup(txr, mp, cmd_type_len, olinfo_status)); - if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) - offload = FALSE; - /* Indicate the whole packet as payload when not doing TSO */ *olinfo_status |= mp->m_pkthdr.len << E1000_ADVTXD_PAYLEN_SHIFT; @@ -3933,8 +3929,9 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, if (mp->m_flags & M_VLANTAG) { vtag = htole16(mp->m_pkthdr.ether_vtag); vlan_macip_lens |= (vtag << E1000_ADVTXD_VLAN_SHIFT); - } else if (offload == FALSE) /* ... no offload to do */ + } else if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) { return (0); + } /* * Determine where frame payload starts. @@ -3968,7 +3965,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_IPV6; break; default: - offload = FALSE; break; } @@ -3978,38 +3974,40 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, switch (ipproto) { case IPPROTO_TCP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_TCP) + if (mp->m_pkthdr.csum_flags & CSUM_TCP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; case IPPROTO_UDP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_UDP) + if (mp->m_pkthdr.csum_flags & CSUM_UDP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_UDP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; #if __FreeBSD_version >= 800000 case IPPROTO_SCTP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_SCTP) + if (mp->m_pkthdr.csum_flags & CSUM_SCTP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; #endif default: - offload = FALSE; break; } - - if (offload) /* For the TX descriptor setup */ - *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; /* 82575 needs the queue index added */ if (adapter->hw.mac.type == e1000_82575) Modified: stable/11/sys/dev/e1000/if_lem.h ============================================================================== --- stable/11/sys/dev/e1000/if_lem.h Sat Jan 5 16:05:39 2019 (r342788) +++ stable/11/sys/dev/e1000/if_lem.h Sat Jan 5 19:32:48 2019 (r342789) @@ -241,7 +241,7 @@ #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ #define ETH_ZLEN 60 #define ETH_ADDR_LEN 6 -#define CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ +#define CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ /* * 82574 has a nonstandard address for EIAC