From owner-svn-src-head@freebsd.org Sun Jan 27 00:37:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1455514B4D8E; Sun, 27 Jan 2019 00:37:53 +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 AF62775559; Sun, 27 Jan 2019 00:37:52 +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 A1CE827D0E; Sun, 27 Jan 2019 00:37:52 +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 x0R0bqPS001478; Sun, 27 Jan 2019 00:37:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0R0bqdG001477; Sun, 27 Jan 2019 00:37:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901270037.x0R0bqdG001477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Jan 2019 00:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343484 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 343484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF62775559 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 00:37:53 -0000 Author: kib Date: Sun Jan 27 00:37:52 2019 New Revision: 343484 URL: https://svnweb.freebsd.org/changeset/base/343484 Log: Remove now redundand ifunc relocation code which should have been removed as part of r341441. This call to reloc_non_plt() may crash if ifunc resolvers use the needed libraries symbols since the pass over the needed libs relocation is not yet done. The change in r341441 ensures the right relocation order otherwise. Submitted by: theraven MFC after: 1 week Discussed in: https://reviews.freebsd.org/D17529 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jan 26 22:27:12 2019 (r343483) +++ head/libexec/rtld-elf/rtld.c Sun Jan 27 00:37:52 2019 (r343484) @@ -2897,16 +2897,6 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent lockstate) == -1) return (-1); - /* - * Process the non-PLT IFUNC relocations. The relocations are - * processed in two phases, because IFUNC resolvers may - * reference other symbols, which must be readily processed - * before resolvers are called. - */ - if (obj->non_plt_gnu_ifunc && - reloc_non_plt(obj, rtldobj, flags | SYMLOOK_IFUNC, lockstate)) - return (-1); - if (!obj->mainprog && obj_enforce_relro(obj) == -1) return (-1); From owner-svn-src-head@freebsd.org Sun Jan 27 00:46:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABA8A14B52D7; Sun, 27 Jan 2019 00:46:08 +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 513C075BF8; Sun, 27 Jan 2019 00:46:08 +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 424A527EB5; Sun, 27 Jan 2019 00:46:08 +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 x0R0k8Di006385; Sun, 27 Jan 2019 00:46:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0R0k7Ca006379; Sun, 27 Jan 2019 00:46:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901270046.x0R0k7Ca006379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Jan 2019 00:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343485 - in head: lib/libprocstat sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libprocstat sys/kern sys/sys X-SVN-Commit-Revision: 343485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 513C075BF8 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 00:46:08 -0000 Author: kib Date: Sun Jan 27 00:46:06 2019 New Revision: 343485 URL: https://svnweb.freebsd.org/changeset/base/343485 Log: Bump SPECNAMELEN to MAXNAMLEN. This includes the bump for cdevsw d_version. Otherwise, the impact on the ABI (not KBI) is surprisingly low. The most important affected interface is devname(3) and ttyname(3) which already correctly handle long names (and ttyname(3) should not be affected at all). Still, due to the d_version bump, I argue that the change is not MFC-able. Requested by: mmacy Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18932 Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/libprocstat_compat.c head/sys/kern/kern_conf.c head/sys/sys/conf.h head/sys/sys/param.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sun Jan 27 00:37:52 2019 (r343484) +++ head/lib/libprocstat/Symbol.map Sun Jan 27 00:46:06 2019 (r343485) @@ -35,9 +35,12 @@ FBSD_1.3 { FBSD_1.5 { procstat_freeptlwpinfo; procstat_getptlwpinfo; - procstat_get_pts_info; procstat_get_sem_info; procstat_get_shm_info; procstat_get_socket_info; +}; + +FBSD_1.6 { + procstat_get_pts_info; procstat_get_vnode_info; }; Modified: head/lib/libprocstat/libprocstat_compat.c ============================================================================== --- head/lib/libprocstat/libprocstat_compat.c Sun Jan 27 00:37:52 2019 (r343484) +++ head/lib/libprocstat/libprocstat_compat.c Sun Jan 27 00:46:06 2019 (r343485) @@ -36,9 +36,11 @@ __FBSDID("$FreeBSD$"); #include "libprocstat.h" +#define SPECNAMELEN_COMPAT12 63 + struct freebsd11_ptsstat { uint32_t dev; - char devname[SPECNAMELEN + 1]; + char devname[SPECNAMELEN_COMPAT12 + 1]; }; struct freebsd11_vnstat { @@ -49,7 +51,7 @@ struct freebsd11_vnstat { uint32_t vn_fsid; int vn_type; uint16_t vn_mode; - char vn_devname[SPECNAMELEN + 1]; + char vn_devname[SPECNAMELEN_COMPAT12 + 1]; }; struct freebsd11_semstat { uint32_t value; @@ -75,8 +77,25 @@ struct freebsd11_sockstat { char dname[32]; }; +struct freebsd12_vnstat { + uint64_t vn_fileid; + uint64_t vn_size; + uint64_t vn_dev; + uint64_t vn_fsid; + char *vn_mntdir; + int vn_type; + uint16_t vn_mode; + char vn_devname[SPECNAMELEN_COMPAT12 + 1]; +}; +struct freebsd12_ptsstat { + uint64_t dev; + char devname[SPECNAMELEN_COMPAT12 + 1]; +}; + int freebsd11_procstat_get_pts_info(struct procstat *procstat, struct filestat *fst, struct freebsd11_ptsstat *pts, char *errbuf); +int freebsd12_procstat_get_pts_info(struct procstat *procstat, + struct filestat *fst, struct freebsd12_ptsstat *pts_compat, char *errbuf); int freebsd11_procstat_get_sem_info(struct procstat *procstat, struct filestat *fst, struct freebsd11_semstat *sem, char *errbuf); int freebsd11_procstat_get_shm_info(struct procstat *procstat, @@ -85,7 +104,11 @@ int freebsd11_procstat_get_socket_info(struct procstat struct filestat *fst, struct freebsd11_sockstat *sock, char *errbuf); int freebsd11_procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst, struct freebsd11_vnstat *vn, char *errbuf); +int freebsd12_procstat_get_vnode_info(struct procstat *procstat, + struct filestat *fst, struct freebsd12_vnstat *vn_compat, char *errbuf); +static const char trunc_name[] = ""; + int freebsd11_procstat_get_pts_info(struct procstat *procstat, struct filestat *fst, struct freebsd11_ptsstat *pts_compat, char *errbuf) @@ -97,12 +120,34 @@ freebsd11_procstat_get_pts_info(struct procstat *procs if (r != 0) return (r); pts_compat->dev = pts.dev; - memcpy(pts_compat->devname, pts.devname, - sizeof(pts_compat->devname)); + if (strlen(pts.devname) >= sizeof(pts_compat->devname)) + strcpy(pts_compat->devname, trunc_name); + else + memcpy(pts_compat->devname, pts.devname, + sizeof(pts_compat->devname)); return (0); } int +freebsd12_procstat_get_pts_info(struct procstat *procstat, + struct filestat *fst, struct freebsd12_ptsstat *pts_compat, char *errbuf) +{ + struct ptsstat pts; + int r; + + r = procstat_get_pts_info(procstat, fst, &pts, errbuf); + if (r != 0) + return (r); + pts_compat->dev = pts.dev; + if (strlen(pts.devname) >= sizeof(pts_compat->devname)) + strcpy(pts_compat->devname, trunc_name); + else + memcpy(pts_compat->devname, pts.devname, + sizeof(pts_compat->devname)); + return (0); +} + +int freebsd11_procstat_get_sem_info(struct procstat *procstat, struct filestat *fst, struct freebsd11_semstat *sem_compat, char *errbuf) { @@ -174,11 +219,39 @@ freebsd11_procstat_get_vnode_info(struct procstat *pro vn_compat->vn_fsid = vn.vn_fsid; vn_compat->vn_type = vn.vn_type; vn_compat->vn_mode = vn.vn_mode; - memcpy(vn_compat->vn_devname, vn.vn_devname, - sizeof(vn_compat->vn_devname)); + if (strlen(vn.vn_devname) >= sizeof(vn_compat->vn_devname)) + strcpy(vn_compat->vn_devname, trunc_name); + else + memcpy(vn_compat->vn_devname, vn.vn_devname, + sizeof(vn_compat->vn_devname)); return (0); } +int +freebsd12_procstat_get_vnode_info(struct procstat *procstat, + struct filestat *fst, struct freebsd12_vnstat *vn_compat, char *errbuf) +{ + struct vnstat vn; + int r; + + r = procstat_get_vnode_info(procstat, fst, &vn, errbuf); + if (r != 0) + return (r); + vn_compat->vn_fileid = vn.vn_fileid; + vn_compat->vn_size = vn.vn_size; + vn_compat->vn_mntdir = vn.vn_mntdir; + vn_compat->vn_dev = vn.vn_dev; + vn_compat->vn_fsid = vn.vn_fsid; + vn_compat->vn_type = vn.vn_type; + vn_compat->vn_mode = vn.vn_mode; + if (strlen(vn.vn_devname) >= sizeof(vn_compat->vn_devname)) + strcpy(vn_compat->vn_devname, trunc_name); + else + memcpy(vn_compat->vn_devname, vn.vn_devname, + sizeof(vn_compat->vn_devname)); + return (0); +} + __sym_compat(procstat_get_pts_info, freebsd11_procstat_get_pts_info, FBSD_1.2); __sym_compat(procstat_get_socket_info, freebsd11_procstat_get_socket_info, FBSD_1.2); @@ -186,3 +259,6 @@ __sym_compat(procstat_get_vnode_info, freebsd11_procst FBSD_1.2); __sym_compat(procstat_get_sem_info, freebsd11_procstat_get_sem_info, FBSD_1.3); __sym_compat(procstat_get_shm_info, freebsd11_procstat_get_shm_info, FBSD_1.3); +__sym_compat(procstat_get_pts_info, freebsd12_procstat_get_pts_info, FBSD_1.5); +__sym_compat(procstat_get_vnode_info, freebsd12_procstat_get_vnode_info, + FBSD_1.5); Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sun Jan 27 00:37:52 2019 (r343484) +++ head/sys/kern/kern_conf.c Sun Jan 27 00:46:06 2019 (r343485) @@ -630,7 +630,7 @@ prep_cdevsw(struct cdevsw *devsw, int flags) return (0); } - if (devsw->d_version != D_VERSION_03) { + if (devsw->d_version != D_VERSION_04) { printf( "WARNING: Device driver \"%s\" has wrong version %s\n", devsw->d_name == NULL ? "???" : devsw->d_name, Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Sun Jan 27 00:37:52 2019 (r343484) +++ head/sys/sys/conf.h Sun Jan 27 00:46:06 2019 (r343485) @@ -166,7 +166,8 @@ typedef int dumper_hdr_t(struct dumperinfo *di, struct #define D_VERSION_01 0x17032005 /* Add d_uid,gid,mode & kind */ #define D_VERSION_02 0x28042009 /* Add d_mmap_single */ #define D_VERSION_03 0x17122009 /* d_mmap takes memattr,vm_ooffset_t */ -#define D_VERSION D_VERSION_03 +#define D_VERSION_04 0x5c48c353 /* SPECNAMELEN bumped to MAXNAMLEN */ +#define D_VERSION D_VERSION_04 /* * Flags used for internal housekeeping Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jan 27 00:37:52 2019 (r343484) +++ head/sys/sys/param.h Sun Jan 27 00:46:06 2019 (r343485) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300009 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300010 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, @@ -115,7 +115,7 @@ #define NOFILE OPEN_MAX /* max open files per process */ #define NOGROUP 65535 /* marker for empty group set member */ #define MAXHOSTNAMELEN 256 /* max hostname size */ -#define SPECNAMELEN 63 /* max length of devicename */ +#define SPECNAMELEN 255 /* max length of devicename */ /* More types and definitions used throughout the kernel. */ #ifdef _KERNEL From owner-svn-src-head@freebsd.org Sun Jan 27 02:31:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30B9614BB02F; Sun, 27 Jan 2019 02:31:43 +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 C419C827FE; Sun, 27 Jan 2019 02:31:42 +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 B2DD014BD; Sun, 27 Jan 2019 02:31:42 +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 x0R2Vgae060299; Sun, 27 Jan 2019 02:31:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0R2VgFK060298; Sun, 27 Jan 2019 02:31:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901270231.x0R2VgFK060298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 27 Jan 2019 02:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343486 - head/contrib/ipfilter/man X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/man X-SVN-Commit-Revision: 343486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C419C827FE 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 02:31:43 -0000 Author: cy Date: Sun Jan 27 02:31:42 2019 New Revision: 343486 URL: https://svnweb.freebsd.org/changeset/base/343486 Log: Fix a typo. MFC after: 3 days Modified: head/contrib/ipfilter/man/ipnat.5 Modified: head/contrib/ipfilter/man/ipnat.5 ============================================================================== --- head/contrib/ipfilter/man/ipnat.5 Sun Jan 27 00:46:06 2019 (r343485) +++ head/contrib/ipfilter/man/ipnat.5 Sun Jan 27 02:31:42 2019 (r343486) @@ -104,7 +104,7 @@ map le0 10.0.0.0/8 -> 192.168.55.0/24 portmap tcp/udp In this instance, the word "auto" tells IPFilter to calculate a private range of port numbers for each address on the LHS to use without fear of them being trampled by others. This can lead to problems if there are -connections being generated mire quickly than IPFilter can expire them. +connections being generated more quickly than IPFilter can expire them. In this instance, and if we want to get away from a private range of port numbers, we can say: .nf From owner-svn-src-head@freebsd.org Sun Jan 27 05:31:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7DF714BFCFE; Sun, 27 Jan 2019 05:31:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 5329E87B9E; Sun, 27 Jan 2019 05:31:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 3FBEB10554EF; Sun, 27 Jan 2019 16:31:39 +1100 (AEDT) Date: Sun, 27 Jan 2019 16:31:34 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Esser cc: Colin Percival , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343480 - head/lib/libfigpar In-Reply-To: Message-ID: <20190127154047.V900@besplex.bde.org> References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Ic4zIQ0n0UbnqT2PbJQA:9 a=kmLDeWUIewAst9HY:21 a=ivDYyo8wYh5hi8Zk:21 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 5329E87B9E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 05:31:51 -0000 On Sat, 26 Jan 2019, Stefan Esser wrote: > Am 26.01.19 um 22:59 schrieb Colin Percival: >> ... >> The length of the string was already being recalculated, by strcpy. >> >> It seems to me that this could be written as >> >> temp = malloc(slen + 1); >> if (temp == NULL) /* could not allocate memory */ >> return (-1); >> memcpy(temp, source, slen + 1); >> >> which avoids both recalculating the string length and using strcpy? > > In principle you are right, there is a small run-time cost by not using > the known length for the allocation. > > The Clang Scan checks are leading to lots (thousands) of false positives > and a I have looked at quite a number and abstained from silencing them > in the hope that the scan will be improved. > > It should learn that at least the trivial case of an allocation of the > value of strlen()+1 followed by a strcpy (and no further strcat or the > like) is safe. It would be a large bug in coverity for it complain about normal use of strcpy(). However, the the use was not normal. It has very broken error checking for malloc(). This gave undefined behaviour for C99 and usually failure of the function and a memory leak for POSIX, The broken error checking was to check errno instead of the return value of malloc(), without even setting errno to 0 before calling malloc(). This is especially broken in a library. It is normal for errno to contain some garbage value from a previous failure, e.g., ENOTTY from isatty(). So the expected behaviour of this library function is to usually fail and leak the successfully malloc()ed memory when the broken code is reached. Coverity should find this bug. Perhaps it did. If errno were set before the call to malloc(), then the code would just be unportable. Setting errno when malloc() fails is a POSIX extension of C99. Coverity should be aware of the standard being used, and should find this bug for C99 but not for POSIX. The fix and the above patch don't fix styles bug related to the broken check. First there is the lexical style bug of placing the comment on the check instead of on the result of the check. The main bug is that it should go without saying that malloc failures are checked for by checking whether malloc() returned NULL. But in the old version, the check was encrypted as the broken check of errno. The comment decrypts this a little. Bruce From owner-svn-src-head@freebsd.org Sun Jan 27 12:21:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8540814A8B20; Sun, 27 Jan 2019 12:21:25 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20C1094EC0; Sun, 27 Jan 2019 12:21:25 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id E760E1F83D; Sun, 27 Jan 2019 12:21:24 +0000 (UTC) Date: Sun, 27 Jan 2019 12:21:24 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: cem@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190127122124.GA13945@FreeBSD.org> References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <03987a1c3ad0c362d50dcefdfd653dec033d14ed.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03987a1c3ad0c362d50dcefdfd653dec033d14ed.camel@freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 20C1094EC0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.88 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.88)[-0.878,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 12:21:25 -0000 On Sat, Jan 26, 2019 at 01:35:18PM -0700, Ian Lepore wrote: > ... > Wait a sec... something has been stable and working fine for 30 years, > then it gets changed to reflect one man's personal preferences, and > it's the people who object to that who have to jump through flaming > hoops to justify themselves? Exactly my problem with this commit as well. Can we please please not bring in uncalled and needless changes to a working stuff? There was nothing to fix here because it wasn't broken in any way. There are so many things that are broken on FreeBSD, should't we better concentrate on those instead? > It's a pity the freebsd prject has turned into linux. That's how I often feel as well, and I don't like it. :-( ./danfe From owner-svn-src-head@freebsd.org Sun Jan 27 14:08:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B653E14AD87E; Sun, 27 Jan 2019 14:08:51 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 512736B127; Sun, 27 Jan 2019 14:08:51 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=54347 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gneMe-000N0i-SW; Sat, 26 Jan 2019 22:56:20 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343480 - head/lib/libfigpar From: Devin Teske In-Reply-To: <20190127154047.V900@besplex.bde.org> Date: Sun, 27 Jan 2019 06:07:47 -0800 Cc: Devin Teske , Stefan Esser , Colin Percival , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> <20190127154047.V900@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 512736B127 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 14:08:52 -0000 > On Jan 26, 2019, at 9:31 PM, Bruce Evans wrote: >=20 > On Sat, 26 Jan 2019, Stefan Esser wrote: >=20 >> Am 26.01.19 um 22:59 schrieb Colin Percival: >>> ... >>> The length of the string was already being recalculated, by strcpy. >>>=20 >>> It seems to me that this could be written as >>>=20 >>> temp =3D malloc(slen + 1); >>> if (temp =3D=3D NULL) /* could not allocate memory */ >>> return (-1); >>> memcpy(temp, source, slen + 1); >>>=20 >>> which avoids both recalculating the string length and using strcpy? >>=20 >> In principle you are right, there is a small run-time cost by not = using >> the known length for the allocation. >>=20 >> The Clang Scan checks are leading to lots (thousands) of false = positives >> and a I have looked at quite a number and abstained from silencing = them >> in the hope that the scan will be improved. >>=20 >> It should learn that at least the trivial case of an allocation of = the >> value of strlen()+1 followed by a strcpy (and no further strcat or = the >> like) is safe. >=20 > It would be a large bug in coverity for it complain about normal use = of > strcpy(). >=20 > However, the the use was not normal. It has very broken error = checking > for malloc(). This gave undefined behaviour for C99 and usually = failure > of the function and a memory leak for POSIX, >=20 > The broken error checking was to check errno instead of the return > value of malloc(), without even setting errno to 0 before calling > malloc(). This is especially broken in a library. It is normal for > errno to contain some garbage value from a previous failure, e.g., > ENOTTY from isatty(). So the expected behaviour of this library > function is to usually fail and leak the successfully malloc()ed = memory > when the broken code is reached. Coverity should find this bug. > Perhaps it did. >=20 > If errno were set before the call to malloc(), then the code would = just > be unportable. Setting errno when malloc() fails is a POSIX extension > of C99. Coverity should be aware of the standard being used, and = should > find this bug for C99 but not for POSIX. >=20 > The fix and the above patch don't fix styles bug related to the broken > check. First there is the lexical style bug of placing the comment > on the check instead of on the result of the check. The main bug is > that it should go without saying that malloc failures are checked for > by checking whether malloc() returned NULL. But in the old version, > the check was encrypted as the broken check of errno. The comment > decrypts this a little. >=20 I am genuinely flattered that so much thought is being placed around = code that I wrote circa 1999. My code there might even pre-date the C99 standard if memory serves. When I wrote that code, I had tested it on extensively on over 20 = different UNIX platforms. Compatibility was a nightmare back then. I'm so happy we have all these = wonderful shiny standards today. --=20 Cheers, Devin From owner-svn-src-head@freebsd.org Sun Jan 27 15:10:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4603014AFA5F; Sun, 27 Jan 2019 15:10:21 +0000 (UTC) (envelope-from avos@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 C1D8E6D4F2; Sun, 27 Jan 2019 15:10:20 +0000 (UTC) (envelope-from avos@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 B026E9A95; Sun, 27 Jan 2019 15:10:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RFAKUO058638; Sun, 27 Jan 2019 15:10:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RFAKR1058637; Sun, 27 Jan 2019 15:10:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901271510.x0RFAKR1058637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Jan 2019 15:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343495 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 343495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1D8E6D4F2 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.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 15:10:21 -0000 Author: avos Date: Sun Jan 27 15:10:20 2019 New Revision: 343495 URL: https://svnweb.freebsd.org/changeset/base/343495 Log: wlan.4: improve wording PR: 218075 Submitted by: Aaron Taylor MFC after: 5 days Modified: head/share/man/man4/wlan.4 Modified: head/share/man/man4/wlan.4 ============================================================================== --- head/share/man/man4/wlan.4 Sun Jan 27 14:36:52 2019 (r343494) +++ head/share/man/man4/wlan.4 Sun Jan 27 15:10:20 2019 (r343495) @@ -167,9 +167,8 @@ was used to be compatible with .Pp Mesh stations follow the 802.11s Draft 3.0 specification which is not ratified and subject to change. -Beware that this specification is incompatible with earlier drafts; -and stations implementing earlier drafts (e.g. Linux) -may not interoperate. +Be aware that this specification is incompatible with earlier drafts. +Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Sh SEE ALSO .Xr an 4 , .Xr ath 4 , From owner-svn-src-head@freebsd.org Sun Jan 27 15:29:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AD0414B08F1; Sun, 27 Jan 2019 15:29:59 +0000 (UTC) (envelope-from avos@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 A51966E5E4; Sun, 27 Jan 2019 15:29:58 +0000 (UTC) (envelope-from avos@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 8F5A79DDE; Sun, 27 Jan 2019 15:29:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RFTw7h069241; Sun, 27 Jan 2019 15:29:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RFTwC6069240; Sun, 27 Jan 2019 15:29:58 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901271529.x0RFTwC6069240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Jan 2019 15:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343497 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 343497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A51966E5E4 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.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 15:29:59 -0000 Author: avos Date: Sun Jan 27 15:29:58 2019 New Revision: 343497 URL: https://svnweb.freebsd.org/changeset/base/343497 Log: devd.conf(5): simplify regex Submitted by: Helge Oldach MFC after: 5 days Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Sun Jan 27 15:19:28 2019 (r343496) +++ head/sbin/devd/devd.conf Sun Jan 27 15:29:58 2019 (r343497) @@ -43,7 +43,7 @@ options { # notify 0 { match "system" "IFNET"; - match "subsystem" "(?!usbus[0-9]+|?!wlan[0-9]+)"; + match "subsystem" "!(usbus|wlan)[0-9]+"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; From owner-svn-src-head@freebsd.org Sun Jan 27 15:50:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D645414B1565; Sun, 27 Jan 2019 15:50:37 +0000 (UTC) (envelope-from mmel@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 7C0D16F33D; Sun, 27 Jan 2019 15:50:37 +0000 (UTC) (envelope-from mmel@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 6C149A151; Sun, 27 Jan 2019 15:50:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RFob5v080013; Sun, 27 Jan 2019 15:50:37 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RFob5X080009; Sun, 27 Jan 2019 15:50:37 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201901271550.x0RFob5X080009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 27 Jan 2019 15:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343498 - head/sys/dev/extres/phy X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/extres/phy X-SVN-Commit-Revision: 343498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C0D16F33D 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 15:50:38 -0000 Author: mmel Date: Sun Jan 27 15:50:36 2019 New Revision: 343498 URL: https://svnweb.freebsd.org/changeset/base/343498 Log: Properly define and declare phynode_topo_lock, it should be single global variable. X-MFC with: r340845 Noticed by: phynode_topo_lock Modified: head/sys/dev/extres/phy/phy.c head/sys/dev/extres/phy/phy_internal.h Modified: head/sys/dev/extres/phy/phy.c ============================================================================== --- head/sys/dev/extres/phy/phy.c Sun Jan 27 15:29:58 2019 (r343497) +++ head/sys/dev/extres/phy/phy.c Sun Jan 27 15:50:36 2019 (r343498) @@ -68,7 +68,7 @@ static phynode_method_t phynode_methods[] = { DEFINE_CLASS_0(phynode, phynode_class, phynode_methods, 0); static phynode_list_t phynode_list = TAILQ_HEAD_INITIALIZER(phynode_list); - +struct sx phynode_topo_lock; SX_SYSINIT(phy_topology, &phynode_topo_lock, "Phy topology lock"); /* ---------------------------------------------------------------------------- Modified: head/sys/dev/extres/phy/phy_internal.h ============================================================================== --- head/sys/dev/extres/phy/phy_internal.h Sun Jan 27 15:29:58 2019 (r343497) +++ head/sys/dev/extres/phy/phy_internal.h Sun Jan 27 15:50:36 2019 (r343498) @@ -78,6 +78,6 @@ struct phy { #define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) #define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) -struct sx phynode_topo_lock; +extern struct sx phynode_topo_lock; #endif /* DEV_EXTRES_PHY_INTERNAL_H */ From owner-svn-src-head@freebsd.org Sun Jan 27 15:19:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912D114B013F; Sun, 27 Jan 2019 15:19:29 +0000 (UTC) (envelope-from avos@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 357626DC3C; Sun, 27 Jan 2019 15:19:29 +0000 (UTC) (envelope-from avos@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 1BB6B9C37; Sun, 27 Jan 2019 15:19:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RFJS7N063669; Sun, 27 Jan 2019 15:19:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RFJSCR063668; Sun, 27 Jan 2019 15:19:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901271519.x0RFJSCR063668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Jan 2019 15:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343496 - head/sys/dev/pcf X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/pcf X-SVN-Commit-Revision: 343496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 357626DC3C 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.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 15:19:29 -0000 Author: avos Date: Sun Jan 27 15:19:28 2019 New Revision: 343496 URL: https://svnweb.freebsd.org/changeset/base/343496 Log: pcf(4): fix parentheses in if condition PR: 210709 Submitted by: David Binderman MFC after: 5 days Modified: head/sys/dev/pcf/pcf_isa.c Modified: head/sys/dev/pcf/pcf_isa.c ============================================================================== --- head/sys/dev/pcf/pcf_isa.c Sun Jan 27 15:10:20 2019 (r343495) +++ head/sys/dev/pcf/pcf_isa.c Sun Jan 27 15:19:28 2019 (r343496) @@ -111,7 +111,7 @@ pcf_isa_probe(device_t dev) /* The port address must be explicitly specified */ bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count); - if ((error = resource_int_value(PCF_NAME, 0, "port", &port) != 0)) + if ((error = resource_int_value(PCF_NAME, 0, "port", &port)) != 0) return (error); /* Probe is only successful for the specified base io */ From owner-svn-src-head@freebsd.org Sun Jan 27 15:55:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7745714B1AC4; Sun, 27 Jan 2019 15:55:32 +0000 (UTC) (envelope-from avos@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 3ED0C6F9DC; Sun, 27 Jan 2019 15:55:32 +0000 (UTC) (envelope-from avos@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 3364BA2F0; Sun, 27 Jan 2019 15:55:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RFtWrc085190; Sun, 27 Jan 2019 15:55:32 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RFtWG1085189; Sun, 27 Jan 2019 15:55:32 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901271555.x0RFtWG1085189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Jan 2019 15:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343499 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 343499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3ED0C6F9DC 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.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 15:55:32 -0000 Author: avos Date: Sun Jan 27 15:55:31 2019 New Revision: 343499 URL: https://svnweb.freebsd.org/changeset/base/343499 Log: rc(8): do not stop dhclient(8) when wpa_supplicant(8) / hostapd(8) is used They will stop it automatically ('Interface wlan0 is down, dhclient exiting'); use /etc/rc.d/dhclient stop command only when none of them is used. MFC after: 5 days Modified: head/libexec/rc/network.subr Modified: head/libexec/rc/network.subr ============================================================================== --- head/libexec/rc/network.subr Sun Jan 27 15:50:36 2019 (r343498) +++ head/libexec/rc/network.subr Sun Jan 27 15:55:31 2019 (r343499) @@ -257,9 +257,7 @@ ifconfig_down() elif hostapif $1; then /etc/rc.d/hostapd stop $1 _cfg=0 - fi - - if dhcpif $1; then + elif dhcpif $1; then /etc/rc.d/dhclient stop $1 _cfg=0 fi From owner-svn-src-head@freebsd.org Sun Jan 27 16:48:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8E6214B43A9; Sun, 27 Jan 2019 16:48:26 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6840B722FC; Sun, 27 Jan 2019 16:48:26 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f174.google.com with SMTP id t9-v6so12181171ljh.6; Sun, 27 Jan 2019 08:48:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=XimDuxiDledmMTZGOhfL/qJi8NM9rS2WFMmKdN3vq2U=; b=o3hZwpultTbZczc0Q8i0SuJ2oFf0Y3zcNlmW+zuwF9iocNP/VWn5b6SKtlJfSFYLkS K6eKMTYPz66nbysV7Lw8F9GBG206XE7i14n/7jV2mZJTCfQm8mRqdh2pkZk3ydOzNUcb uv5MqtgwAb3KhPWj++eZWYSrGfApT13ShW2XbfApPW8LkU35pH8s7OyJSPwMKw06lpws KYiaOOhI+de7a1FzjTlfuxqqKXME/5k/rf6pQT8DyB7GNDrDBDZvakHpyAUkGm2plvfn a54mP2CCzzp1zVoM4dDdM6O9zNxibIyTYQcdU/z3qXt9jo5TpEWI1cHZh+MoZykuFsvY 1e5A== X-Gm-Message-State: AHQUAuYuyxc8bpUmLq6W09lfo3+qp5fchecyXu/F99IybLGetVIFK3pw Xhtboq4vjJnkhIZlCb15R4hFSC4q X-Google-Smtp-Source: AHgI3Ibo9voXBsbC85uZ4pWo5BOVabT/Eyu/O7w+BakxEInfjOpw78aXrW+ztu3gvVV/LBwXq10pew== X-Received: by 2002:a2e:8446:: with SMTP id u6-v6mr2992453ljh.74.1548607699090; Sun, 27 Jan 2019 08:48:19 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id c15-v6sm2633852ljf.76.2019.01.27.08.48.14 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 27 Jan 2019 08:48:18 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343500 - head/sys/kern References: <201901271644.x0RGiRQS012097@repo.freebsd.org> Date: Sun, 27 Jan 2019 18:47:35 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201901271644.x0RGiRQS012097@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 6840B722FC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 16:48:27 -0000 Sun, 27 Jan 2019 18:44:27 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : > Author: avos > Date: Sun Jan 27 16:44:27 2019 > New Revision: 343500 > URL: https://svnweb.freebsd.org/changeset/base/343500 > > Log: > m_getm2: correct a comment. > The comment states that function always return a top of allocated mbu= f; > however, the function actually return the overall mbuf chain top = > pointer. > Since there are already existing users of it (via m_getm(4) macro), > rephrase the comment and leave behavior unchanged. > PR: 134335 This should be PR: 134355 From owner-svn-src-head@freebsd.org Sun Jan 27 16:44:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A65D14B40D3; Sun, 27 Jan 2019 16:44:28 +0000 (UTC) (envelope-from avos@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 11BD271FEF; Sun, 27 Jan 2019 16:44:28 +0000 (UTC) (envelope-from avos@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 06A10AB73; Sun, 27 Jan 2019 16:44:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RGiRIc012098; Sun, 27 Jan 2019 16:44:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RGiRQS012097; Sun, 27 Jan 2019 16:44:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901271644.x0RGiRQS012097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Jan 2019 16:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343500 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11BD271FEF 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 16:44:28 -0000 Author: avos Date: Sun Jan 27 16:44:27 2019 New Revision: 343500 URL: https://svnweb.freebsd.org/changeset/base/343500 Log: m_getm2: correct a comment. The comment states that function always return a top of allocated mbuf; however, the function actually return the overall mbuf chain top pointer. Since there are already existing users of it (via m_getm(4) macro), rephrase the comment and leave behavior unchanged. PR: 134335 MFC after: 12 days Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun Jan 27 15:55:31 2019 (r343499) +++ head/sys/kern/kern_mbuf.c Sun Jan 27 16:44:27 2019 (r343500) @@ -1031,8 +1031,7 @@ m_getjcl(int how, short type, int flags, int size) * Allocate a given length worth of mbufs and/or clusters (whatever fits * best) and return a pointer to the top of the allocated chain. If an * existing mbuf chain is provided, then we will append the new chain - * to the existing one but still return the top of the newly allocated - * chain. + * to the existing one and return a pointer to the provided mbuf. */ struct mbuf * m_getm2(struct mbuf *m, int len, int how, short type, int flags) From owner-svn-src-head@freebsd.org Sun Jan 27 17:51:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9A5314B655F; Sun, 27 Jan 2019 17:51:49 +0000 (UTC) (envelope-from avos@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 8DBC374B6A; Sun, 27 Jan 2019 17:51:49 +0000 (UTC) (envelope-from avos@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 7C72CB725; Sun, 27 Jan 2019 17:51:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RHpnII046717; Sun, 27 Jan 2019 17:51:49 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RHpnTB046716; Sun, 27 Jan 2019 17:51:49 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901271751.x0RHpnTB046716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Jan 2019 17:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343501 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 343501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DBC374B6A 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 17:51:50 -0000 Author: avos Date: Sun Jan 27 17:51:49 2019 New Revision: 343501 URL: https://svnweb.freebsd.org/changeset/base/343501 Log: Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras PR: 97472 Submitted by: Fabio Luis Girardi Reviewed by: imp MFC after: 3 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Jan 27 16:44:27 2019 (r343500) +++ head/sys/cam/scsi/scsi_da.c Sun Jan 27 17:51:49 2019 (r343501) @@ -1092,6 +1092,30 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Olympus digital cameras (C-3040ZOOM, C-2040ZOOM, C-1) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "C*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* + * Olympus digital cameras (D-370) + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "D*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE + }, + { + /* + * Olympus digital cameras (E-100RS, E-10). + * PR: usb/97472 + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "E*", "*"}, + /*quirks*/ DA_Q_NO_6_BYTE | DA_Q_NO_SYNC_CACHE + }, + { + /* * Olympus FE-210 camera */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "OLYMPUS", "FE210*", From owner-svn-src-head@freebsd.org Sun Jan 27 18:53:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE0CF14B880C; Sun, 27 Jan 2019 18:53:36 +0000 (UTC) (envelope-from avos@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 B6FDD7713C; Sun, 27 Jan 2019 18:53:36 +0000 (UTC) (envelope-from avos@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 AD789C334; Sun, 27 Jan 2019 18:53:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0RIraVb080044; Sun, 27 Jan 2019 18:53:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0RIraXF080043; Sun, 27 Jan 2019 18:53:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901271853.x0RIraXF080043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Jan 2019 18:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343502 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 343502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6FDD7713C 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 18:53:37 -0000 Author: avos Date: Sun Jan 27 18:53:36 2019 New Revision: 343502 URL: https://svnweb.freebsd.org/changeset/base/343502 Log: Remove RADIUS-related files when WITHOUT_RADIUS_SUPPORT=true is set in src.conf(5) PR: 234041 MFC after: 5 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jan 27 17:51:49 2019 (r343501) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jan 27 18:53:36 2019 (r343502) @@ -7647,6 +7647,54 @@ OLD_FILES+=usr/share/man/man8/quotaon.8.gz OLD_FILES+=usr/share/man/man8/repquota.8.gz .endif +.if ${MK_RADIUS_SUPPORT} == no +OLD_FILES+=usr/lib/libradius.a +OLD_FILES+=usr/lib/libradius.so +OLD_LIBS+=usr/lib/libradius.so.4 +OLD_FILES+=usr/lib/libradius_p.a +OLD_FILES+=usr/lib/pam_radius.so +OLD_LIBS+=usr/lib/pam_radius.so.6 +OLD_FILES+=usr/include/radlib.h +OLD_FILES+=usr/include/radlib_vs.h +OLD_FILES+=usr/share/man/man3/libradius.3.gz +OLD_FILES+=usr/share/man/man3/rad_acct_open.3.gz +OLD_FILES+=usr/share/man/man3/rad_add_server.3.gz +OLD_FILES+=usr/share/man/man3/rad_add_server_ex.3.gz +OLD_FILES+=usr/share/man/man3/rad_auth_open.3.gz +OLD_FILES+=usr/share/man/man3/rad_bind_to.3.gz +OLD_FILES+=usr/share/man/man3/rad_close.3.gz +OLD_FILES+=usr/share/man/man3/rad_config.3.gz +OLD_FILES+=usr/share/man/man3/rad_continue_send_request.3.gz +OLD_FILES+=usr/share/man/man3/rad_create_request.3.gz +OLD_FILES+=usr/share/man/man3/rad_create_response.3.gz +OLD_FILES+=usr/share/man/man3/rad_cvt_addr.3.gz +OLD_FILES+=usr/share/man/man3/rad_cvt_int.3.gz +OLD_FILES+=usr/share/man/man3/rad_cvt_string.3.gz +OLD_FILES+=usr/share/man/man3/rad_demangle.3.gz +OLD_FILES+=usr/share/man/man3/rad_demangle_mppe_key.3.gz +OLD_FILES+=usr/share/man/man3/rad_get_attr.3.gz +OLD_FILES+=usr/share/man/man3/rad_get_vendor_attr.3.gz +OLD_FILES+=usr/share/man/man3/rad_init_send_request.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_addr.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_attr.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_int.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_message_authentic.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_string.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_vendor_addr.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_vendor_attr.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_vendor_int.3.gz +OLD_FILES+=usr/share/man/man3/rad_put_vendor_string.3.gz +OLD_FILES+=usr/share/man/man3/rad_receive_request.3.gz +OLD_FILES+=usr/share/man/man3/rad_request_authenticator.3.gz +OLD_FILES+=usr/share/man/man3/rad_send_request.3.gz +OLD_FILES+=usr/share/man/man3/rad_send_response.3.gz +OLD_FILES+=usr/share/man/man3/rad_server_open.3.gz +OLD_FILES+=usr/share/man/man3/rad_server_secret.3.gz +OLD_FILES+=usr/share/man/man3/rad_strerror.3.gz +OLD_FILES+=usr/share/man/man5/radius.conf.5.gz +OLD_FILES+=usr/share/man/man8/pam_radius.8.gz +.endif + .if ${MK_RBOOTD} == no OLD_FILES+=usr/libexec/rbootd OLD_FILES+=usr/share/man/man8/rbootd.8.gz From owner-svn-src-head@freebsd.org Sun Jan 27 23:38:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B319714C1324 for ; Sun, 27 Jan 2019 23:38:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43D638B99F for ; Sun, 27 Jan 2019 23:38:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72c.google.com with SMTP id c21so8465261qkl.6 for ; Sun, 27 Jan 2019 15:38:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JShXvvmrJuLImVG9P9sqt7uNcqbxfXL8KTCORV8im5k=; b=fs6ZxzlZCLC1atJXTFB9sq1gejo0ceN7K+u4kaz3M2T3TAeaDqZa0aXheoOVuJwAUD hRNtwXStEOkKQQb5DO6S1RWGP3087vMhdB5KS2qg0bS2rVg7V7JdFBF8+5TqAABQ3U4b FUGec6RCfjTB5ujFkPRIIxPKDd91XUmEhxEDNGYoT4hQjZw9dlD6ReNaN2iO6TuulBmQ BonvicBDl2M+DnyfbkAA5W/tvjc8Q2Xav3qrV9/rA4bWeaQCiZ2VQYK4ZeHZfKaiDmpA X6600udAmACB+X3noq0QK8MBJoD8NUhvVUV9lVXAWdPYTlQ64yG6ht5GX/zh3T7cLPZt nNAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JShXvvmrJuLImVG9P9sqt7uNcqbxfXL8KTCORV8im5k=; b=N4hUQThgK1NufUqATbtcO+dRv2WU4XoRxYaCql5yqvgL86fBHBQ4D2Dq50Z+4WGkLz GA8cjry5LWn2nDgXI8tFB//uuKwV4LGDtgZPlA5IHtAkKXqWq9AbpuJeL6+JCy6QxMUR fR0c+MNOCnr9m6CbC8kx+hpIWNL0KZkQnPCRGCAg/B7qtUXZSjvGrYOomNEhmy6KLtKV OBeYsq7m+/t3fCFa+1mBKRIkxGhtZTlr9woiHx/V6U1ybaSs12JRFxnHvansPxkEW/2P FXgaMXBv9FHWNXO8ZddNGuO/k5l58Ja9iLOKzO807iYBIDcXehVKl4tEf78H1l1RXN4Q o5ng== X-Gm-Message-State: AJcUukdw1XcgKdoaC2njnYpBVwesE68vvkYDN7s9d+VwmNye73dlZm/D LdZ6nKMD4Z3TgrYUbORr6INnqG193gd6ttOLv/NG7w== X-Google-Smtp-Source: ALg8bN5x4dKJuNuuMb8+8erZGgCsN55Qs6LYm9xtQkiFhWry03WFa+ayloLezQMTHz5ZGzDl13dwhxaYzt8EK1WM6X0= X-Received: by 2002:a37:6c05:: with SMTP id h5mr17735428qkc.175.1548632336406; Sun, 27 Jan 2019 15:38:56 -0800 (PST) MIME-Version: 1.0 References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> <20190127154047.V900@besplex.bde.org> In-Reply-To: From: Warner Losh Date: Sun, 27 Jan 2019 16:38:45 -0700 Message-ID: Subject: Re: svn commit: r343480 - head/lib/libfigpar To: Devin Teske Cc: Bruce Evans , Stefan Esser , Colin Percival , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 43D638B99F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2019 23:38:58 -0000 On Sun, Jan 27, 2019 at 7:09 AM Devin Teske wrote: > > > > On Jan 26, 2019, at 9:31 PM, Bruce Evans wrote: > > > > On Sat, 26 Jan 2019, Stefan Esser wrote: > > > >> Am 26.01.19 um 22:59 schrieb Colin Percival: > >>> ... > >>> The length of the string was already being recalculated, by strcpy. > >>> > >>> It seems to me that this could be written as > >>> > >>> temp = malloc(slen + 1); > >>> if (temp == NULL) /* could not allocate memory */ > >>> return (-1); > >>> memcpy(temp, source, slen + 1); > >>> > >>> which avoids both recalculating the string length and using strcpy? > >> > >> In principle you are right, there is a small run-time cost by not using > >> the known length for the allocation. > >> > >> The Clang Scan checks are leading to lots (thousands) of false positives > >> and a I have looked at quite a number and abstained from silencing them > >> in the hope that the scan will be improved. > >> > >> It should learn that at least the trivial case of an allocation of the > >> value of strlen()+1 followed by a strcpy (and no further strcat or the > >> like) is safe. > > > > It would be a large bug in coverity for it complain about normal use of > > strcpy(). > > > > However, the the use was not normal. It has very broken error checking > > for malloc(). This gave undefined behaviour for C99 and usually failure > > of the function and a memory leak for POSIX, > > > > The broken error checking was to check errno instead of the return > > value of malloc(), without even setting errno to 0 before calling > > malloc(). This is especially broken in a library. It is normal for > > errno to contain some garbage value from a previous failure, e.g., > > ENOTTY from isatty(). So the expected behaviour of this library > > function is to usually fail and leak the successfully malloc()ed memory > > when the broken code is reached. Coverity should find this bug. > > Perhaps it did. > > > > If errno were set before the call to malloc(), then the code would just > > be unportable. Setting errno when malloc() fails is a POSIX extension > > of C99. Coverity should be aware of the standard being used, and should > > find this bug for C99 but not for POSIX. > > > > The fix and the above patch don't fix styles bug related to the broken > > check. First there is the lexical style bug of placing the comment > > on the check instead of on the result of the check. The main bug is > > that it should go without saying that malloc failures are checked for > > by checking whether malloc() returned NULL. But in the old version, > > the check was encrypted as the broken check of errno. The comment > > decrypts this a little. > > > > I am genuinely flattered that so much thought is being placed around code > that I wrote circa 1999. > > My code there might even pre-date the C99 standard if memory serves. > > When I wrote that code, I had tested it on extensively on over 20 > different UNIX platforms. > > Compatibility was a nightmare back then. I'm so happy we have all these > wonderful shiny standards today. > Yea, Unix compatibility was great through '77 or so (since even though there was some minor diversity inside of Bell Labs, it wasn't so large and the extant code base was small enough to cope). The jump form V6 to V7 broke a lot of interfaces, so people started doing portability hacks. It got worse as BSD released its evolved versions, and USG started to go in a different direction with System III. Then the Unix Wars happened during the 80's. By 1999 these had mostly settled out and most of the portability mess as but a mere echo of what it had grown to in the early 80's (the curious can go look at the TTY interface diversity that Kermit pandered to until the late 90's when it grew too large to run on most of the crazy systems it had compat code for and started trimming the ancient ones... I think it supported 6 or 7 different variants of Unix that ran on the PDP-11 alone... though to be fair, the tty interface was/is the hardest to write portably, even today). Today, the fast moving target is all the new Linux system calls and weird library routines, but much of that makes it into standards bodies and FreeBSD keeps up enough to knock most of the rough edges off... Warner From owner-svn-src-head@freebsd.org Mon Jan 28 02:00:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9340414C50D2; Mon, 28 Jan 2019 02:00:40 +0000 (UTC) (envelope-from gonzo@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 3748C69C36; Mon, 28 Jan 2019 02:00:40 +0000 (UTC) (envelope-from gonzo@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 2C17B18BF4; Mon, 28 Jan 2019 02:00:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0S20e1k006707; Mon, 28 Jan 2019 02:00:40 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0S20eQN006706; Mon, 28 Jan 2019 02:00:40 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901280200.x0S20eQN006706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 28 Jan 2019 02:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343516 - head/usr.bin/find X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/find X-SVN-Commit-Revision: 343516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3748C69C36 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 02:00:40 -0000 Author: gonzo Date: Mon Jan 28 02:00:39 2019 New Revision: 343516 URL: https://svnweb.freebsd.org/changeset/base/343516 Log: Fix whiteout support in find(1) find(1) ignores -type w passed to it. With this patch find(1) properly identifies and prints whiteouts. PR: 126384, 156703 Submitted by: oleg@mamontov.net MFC after: 1 week Modified: head/usr.bin/find/find.c Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Mon Jan 28 01:50:47 2019 (r343515) +++ head/usr.bin/find/find.c Mon Jan 28 02:00:39 2019 (r343516) @@ -208,8 +208,10 @@ find_execute(PLAN *plan, char *paths[]) entry->fts_path, strerror(entry->fts_errno)); exitstatus = 1; continue; -#ifdef FTS_W +#if defined(FTS_W) && defined(FTS_WHITEOUT) case FTS_W: + if (ftsoptions & FTS_WHITEOUT) + break; continue; #endif /* FTS_W */ } From owner-svn-src-head@freebsd.org Mon Jan 28 02:15:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0909314C5741; Mon, 28 Jan 2019 02:15:43 +0000 (UTC) (envelope-from avos@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 A2AB26A879; Mon, 28 Jan 2019 02:15:42 +0000 (UTC) (envelope-from avos@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 7946818F40; Mon, 28 Jan 2019 02:15:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0S2FgZj016907; Mon, 28 Jan 2019 02:15:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0S2FfMX016904; Mon, 28 Jan 2019 02:15:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901280215.x0S2FfMX016904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 28 Jan 2019 02:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343518 - in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Commit-Revision: 343518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2AB26A879 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.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 02:15:43 -0000 Author: avos Date: Mon Jan 28 02:15:41 2019 New Revision: 343518 URL: https://svnweb.freebsd.org/changeset/base/343518 Log: rtwn_usb(4): add new USB id. Submitted by: Github issue: https://github.com/s3erios/rtwn/issues/4 MFC after: 5 days Modified: head/share/man/man4/rtwn_usb.4 head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Mon Jan 28 02:12:48 2019 (r343517) +++ head/share/man/man4/rtwn_usb.4 Mon Jan 28 02:15:41 2019 (r343518) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd January 2, 2019 +.Dd January 28, 2019 .Dt RTWN_USB 4 .Os .Sh NAME @@ -80,6 +80,7 @@ based USB wireless network adapters, including: .It "Edimax EW-7811Un" Ta RTL8188CUS Ta USB 2.0 .It "Edimax EW-7811UTC" Ta RTL8821AU Ta USB 2.0 .It "Edimax EW-7822UAC" Ta RTL8812AU Ta USB 3.0 +.It "EDUP EP-AC1620" Ta RTL8821AU Ta USB 2.0 .It "Elecom WDC-150SU2M" Ta RTL8188EU Ta USB 2.0 .It "EnGenius EUB1200AC" Ta RTL8812AU Ta USB 3.0 .It "Hawking HD65U" Ta RTL8821AU Ta USB 2.0 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Jan 28 02:12:48 2019 (r343517) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Jan 28 02:15:41 2019 (r343518) @@ -157,7 +157,8 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8821AU_DEV(HAWKING, HD65U), RTWN_RTL8821AU_DEV(MELCO, WIU2433DM), RTWN_RTL8821AU_DEV(NETGEAR, A6100), - RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU) + RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_1), + RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2) #undef RTWN_RTL8821AU_DEV }; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jan 28 02:12:48 2019 (r343517) +++ head/sys/dev/usb/usbdevs Mon Jan 28 02:15:41 2019 (r343518) @@ -3954,6 +3954,7 @@ product REALTEK DUMMY 0x0000 Dummy product product REALTEK USB20CRW 0x0158 USB20CRW Card Reader product REALTEK RTL8188ETV 0x0179 RTL8188ETV product REALTEK RTL8188CTV 0x018a RTL8188CTV +product REALTEK RTL8821AU_2 0x0811 RTL8821AU product REALTEK RTL8188RU_2 0x317f RTL8188RU product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8152 0x8152 RTL8152 USB Ethernet @@ -3984,7 +3985,7 @@ product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Ad product REALTEK RTL8712 0x8712 RTL8712 product REALTEK RTL8713 0x8713 RTL8713 product REALTEK RTL8188CU_COMBO 0x8754 RTL8188CU -product REALTEK RTL8821AU 0xa811 RTL8821AU +product REALTEK RTL8821AU_1 0xa811 RTL8821AU product REALTEK RTL8723BU 0xb720 RTL8723BU product REALTEK RTL8192SU 0xc512 RTL8192SU product REALTEK RTL8812AU 0x8812 RTL8812AU Wireless Adapter From owner-svn-src-head@freebsd.org Mon Jan 28 08:36:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852A814AB7FA; Mon, 28 Jan 2019 08:36:11 +0000 (UTC) (envelope-from kp@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 2C21380293; Mon, 28 Jan 2019 08:36:11 +0000 (UTC) (envelope-from kp@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 1A8F01D09F; Mon, 28 Jan 2019 08:36:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0S8aA1b016283; Mon, 28 Jan 2019 08:36:10 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0S8aAZY016282; Mon, 28 Jan 2019 08:36:10 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901280836.x0S8aAZY016282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 28 Jan 2019 08:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343520 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 343520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C21380293 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 08:36:11 -0000 Author: kp Date: Mon Jan 28 08:36:10 2019 New Revision: 343520 URL: https://svnweb.freebsd.org/changeset/base/343520 Log: pfctl: Point users to net.pf.request_maxcount if large requests are rejected The kernel will reject very large tables to avoid resource exhaustion attacks. Some users run into this limit with legitimate table configurations. The error message in this case was not very clear: pf.conf:1: cannot define table nets: Invalid argument pfctl: Syntax error in config file: pf rules not loaded If a table definition fails we now check the request_maxcount sysctl, and if we've tried to create more than that point the user at net.pf.request_maxcount: pf.conf:1: cannot define table nets: too many elements. Consider increasing net.pf.request_maxcount. pfctl: Syntax error in config file: pf rules not loaded PR: 235076 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18909 Modified: head/sbin/pfctl/parse.y Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Mon Jan 28 02:26:05 2019 (r343519) +++ head/sbin/pfctl/parse.y Mon Jan 28 08:36:10 2019 (r343520) @@ -4743,6 +4743,8 @@ process_tabledef(char *name, struct table_opts *opts) { struct pfr_buffer ab; struct node_tinit *ti; + unsigned long maxcount; + size_t s = sizeof(maxcount); bzero(&ab, sizeof(ab)); ab.pfrb_type = PFRB_ADDRS; @@ -4770,8 +4772,19 @@ process_tabledef(char *name, struct table_opts *opts) if (!(pf->opts & PF_OPT_NOACTION) && pfctl_define_table(name, opts->flags, opts->init_addr, pf->anchor->name, &ab, pf->anchor->ruleset.tticket)) { - yyerror("cannot define table %s: %s", name, - pfr_strerror(errno)); + + if (sysctlbyname("net.pf.request_maxcount", &maxcount, &s, + NULL, 0) == -1) + maxcount = 65535; + + if (ab.pfrb_size > maxcount) + yyerror("cannot define table %s: too many elements.\n" + "Consider increasing net.pf.request_maxcount.", + name); + else + yyerror("cannot define table %s: %s", name, + pfr_strerror(errno)); + goto _error; } pf->tdirty = 1; From owner-svn-src-head@freebsd.org Mon Jan 28 11:39:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C88114B03E5; Mon, 28 Jan 2019 11:39:55 +0000 (UTC) (envelope-from avos@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 C0A518733E; Mon, 28 Jan 2019 11:39:54 +0000 (UTC) (envelope-from avos@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 AE4C61F085; Mon, 28 Jan 2019 11:39:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SBdsCK012047; Mon, 28 Jan 2019 11:39:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SBds4D012045; Mon, 28 Jan 2019 11:39:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901281139.x0SBds4D012045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 28 Jan 2019 11:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343524 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0A518733E 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 11:39:55 -0000 Author: avos Date: Mon Jan 28 11:39:54 2019 New Revision: 343524 URL: https://svnweb.freebsd.org/changeset/base/343524 Log: rsu(4): do not ignore mgmtrate / mcastrate / ucastrate. Enforce net80211 rates for control / management / multicast / EAPOL frames and allow to override rate for unicast frames via ifconfig(8) 'ucastrate' option; by default it still uses f/w rate adaptation for unicast frames. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Mon Jan 28 09:45:28 2019 (r343523) +++ head/sys/dev/usb/wlan/if_rsu.c Mon Jan 28 11:39:54 2019 (r343524) @@ -2753,15 +2753,17 @@ static int rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, struct rsu_data *data) { + const struct ieee80211_txparam *tp = ni->ni_txparms; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct r92s_tx_desc *txd; - uint8_t type, cipher; + uint8_t rate, ridx, type, cipher; int prio = 0; uint8_t which; int hasqos; + int ismcast; int xferlen; int qid; @@ -2769,10 +2771,26 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no wh = mtod(m0, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); RSU_DPRINTF(sc, RSU_DEBUG_TX, "%s: data=%p, m=%p\n", __func__, data, m0); + /* Choose a TX rate index. */ + if (type == IEEE80211_FC0_TYPE_MGT || + type == IEEE80211_FC0_TYPE_CTL || + (m0->m_flags & M_EAPOL) != 0) + rate = tp->mgmtrate; + else if (ismcast) + rate = tp->mcastrate; + else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rate = tp->ucastrate; + else + rate = 0; + + if (rate != 0) + ridx = rate2ridx(rate); + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { @@ -2851,8 +2869,17 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no } /* XXX todo: set AGGEN bit if appropriate? */ txd->txdw2 |= htole32(R92S_TXDW2_BK); - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + if (ismcast) txd->txdw2 |= htole32(R92S_TXDW2_BMCAST); + + /* Force mgmt / mcast / ucast rate if needed. */ + if (rate != 0) { + /* Data rate fallback limit (max). */ + txd->txdw5 |= htole32(SM(R92S_TXDW5_DATARATE_FB_LMT, 0x1f)); + txd->txdw5 |= htole32(SM(R92S_TXDW5_DATARATE, ridx)); + txd->txdw4 |= htole32(R92S_TXDW4_DRVRATE); + } + /* * Firmware will use and increment the sequence number for the * specified priority. Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Mon Jan 28 09:45:28 2019 (r343523) +++ head/sys/dev/usb/wlan/if_rsureg.h Mon Jan 28 11:39:54 2019 (r343524) @@ -700,9 +700,14 @@ struct r92s_tx_desc { uint32_t txdw4; #define R92S_TXDW4_TXBW 0x00040000 +#define R92S_TXDW4_DRVRATE 0x80000000 uint32_t txdw5; -#define R92S_TXDW5_DISFB 0x00008000 +#define R92S_TXDW5_DATARATE_M 0x00007e00 +#define R92S_TXDW5_DATARATE_S 9 +#define R92S_TXDW5_DISFB 0x00008000 +#define R92S_TXDW5_DATARATE_FB_LMT_M 0x001f0000 +#define R92S_TXDW5_DATARATE_FB_LMT_S 16 uint16_t ipchksum; uint16_t tcpchksum; From owner-svn-src-head@freebsd.org Mon Jan 28 12:44:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC34C14B27B4; Mon, 28 Jan 2019 12:44:00 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 383FE89F65; Mon, 28 Jan 2019 12:44:00 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f173.google.com with SMTP id s5-v6so14042811ljd.12; Mon, 28 Jan 2019 04:44:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=mWd+BsaEMSZyhvUvDIVFCvR0WW3L2Idejj7YMp08cps=; b=ouSadAYhF7XdifG1PlC6Fy8n/yh4OB2Cqab1+PB3wPqsh+JCC7mPgcxnxui/FKgYpX sMBl79fbdpMRBENxe2fcQj+oeZ9Bi7R5P08aC9quntoirSv+lZQ77vpgqO+/Ps8S/SSr RqUBB47G11KZ3ODfE6J++jPoliU3thmnAo4iglEVqz6tFIsC83DsNkGBM7dwrGNMs6AA dRSyQyBfKZl43O8rpYk+bx9dHokpnqlfwNyyQeOLPp1imJ0omwYPF8RJtRCQNtP/MRIV 9FybNqcL1Q59n4A62FNlLU1ZZqahyRTkrp+IMFeBSE/jK22fOrYHbRcjNMbHrHqS1NJ5 vs/A== X-Gm-Message-State: AJcUukct/FeBzue+k1daDK6E0T0ekB9ASMbvYJ0o7ojVl7KwOQXNt1zG dMXHZGEhHwPlRqP2HxIf1FvGitbl X-Google-Smtp-Source: ALg8bN7E3wkU9u4xl3Sisra31F0fGd/A/A+IINHjGdiuTodtfd6sllhb+usWlzZe2K6yvT9IA11OXQ== X-Received: by 2002:a2e:9ad9:: with SMTP id p25-v6mr17362573ljj.189.1548679432569; Mon, 28 Jan 2019 04:43:52 -0800 (PST) Received: from localhost ([37.73.227.23]) by smtp.gmail.com with ESMTPSA id u30sm3112809lfc.90.2019.01.28.04.43.51 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 04:43:51 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343524 - head/sys/dev/usb/wlan References: <201901281139.x0SBds4D012045@repo.freebsd.org> Date: Mon, 28 Jan 2019 14:43:19 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201901281139.x0SBds4D012045@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 383FE89F65 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 12:44:00 -0000 Mon, 28 Jan 2019 13:39:54 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : > Author: avos > Date: Mon Jan 28 11:39:54 2019 > New Revision: 343524 > URL: https://svnweb.freebsd.org/changeset/base/343524 > > Log: > rsu(4): do not ignore mgmtrate / mcastrate / ucastrate. > Enforce net80211 rates for control / management / multicast / EAPOL = > frames > and allow to override rate for unicast frames via ifconfig(8) = > 'ucastrate' > option; by default it still uses f/w rate adaptation for unicast = > frames. Tested with: ASUS USB-N10, STA mode + RTL8188EE, MONITOR mode. From owner-svn-src-head@freebsd.org Mon Jan 28 12:45:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EAA714B28E5; Mon, 28 Jan 2019 12:45:32 +0000 (UTC) (envelope-from tuexen@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 26D818A151; Mon, 28 Jan 2019 12:45:32 +0000 (UTC) (envelope-from tuexen@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 136EF1FD2E; Mon, 28 Jan 2019 12:45:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SCjV04048725; Mon, 28 Jan 2019 12:45:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SCjVpw048723; Mon, 28 Jan 2019 12:45:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901281245.x0SCjVpw048723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 28 Jan 2019 12:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343525 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 343525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26D818A151 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 12:45:32 -0000 Author: tuexen Date: Mon Jan 28 12:45:31 2019 New Revision: 343525 URL: https://svnweb.freebsd.org/changeset/base/343525 Log: Fix the detection of ECN-setup SYN-ACK packets. RFC 3168 defines an ECN-setup SYN-ACK packet as on with the ECE flags set and the CWR flags not set. The code was only checking if ECE flag is set. This patch adds the check to verify that the CWR flags is not set. Submitted by: Richard Scheffenegger Reviewed by: tuexen@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18996 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Jan 28 11:39:54 2019 (r343524) +++ head/sys/netinet/tcp_input.c Mon Jan 28 12:45:31 2019 (r343525) @@ -2010,7 +2010,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru else tp->t_flags |= TF_ACKNOW; - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Jan 28 11:39:54 2019 (r343524) +++ head/sys/netinet/tcp_stacks/rack.c Mon Jan 28 12:45:31 2019 (r343525) @@ -5233,7 +5233,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= TF_ACKNOW; } - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } From owner-svn-src-head@freebsd.org Mon Jan 28 16:23:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24A814B8305; Mon, 28 Jan 2019 16:23:56 +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 8960B6C4A9; Mon, 28 Jan 2019 16:23:56 +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 7E2F52235B; Mon, 28 Jan 2019 16:23:56 +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 x0SGNub6084390; Mon, 28 Jan 2019 16:23:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SGNuYP084389; Mon, 28 Jan 2019 16:23:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901281623.x0SGNuYP084389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 28 Jan 2019 16:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343529 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 343529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8960B6C4A9 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 16:23:57 -0000 Author: markj Date: Mon Jan 28 16:23:56 2019 New Revision: 343529 URL: https://svnweb.freebsd.org/changeset/base/343529 Log: Remove a redundant test. The existence of a PV entry for a mapping guarantees that the mapping exists, so we should not need to test for that. Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18866 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Jan 28 16:18:17 2019 (r343528) +++ head/sys/riscv/riscv/pmap.c Mon Jan 28 16:23:56 2019 (r343529) @@ -2655,7 +2655,7 @@ restart: } } l3 = pmap_l3(pmap, pv->pv_va); - if (l3 != NULL && (pmap_load(l3) & PTE_SW_WIRED) != 0) + if ((pmap_load(l3) & PTE_SW_WIRED) != 0) count++; PMAP_UNLOCK(pmap); } From owner-svn-src-head@freebsd.org Mon Jan 28 18:07:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CBB914BAA88; Mon, 28 Jan 2019 18:07:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B64917068F; Mon, 28 Jan 2019 18:07:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id F10C574E2; Mon, 28 Jan 2019 18:07:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r343440 - head/bin/sh To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> <20190125095051.GA26744@v2> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 28 Jan 2019 10:07:12 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190125095051.GA26744@v2> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B64917068F 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(-0.99)[-0.992,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 18:07:14 -0000 On 1/25/19 1:50 AM, Edward Napierala wrote: >> mergemaster, iirc, will merge in changes to etc files after an upgrade. >> So this would effect anybody that goes through an upgrade and performs mergemaster. > > No, it won't - it doesn't affect files in /etc at all. It doesn't > affect stuff that's being installed by mergemaster(8), nor stuff > installed by 'make install'. It only affects the default /root/.profile > and /root/.shrc, as installed by bsdinstall(8) or shipped as VM or SD > card images. Nope. Try again: % ll /var/db/etcupdate/current/root/ total 18 -rw-r--r-- 2 root wheel 949 Nov 17 17:41 .cshrc -rw-r--r-- 1 root wheel 147 Nov 17 17:41 .k5login -rw-r--r-- 1 root wheel 390 Nov 17 17:41 .login -rw-r--r-- 2 root wheel 468 Nov 17 17:41 .profile Both etcupdate and mergemaster use 'make distribution' to build the set of files (mostly things in /etc) that get merged. If it doesn't get installed by installworld but does get installed in 'base.txz', then etcupdate and mergemaster will try to merge it. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Mon Jan 28 18:34:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD58C14BB870; Mon, 28 Jan 2019 18:34:05 +0000 (UTC) (envelope-from asomers@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 5E6EA71CE2; Mon, 28 Jan 2019 18:34:05 +0000 (UTC) (envelope-from asomers@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 52ACF239CD; Mon, 28 Jan 2019 18:34:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SIY55X053275; Mon, 28 Jan 2019 18:34:05 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SIY5DQ053274; Mon, 28 Jan 2019 18:34:05 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201901281834.x0SIY5DQ053274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 28 Jan 2019 18:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343530 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 343530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E6EA71CE2 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 18:34:05 -0000 Author: asomers Date: Mon Jan 28 18:34:04 2019 New Revision: 343530 URL: https://svnweb.freebsd.org/changeset/base/343530 Log: ifconfig: fix endianness bug displaying pfsync interfaces Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19005 Modified: head/sbin/ifconfig/ifpfsync.c Modified: head/sbin/ifconfig/ifpfsync.c ============================================================================== --- head/sbin/ifconfig/ifpfsync.c Mon Jan 28 16:23:56 2019 (r343529) +++ head/sbin/ifconfig/ifpfsync.c Mon Jan 28 18:34:04 2019 (r343530) @@ -195,16 +195,16 @@ pfsync_status(int s) return; if (preq.pfsyncr_syncdev[0] != '\0' || - preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP) + preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) printf("\t"); if (preq.pfsyncr_syncdev[0] != '\0') printf("pfsync: syncdev: %s ", preq.pfsyncr_syncdev); - if (preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP) + if (preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) printf("syncpeer: %s ", inet_ntoa(preq.pfsyncr_syncpeer)); if (preq.pfsyncr_syncdev[0] != '\0' || - preq.pfsyncr_syncpeer.s_addr != INADDR_PFSYNC_GROUP) { + preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) { printf("maxupd: %d ", preq.pfsyncr_maxupdates); printf("defer: %s\n", preq.pfsyncr_defer ? "on" : "off"); } From owner-svn-src-head@freebsd.org Mon Jan 28 19:54:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0682D14BDC3F; Mon, 28 Jan 2019 19:54:59 +0000 (UTC) (envelope-from bcr@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 A073D756E7; Mon, 28 Jan 2019 19:54:58 +0000 (UTC) (envelope-from bcr@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 8DBF0247C0; Mon, 28 Jan 2019 19:54:58 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SJswqs096407; Mon, 28 Jan 2019 19:54:58 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SJswMV096406; Mon, 28 Jan 2019 19:54:58 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201901281954.x0SJswMV096406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Mon, 28 Jan 2019 19:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343532 - head/usr.bin/fortune/datfiles X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 343532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A073D756E7 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 19:54:59 -0000 Author: bcr (doc committer) Date: Mon Jan 28 19:54:58 2019 New Revision: 343532 URL: https://svnweb.freebsd.org/changeset/base/343532 Log: A few corrections and clarifications to r343406. - Use "in" instead of "on" when referring to directory and UFS partition. - Switch from hw.physmem to hw.realmem and add a description to distinguish the two. - Explain why the "df" command is having trouble displaying ZFS sizes correctly. Add a bit more descriptive text to help why the output of "zfs list -o space" should be used. - Switch to vmstat instead of iostat display for systat(1) as it shows more information on one screen. Describe what is displayed based on the text of the man page. Change the list of the other values accordingly. - Sort the flags to "zfs destroy" alphabetically. Reviewed by: rgrimes Approved by: rgrimes MFC after: 8 days Differential Revision: https://reviews.freebsd.org/D18993 Modified: head/usr.bin/fortune/datfiles/freebsd-tips Modified: head/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- head/usr.bin/fortune/datfiles/freebsd-tips Mon Jan 28 18:55:29 2019 (r343531) +++ head/usr.bin/fortune/datfiles/freebsd-tips Mon Jan 28 19:54:58 2019 (r343532) @@ -275,7 +275,7 @@ To see how much disk space is left on your UFS partiti df -h -- Dru % -To see the 10 largest files on a directory or UFS partition, use +To see the 10 largest files in a directory or on a UFS partition, use du -h /partition_or_directory_name | sort -rh | head -- Dru @@ -560,31 +560,38 @@ curl -v -d "nickname=$USER" -d "description=FreeBSD/$( $(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ --data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi % -Want to know how much memory (in bytes) your machine has available? Let +Want to know how much memory (in bytes) your machine has installed? Let sysctl(8) tell you with the following command: -sysctl hw.physmem +sysctl hw.realmem +The realmem value is memory before the kernel and modules are loaded, whereas +hw.physmem is what is left after they were loaded. + The number of active CPUs is displayed using this command: sysctl hw.ncpu -- Benedict Reuschling % -When using ZFS as the file system the "df" command will display confusing -values. Use the built-in "zfs list" command to get an overview of space usage: +When using ZFS as the file system the "df" command is reporting the pool size +and not file system sizes. It also does not know about descendent ZFS +datasets, snapshots, quotas, and reservations with their individual space usage. +Use the built-in "zfs list" command to get a better overview of space usage: zfs list -o space -- Benedict Reuschling % To learn more about what your system is doing, take a look at systat(1). For -example, to get an overview of I/O happening in the system, run: +example, to get various of statistics related to virtual memory usage, process +scheduling, device interrupts, system name translation caching, and disk I/O, +enter the following: -systat -iostat +systat -vmstat -Other values are icmp, icmp6, ifstat, ip, ip6, netstat, pigs, sctp, swap, tcp, -vmstat, or zarc. You can switch between displays using : and exit +Other values are icmp, icmp6, ifstat, iostat, ip, ip6, netstat, pigs, sctp, +swap, tcp, or zarc. You can switch between displays using : and exit back to your shell by typing :quit @@ -694,7 +701,7 @@ dataset/snapshot and not any dependent ones. ZFS will action when -n is combined with the -v option without actually performing it: -zfs destroy -rvn mypool@mysnap +zfs destroy -nrv mypool@mysnap Once you are sure this is exactly what you intend to do, remove the -n parameter to execute the destroy operation. From owner-svn-src-head@freebsd.org Mon Jan 28 20:22:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 977A914BE539; Mon, 28 Jan 2019 20:22:18 +0000 (UTC) (envelope-from gonzo@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 4045F76463; Mon, 28 Jan 2019 20:22:18 +0000 (UTC) (envelope-from gonzo@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 35DCF24CB5; Mon, 28 Jan 2019 20:22:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SKMIs9011139; Mon, 28 Jan 2019 20:22:18 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SKMHd7011138; Mon, 28 Jan 2019 20:22:17 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901282022.x0SKMHd7011138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 28 Jan 2019 20:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343533 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4045F76463 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.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 20:22:18 -0000 Author: gonzo Date: Mon Jan 28 20:22:17 2019 New Revision: 343533 URL: https://svnweb.freebsd.org/changeset/base/343533 Log: [usb] Add UQ_KBD_BOOTPROTO quirk for Corsair K68 keyboard PR: 222114 Submitted by: Zane C. Bowers-Hadley MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 19:54:58 2019 (r343532) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 20:22:17 2019 (r343533) @@ -165,6 +165,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* Quirk for Corsair Vengeance K60 keyboard */ USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair Gaming K68 keyboard */ + USB_QUIRK(CORSAIR, K68, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair K70 RGB keyboard */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jan 28 19:54:58 2019 (r343532) +++ head/sys/dev/usb/usbdevs Mon Jan 28 20:22:17 2019 (r343533) @@ -1581,6 +1581,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard +product CORSAIR K68 0x1b3f Corsair Gaming K68 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard product CORSAIR STRAFE 0x1b15 Corsair STRAFE Gaming keyboard From owner-svn-src-head@freebsd.org Mon Jan 28 20:26:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F8614BE70B; Mon, 28 Jan 2019 20:26:10 +0000 (UTC) (envelope-from pkelsey@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 82B5F7672B; Mon, 28 Jan 2019 20:26:10 +0000 (UTC) (envelope-from pkelsey@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 746A224CCA; Mon, 28 Jan 2019 20:26:10 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SKQAqw012082; Mon, 28 Jan 2019 20:26:10 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SKQA34012081; Mon, 28 Jan 2019 20:26:10 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901282026.x0SKQA34012081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Mon, 28 Jan 2019 20:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343534 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 343534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82B5F7672B 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 20:26:11 -0000 Author: pkelsey Date: Mon Jan 28 20:26:09 2019 New Revision: 343534 URL: https://svnweb.freebsd.org/changeset/base/343534 Log: Don't re-evaluate ALTQ kernel configuration due to events on non-ALTQ interfaces Re-evaluating the ALTQ kernel configuration can be expensive, particularly when there are a large number (hundreds or thousands) of queues, and is wholly unnecessary in response to events on interfaces that do not support ALTQ as such interfaces cannot be part of an ALTQ configuration. Reviewed by: kp MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18918 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Mon Jan 28 20:22:17 2019 (r343533) +++ head/sys/netpfil/pf/pf_ioctl.c Mon Jan 28 20:26:09 2019 (r343534) @@ -683,6 +683,14 @@ pf_altq_ifnet_event(struct ifnet *ifp, int remove) u_int32_t ticket; int error = 0; + /* + * No need to re-evaluate the configuration for events on interfaces + * that do not support ALTQ, as it's not possible for such + * interfaces to be part of the configuration. + */ + if (!ALTQ_IS_READY(&ifp->if_snd)) + return; + /* Interrupt userland queue modifications */ if (V_altqs_inactive_open) pf_rollback_altq(V_ticket_altqs_inactive); From owner-svn-src-head@freebsd.org Mon Jan 28 20:30:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95EE514BE8CB; Mon, 28 Jan 2019 20:30:05 +0000 (UTC) (envelope-from pkelsey@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 3A3DC76989; Mon, 28 Jan 2019 20:30:05 +0000 (UTC) (envelope-from pkelsey@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 2B03424CD3; Mon, 28 Jan 2019 20:30:05 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SKU5Lj012303; Mon, 28 Jan 2019 20:30:05 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SKU56I012302; Mon, 28 Jan 2019 20:30:05 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901282030.x0SKU56I012302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Mon, 28 Jan 2019 20:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343535 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 343535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A3DC76989 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.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 20:30:05 -0000 Author: pkelsey Date: Mon Jan 28 20:30:04 2019 New Revision: 343535 URL: https://svnweb.freebsd.org/changeset/base/343535 Log: Speed up non-status operations applied to a single interface When performing a non-status operation on a single interface, it is not necessary for ifconfig to build a list of all addresses in the system, sort them, then iterate through them looking for the entry for the single interface of interest. Doing so becomes increasingly expensive as the number of interfaces in the system grows (e.g., in a system with 1000+ vlan(4) interfaces). Reviewed by: ae, kp MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18919 Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Mon Jan 28 20:26:09 2019 (r343534) +++ head/sbin/ifconfig/ifconfig.c Mon Jan 28 20:30:04 2019 (r343535) @@ -111,6 +111,8 @@ static void status(const struct afswtch *afp, const st static void tunnel_status(int s); static _Noreturn void usage(void); +static int getifflags(const char *ifname, int us); + static struct afswtch *af_getbyname(const char *name); static struct afswtch *af_getbyfamily(int af); static void af_other_status(int); @@ -369,6 +371,7 @@ main(int argc, char *argv[]) const char *ifname; struct option *p; size_t iflen; + int flags; all = downonly = uponly = namesonly = noload = verbose = 0; f_inet = f_inet6 = f_ether = f_addr = NULL; @@ -526,6 +529,25 @@ main(int argc, char *argv[]) argc--, argv++; } + /* + * Check for a requested configuration action on a single interface, + * which doesn't require building, sorting, and searching the entire + * system address list + */ + if ((argc > 0) && (ifname != NULL)) { + iflen = strlcpy(name, ifname, sizeof(name)); + if (iflen >= sizeof(name)) { + warnx("%s: interface name too long, skipping", ifname); + } else { + flags = getifflags(name, -1); + if (!(((flags & IFF_CANTCONFIG) != 0) || + (downonly && (flags & IFF_UP) != 0) || + (uponly && (flags & IFF_UP) == 0))) + ifconfig(argc, argv, 0, afp); + } + goto done; + } + if (getifaddrs(&ifap) != 0) err(EXIT_FAILURE, "getifaddrs"); @@ -609,6 +631,7 @@ main(int argc, char *argv[]) printf("\n"); freeifaddrs(ifap); +done: freeformat(); exit(exit_code); } @@ -1020,6 +1043,28 @@ setifdstaddr(const char *addr, int param __unused, int afp->af_getaddr(addr, DSTADDR); } +static int +getifflags(const char *ifname, int us) +{ + struct ifreq my_ifr; + int s; + + memset(&my_ifr, 0, sizeof(my_ifr)); + (void) strlcpy(my_ifr.ifr_name, ifname, sizeof(my_ifr.ifr_name)); + if (us < 0) { + if ((s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) + err(1, "socket(family AF_LOCAL,SOCK_DGRAM"); + } else + s = us; + if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&my_ifr) < 0) { + Perror("ioctl (SIOCGIFFLAGS)"); + exit(1); + } + if (us < 0) + close(s); + return ((my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16)); +} + /* * Note: doing an SIOCIGIFFLAGS scribbles on the union portion * of the ifreq structure, which may confuse other parts of ifconfig. @@ -1031,20 +1076,14 @@ setifflags(const char *vname, int value, int s, const struct ifreq my_ifr; int flags; - memset(&my_ifr, 0, sizeof(my_ifr)); - (void) strlcpy(my_ifr.ifr_name, name, sizeof(my_ifr.ifr_name)); - - if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&my_ifr) < 0) { - Perror("ioctl (SIOCGIFFLAGS)"); - exit(1); - } - flags = (my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16); - + flags = getifflags(name, s); if (value < 0) { value = -value; flags &= ~value; } else flags |= value; + memset(&my_ifr, 0, sizeof(my_ifr)); + (void) strlcpy(my_ifr.ifr_name, name, sizeof(my_ifr.ifr_name)); my_ifr.ifr_flags = flags & 0xffff; my_ifr.ifr_flagshigh = flags >> 16; if (ioctl(s, SIOCSIFFLAGS, (caddr_t)&my_ifr) < 0) From owner-svn-src-head@freebsd.org Mon Jan 28 21:36:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B631914C0525; Mon, 28 Jan 2019 21:36:46 +0000 (UTC) (envelope-from mckusick@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 5D6B280E85; Mon, 28 Jan 2019 21:36:46 +0000 (UTC) (envelope-from mckusick@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 4878C2587D; Mon, 28 Jan 2019 21:36:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0SLajZT048224; Mon, 28 Jan 2019 21:36:45 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0SLajGc048223; Mon, 28 Jan 2019 21:36:45 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901282136.x0SLajGc048223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 28 Jan 2019 21:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343536 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 343536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D6B280E85 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.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 21:36:46 -0000 Author: mckusick Date: Mon Jan 28 21:36:45 2019 New Revision: 343536 URL: https://svnweb.freebsd.org/changeset/base/343536 Log: This bug was introduced with the change to use softdep_bp_to_mp() in January 2018 changes -r327723 and -r327821. The softdep_bp_to_mp() function failed to include VFIFO as one of the valid cases. Although fifo's do not allocate blocks in the filesystem, they will allocate blocks if they use extended attributes (such as ACLs). Thus, softdep_bp_to_mp() needs to return a non-NULL mount pointer when presented with a fifo vnode so that the soft updates write complete will properly process the soft updates structures associated with the extended attribute blocks. It was the failure to process these soft updates structures, thus leaving them hanging off the buffer, which lead to the "panic: softdep_deallocate_dependencies: dangling deps" when trying to clean up the buffer after it was written. PR: 230962 Reported by: 2t8mr7kx9f@protonmail.com Reviewed by: kib Tested by: Peter Holm MFC after: 1 week Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Jan 28 20:30:04 2019 (r343535) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Jan 28 21:36:45 2019 (r343536) @@ -13983,7 +13983,7 @@ retry: if (mp == NULL) goto retry; } else if (vp->v_type == VREG || vp->v_type == VDIR || - vp->v_type == VLNK) { + vp->v_type == VLNK || vp->v_type == VFIFO) { mp = vp->v_mount; } else { return (NULL); From owner-svn-src-head@freebsd.org Tue Jan 29 00:49:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E7A14C4A23; Tue, 29 Jan 2019 00:49:13 +0000 (UTC) (envelope-from np@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 BCEA0879E8; Tue, 29 Jan 2019 00:49:12 +0000 (UTC) (envelope-from np@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 AE562278FB; Tue, 29 Jan 2019 00:49:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0T0nCcS064152; Tue, 29 Jan 2019 00:49:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0T0nC3c064151; Tue, 29 Jan 2019 00:49:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901290049.x0T0nC3c064151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Jan 2019 00:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343539 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 343539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BCEA0879E8 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.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 00:49:13 -0000 Author: np Date: Tue Jan 29 00:49:12 2019 New Revision: 343539 URL: https://svnweb.freebsd.org/changeset/base/343539 Log: cxgbe(4): Add adapter information to messages logged by the OS-agnostic code in t4_hw.c. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/osdep.h Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Mon Jan 28 21:48:04 2019 (r343538) +++ head/sys/dev/cxgbe/osdep.h Tue Jan 29 00:49:12 2019 (r343539) @@ -42,10 +42,14 @@ #include #include -#define CH_ERR(adap, fmt, ...) log(LOG_ERR, fmt, ##__VA_ARGS__) -#define CH_WARN(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__) -#define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, fmt, ##__VA_ARGS__) -#define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__) +#define CH_ERR(adap, fmt, ...) log(LOG_ERR, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) +#define CH_WARN(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) +#define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) +#define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) #ifndef LINUX_TYPES_DEFINED typedef int8_t s8; From owner-svn-src-head@freebsd.org Tue Jan 29 03:28:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47F7C14A93FC; Tue, 29 Jan 2019 03:28:50 +0000 (UTC) (envelope-from avos@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 DCDB78F835; Tue, 29 Jan 2019 03:28:49 +0000 (UTC) (envelope-from avos@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 AF93819D9; Tue, 29 Jan 2019 03:28:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0T3SnRS059454; Tue, 29 Jan 2019 03:28:49 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0T3Smb3059446; Tue, 29 Jan 2019 03:28:48 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901290328.x0T3Smb3059446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 29 Jan 2019 03:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343541 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DCDB78F835 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 03:28:50 -0000 Author: avos Date: Tue Jan 29 03:28:47 2019 New Revision: 343541 URL: https://svnweb.freebsd.org/changeset/base/343541 Log: Drop some unneeded includes from wireless USB drivers. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_rsu.c Tue Jan 29 03:28:47 2019 (r343541) @@ -39,12 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include - -#include -#include #include #include Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_rum.c Tue Jan 29 03:28:47 2019 (r343541) @@ -44,10 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include #include Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_run.c Tue Jan 29 03:28:47 2019 (r343541) @@ -44,10 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include #include Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_uath.c Tue Jan 29 03:28:47 2019 (r343541) @@ -85,10 +85,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include #include Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_upgt.c Tue Jan 29 03:28:47 2019 (r343541) @@ -41,7 +41,6 @@ #include #include -#include #include #include Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_ural.c Tue Jan 29 03:28:47 2019 (r343541) @@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include #include Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_urtw.c Tue Jan 29 03:28:47 2019 (r343541) @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include #include Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Tue Jan 29 03:06:25 2019 (r343540) +++ head/sys/dev/usb/wlan/if_zyd.c Tue Jan 29 03:28:47 2019 (r343541) @@ -44,10 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include #include From owner-svn-src-head@freebsd.org Tue Jan 29 03:31:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C5F114A9680; Tue, 29 Jan 2019 03:31:37 +0000 (UTC) (envelope-from avos@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 D75928FBCE; Tue, 29 Jan 2019 03:31:36 +0000 (UTC) (envelope-from avos@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 BF7CF1B3E; Tue, 29 Jan 2019 03:31:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0T3Va80061078; Tue, 29 Jan 2019 03:31:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0T3Valk061077; Tue, 29 Jan 2019 03:31:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901290331.x0T3Valk061077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 29 Jan 2019 03:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343542 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D75928FBCE 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 03:31:37 -0000 Author: avos Date: Tue Jan 29 03:31:36 2019 New Revision: 343542 URL: https://svnweb.freebsd.org/changeset/base/343542 Log: upgt(4): unbreak build with UPGT_DEBUG MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_upgt.c Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Tue Jan 29 03:28:47 2019 (r343541) +++ head/sys/dev/usb/wlan/if_upgt.c Tue Jan 29 03:31:36 2019 (r343542) @@ -1615,7 +1615,7 @@ upgt_fw_load(struct upgt_softc *sc) data_cmd->buflen = bsize; upgt_bulk_tx(sc, data_cmd); - DPRINTF(sc, UPGT_DEBUG_FW, "FW offset=%d, read=%d, sent=%d\n", + DPRINTF(sc, UPGT_DEBUG_FW, "FW offset=%zu, read=%d, sent=%d\n", offset, n, bsize); bsize = n; } @@ -1772,7 +1772,7 @@ upgt_fw_verify(struct upgt_softc *sc) } DPRINTF(sc, UPGT_DEBUG_FW, - "firmware Boot Record Area found at offset %d\n", offset); + "firmware Boot Record Area found at offset %zu\n", offset); /* * Parse Boot Record Area (BRA) options. From owner-svn-src-head@freebsd.org Tue Jan 29 04:08:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1011014AA126; Tue, 29 Jan 2019 04:08:51 +0000 (UTC) (envelope-from kevans@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 9D13B69EF1; Tue, 29 Jan 2019 04:08:50 +0000 (UTC) (envelope-from kevans@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 825C220C5; Tue, 29 Jan 2019 04:08:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0T48oHF080244; Tue, 29 Jan 2019 04:08:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0T48oJQ080243; Tue, 29 Jan 2019 04:08:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901290408.x0T48oJQ080243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 29 Jan 2019 04:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343543 - head/sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl/tests X-SVN-Commit-Revision: 343543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D13B69EF1 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.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 04:08:51 -0000 Author: kevans Date: Tue Jan 29 04:08:49 2019 New Revision: 343543 URL: https://svnweb.freebsd.org/changeset/base/343543 Log: bectl(8) test: Force destroy the zpool in cleanup This is a wild guess as to why bectl tests failed once upon a time in CI, given no apparent way to see a transcript of cleanup routines with Kyua. The bectl tests construct a new, clean zpool for every test. The failure indicated was because of a mount that was leftover from a previous test, but the previous test had succeeded so it's not clear how the mount remained leftover unless the `zpool get health ${pool}` had somehow failed. MFC after: 1 week Modified: head/sbin/bectl/tests/bectl_test.sh Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Tue Jan 29 03:31:36 2019 (r343542) +++ head/sbin/bectl/tests/bectl_test.sh Tue Jan 29 04:08:49 2019 (r343543) @@ -62,7 +62,7 @@ bectl_cleanup() zpool=$1 if zpool get health ${zpool} >/dev/null 2>&1; then - zpool destroy ${zpool} + zpool destroy -f ${zpool} fi } From owner-svn-src-head@freebsd.org Tue Jan 29 04:10:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D49014AA38B for ; Tue, 29 Jan 2019 04:10:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1756D6A15E for ; Tue, 29 Jan 2019 04:10:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B1AB5B68B for ; Tue, 29 Jan 2019 04:10:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f53.google.com with SMTP id z13so13547128lfe.11 for ; Mon, 28 Jan 2019 20:10:38 -0800 (PST) X-Gm-Message-State: AJcUukdInmMjMUKDOc4iYWyBValeL8u6Fa9rDio0pDHoqU6+W93FKIKb dQUUagwDWmOix3OzQCk13cGfMMUBVN8SBdKOeiQ= X-Received: by 2002:a19:920a:: with SMTP id u10mt8269461lfd.122.1548735037049; Mon, 28 Jan 2019 20:10:37 -0800 (PST) MIME-Version: 1.0 References: <201901290408.x0T48oJQ080243@repo.freebsd.org> In-Reply-To: <201901290408.x0T48oJQ080243@repo.freebsd.org> From: Kyle Evans Date: Mon, 28 Jan 2019 22:10:25 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343543 - head/sbin/bectl/tests Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1756D6A15E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 04:10:39 -0000 On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote: > > Author: kevans > Date: Tue Jan 29 04:08:49 2019 > New Revision: 343543 > URL: https://svnweb.freebsd.org/changeset/base/343543 > > Log: > bectl(8) test: Force destroy the zpool in cleanup > > This is a wild guess as to why bectl tests failed once upon a time in CI, > given no apparent way to see a transcript of cleanup routines with Kyua. The > bectl tests construct a new, clean zpool for every test. The failure > indicated was because of a mount that was leftover from a previous test, but > the previous test had succeeded so it's not clear how the mount remained > leftover unless the `zpool get health ${pool}` had somehow failed. > I left out: the tests are supposed to be constructed to clean up any mounts that were left over in the course of the test, hence the assumption that the failure lies in the cleanup. From owner-svn-src-head@freebsd.org Tue Jan 29 04:32:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D256114AB873; Tue, 29 Jan 2019 04:32:02 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C27C6B5A5; Tue, 29 Jan 2019 04:32:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0T4VrPc006703; Mon, 28 Jan 2019 20:31:53 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0T4VrZm006702; Mon, 28 Jan 2019 20:31:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901290431.x0T4VrZm006702@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343543 - head/sbin/bectl/tests In-Reply-To: To: Kyle Evans Date: Mon, 28 Jan 2019 20:31:53 -0800 (PST) CC: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4C27C6B5A5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 04:32:03 -0000 > On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote: > > > > Author: kevans > > Date: Tue Jan 29 04:08:49 2019 > > New Revision: 343543 > > URL: https://svnweb.freebsd.org/changeset/base/343543 > > > > Log: > > bectl(8) test: Force destroy the zpool in cleanup > > > > This is a wild guess as to why bectl tests failed once upon a time in CI, > > given no apparent way to see a transcript of cleanup routines with Kyua. The > > bectl tests construct a new, clean zpool for every test. The failure > > indicated was because of a mount that was leftover from a previous test, but > > the previous test had succeeded so it's not clear how the mount remained > > leftover unless the `zpool get health ${pool}` had somehow failed. > > > > I left out: the tests are supposed to be constructed to clean up any > mounts that were left over in the course of the test, hence the > assumption that the failure lies in the cleanup. >From my experience as a hardware test engineer the test setup was required to make sure any of those assumptions are valid. Meaning that the test would have to validate that no left over cruft was going to interfere with the test about to be run. Ie, you should probably do a force destroy of the pool *before* the test too. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jan 29 08:07:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923FC14B03FC; Tue, 29 Jan 2019 08:07:15 +0000 (UTC) (envelope-from bapt@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 3096471862; Tue, 29 Jan 2019 08:07:15 +0000 (UTC) (envelope-from bapt@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 1B16E4C14; Tue, 29 Jan 2019 08:07:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0T87FWw004885; Tue, 29 Jan 2019 08:07:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0T87FOd004884; Tue, 29 Jan 2019 08:07:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201901290807.x0T87FOd004884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 29 Jan 2019 08:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343546 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 343546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3096471862 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 08:07:15 -0000 Author: bapt Date: Tue Jan 29 08:07:14 2019 New Revision: 343546 URL: https://svnweb.freebsd.org/changeset/base/343546 Log: Update pci_vendors to 2019.01.29 MFC after: 2 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Tue Jan 29 07:48:49 2019 (r343545) +++ head/share/misc/pci_vendors Tue Jan 29 08:07:14 2019 (r343546) @@ -2,11 +2,11 @@ # List of PCI ID's # -# Version: 2018.08.12 -# Date: 2018-08-12 03:15:01 +# Version: 2019.01.29 +# Date: 2019-01-29 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from -# the PCI ID Project at http://pci-ids.ucw.cz/. +# the PCI ID Project at https://pci-ids.ucw.cz/. # # New data are always welcome, especially if they are accurate. If you have # anything to contribute, please follow the instructions at the web site. @@ -58,8 +58,7 @@ 0680 Ultra ATA/133 IDE RAID CONTROLLER CARD # Wrong ID used in subsystem ID of the TELES.S0/PCI 2.x ISDN adapter 00a7 Teles AG (Wrong ID) -# nee nCipher -0100 Thales e-Security +0100 nCipher Security 0123 General Dynamics 0128 Dell (wrong ID) # 018a is not LevelOne but there is a board misprogrammed @@ -275,6 +274,7 @@ 8086 9460 RAID Controller RSP3TD160F 8086 9480 RAID Controller RSP3MD088F 0015 MegaRAID Tri-Mode SAS3416 + 1d49 0503 ThinkSystem RAID 530-16i PCIe 12Gb Adapter 0016 MegaRAID Tri-Mode SAS3508 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter @@ -282,7 +282,6 @@ 1028 1fcf PERC H740P Mini 1d49 0601 ThinkSystem RAID 930-8i 2GB Flash PCIe 12Gb Adapter 1d49 0603 ThinkSystem RAID 930-24i 4GB Flash PCIe 12Gb Adapter - 1d49 0604 ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter 8086 352e Integrated RAID Module RMSP3CD080F 8086 352f Integrated RAID Module RMSP3HD080E 8086 9461 RAID Controller RSP3DD080F @@ -413,6 +412,7 @@ 005c SAS1064A PCI-X Fusion-MPT SAS 005d MegaRAID SAS-3 3108 [Invader] 1000 9361 MegaRAID SAS 9361-8i + 1000 9363 MegaRAID SAS 9361-4i 1000 9364 MegaRAID SAS 9364-8i 1000 936a MegaRAID SAS 9364-8i 1028 1f41 PERC H830 Adapter @@ -445,6 +445,7 @@ 1028 1f4d PERC H330 Embedded (for monolithic) 1054 306a SAS 3004 iMR ROMB 1d49 04db ServeRAID M1210 SAS/SATA Controller + 1d49 0504 ThinkSystem RAID 520-8i PCIe 12Gb Adapter 0060 MegaRAID SAS 1078 1000 1006 MegaRAID SAS 8888ELP 1000 100a MegaRAID SAS 8708ELP @@ -483,15 +484,17 @@ 0065 SAS2116 PCI-Express Fusion-MPT SAS-2 [Meteor] 006e SAS2308 PCI-Express Fusion-MPT SAS-2 0070 SAS2004 PCI-Express Fusion-MPT SAS-2 [Spitfire] + 1000 3010 SAS9211-4i 0071 MR SAS HBA 2004 0072 SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] + 1000 3040 9210-8i 1000 30b0 9200-8e [LSI SAS 6Gb/s SAS/SATA PCIe x8 External HBA] 1028 1f1c 6Gbps SAS HBA Adapter 1028 1f1d PERC H200 Adapter 1028 1f1e PERC H200 Integrated 1028 1f1f PERC H200 Modular 1028 1f20 PERC H200 Embedded - 1028 1f22 Internal Tape Adapter + 1028 1f22 PERC H200 Internal Tape Adapter 8086 350f RMS2LL040 RAID Controller 8086 3700 SSD 910 Series 0073 MegaRAID SAS 2008 [Falcon] @@ -506,6 +509,7 @@ 1028 1f52 PERC H310 Embedded1 1028 1f53 PERC H310 Embedded2 1028 1f54 PERC H310 Reserved + 1028 1f78 PERC H310 1054 3035 LSI MegaRAID SAS 9240-8i 1137 0072 2004 iMR ROMB 1137 0073 2008 ROMB @@ -586,10 +590,13 @@ 0084 SAS2208 PCI-Express Fusion-MPT SAS-2 0085 SAS2208 PCI-Express Fusion-MPT SAS-2 0086 SAS2308 PCI-Express Fusion-MPT SAS-2 + 15d9 0690 Onboard MegaRAID SAS2208 [Thunderbolt] + 15d9 0691 Onboard SAS2308 PCI-Express Fusion-MPT SAS-2 0087 SAS2308 PCI-Express Fusion-MPT SAS-2 1000 3020 9207-8i SAS2.1 HBA 1000 3040 9207-8e SAS2.1 HBA 1000 3050 SAS9217-8i + 1014 0472 N2125 External Host Bus Adapter 1590 0044 H220i 8086 3000 RS25GB008 RAID Controller 8086 3060 RS25FB044 RAID Controller @@ -627,6 +634,7 @@ 8086 3020 RAID Controller RSP3GD016J 00ae SAS3508 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00af SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) + 1000 3010 HBA 9400-8i 1d49 0200 ThinkSystem 430-8i SAS/SATA 12Gb HBA 1d49 0202 ThinkSystem 430-8e SAS/SATA 12Gb HBA 1d49 0204 ThinkSystem 430-8i SAS/SATA 12Gb Dense HBA @@ -650,11 +658,19 @@ 00d0 SAS3716 Fusion-MPT Tri-Mode RAID Controller Chip (ROC) 00d1 SAS3616 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 00d3 MegaRAID Tri-Mode SAS3716W + 00e0 Fusion-MPT 12GSAS/PCIe Unsupported SAS39xx + 00e1 Fusion-MPT 12GSAS/PCIe SAS39xx + 00e2 Fusion-MPT 12GSAS/PCIe Secure SAS39xx + 00e3 Fusion-MPT 12GSAS/PCIe Unsupported SAS39xx + 00e4 Fusion-MPT 12GSAS/PCIe Unsupported SAS38xx + 00e5 Fusion-MPT 12GSAS/PCIe SAS38xx + 00e6 Fusion-MPT 12GSAS/PCIe Secure SAS38xx + 00e7 Fusion-MPT 12GSAS/PCIe Unsupported SAS38xx 02b0 Virtual Endpoint on PCIe Switch 1d49 0001 ThinkSystem 1610-4P NVMe Switch Adapter 1d49 0002 ThinkSystem 810-4P NVMe Switch Adapter 02b1 Virtual Endpoint on PCIe Switch (9749) - 1d49 0004 Lenovo ThinkSystem 1610-8P NVMe Switch Adapter + 1d49 0004 ThinkSystem 1610-8P NVMe Switch Adapter 0407 MegaRAID 1000 0530 MegaRAID 530 SCSI 320-0X RAID Controller 1000 0531 MegaRAID 531 SCSI 320-4X RAID Controller @@ -725,6 +741,14 @@ 0807 SA2020ZC 0901 61C102 1000 63C815 + 10e0 MegaRAID 12GSAS/PCIe Unsupported SAS39xx + 10e1 MegaRAID 12GSAS/PCIe SAS39xx + 10e2 MegaRAID 12GSAS/PCIe Secure SAS39xx + 10e3 MegaRAID 12GSAS/PCIe Unsupported SAS39xx + 10e4 MegaRAID 12GSAS/PCIe Unsupported SAS38xx + 10e5 MegaRAID 12GSAS/PCIe SAS38xx + 10e6 MegaRAID 12GSAS/PCIe Secure SAS38xx + 10e7 MegaRAID 12GSAS/PCIe Unsupported SAS38xx 1960 MegaRAID 1000 0518 MegaRAID 518 SCSI 320-2 Controller 1000 0520 MegaRAID 520 SCSI 320-1 Controller @@ -777,11 +801,20 @@ 131b Kaveri [Radeon R4 Graphics] 131c Kaveri [Radeon R7 Graphics] 131d Kaveri [Radeon R6 Graphics] + 13e9 Ariel + 154c Kryptos + 154e Garfield + 1551 Arlene + 1552 Pooky + 1561 Anubis 15d8 Picasso 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 103c 83c6 Radeon Vega 8 Mobile 1458 d000 Radeon RX Vega 11 - 15ff Vega 11 [Radeon Vega 28 Mobile] + 15de Raven Ridge HDMI/DP Audio Controller + 15ff Fenghuang [Zhongshan Subor Z+] + 1607 Arden + 1636 Renoir 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 103c 168b ProBook 4535s 3150 RV380/M24 [Mobility Radeon X600] @@ -863,19 +896,28 @@ 4337 RS200M [Radeon IGP 330M/340M/345M/350M] 1014 053a ThinkPad R40e 103c 0850 Radeon IGP 345M - 4341 IXP150 AC'97 Audio Controller - 4342 IXP200 3COM 3C920B Ethernet Controller - 4345 EHCI USB Controller - 4347 OHCI USB Controller #1 - 4348 OHCI USB Controller #2 - 4349 Dual Channel Bus Master PCI IDE Controller - 434d IXP AC'97 Modem - 4353 SMBus + 4341 SB200 AC97 Audio Controller + 4342 SB200 PCI to PCI Bridge + 4345 SB200 EHCI USB Controller + 4346 Crayola 6 [XENOS Parent Die (XBOX 360)] + 4347 SB200 OHCI USB Controller #1 + 4348 SB200 OHCI USB Controller #2 + 4349 SB200 IDE Controller + 434c SB200 PCI to LPC Bridge + 434d SB200 AC97 Modem Controller + 4353 SB200 SMBus Controller 4354 215CT [Mach64 CT PCI] 4358 Mach64 CX [Graphics Xpression] - 4361 IXP SB300 AC'97 Audio Controller - 4363 SMBus - 436e 436E Serial ATA Controller + 4361 SB300 AC'97 Audio Controller + 4362 SB300 PCI to PCI Bridge + 4363 SB300 SMBus Controller + 4365 SB300 USB Controller (EHCI) + 4367 SB300 USB Controller (EHCI) + 4368 SB300 USB Controller (EHCI) + 4369 SB300 IDE Controller + 436c SB300 PCI to LPC Bridge + 436d SB300 AC97 Modem Controller + 436e SB300 Serial ATA Controller 4370 IXP SB400 AC'97 Audio Controller 1025 0079 Aspire 5024WLMMi 1025 0091 Aspire 5032WXMi @@ -1021,6 +1063,7 @@ 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 1043 84dd M5A99X EVO (R1.0) SB950 105b 0e13 N15235/A74MX mainboard / AMD SB700 174b 1001 PURE Fusion Mini 4392 SB7x0/SB8x0/SB9x0 SATA Controller [Non-RAID5 mode] @@ -1056,6 +1099,7 @@ 105b 0e13 N15235/A74MX mainboard / AMD SB700 174b 1001 PURE Fusion Mini 439c SB7x0/SB8x0/SB9x0 IDE Controller + 1002 4392 MSI MS-7713 motherboard 1019 2120 A785GM-M 1043 82ef M3A78-EH Motherboard 105b 0e13 N15235/A74MX mainboard / AMD SB700 @@ -1072,6 +1116,8 @@ 43a3 SB900 PCI to PCI bridge (PCIE port 3) 4437 RS250 [Mobility Radeon 7000 IGP] 4554 210888ET [Mach64 ET] + 4630 XENOS Parent Die (XBOX 360) + 4631 XENOS Daughter Die (XBOX 360) 4654 Mach64 VT 4742 Rage 3 [3D Rage PRO AGP 2X] 1002 0040 Rage Pro Turbo AGP 2X @@ -1152,6 +1198,22 @@ 1002 0084 Rage 3D Pro AGP 2x XPERT 98 1002 0087 Rage 3D IIC 1002 475a Rage IIC AGP + 4845 Xilleon 220 HBIU for HDTV2 + 4846 Xilleon 220 IDE for HDTV2 + 4847 Xilleon 220 USB for HDTV2 + 4848 Xilleon 220 DAIO-0 for HDTV2 + 4849 Xilleon 220 DAIO-1 for HDTV2 + 484a Xilleon 220 LPC for HDTV2 + 4850 Xilleon 215 HBIU for X215 + 4851 Xilleon 215 IDE for X215 + 4852 Xilleon 215 USB for X215 + 4853 Xilleon 215 DAIO-0 for X215 + 4854 Xilleon 215 DAIO-1 for X215 + 4855 Xilleon 225 HBIU for X225 + 4856 Xilleon 225 IDE for X225 + 4857 Xilleon 225 USB for X225 + 4858 Xilleon 225 DAIO-0 for X225 + 4859 Xilleon 225 DAIO-1 for X225 4966 RV250 [Radeon 9000 Series] 10f1 0002 RV250 If [Tachyon G9000 PRO] 148c 2039 RV250 If [Radeon 9000 Pro "Evil Commando"] @@ -1668,7 +1730,8 @@ 106b 014b Tropo XT [Radeon R9 M380 Mac Edition] 6641 Saturn PRO [Radeon HD 8930M] 6646 Bonaire XT [Radeon R9 M280X] - 6647 Bonaire PRO [Radeon R9 M270X] + 6647 Saturn PRO/XT [Radeon R9 M270X/M280X] + 1043 223d N551ZU laptop Radeon R9 M280X 6649 Bonaire [FirePro W5100] 1002 0b0c FirePro W4300 103c 0b0c Bonaire [FirePro W4300] @@ -1677,6 +1740,7 @@ 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] + 1043 04d3 AMD Radeon R7 260X 148c 0907 Radeon R7 360 1682 0907 Radeon R7 360 1682 7360 Radeon R7 360 @@ -1702,7 +1766,7 @@ 1462 2938 Radeon R9 360 OEM 1462 3271 Radeon R9 360 OEM 1682 7360 Radeon R7 360 - 6660 Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520] + 6660 Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile] 1028 05ea Radeon HD 8670M 1028 06bf Radeon R5 M335 103c 1970 Radeon HD 8670M @@ -1718,7 +1782,8 @@ 1025 0846 Radeon HD 8570A 17aa 3805 Radeon HD 8570M 6664 Jet XT [Radeon R5 M240] - 6665 Jet PRO [Radeon R5 M230] + 6665 Jet PRO [Radeon R5 M230 / R7 M260DX / Radeon 520 Mobile] + 17aa 1309 Radeon R7 M260DX 17aa 368f Radeon R5 A230 6667 Jet ULT [Radeon R5 M230] 666f Sun LE [Radeon HD 8550M / R5 M230] @@ -1727,7 +1792,7 @@ 66a2 Vega 20 66a3 Vega 20 66a7 Vega 20 [Radeon Pro Vega 20] - 66af Vega 20 + 66af Vega 20 [Radeon VII] 6704 Cayman PRO GL [FirePro V7900] 6707 Cayman LE GL [FirePro V5900] 6718 Cayman XT [Radeon HD 6970] @@ -2182,6 +2247,7 @@ 1028 2120 Radeon HD 6450 103c 2128 Radeon HD 6450 103c 2aee Radeon HD 7450A + 1092 6450 Radeon HD 6450 1462 2125 Radeon HD 6450 1462 2346 Radeon HD 7450 1462 2490 Radeon HD 6450 @@ -2328,7 +2394,7 @@ 67cc Ellesmere [Polaris10] 67cf Ellesmere [Polaris10] 67d0 Ellesmere [Radeon Pro V7300X / V7350x2] - 67df Ellesmere [Radeon RX 470/480/570/570X/580/580X] + 67df Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] 1002 0b37 Radeon RX 480 1028 1722 Radeon RX 570X 1028 1723 Radeon RX 580X @@ -2336,13 +2402,14 @@ 1043 04b0 Radeon RX 470 1043 04fb Radeon RX 480 1043 04fd Radeon RX 480 8GB + 1043 056a Radeon RX 590 106b 0161 Radeon Pro 580 106b 0162 Radeon Pro 575 106b 0163 Radeon Pro 570 1458 22f0 Radeon RX 570 1458 22f7 Radeon RX 570 Gaming 4G 1462 3411 Radeon RX 470 - 1462 3413 Radeon RX 480 + 1462 3413 Radeon RX 480 Gaming X 8GB 1462 3416 Radeon RX 570 1462 3418 Radeon RX 580 Armor 4G OC 148c 2372 Radeon RX 480 @@ -2355,8 +2422,8 @@ 1787 a470 Radeon RX 470 1787 a480 Radeon RX 480 1849 5001 Phantom Gaming X RX 580 OC - 1da2 e353 Sapphire Radeon RX 580 Pulse 8GB - 1da2 e366 Nitro+ Radeon RX 580 4GB + 1da2 e353 Radeon RX 570 Pulse 4GB + 1da2 e366 Nitro+ Radeon RX 570/580 67e0 Baffin [Radeon Pro WX 4170] 103c 8270 Radeon Pro WX 4170 103c 8272 Radeon Pro WX 4170 @@ -2466,8 +2533,9 @@ 15c3 2b1e MED-X6000 6829 Cape Verde 682a Venus PRO - 682b Venus LE / Tropo PRO-L [Radeon HD 8830M / R7 M465X] + 682b Cape Verde PRO / Venus LE / Tropo PRO-L [Radeon HD 8830M / R7 250 / R7 M465X] 0128 079c Radeon R7 465X + 1462 3012 Radeon R7 250 682c Cape Verde GL [FirePro W4100] 682d Chelsea XT GL [FirePro M4000] 682f Chelsea LP [Radeon HD 7730M] @@ -2608,9 +2676,9 @@ 6863 Vega 10 XTX [Radeon Vega Frontier Edition] 6864 Vega 6867 Vega 10 XL [Radeon Pro Vega 56] - 6868 Vega 10 [Radeon PRO WX 8100] + 6868 Vega 10 [Radeon PRO WX 8100/8200] 686c Vega 10 [Radeon Instinct MI25 MxGPU] - 687f Vega 10 XT [Radeon RX Vega 64] + 687f Vega 10 XL/XT [Radeon RX Vega 56/64] 6880 Lexington [Radeon HD 6550M] 103c 163c Pavilion dv6 Radeon HD 6550M 6888 Cypress XT [FirePro V8800] @@ -3126,8 +3194,9 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 - 694c Polaris 22 [Radeon RX Vega M GH] + 694c Polaris 22 XT [Radeon RX Vega M GH] 694e Polaris 22 XL [Radeon RX Vega M GL] + 694f Polaris 22 MGL XL [Radeon Pro WX Vega M GL] 6980 Polaris12 6981 Polaris12 6985 Lexa XT [Radeon PRO WX 3100] @@ -3142,7 +3211,8 @@ 69a1 Vega 12 69a2 Vega 12 69a3 Vega 12 - 69af Vega 12 + 69af Vega 12 [Radeon Pro Vega 20] + 6fdf Polaris 20 XL [Radeon RX 580 2048SP] 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -3285,6 +3355,8 @@ 1043 049e Radeon R9 FURY 1043 04a0 Radeon R9 FURY X 174b e329 Radeon R9 FURY + 7310 Navi 10 + 731f Navi 10 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -3577,6 +3649,8 @@ 17aa 5113 Radeon R6 Graphics 17aa 5116 Radeon R6 Graphics 17aa 5118 Radeon R5 Graphics + 9890 Amur + 98c0 Nolan 98e4 Stoney [Radeon R2/R3/R4/R5 Graphics] 9900 Trinity [Radeon HD 7660G] 103c 1985 Pavilion 17-e163sg Notebook PC @@ -3605,13 +3679,18 @@ 9917 Trinity [Radeon HD 7620G] 9918 Trinity [Radeon HD 7600G] 9919 Trinity [Radeon HD 7500G] + 991e Bishop 9920 Liverpool [Playstation 4 APU] 9921 Liverpool HDMI/DP Audio Controller - 9990 Trinity [Radeon HD 7520G] - 9991 Trinity [Radeon HD 7540D] - 9992 Trinity [Radeon HD 7420G] - 9993 Trinity [Radeon HD 7480D] - 9994 Trinity [Radeon HD 7400G] + 9922 Starship + 9923 Starsha2 [Kingston/Clayton] + 9924 Gladius + 9926 Jupiter + 9990 Trinity 2 [Radeon HD 7520G] + 9991 Trinity 2 [Radeon HD 7540D] + 9992 Trinity 2 [Radeon HD 7420G] + 9993 Trinity 2 [Radeon HD 7480D] + 9994 Trinity 2 [Radeon HD 7400G] 9995 Richland [Radeon HD 8450G] 9996 Richland [Radeon HD 8470D] 9997 Richland [Radeon HD 8350G] @@ -3622,9 +3701,9 @@ 999c Richland # AMD Quad-Core A8-Series APU A8-6500T with Radeon HD 8550D 999d Richland [Radeon HD 8550D] - 99a0 Trinity [Radeon HD 7520G] - 99a2 Trinity [Radeon HD 7420G] - 99a4 Trinity [Radeon HD 7400G] + 99a0 Trinity 2 [Radeon HD 7520G] + 99a2 Trinity 2 [Radeon HD 7420G] + 99a4 Trinity 2 [Radeon HD 7400G] aa00 R600 HDMI Audio [Radeon HD 2900 GT/PRO/XT] aa01 RV635 HDMI Audio [Radeon HD 3650/3730/3750] aa08 RV630 HDMI Audio [Radeon HD 2600 PRO/XT / HD 3610] @@ -3656,13 +3735,34 @@ aab0 Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series] aac0 Tobago HDMI Audio [Radeon R7 360 / R9 360 OEM] aac8 Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X] -# I have a Tonga card and this is the HDMI Audio part aad8 Tonga HDMI Audio [Radeon R9 285/380] 174b aad8 Radeon R9 285/380 HDMI Audio + aae0 Baffin HDMI/DP Audio [Radeon RX 550 640SP / RX 560/560X] aae8 Fiji HDMI/DP Audio [Radeon R9 Nano / FURY/FURY X] - aaf0 Ellesmere [Radeon RX 580] - ac00 Theater 600 Pro + aaf0 Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] + aaf8 Vega 10 HDMI Audio [Radeon Vega 56/64] + ab00 Baffin HDMI/DP Audio [Radeon RX 550 640SP / RX 560/560X] + ab08 Polaris 22 HDMI Audio + ab10 Lexa HDMI Audio + ab18 Vega 12 HDMI Audio + ab20 Vega 20 HDMI Audio [Radeon VII] + ab38 Navi 10 HDMI Audio + ac00 Theater 506 World-Wide Analog Decoder + ac01 Theater 506 World-Wide Analog Decoder ac02 TV Wonder HD 600 PCIe + ac03 Theater 506 PCIe + ac04 Theater 506 USB + ac05 Theater 506 USB + ac06 Theater 506 External USB + ac07 Theater 506 External USB + ac08 Theater 506A World-Wide Analog Decoder + Demodulator + ac09 Theater 506A World-Wide Analog Decoder + Demodulator + ac0a Theater 506A PCIe + ac0b Theater 506A PCIe + ac0c Theater 506A USB + ac0d Theater 506A USB + ac0e Theater 506A External USB + ac0f Theater 506A External USB ac12 Theater HD T507 (DVB-T) TV tuner/capture device cab0 RS100 Host Bridge cab2 RS200 Host Bridge @@ -4082,6 +4182,7 @@ 03dc POWER8 Host Bridge (PHB3) 044b GenWQE Accelerator Adapter 04aa Flash Adapter 90 (PCIe2 0.9TB) + 04c1 POWER9 Host Bridge (PHB4) 04da PCI-E IPR SAS+ Adapter (ASIC) 1014 04fb PCIe3 x16 20GB Cache 12Gb Quad SAS RAID+ Adapter(580B) 1014 04fc PCIe3 x8 12Gb Quad SAS RAID+ Adapter(580A) @@ -4212,7 +4313,7 @@ 1439 Family 16h Processor Functions 5:1 1450 Family 17h (Models 00h-0fh) Root Complex 1451 Family 17h (Models 00h-0fh) I/O Memory Management Unit - 1452 Family 17h (Models 00h-0fh) PCIe Dummy Host Bridge + 1452 Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge 1453 Family 17h (Models 00h-0fh) PCIe GPP Bridge 1454 Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B 1456 Family 17h (Models 00h-0fh) Platform Security Processor @@ -4243,6 +4344,8 @@ 1535 Family 16h Processor Function 5 1536 Family 16h Processor Root Complex 1538 Family 16h Processor Function 0 + 1566 Family 16h (Models 30h-3fh) Processor Root Complex + 156b Family 16h (Models 30h-3fh) Host Bridge 1570 Family 15h (Models 60h-6fh) Processor Function 0 1571 Family 15h (Models 60h-6fh) Processor Function 1 1572 Family 15h (Models 60h-6fh) Processor Function 2 @@ -4254,6 +4357,14 @@ 157a Family 15h (Models 60h-6fh) Audio Controller 157b Family 15h (Models 60h-6fh) Host Bridge 157c Family 15h (Models 60h-6fh) Processor Root Port + 1580 Family 16h (Models 30h-3fh) Processor Function 0 + 1581 Family 16h (Models 30h-3fh) Processor Function 1 + 1582 Family 16h (Models 30h-3fh) Processor Function 2 + 1583 Family 16h (Models 30h-3fh) Processor Function 3 + 1584 Family 16h (Models 30h-3fh) Processor Function 4 + 1585 Family 16h (Models 30h-3fh) Processor Function 5 + 15df Family 17h (Models 10h-1fh) Platform Security Processor + 15e3 Family 17h (Models 10h-1fh) HD Audio Controller 1600 Family 15h Processor Function 0 1601 Family 15h Processor Function 1 1602 Family 15h Processor Function 2 @@ -4323,12 +4434,22 @@ 43a1 Hudson PCI to PCI bridge (PCIE port 1) 43a2 Hudson PCI to PCI bridge (PCIE port 2) 43a3 Hudson PCI to PCI bridge (PCIE port 3) + 43b0 X370 Series Chipset PCIe Upstream Port + 1849 43c6 Fatal1ty X370 Professional Gaming 43b1 X399 Series Chipset PCIe Bridge 43b4 300 Series Chipset PCIe Port + 43b5 X370 Series Chipset SATA Controller + 1849 43c8 Fatal1ty X370 Professional Gaming 43b6 X399 Series Chipset SATA Controller 43b7 300 Series Chipset SATA Controller + 43b9 X370 Series Chipset USB 3.1 xHCI Controller + 1849 43d0 Fatal1ty X370 Professional Gaming 43ba X399 Series Chipset USB 3.1 xHCI Controller 43bb 300 Series Chipset USB 3.1 xHCI Controller + 43c6 400 Series Chipset PCIe Bridge + 43c7 400 Series Chipset PCIe Port + 43c8 400 Series Chipset SATA Controller + 43d5 400 Series Chipset USB 3.1 XHCI Controller 7006 AMD-751 [Irongate] System Controller 7007 AMD-751 [Irongate] AGP Bridge 700a AMD-IGR4 AGP Host to PCI Bridge @@ -4778,11 +4899,14 @@ 1028 028d PowerEdge T410 MGA G200eW WPCM450 1028 029c PowerEdge M710 MGA G200eW WPCM450 1028 02a4 PowerEdge T310 MGA G200eW WPCM450 + 15d9 0605 X8SIL 15d9 0624 X9SCM-F Motherboard + 15d9 066b X9SRL-F 15d9 a811 H8DGU 0533 MGA G200EH 103c 3381 iLO4 0534 G200eR2 + 1028 04f7 PowerEdge R320 server 0536 Integrated Matrox G200eW3 Graphics Controller 0538 MGA G200eH3 1590 00e4 iLO5 VGA @@ -5290,6 +5414,7 @@ 122e PCI-X Local Bus Adapter 127b sx1000 System Bus Adapter 127c sx1000 I/O Controller + 128d Diva [GSP] Management Board 1290 Auxiliary Diva Serial Port 103c 1291 Diva SP2 1291 Auxiliary Diva Serial Port @@ -5819,10 +5944,19 @@ 104d Sony Corporation 8004 DTL-H2500 [Playstation development board] 8009 CXD1947Q i.LINK Controller + 800c DTL-H800 [PS1 sound development board] 8039 CXD3222 i.LINK Controller + 8047 PS2 TOOL MRP 8056 Rockwell HCF 56K modem 808a Memory Stick Controller + 80ff PS2 Performance Analyzer + 814a PS2 Performance Analyzer + 8183 ATHENS [PS3 prototype developer interface card] + 81b0 BM-1 [PSP TOOL Board Management Device] + 81c3 VO-4 [PSP TOOL Video Output Device] 81ce SxS Pro memory card + 81ff PS3 TOOL MRP + 820e CXD9208GP [PS3 PS2 emulation subsystem adapter] # 2nd ID 905c SxS Pro memory card # 2nd ID @@ -6258,6 +6392,8 @@ 0074 U4 HT Bridge # should be 14e4:1645 1645 Broadcom NetXtreme BCM5701 Gigabit Ethernet + 1801 T2 Bridge Controller + 1802 T2 Secure Enclave Processor 2001 S1X NVMe Controller 2002 S3ELab NVMe Controller 2003 S3X NVMe Controller @@ -6373,6 +6509,8 @@ 1077 02a8 QLE2692 Dual Port 16Gb FC to PCIe Gen3 x8 Adapter 1077 02ab QLE2740 Single Port 32Gb FC to PCIe Gen3 x8 Adapter 1077 02ac QLE2742 Dual Port 32Gb FC to PCIe Gen3 x8 Adapter + 1077 02b8 2x16Gb QME2692 FC HBA + 1077 02b9 2x32Gb QME2742 FC HBA 1590 00f9 StoreFabric SN1100Q 16Gb Single Port Fibre Channel Host Bus Adapter 1590 00fa StoreFabric SN1100Q 16Gb Dual Port Fibre Channel Host Bus Adapter 1590 0203 StoreFabric SN1600Q 32Gb Single Port Fibre Channel Host Bus Adapter @@ -6442,10 +6580,14 @@ 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA 1077 0009 QLogic 2x1GE+2x10GE QL41162HMRJ CNA 1077 000b 25GE 2P QL41262HxCU-DE Adapter + 1077 000f 2x25GE QL41262HMKR CNA + 1077 0010 2x25GE QL41232HMKR NIC 1077 0011 FastLinQ QL41212HLCU 25GbE Adapter 1077 0012 FastLinQ QL41112H 10GbE Adapter 1077 0019 QL41232HOCU - Dual Port 25/10GbE SFP28 OCP Adapter 1077 0039 QLogic QL41262 PCIe 25Gb 2-Port SFP28 Ethernet Adapter + 1590 021a 10GbE 2P QL41162HLRJ-HP Adapter + 1590 021b 10GbE 2P QL41162HLRJ-HP Adapter 1590 021d 10/25GbE 2P QL41222HLCU-HP Adapter 1590 021e 10/25GbE 2P QL41162HMRJ-HP Adapter 1590 021f 10/25GbE 2P QL41262HMCU-HP Adapter @@ -6462,6 +6604,9 @@ 1077 000c QLogic 2x25GE QL41262HMCU CNA 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter 1077 000e FastLinQ QL41162H 10GbE FCoE Adapter + 1077 000f 2x25GE QL41262HMKR CNA + 1590 021a 10GbE 2P QL41162HLRJ-HP Adapter + 1590 021b 10GbE 2P QL41162HLRJ-HP Adapter 8084 FastLinQ QL41000 Series 10/25/40/50GbE Controller (iSCSI) 1077 0001 10GE 2P QL41162HxRJ-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter @@ -6475,6 +6620,9 @@ 1077 000c QLogic 2x25GE QL41262HMCU CNA 1077 000d FastLinQ QL41262H 25GbE iSCSI Adapter 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter + 1077 000f 2x25GE QL41262HMKR CNA + 1590 021a 10GbE 2P QL41162HLRJ-HP Adapter + 1590 021b 10GbE 2P QL41162HLRJ-HP Adapter 8090 FastLinQ QL41000 Series Gigabit Ethernet Controller (SR-IOV VF) 1077 0001 25GE 2P QL41262HxCU-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter @@ -6488,8 +6636,12 @@ 1077 000c QLogic 2x25GE QL41262HMCU CNA 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter (SR-IOV VF) 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF) + 1077 000f 2x25GE QL41262HMKR CNA + 1077 0010 2x25GE QL41232HMKR NIC 1077 0011 FastLinQ QL41212H 25GbE Adapter (SR-IOV VF) 1077 0012 FastLinQ QL41112H 10GbE Adapter (SR-IOV VF) + 1590 021a 10GbE 2P QL41162HLRJ-HP Adapter + 1590 021b 10GbE 2P QL41162HLRJ-HP Adapter 1590 021e 10/25GbE 2P QL41162HMRJ-HP Adapter 1590 021f 10/25GbE 2P QL41262HMCU-HP Adapter 8430 ISP8324 1/10GbE Converged Network Controller (NIC VF) @@ -7492,6 +7644,7 @@ 036c Bt879(??) Video Capture 13e9 0070 Win/TV (Video Section) 036e Bt878 Video Capture + 0000 0001 Euresys Picolo PCIe 0070 13eb WinTV Series 0070 ff01 Viewcast Osprey 200 0071 0101 DigiTV PCI @@ -7586,6 +7739,7 @@ 1851 1851 FlyVideo'98 EZ - video 1852 1852 FlyVideo'98 (with FM Tuner) 0878 Bt878 Audio Capture + 0000 0001 Euresys Picolo PCIe 0070 13eb WinTV Series 0070 ff01 Viewcast Osprey 200 0071 0101 DigiTV PCI @@ -8921,7 +9075,6 @@ 018b NV18GL [Quadro4 380 XGL] 018c NV18GL [Quadro NVS 50 PCI] 018d NV18M [GeForce4 448 Go] - 018f NV18 0190 G80 [GeForce 8800 GTS / 8800 GTX] 0191 G80 [GeForce 8800 GTX] 0192 G80 [GeForce 8800 GTS] @@ -9464,6 +9617,7 @@ 040f G84GL [Quadro FX 1700] 0410 G92 [GeForce GT 330] 0414 G92 [GeForce 9800 GT] + 0418 G92 [GeForce GT 330 OEM] 0420 G86 [GeForce 8400 SE] 0421 G86 [GeForce 8500 GT] 1462 0960 NX8500GT-TD512EH/M2 @@ -10324,10 +10478,12 @@ 0f00 GF108 [GeForce GT 630] 0f01 GF108 [GeForce GT 620] 0f02 GF108 [GeForce GT 730] + 0f03 GF108 [GeForce GT 610] 0f06 GF108 [GeForce GT 730] 0fb0 GM200 High Definition Audio 0fb8 GP108 High Definition Audio Controller 0fb9 GP107GL High Definition Audio Controller + 0fba GM206 High Definition Audio Controller 0fbb GM204 High Definition Audio Controller 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] @@ -10509,6 +10665,9 @@ 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller 10f1 GP106 High Definition Audio Controller + 10f7 TU102 High Definition Audio Controller + 10f9 TU106 High Definition Audio Controller + 1043 8673 TURBO-RTX2070-8G 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M 1019 999f GeForce GT 720M @@ -11047,6 +11206,7 @@ 1392 GM107M [GeForce GTX 860M] 1393 GM107M [GeForce 840M] 1398 GM107M [GeForce 845M] + 1399 GM107M [GeForce 945M] 139a GM107M [GeForce GTX 950M] 17aa 362c GeForce GTX 950A 17aa 362f GeForce GTX 950A @@ -11121,13 +11281,20 @@ 174d GM108M [GeForce MX130] 174e GM108M [GeForce MX110] 1789 GM107GL [GRID M3-3020] + 179c GM107 [GeForce 940MX] 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] 17f1 GM200GL [Quadro M6000 24GB] 17fd GM200GL [Tesla M40] + 1ad6 TU102 USB 3.1 Controller + 1ad7 TU102 UCSI Controller + 1ada TU106 USB 3.1 Host Controller + 1043 8673 TURBO-RTX2070-8G + 1adb TU106 USB Type-C Port Policy Controller + 1043 8673 TURBO-RTX2070-8G 1b00 GP102 [TITAN X] - 1b01 GP102 + 1b01 GP102 [GeForce GTX 1080 Ti 10GB] 1b02 GP102 [TITAN Xp] 1b04 GP102 1b06 GP102 [GeForce GTX 1080 Ti] @@ -11149,18 +11316,23 @@ 1462 11e9 GeForce GTX 1070 Max-Q 1558 9501 GeForce GTX 1070 Max-Q 1ba2 GP104M [GeForce GTX 1070 Mobile] + 1ba9 GP104M + 1baa GP104M 1bad GP104 [GeForce GTX 1070 Engineering Sample] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL [Quadro P4000] 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL [Tesla P6] 1bb5 GP104GLM [Quadro P5200 Mobile] + 103c 842f P5200 [Zbook 17 G5 mobile workstation] 1bb6 GP104GLM [Quadro P5000 Mobile] 1bb7 GP104GLM [Quadro P4000 Mobile] 1462 11e9 Quadro P4000 Max-Q 1bb8 GP104GLM [Quadro P3000 Mobile] 1bb9 GP104GLM [Quadro P4200 Mobile] + 103c 842f P4200 [Zbook 17 G5 mobile workstation] 1bbb GP104GLM [Quadro P3200 Mobile] + 103c 842f P3200 [Zbook 17 G5 moble workstation] 1bc7 GP104 [P104-101] 1be0 GP104BM [GeForce GTX 1080 Mobile] 1028 07c0 GeForce GTX 1080 Max-Q @@ -11178,6 +11350,9 @@ 17aa 39b9 GeForce GTX 1060 Max-Q 3GB 1c21 GP106M [GeForce GTX 1050 Ti Mobile] 1c22 GP106M [GeForce GTX 1050 Mobile] + 1c23 GP106M [GeForce GTX 1060 Mobile Rev. 2] + 1414 0020 GTX 1060 Mobile + 1c2d GP106M 1c30 GP106GL [Quadro P2000] 1c35 GP106 1c60 GP106BM [GeForce GTX 1060 Mobile 6GB] @@ -11201,17 +11376,28 @@ 1cb3 GP107GL [Quadro P400] 1cb6 GP107GL [Quadro P620] 1cba GP107GLM [Quadro P2000 Mobile] + 103c 842c P2000 [Zbook 15 G5 mobile workstation] + 103c 842f P2000 [Zbook 17 G5 mobile workstation] 1cbb GP107GLM [Quadro P1000 Mobile] + 103c 8429 P1000 [Zbook Studio G5 mobile workstation] + 103c 842c P1000 [Zbook 15 G5 mobile workstation] + 103c 842f P1000 [Zbook 17 G5 mobile workstation] + 103c 8451 P1000 [Zbook Studio x360 G5 mobile workstation] 1cbc GP107GLM [Quadro P600 Mobile] 1ccc GP107BM [GeForce GTX 1050 Ti Mobile] 1ccd GP107BM [GeForce GTX 1050 Mobile] 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] + 17aa 225e ThinkPad T480 + 1d11 GP108M [GeForce MX230] 1d12 GP108M [GeForce MX150] 1d72 1701 Mi Notebook Pro [GeForce MX150] + 1d13 GP108M [GeForce MX250] 1d33 GP108GLM [Quadro P500 Mobile] + 1d52 GP108BM [GeForce MX250] 1d81 GV100 [TITAN V] 1db1 GV100GL [Tesla V100 SXM2 16GB] + 1db2 GV100 [Tesla V100-DGXS-16GB] 1db3 GV100GL [Tesla V100 FHHL 16GB] 1db4 GV100GL [Tesla V100 PCIe 16GB] 1db5 GV100GL [Tesla V100 SXM2 32GB] @@ -11219,11 +11405,41 @@ 1db7 GV100GL [Tesla V100 DGXS 32GB] 1dba GV100GL [Quadro GV100] 10de 12eb TITAN V CEO Edition - 1e07 GV102 - 1e3c GV102GL - 1e82 GV104 - 1e87 GV104 - 1eab GV104M + 1e02 TU102 [TITAN RTX] + 1e04 TU102 [GeForce RTX 2080 Ti] + 1e07 TU102 [GeForce RTX 2080 Ti Rev. A] + 1462 3715 RTX 2080 Ti GAMING X TRIO + 1e2d TU102B + 1e2e TU102B + 1e30 TU102GL [Quadro RTX 6000/8000] + 10de 129e Quadro RTX 8000 + 10de 12ba Quadro RTX 6000 + 1e38 TU102GL + 1e3c TU102GL + 1e3d TU102GL + 1e3e TU102GL + 1e82 TU104 [GeForce RTX 2080] + 1e87 TU104 [GeForce RTX 2080 Rev. A] + 1e90 TU104M [GeForce RTX 2080 Mobile] + 1eab TU104M + 1eae TU104M + 1eb0 TU104GL [Quadro RTX 5000] + 1eb1 TU104GL [Quadro RTX 4000] + 1eb8 TU104GL [Tesla T4] + 1ed0 TU104M [GeForce RTX 2080 Mobile] + 1f02 TU106 [GeForce RTX 2070] + 1043 8673 TURBO RTX 2070 + 1f04 TU106 + 1f07 TU106 [GeForce RTX 2070 Rev. A] + 1f08 TU106 [GeForce RTX 2060 Rev. A] + 1f10 TU106M [GeForce RTX 2070 Mobile] + 1f11 TU106M [GeForce RTX 2060 Mobile] + 1f2e TU106M + 1f50 TU106M [GeForce RTX 2070 Mobile] + 1f51 TU106M [GeForce RTX 2060 Mobile] + 1f82 TU107 + 1f92 TU107M + 1fbf TU107GL 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -11264,6 +11480,7 @@ 10df e322 Lancer Gen6: LPe31000 Fibre Channel Host Adapter 10df e323 Lancer Gen6: LPe31000 Fibre Channel Host Adapter 10df e325 Lancer Gen6: LPe31000 Fibre Channel Host Adapter + e333 Lancer Gen6: LPe32000 Fibre Channel Host Adapter f011 Saturn: LightPulse Fibre Channel Host Adapter f015 Saturn: LightPulse Fibre Channel Host Adapter f085 LP850 Fibre Channel Host Adapter @@ -11410,6 +11627,7 @@ 524a RTS524A PCI Express Card Reader 5250 RTS5250 PCI Express Card Reader 525a RTS525A PCI Express Card Reader + 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 17aa 224f ThinkPad X1 Carbon 5th Gen 5286 RTS5286 PCI Express Card Reader @@ -11570,6 +11788,7 @@ 10ec 8739 Dell Wireless 1801 b822 RTL8822BE 802.11a/b/g/n/ac WiFi adapter c821 RTL8821CE 802.11ac PCIe Wireless Network Adapter + d723 RTL8723DE 802.11b/g/n PCIe Adapter 10ed Ascii Corporation 7310 V7310 10ee Xilinx Corporation @@ -11599,6 +11818,7 @@ ebf0 SED Systems Modulator/Demodulator ebf1 SED Systems Audio Interface Card ebf2 SED Systems Common PCI Interface + ebf3 SED Systems PCIe-AXI Bridge 10ef Racore Computer Products, Inc. 8154 M815x Token Ring Adapter 10f0 Peritek Corporation @@ -13089,6 +13309,15 @@ 1137 012e VIC 1227 PCIe Ethernet NIC 1137 0137 VIC 1380 Mezzanine Ethernet NIC 1137 014d VIC 1385 PCIe Ethernet NIC + 1137 015d VIC 1387 MLOM Ethernet NIC + 1137 0215 VIC 1440 Mezzanine Ethernet NIC + 1137 0216 VIC 1480 MLOM Ethernet NIC + 1137 0217 VIC 1455 PCIe Ethernet NIC + 1137 0218 VIC 1457 MLOM Ethernet NIC + 1137 0219 VIC 1485 PCIe Ethernet NIC + 1137 021a VIC 1487 MLOM Ethernet NIC + 1137 024a VIC 1495 PCIe Ethernet NIC + 1137 024b VIC 1497 MLOM Ethernet NIC 0044 VIC Ethernet NIC Dynamic 1137 0047 VIC P81E PCIe Ethernet NIC Dynamic 1137 0048 VIC M81KR Mezzanine Ethernet NIC Dynamic @@ -13134,6 +13363,7 @@ 1137 012c VIC 1340 MLOM Userspace NIC 1137 012e VIC 1227 PCIe Userspace NIC 1137 0137 VIC 1380 Mezzanine Userspace NIC + 023e 1GigE I350 LOM 1138 Ziatech Corporation 8905 8905 [STD 32 Bridge] 1139 Dynamic Pictures, Inc @@ -13509,6 +13739,13 @@ 0102 Extended IDE Controller 0103 EX-IDE Type-B 010f NVMe Controller + 0110 NVMe SSD Controller Cx5 + 1028 1ffb Express Flash NVMe 960G (RI) U.2 (CD5) + 1028 1ffc Express Flash NVMe 1.92T (RI) U.2 (CD5) + 1028 1ffd Express Flash NVMe 3.84T (RI) U.2 (CD5) + 1028 1ffe Express Flash NVMe 7.68T (RI) U.2 (CD5) + 1d49 4039 Thinksystem U.2 CM5 NVMe SSD + 1d49 403a Thinksystem AIC CM5 NVMe SSD 0115 XG4 NVMe SSD Controller 0404 DVD Decoder card 0406 Tecra Video Capture device @@ -13611,7 +13848,7 @@ 14ef 0220 PCD-RP-220S 17aa 201c ThinkPad X60/X60s 17aa 20c4 ThinkPad T61/R61 - 17aa 20c6 ThinkPad R61 + 17aa 20c6 ThinkPad R61/T400 0477 RL5c477 0478 RL5c478 1014 0184 ThinkPad A30p @@ -13646,7 +13883,7 @@ 1043 1237 A6J-Q008 1043 1967 V6800V 144d c018 X20 IV - 17aa 20ca ThinkPad T61 + 17aa 20ca ThinkPad T61/T400 0811 R5C811 0822 R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter 1014 0556 ThinkPad X40 / X41 / X60s / Z60t @@ -13668,7 +13905,7 @@ 144d c018 X20 IV 17aa 201d ThinkPad X60/X60s 17aa 20c7 ThinkPad T61 - 17aa 20c8 ThinkPad W500 + 17aa 20c8 ThinkPad T400/W500 0832 R5C832 IEEE 1394 Controller 1025 0121 Aspire 5920G 1028 01d7 XPS M1210 @@ -13705,6 +13942,7 @@ 1043 1967 V6800V 1180 0852 Pavilion 2410us 1324 10cf P7120 + 17aa 20cb ThinkPad T400 e230 R5U2xx (R5U230 / R5U231 / R5U241) [Memory Stick Host Controller] e476 CardBus bridge 1028 040a Latitude E6410 @@ -13712,6 +13950,7 @@ e822 MMC/SD Host Controller 1028 040a Latitude E6410 1028 040b Latitude E6510 + 17aa 21cf ThinkPad T520 e823 PCIe SDXC/MMC Host Controller 17aa 21cf ThinkPad T520 e832 R5C832 PCIe IEEE 1394 Controller @@ -14376,6 +14615,7 @@ 7384 PM7384 [FREEDM - 84P672 Frm Engine & Datalink Mgr] 8000 PM8000 [SPC - SAS Protocol Controller] 8009 PM8009 SPCve 8x6G + 8018 PM8018 Adaptec SAS Adaptor ASA-70165H PCIe Gen3 x8 6 Gbps 16-lane 4x SFF-8644 8032 PM8032 Tachyon QE8 117c 003a Celerity FC-81EN Fibre Channel Adapter 117c 003b Celerity FC-82EN Fibre Channel Adapter @@ -16194,6 +16434,7 @@ 1043 8428 Virtuoso 100 (Xonar Xense) 1043 8467 CMI8786 (Xonar DG) 1043 8521 CMI8786 (Xonar DGX) + 1043 8522 Xonar DSX 1043 85f4 Virtuoso 100 (Xonar Essence STX II) 13f6 8782 PCI 2.0 HD Audio 13f6 ffff CMI8787-HG2PCI @@ -16225,15 +16466,19 @@ 1612 0004 PCI-1612 4-port RS-232/422/485 1603 PCI-1603 2-port isolated RS-232/current loop 1604 PCI-1604 2-port RS-232 + 1680 PCI-1680 Rev.A1 2-port CAN-bus with isolation protection 16ff PCI-16xx series PCI multiport serial board (function 1: RX/TX steering CPLD) 1601 0000 PCI-1601 2-port unisolated RS-422/485 PCI communications card 1602 0000 PCI-1602 2-port isolated RS-422/485 1612 0000 PCI-1612 4-port RS-232/422/485 1711 PCI-1711 16-channel data acquisition card 12-bit, 100kS/s + 1713 PCI-1713 32-channel isolated analog input card 1733 PCI-1733 32-channel isolated digital input card - 1752 PCI-1752 - 1754 PCI-1754 - 1756 PCI-1756 + 1734 PCI-1734 32-channel isolated digital output card + 1752 PCI-1752 64-channel Isolated Digital Output Card + 1754 PCI-1754 64-channel Isolated Digital Input Card + 1756 PCI-1756 64-ch Isolated Digital I/O PCI Card + a004 PCI-1612 4-port RS-232/422/485 # FPGA bridge to two SJA1000 c302 MIOe-3680 2-Port CAN-Bus MIOe Module with Isolation Protection *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 29 10:21:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D398414B5F6D; Tue, 29 Jan 2019 10:21:42 +0000 (UTC) (envelope-from marck@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 732C176F8E; Tue, 29 Jan 2019 10:21:42 +0000 (UTC) (envelope-from marck@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 63B7A6329; Tue, 29 Jan 2019 10:21:42 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0TALgPh075993; Tue, 29 Jan 2019 10:21:42 GMT (envelope-from marck@FreeBSD.org) Received: (from marck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TALf5d075989; Tue, 29 Jan 2019 10:21:41 GMT (envelope-from marck@FreeBSD.org) Message-Id: <201901291021.x0TALf5d075989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marck set sender to marck@FreeBSD.org using -f From: Dmitry Morozovsky Date: Tue, 29 Jan 2019 10:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343548 - in head/sbin: newfs tunefs X-SVN-Group: head X-SVN-Commit-Author: marck X-SVN-Commit-Paths: in head/sbin: newfs tunefs X-SVN-Commit-Revision: 343548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 732C176F8E 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 10:21:43 -0000 Author: marck (doc committer) Date: Tue Jan 29 10:21:41 2019 New Revision: 343548 URL: https://svnweb.freebsd.org/changeset/base/343548 Log: Allow dashes as a valid character in UFS labels. Reviewed by: mckusick, imp, 0mp MFC after: 2 weeks Differential Revision: D18991 Modified: head/sbin/newfs/newfs.8 head/sbin/newfs/newfs.c head/sbin/tunefs/tunefs.8 head/sbin/tunefs/tunefs.c Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Tue Jan 29 09:22:20 2019 (r343547) +++ head/sbin/newfs/newfs.8 Tue Jan 29 10:21:41 2019 (r343548) @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd July 7, 2017 +.Dd January 29, 2019 .Dt NEWFS 8 .Os .Sh NAME @@ -89,7 +89,7 @@ See for details. .It Fl L Ar volname Add a volume label to the new file system. -Legal characters are alphanumerics and underscores. +Legal characters are alphanumerics, dashes, and underscores. .It Fl N Cause the file system parameters to be printed out without really creating the file system. Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Tue Jan 29 09:22:20 2019 (r343547) +++ head/sbin/newfs/newfs.c Tue Jan 29 10:21:41 2019 (r343548) @@ -153,10 +153,10 @@ main(int argc, char *argv[]) volumelabel = optarg; i = -1; while (isalnum(volumelabel[++i]) || - volumelabel[i] == '_'); + volumelabel[i] == '_' || volumelabel[i] == '-'); if (volumelabel[i] != '\0') { errx(1, "bad volume label. Valid characters " - "are alphanumerics and underscores."); + "are alphanumerics, dashes, and underscores."); } if (strlen(volumelabel) >= MAXVOLLEN) { errx(1, "bad volume label. Length is longer than %d.", Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Tue Jan 29 09:22:20 2019 (r343547) +++ head/sbin/tunefs/tunefs.8 Tue Jan 29 10:21:41 2019 (r343548) @@ -28,7 +28,7 @@ .\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd April 19, 2016 +.Dd January 29, 2019 .Dt TUNEFS 8 .Os .Sh NAME @@ -112,7 +112,7 @@ By default sets it to half of the space reserved to minfree. .It Fl L Ar volname Add/modify an optional file system volume label. -Legal characters are alphanumerics and underscores. +Legal characters are alphanumerics, dashes, and underscores. .It Fl l Cm enable | disable Turn on/off MAC multilabel flag. .It Fl m Ar minfree Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Tue Jan 29 09:22:20 2019 (r343547) +++ head/sbin/tunefs/tunefs.c Tue Jan 29 10:21:41 2019 (r343548) @@ -189,10 +189,13 @@ main(int argc, char *argv[]) name = "volume label"; Lvalue = optarg; i = -1; - while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); + while (isalnum(Lvalue[++i]) || Lvalue[i] == '_' || + Lvalue[i] == '-') + ; if (Lvalue[i] != '\0') { errx(10, "bad %s. Valid characters are " - "alphanumerics and underscores.", name); + "alphanumerics, dashes, and underscores.", + name); } if (strlen(Lvalue) >= MAXVOLLEN) { errx(10, "bad %s. Length is longer than %d.", From owner-svn-src-head@freebsd.org Tue Jan 29 10:28:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4351E14B66E9; Tue, 29 Jan 2019 10:28:52 +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 D7C8E77630; Tue, 29 Jan 2019 10:28:51 +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 AEC2B64BB; Tue, 29 Jan 2019 10:28:51 +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 x0TASpmt079440; Tue, 29 Jan 2019 10:28:51 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TASpgu079438; Tue, 29 Jan 2019 10:28:51 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901291028.x0TASpgu079438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 29 Jan 2019 10:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343549 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 343549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7C8E77630 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 10:28:52 -0000 Author: vmaffione Date: Tue Jan 29 10:28:50 2019 New Revision: 343549 URL: https://svnweb.freebsd.org/changeset/base/343549 Log: netmap: add notifications on kloop stop On sync-kloop stop, send a wake-up signal to the kloop, so that waiting for the timeout is not needed. Also, improve logging in netmap_freebsd.c. MFC after: 3 days Modified: head/sys/dev/netmap/netmap_bdg.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_kloop.c Modified: head/sys/dev/netmap/netmap_bdg.c ============================================================================== --- head/sys/dev/netmap/netmap_bdg.c Tue Jan 29 10:21:41 2019 (r343548) +++ head/sys/dev/netmap/netmap_bdg.c Tue Jan 29 10:28:50 2019 (r343549) @@ -1141,8 +1141,8 @@ netmap_bwrap_intr_notify(struct netmap_kring *kring, i goto put_out; if (kring->nr_hwcur == kring->nr_hwtail) { if (netmap_verbose) - nm_prerr("how strange, interrupt with no packets on %s", - na->name); + nm_prlim(1, "interrupt with no packets on %s", + kring->name); goto put_out; } Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Tue Jan 29 10:21:41 2019 (r343548) +++ head/sys/dev/netmap/netmap_freebsd.c Tue Jan 29 10:28:50 2019 (r343549) @@ -240,7 +240,7 @@ nm_os_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *dat static int notsupported = 0; if (!notsupported) { notsupported = 1; - D("inet4 segmentation not supported"); + nm_prerr("inet4 segmentation not supported"); } #endif } @@ -256,7 +256,7 @@ nm_os_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void * static int notsupported = 0; if (!notsupported) { notsupported = 1; - D("inet6 segmentation not supported"); + nm_prerr("inet6 segmentation not supported"); } #endif } @@ -288,8 +288,9 @@ freebsd_generic_rx_handler(struct ifnet *ifp, struct m { int stolen; - if (!NM_NA_VALID(ifp)) { - RD(1, "Warning: got RX packet for invalid emulated adapter"); + if (unlikely(!NM_NA_VALID(ifp))) { + nm_prlim(1, "Warning: RX packet intercepted, but no" + " emulated adapter"); return; } @@ -315,15 +316,16 @@ nm_os_catch_rx(struct netmap_generic_adapter *gna, int nm_os_ifnet_lock(); if (intercept) { if (gna->save_if_input) { - D("cannot intercept again"); - ret = EINVAL; /* already set */ + nm_prerr("RX on %s already intercepted", na->name); + ret = EBUSY; /* already set */ goto out; } gna->save_if_input = ifp->if_input; ifp->if_input = freebsd_generic_rx_handler; } else { - if (!gna->save_if_input){ - D("cannot restore"); + if (!gna->save_if_input) { + nm_prerr("Failed to undo RX intercept on %s", + na->name); ret = EINVAL; /* not saved */ goto out; } @@ -392,11 +394,11 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) * we need to copy from the cluster to the netmap buffer. */ if (MBUF_REFCNT(m) != 1) { - D("invalid refcnt %d for %p", MBUF_REFCNT(m), m); + nm_prerr("invalid refcnt %d for %p", MBUF_REFCNT(m), m); panic("in generic_xmit_frame"); } if (m->m_ext.ext_size < len) { - RD(5, "size %d < len %d", m->m_ext.ext_size, len); + nm_prlim(2, "size %d < len %d", m->m_ext.ext_size, len); len = m->m_ext.ext_size; } bcopy(a->addr, m->m_data, len); @@ -459,7 +461,6 @@ nm_os_generic_set_features(struct netmap_generic_adapt void nm_os_mitigation_init(struct nm_generic_mit *mit, int idx, struct netmap_adapter *na) { - ND("called"); mit->mit_pending = 0; mit->mit_ring_idx = idx; mit->mit_na = na; @@ -469,21 +470,19 @@ nm_os_mitigation_init(struct nm_generic_mit *mit, int void nm_os_mitigation_start(struct nm_generic_mit *mit) { - ND("called"); } void nm_os_mitigation_restart(struct nm_generic_mit *mit) { - ND("called"); } int nm_os_mitigation_active(struct nm_generic_mit *mit) { - ND("called"); + return 0; } @@ -491,12 +490,12 @@ nm_os_mitigation_active(struct nm_generic_mit *mit) void nm_os_mitigation_cleanup(struct nm_generic_mit *mit) { - ND("called"); } static int nm_vi_dummy(struct ifnet *ifp, u_long cmd, caddr_t addr) { + return EINVAL; } @@ -559,7 +558,7 @@ nm_vi_free_index(uint8_t val) } } if (lim == nm_vi_indices.active) - D("funny, index %u didn't found", val); + nm_prerr("Index %u not found", val); mtx_unlock(&nm_vi_indices.lock); } #undef NM_VI_MAX @@ -597,7 +596,7 @@ nm_os_vi_persist(const char *name, struct ifnet **ret) ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - D("if_alloc failed"); + nm_prerr("if_alloc failed"); return ENOMEM; } if_initname(ifp, name, IF_DUNIT_NONE); @@ -638,7 +637,7 @@ struct nm_os_extmem { void nm_os_extmem_delete(struct nm_os_extmem *e) { - D("freeing %zx bytes", (size_t)e->size); + nm_prinf("freeing %zx bytes", (size_t)e->size); vm_map_remove(kernel_map, e->kva, e->kva + e->size); nm_os_free(e); } @@ -688,7 +687,7 @@ nm_os_extmem_create(unsigned long p, struct nmreq_pool rv = vm_map_lookup(&map, p, VM_PROT_RW, &entry, &obj, &index, &prot, &wired); if (rv != KERN_SUCCESS) { - D("address %lx not found", p); + nm_prerr("address %lx not found", p); goto out_free; } /* check that we are given the whole vm_object ? */ @@ -707,13 +706,13 @@ nm_os_extmem_create(unsigned long p, struct nmreq_pool VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, 0); if (rv != KERN_SUCCESS) { - D("vm_map_find(%zx) failed", (size_t)e->size); + nm_prerr("vm_map_find(%zx) failed", (size_t)e->size); goto out_rel; } rv = vm_map_wire(kernel_map, e->kva, e->kva + e->size, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); if (rv != KERN_SUCCESS) { - D("vm_map_wire failed"); + nm_prerr("vm_map_wire failed"); goto out_rem; } @@ -795,7 +794,7 @@ nm_os_pt_memdev_iomap(struct ptnetmap_memdev *ptn_dev, { int rid; - D("ptn_memdev_driver iomap"); + nm_prinf("ptn_memdev_driver iomap"); rid = PCIR_BAR(PTNETMAP_MEM_PCI_BAR); *mem_size = bus_read_4(ptn_dev->pci_io, PTNET_MDEV_IO_MEMSIZE_HI); @@ -814,7 +813,7 @@ nm_os_pt_memdev_iomap(struct ptnetmap_memdev *ptn_dev, *nm_paddr = rman_get_start(ptn_dev->pci_mem); *nm_addr = rman_get_virtual(ptn_dev->pci_mem); - D("=== BAR %d start %lx len %lx mem_size %lx ===", + nm_prinf("=== BAR %d start %lx len %lx mem_size %lx ===", PTNETMAP_MEM_PCI_BAR, (unsigned long)(*nm_paddr), (unsigned long)rman_get_size(ptn_dev->pci_mem), @@ -832,7 +831,7 @@ nm_os_pt_memdev_ioread(struct ptnetmap_memdev *ptn_dev void nm_os_pt_memdev_iounmap(struct ptnetmap_memdev *ptn_dev) { - D("ptn_memdev_driver iounmap"); + nm_prinf("ptn_memdev_driver iounmap"); if (ptn_dev->pci_mem) { bus_release_resource(ptn_dev->dev, SYS_RES_MEMORY, @@ -868,8 +867,6 @@ ptn_memdev_attach(device_t dev) int rid; uint16_t mem_id; - D("ptn_memdev_driver attach"); - ptn_dev = device_get_softc(dev); ptn_dev->dev = dev; @@ -893,7 +890,7 @@ ptn_memdev_attach(device_t dev) } netmap_mem_get(ptn_dev->nm_mem); - D("ptn_memdev_driver probe OK - host_mem_id: %d", mem_id); + nm_prinf("ptnetmap memdev attached, host memid: %u", mem_id); return (0); } @@ -904,10 +901,11 @@ ptn_memdev_detach(device_t dev) { struct ptnetmap_memdev *ptn_dev; - D("ptn_memdev_driver detach"); ptn_dev = device_get_softc(dev); if (ptn_dev->nm_mem) { + nm_prinf("ptnetmap memdev detached, host memid %u", + netmap_mem_get_id(ptn_dev->nm_mem)); netmap_mem_put(ptn_dev->nm_mem); ptn_dev->nm_mem = NULL; } @@ -928,7 +926,6 @@ ptn_memdev_detach(device_t dev) static int ptn_memdev_shutdown(device_t dev) { - D("ptn_memdev_driver shutdown"); return bus_generic_shutdown(dev); } @@ -953,7 +950,7 @@ netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, struct netmap_vm_handle_t *vmh = handle; if (netmap_verbose) - D("handle %p size %jd prot %d foff %jd", + nm_prinf("handle %p size %jd prot %d foff %jd", handle, (intmax_t)size, prot, (intmax_t)foff); if (color) *color = 0; @@ -970,7 +967,7 @@ netmap_dev_pager_dtor(void *handle) struct netmap_priv_d *priv = vmh->priv; if (netmap_verbose) - D("handle %p", handle); + nm_prinf("handle %p", handle); netmap_dtor(priv); free(vmh, M_DEVBUF); dev_rel(dev); @@ -989,7 +986,7 @@ netmap_dev_pager_fault(vm_object_t object, vm_ooffset_ vm_memattr_t memattr; vm_pindex_t pidx; - ND("object %p offset %jd prot %d mres %p", + nm_prdis("object %p offset %jd prot %d mres %p", object, (intmax_t)offset, prot, mres); memattr = object->memattr; pidx = OFF_TO_IDX(offset); @@ -1045,7 +1042,7 @@ netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *fo vm_object_t obj; if (netmap_verbose) - D("cdev %p foff %jd size %jd objp %p prot %d", cdev, + nm_prinf("cdev %p foff %jd size %jd objp %p prot %d", cdev, (intmax_t )*foff, (intmax_t )objsize, objp, prot); vmh = malloc(sizeof(struct netmap_vm_handle_t), M_DEVBUF, @@ -1070,7 +1067,7 @@ netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *fo &netmap_cdev_pager_ops, objsize, prot, *foff, NULL); if (obj == NULL) { - D("cdev_pager_allocate failed"); + nm_prerr("cdev_pager_allocate failed"); error = EINVAL; goto err_deref; } @@ -1104,7 +1101,7 @@ static int netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { if (netmap_verbose) - D("dev %p fflag 0x%x devtype %d td %p", + nm_prinf("dev %p fflag 0x%x devtype %d td %p", dev, fflag, devtype, td); return 0; } @@ -1255,11 +1252,11 @@ nm_os_kctx_worker_start(struct nm_kctx *nmk) goto err; } - D("nm_kthread started td %p", nmk->worker); + nm_prinf("nm_kthread started td %p", nmk->worker); return 0; err: - D("nm_kthread start failed err %d", error); + nm_prerr("nm_kthread start failed err %d", error); nmk->worker = NULL; return error; } @@ -1337,7 +1334,7 @@ netmap_knrdetach(struct knote *kn) struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; struct selinfo *si = &priv->np_si[NR_RX]->si; - D("remove selinfo %p", si); + nm_prinf("remove selinfo %p", si); knlist_remove(&si->si_note, kn, /*islocked=*/0); } @@ -1347,7 +1344,7 @@ netmap_knwdetach(struct knote *kn) struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; struct selinfo *si = &priv->np_si[NR_TX]->si; - D("remove selinfo %p", si); + nm_prinf("remove selinfo %p", si); knlist_remove(&si->si_note, kn, /*islocked=*/0); } @@ -1418,17 +1415,17 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) int ev = kn->kn_filter; if (ev != EVFILT_READ && ev != EVFILT_WRITE) { - D("bad filter request %d", ev); + nm_prerr("bad filter request %d", ev); return 1; } error = devfs_get_cdevpriv((void**)&priv); if (error) { - D("device not yet setup"); + nm_prerr("device not yet setup"); return 1; } na = priv->np_na; if (na == NULL) { - D("no netmap adapter for this file descriptor"); + nm_prerr("no netmap adapter for this file descriptor"); return 1; } /* the si is indicated in the priv */ @@ -1535,7 +1532,7 @@ netmap_loader(__unused struct module *module, int even * then the module can not be unloaded. */ if (netmap_use_count) { - D("netmap module can not be unloaded - netmap_use_count: %d", + nm_prerr("netmap module can not be unloaded - netmap_use_count: %d", netmap_use_count); error = EBUSY; break; Modified: head/sys/dev/netmap/netmap_kloop.c ============================================================================== --- head/sys/dev/netmap/netmap_kloop.c Tue Jan 29 10:21:41 2019 (r343548) +++ head/sys/dev/netmap/netmap_kloop.c Tue Jan 29 10:28:50 2019 (r343549) @@ -567,16 +567,12 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n /* Poll for notifications coming from the netmap rings bound to * this file descriptor. */ { - NM_SELINFO_T *si[NR_TXRX]; - NMG_LOCK(); - si[NR_RX] = nm_si_user(priv, NR_RX) ? &na->si[NR_RX] : - &na->rx_rings[priv->np_qfirst[NR_RX]]->si; - si[NR_TX] = nm_si_user(priv, NR_TX) ? &na->si[NR_TX] : - &na->tx_rings[priv->np_qfirst[NR_TX]]->si; + poll_wait(priv->np_filp, priv->np_si[NR_TX], + &poll_ctx->wait_table); + poll_wait(priv->np_filp, priv->np_si[NR_RX], + &poll_ctx->wait_table); NMG_UNLOCK(); - poll_wait(priv->np_filp, si[NR_TX], &poll_ctx->wait_table); - poll_wait(priv->np_filp, si[NR_RX], &poll_ctx->wait_table); } #else /* SYNC_KLOOP_POLL */ opt->nro_status = EOPNOTSUPP; @@ -657,7 +653,7 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n /* If a poll context is present, yield to the scheduler * waiting for a notification to come either from * netmap or the application. */ - schedule_timeout(msecs_to_jiffies(20000)); + schedule_timeout(msecs_to_jiffies(3000)); } else #endif /* SYNC_KLOOP_POLL */ { @@ -708,12 +704,31 @@ out: int netmap_sync_kloop_stop(struct netmap_priv_d *priv) { + struct netmap_adapter *na; bool running = true; int err = 0; + if (priv->np_nifp == NULL) { + return ENXIO; + } + mb(); /* make sure following reads are not from cache */ + + na = priv->np_na; + if (!nm_netmap_on(na)) { + return ENXIO; + } + + /* Set the kloop stopping flag. */ NMG_LOCK(); priv->np_kloop_state |= NM_SYNC_KLOOP_STOPPING; NMG_UNLOCK(); + + /* Send a notification to the kloop, in case it is blocked in + * schedule_timeout(). We can use either RX or TX, because the + * kloop is waiting on both. */ + nm_os_selwakeup(priv->np_si[NR_RX]); + + /* Wait for the kloop to actually terminate. */ while (running) { usleep_range(1000, 1500); NMG_LOCK(); From owner-svn-src-head@freebsd.org Tue Jan 29 11:04:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F2EE14B7A7E; Tue, 29 Jan 2019 11:04:20 +0000 (UTC) (envelope-from andrew@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 2136A80AFE; Tue, 29 Jan 2019 11:04:20 +0000 (UTC) (envelope-from andrew@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 0E8476B8B; Tue, 29 Jan 2019 11:04:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0TB4K0C000318; Tue, 29 Jan 2019 11:04:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TB4I7n000308; Tue, 29 Jan 2019 11:04:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201901291104.x0TB4I7n000308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 29 Jan 2019 11:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343550 - in head/sys: amd64/conf arm64/conf conf kern sys X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: amd64/conf arm64/conf conf kern sys X-SVN-Commit-Revision: 343550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2136A80AFE 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.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 11:04:20 -0000 Author: andrew Date: Tue Jan 29 11:04:17 2019 New Revision: 343550 URL: https://svnweb.freebsd.org/changeset/base/343550 Log: Extract the coverage sanitizer KPI to a new file. This will allow multiple consumers of the coverage data to be compiled into the kernel together. The only requirement is only one can be registered at a given point in time, however it is expected they will only register when the coverage data is needed. A new kernel conflig option COVERAGE is added. This will allow kcov to become a module that can be loaded as needed, or compiled into the kernel. While here clean up the #include style a little. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18955 Added: head/sys/kern/subr_coverage.c - copied, changed from r343547, head/sys/kern/kern_kcov.c head/sys/sys/coverage.h - copied, changed from r343547, head/sys/sys/kcov.h Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/GENERIC-NODEBUG head/sys/arm64/conf/GENERIC head/sys/arm64/conf/GENERIC-NODEBUG head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/conf/options head/sys/kern/kern_kcov.c head/sys/sys/kcov.h Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/amd64/conf/GENERIC Tue Jan 29 11:04:17 2019 (r343550) @@ -100,9 +100,12 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default + +# Kernel Sanitizers +#options COVERAGE # Generic kernel coverage. Used by KCOV +#options KCOV # Kernel Coverage Sanitizer # Warning: KUBSAN can result in a kernel too large for loader to load #options KUBSAN # Kernel Undefined Behavior Sanitizer -#options KCOV # Kernel Coverage Sanitizer # Kernel dump features. options EKCD # Support for encrypted kernel dumps Modified: head/sys/amd64/conf/GENERIC-NODEBUG ============================================================================== --- head/sys/amd64/conf/GENERIC-NODEBUG Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/amd64/conf/GENERIC-NODEBUG Tue Jan 29 11:04:17 2019 (r343550) @@ -37,4 +37,5 @@ nooptions WITNESS_SKIPSPIN nooptions BUF_TRACKING nooptions DEADLKRES nooptions FULL_BUF_TRACKING - +nooptions COVERAGE +nooptions KCOV Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/arm64/conf/GENERIC Tue Jan 29 11:04:17 2019 (r343550) @@ -92,9 +92,12 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence options USB_DEBUG # enable debug msgs options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default + +# Kernel Sanitizers +#options COVERAGE # Generic kernel coverage. Used by KCOV +#options KCOV # Kernel Coverage Sanitizer # Warning: KUBSAN can result in a kernel too large for loader to load #options KUBSAN # Kernel Undefined Behavior Sanitizer -#options KCOV # Kernel Coverage Sanitizer # Kernel dump features. options EKCD # Support for encrypted kernel dumps Modified: head/sys/arm64/conf/GENERIC-NODEBUG ============================================================================== --- head/sys/arm64/conf/GENERIC-NODEBUG Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/arm64/conf/GENERIC-NODEBUG Tue Jan 29 11:04:17 2019 (r343550) @@ -36,3 +36,5 @@ nooptions WITNESS nooptions WITNESS_SKIPSPIN nooptions DEADLKRES nooptions USB_DEBUG +nooptions COVERAGE +nooptions KCOV Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/conf/files Tue Jan 29 11:04:17 2019 (r343550) @@ -3883,6 +3883,8 @@ kern/subr_capability.c standard kern/subr_clock.c standard kern/subr_compressor.c standard \ compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd" +kern/subr_coverage.c optional coverage \ + compile-with "${NORMAL_C} -fno-sanitize=all" kern/subr_counter.c standard kern/subr_devstat.c standard kern/subr_disk.c standard Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/conf/kern.pre.mk Tue Jan 29 11:04:17 2019 (r343550) @@ -118,8 +118,8 @@ KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; ec SAN_CFLAGS+= -fsanitize=undefined .endif -KCOV_ENABLED!= grep KCOV opt_kcov.h || true ; echo -.if !empty(KCOV_ENABLED) +COVERAGE_ENABLED!= grep COVERAGE opt_global.h || true ; echo +.if !empty(COVERAGE_ENABLED) SAN_CFLAGS+= -fsanitize-coverage=trace-pc,trace-cmp .endif Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/conf/options Tue Jan 29 11:04:17 2019 (r343550) @@ -57,7 +57,6 @@ DDB_CTF opt_ddb.h DDB_NUMSYM opt_ddb.h FULL_BUF_TRACKING opt_global.h GDB -KCOV opt_kcov.h KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h @@ -234,6 +233,8 @@ VERBOSE_SYSINIT ZSTDIO opt_zstdio.h # Sanitizers +COVERAGE opt_global.h +KCOV KUBSAN opt_global.h # POSIX kernel options Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Tue Jan 29 10:28:50 2019 (r343549) +++ head/sys/kern/kern_kcov.c Tue Jan 29 11:04:17 2019 (r343550) @@ -39,29 +39,26 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include #include +#include #include #include #include #include #include #include -#include #include -#include -#include #include +#include #include #include #include #include -#include - MALLOC_DEFINE(M_KCOV_INFO, "kcovinfo", "KCOV info type"); #define KCOV_ELEMENT_SIZE sizeof(uint64_t) @@ -138,17 +135,6 @@ static d_close_t kcov_close; static d_mmap_single_t kcov_mmap_single; static d_ioctl_t kcov_ioctl; -void __sanitizer_cov_trace_pc(void); -void __sanitizer_cov_trace_cmp1(uint8_t, uint8_t); -void __sanitizer_cov_trace_cmp2(uint16_t, uint16_t); -void __sanitizer_cov_trace_cmp4(uint32_t, uint32_t); -void __sanitizer_cov_trace_cmp8(uint64_t, uint64_t); -void __sanitizer_cov_trace_const_cmp1(uint8_t, uint8_t); -void __sanitizer_cov_trace_const_cmp2(uint16_t, uint16_t); -void __sanitizer_cov_trace_const_cmp4(uint32_t, uint32_t); -void __sanitizer_cov_trace_const_cmp8(uint64_t, uint64_t); -void __sanitizer_cov_trace_switch(uint64_t, uint64_t *); - static int kcov_alloc(struct kcov_info *info, size_t entries); static void kcov_init(const void *unused); @@ -169,6 +155,7 @@ SYSCTL_UINT(_kern_kcov, OID_AUTO, max_entries, CTLFLAG "Maximum number of entries in the kcov buffer"); static struct mtx kcov_lock; +static int active_count; static struct kcov_info * get_kinfo(struct thread *td) @@ -197,25 +184,13 @@ get_kinfo(struct thread *td) return (info); } -/* - * Main entry point. A call to this function will be inserted - * at every edge, and if coverage is enabled for the thread - * this function will add the PC to the buffer. - */ -void -__sanitizer_cov_trace_pc(void) +static void +trace_pc(uintptr_t ret) { struct thread *td; struct kcov_info *info; uint64_t *buf, index; - /* - * To guarantee curthread is properly set, we exit early - * until the driver has been initialized - */ - if (cold) - return; - td = curthread; info = get_kinfo(td); if (info == NULL) @@ -237,7 +212,7 @@ __sanitizer_cov_trace_pc(void) if (index + 2 > info->entries) return; - buf[index + 1] = (uint64_t)__builtin_return_address(0); + buf[index + 1] = ret; buf[0] = index + 1; } @@ -248,13 +223,6 @@ trace_cmp(uint64_t type, uint64_t arg1, uint64_t arg2, struct kcov_info *info; uint64_t *buf, index; - /* - * To guarantee curthread is properly set, we exit early - * until the driver has been initialized - */ - if (cold) - return (false); - td = curthread; info = get_kinfo(td); if (info == NULL) @@ -287,109 +255,7 @@ trace_cmp(uint64_t type, uint64_t arg1, uint64_t arg2, return (true); } -void -__sanitizer_cov_trace_cmp1(uint8_t arg1, uint8_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(0), arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - -void -__sanitizer_cov_trace_cmp2(uint16_t arg1, uint16_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(1), arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - -void -__sanitizer_cov_trace_cmp4(uint32_t arg1, uint32_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(2), arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - -void -__sanitizer_cov_trace_cmp8(uint64_t arg1, uint64_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(3), arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - -void -__sanitizer_cov_trace_const_cmp1(uint8_t arg1, uint8_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(0) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - -void -__sanitizer_cov_trace_const_cmp2(uint16_t arg1, uint16_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(1) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - -void -__sanitizer_cov_trace_const_cmp4(uint32_t arg1, uint32_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(2) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - -void -__sanitizer_cov_trace_const_cmp8(uint64_t arg1, uint64_t arg2) -{ - - trace_cmp(KCOV_CMP_SIZE(3) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); -} - /* - * val is the switch operand - * cases[0] is the number of case constants - * cases[1] is the size of val in bits - * cases[2..n] are the case constants - */ -void -__sanitizer_cov_trace_switch(uint64_t val, uint64_t *cases) -{ - uint64_t i, count, ret, type; - - count = cases[0]; - ret = (uint64_t)__builtin_return_address(0); - - switch (cases[1]) { - case 8: - type = KCOV_CMP_SIZE(0); - break; - case 16: - type = KCOV_CMP_SIZE(1); - break; - case 32: - type = KCOV_CMP_SIZE(2); - break; - case 64: - type = KCOV_CMP_SIZE(3); - break; - default: - return; - } - - val |= KCOV_CMP_CONST; - - for (i = 0; i < count; i++) - if (!trace_cmp(type, val, cases[i + 2], ret)) - return; -} - -/* * The fd is being closed, cleanup everything we can. */ static void @@ -456,6 +322,7 @@ kcov_close(struct cdev *dev, int fflag, int devtype, s struct kcov_info *info; int error; + if ((error = devfs_get_cdevpriv((void **)&info)) != 0) return (error); @@ -571,6 +438,16 @@ kcov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, error = EINVAL; break; } + + /* Lets hope nobody opens this 2 billion times */ + KASSERT(active_count < INT_MAX, + ("%s: Open too many times", __func__)); + active_count++; + if (active_count == 1) { + cov_register_pc(&trace_pc); + cov_register_cmp(&trace_cmp); + } + KASSERT(info->thread == NULL, ("Enabling kcov when already enabled")); info->thread = td; @@ -589,6 +466,13 @@ kcov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, error = EINVAL; break; } + KASSERT(active_count > 0, ("%s: Open count is zero", __func__)); + active_count--; + if (active_count == 0) { + cov_register_pc(&trace_pc); + cov_register_cmp(&trace_cmp); + } + td->td_kcov_info = NULL; atomic_store_int(&info->state, KCOV_STATE_READY); /* @@ -618,6 +502,12 @@ kcov_thread_dtor(void *arg __unused, struct thread *td return; mtx_lock_spin(&kcov_lock); + KASSERT(active_count > 0, ("%s: Open count is zero", __func__)); + active_count--; + if (active_count == 0) { + cov_register_pc(&trace_pc); + cov_register_cmp(&trace_cmp); + } td->td_kcov_info = NULL; if (info->state != KCOV_STATE_DYING) { /* @@ -673,4 +563,4 @@ kcov_init(const void *unused) EVENTHANDLER_PRI_ANY); } -SYSINIT(kcovdev, SI_SUB_DEVFS, SI_ORDER_ANY, kcov_init, NULL); +SYSINIT(kcovdev, SI_SUB_LAST, SI_ORDER_ANY, kcov_init, NULL); Copied and modified: head/sys/kern/subr_coverage.c (from r343547, head/sys/kern/kern_kcov.c) ============================================================================== --- head/sys/kern/kern_kcov.c Tue Jan 29 09:22:20 2019 (r343547, copy source) +++ head/sys/kern/subr_coverage.c Tue Jan 29 11:04:17 2019 (r343550) @@ -39,105 +39,10 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include -#include -#include -#include +#include -#include - -MALLOC_DEFINE(M_KCOV_INFO, "kcovinfo", "KCOV info type"); - -#define KCOV_ELEMENT_SIZE sizeof(uint64_t) - -/* - * To know what the code can safely perform at any point in time we use a - * state machine. In the normal case the state transitions are: - * - * OPEN -> READY -> RUNNING -> DYING - * | | ^ | ^ ^ - * | | +--------+ | | - * | +-------------------+ | - * +-----------------------------+ - * - * The states are: - * OPEN: The kcov fd has been opened, but no buffer is available to store - * coverage data. - * READY: The buffer to store coverage data has been allocated. Userspace - * can set this by using ioctl(fd, KIOSETBUFSIZE, entries);. When - * this has been set the buffer can be written to by the kernel, - * and mmaped by userspace. - * RUNNING: The coverage probes are able to store coverage data in the buffer. - * This is entered with ioctl(fd, KIOENABLE, mode);. The READY state - * can be exited by ioctl(fd, KIODISABLE); or exiting the thread to - * return to the READY state to allow tracing to be reused, or by - * closing the kcov fd to enter the DYING state. - * DYING: The fd has been closed. All states can enter into this state when - * userspace closes the kcov fd. - * - * We need to be careful when moving into and out of the RUNNING state. As - * an interrupt may happen while this is happening the ordering of memory - * operations is important so struct kcov_info is valid for the tracing - * functions. - * - * When moving into the RUNNING state prior stores to struct kcov_info need - * to be observed before the state is set. This allows for interrupts that - * may call into one of the coverage functions to fire at any point while - * being enabled and see a consistent struct kcov_info. - * - * When moving out of the RUNNING state any later stores to struct kcov_info - * need to be observed after the state is set. As with entering this is to - * present a consistent struct kcov_info to interrupts. - */ -typedef enum { - KCOV_STATE_INVALID, - KCOV_STATE_OPEN, /* The device is open, but with no buffer */ - KCOV_STATE_READY, /* The buffer has been allocated */ - KCOV_STATE_RUNNING, /* Recording trace data */ - KCOV_STATE_DYING, /* The fd was closed */ -} kcov_state_t; - -/* - * (l) Set while holding the kcov_lock mutex and not in the RUNNING state. - * (o) Only set once while in the OPEN state. Cleaned up while in the DYING - * state, and with no thread associated with the struct kcov_info. - * (s) Set atomically to enter or exit the RUNNING state, non-atomically - * otherwise. See above for a description of the other constraints while - * moving into or out of the RUNNING state. - */ -struct kcov_info { - struct thread *thread; /* (l) */ - vm_object_t bufobj; /* (o) */ - vm_offset_t kvaddr; /* (o) */ - size_t entries; /* (o) */ - size_t bufsize; /* (o) */ - kcov_state_t state; /* (s) */ - int mode; /* (l) */ - bool mmap; -}; - -/* Prototypes */ -static d_open_t kcov_open; -static d_close_t kcov_close; -static d_mmap_single_t kcov_mmap_single; -static d_ioctl_t kcov_ioctl; - void __sanitizer_cov_trace_pc(void); void __sanitizer_cov_trace_cmp1(uint8_t, uint8_t); void __sanitizer_cov_trace_cmp2(uint16_t, uint16_t); @@ -149,52 +54,35 @@ void __sanitizer_cov_trace_const_cmp4(uint32_t, uint32 void __sanitizer_cov_trace_const_cmp8(uint64_t, uint64_t); void __sanitizer_cov_trace_switch(uint64_t, uint64_t *); -static int kcov_alloc(struct kcov_info *info, size_t entries); -static void kcov_init(const void *unused); +static cov_trace_pc_t cov_trace_pc; +static cov_trace_cmp_t cov_trace_cmp; -static struct cdevsw kcov_cdevsw = { - .d_version = D_VERSION, - .d_open = kcov_open, - .d_close = kcov_close, - .d_mmap_single = kcov_mmap_single, - .d_ioctl = kcov_ioctl, - .d_name = "kcov", -}; +void +cov_register_pc(cov_trace_pc_t trace_pc) +{ -SYSCTL_NODE(_kern, OID_AUTO, kcov, CTLFLAG_RW, 0, "Kernel coverage"); + atomic_store_ptr(&cov_trace_pc, trace_pc); +} -static u_int kcov_max_entries = KCOV_MAXENTRIES; -SYSCTL_UINT(_kern_kcov, OID_AUTO, max_entries, CTLFLAG_RW, - &kcov_max_entries, 0, - "Maximum number of entries in the kcov buffer"); +void +cov_unregister_pc(void) +{ -static struct mtx kcov_lock; + atomic_store_ptr(&cov_trace_pc, NULL); +} -static struct kcov_info * -get_kinfo(struct thread *td) +void +cov_register_cmp(cov_trace_cmp_t trace_cmp) { - struct kcov_info *info; - /* We might have a NULL thread when releasing the secondary CPUs */ - if (td == NULL) - return (NULL); + atomic_store_ptr(&cov_trace_cmp, trace_cmp); +} - /* - * We are in an interrupt, stop tracing as it is not explicitly - * part of a syscall. - */ - if (td->td_intr_nesting_level > 0 || td->td_intr_frame != NULL) - return (NULL); +void +cov_unregister_cmp(void) +{ - /* - * If info is NULL or the state is not running we are not tracing. - */ - info = td->td_kcov_info; - if (info == NULL || - atomic_load_acq_int(&info->state) != KCOV_STATE_RUNNING) - return (NULL); - - return (info); + atomic_store_ptr(&cov_trace_cmp, NULL); } /* @@ -205,150 +93,104 @@ get_kinfo(struct thread *td) void __sanitizer_cov_trace_pc(void) { - struct thread *td; - struct kcov_info *info; - uint64_t *buf, index; + cov_trace_pc_t trace_pc; - /* - * To guarantee curthread is properly set, we exit early - * until the driver has been initialized - */ - if (cold) - return; - - td = curthread; - info = get_kinfo(td); - if (info == NULL) - return; - - /* - * Check we are in the PC-trace mode. - */ - if (info->mode != KCOV_MODE_TRACE_PC) - return; - - KASSERT(info->kvaddr != 0, - ("__sanitizer_cov_trace_pc: NULL buf while running")); - - buf = (uint64_t *)info->kvaddr; - - /* The first entry of the buffer holds the index */ - index = buf[0]; - if (index + 2 > info->entries) - return; - - buf[index + 1] = (uint64_t)__builtin_return_address(0); - buf[0] = index + 1; + trace_pc = (cov_trace_pc_t)atomic_load_ptr(&cov_trace_pc); + if (trace_pc != NULL) + trace_pc((uint64_t)__builtin_return_address(0)); } -static bool -trace_cmp(uint64_t type, uint64_t arg1, uint64_t arg2, uint64_t ret) -{ - struct thread *td; - struct kcov_info *info; - uint64_t *buf, index; - - /* - * To guarantee curthread is properly set, we exit early - * until the driver has been initialized - */ - if (cold) - return (false); - - td = curthread; - info = get_kinfo(td); - if (info == NULL) - return (false); - - /* - * Check we are in the comparison-trace mode. - */ - if (info->mode != KCOV_MODE_TRACE_CMP) - return (false); - - KASSERT(info->kvaddr != 0, - ("__sanitizer_cov_trace_pc: NULL buf while running")); - - buf = (uint64_t *)info->kvaddr; - - /* The first entry of the buffer holds the index */ - index = buf[0]; - - /* Check we have space to store all elements */ - if (index * 4 + 4 + 1 > info->entries) - return (false); - - buf[index * 4 + 1] = type; - buf[index * 4 + 2] = arg1; - buf[index * 4 + 3] = arg2; - buf[index * 4 + 4] = ret; - buf[0] = index + 1; - - return (true); -} - +/* + * Comparison entry points. When the kernel performs a comparison + * operation the compiler inserts a call to one of the following + * functions to record the operation. + */ void __sanitizer_cov_trace_cmp1(uint8_t arg1, uint8_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(0), arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(0), arg1, arg2, + (uint64_t)__builtin_return_address(0)); } void __sanitizer_cov_trace_cmp2(uint16_t arg1, uint16_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(1), arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(1), arg1, arg2, + (uint64_t)__builtin_return_address(0)); } void __sanitizer_cov_trace_cmp4(uint32_t arg1, uint32_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(2), arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(2), arg1, arg2, + (uint64_t)__builtin_return_address(0)); } void __sanitizer_cov_trace_cmp8(uint64_t arg1, uint64_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(3), arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(3), arg1, arg2, + (uint64_t)__builtin_return_address(0)); } void __sanitizer_cov_trace_const_cmp1(uint8_t arg1, uint8_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(0) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(0) | COV_CMP_CONST, arg1, arg2, + (uint64_t)__builtin_return_address(0)); } void __sanitizer_cov_trace_const_cmp2(uint16_t arg1, uint16_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(1) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(1) | COV_CMP_CONST, arg1, arg2, + (uint64_t)__builtin_return_address(0)); } void __sanitizer_cov_trace_const_cmp4(uint32_t arg1, uint32_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(2) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(2) | COV_CMP_CONST, arg1, arg2, + (uint64_t)__builtin_return_address(0)); } void __sanitizer_cov_trace_const_cmp8(uint64_t arg1, uint64_t arg2) { + cov_trace_cmp_t trace_cmp; - trace_cmp(KCOV_CMP_SIZE(3) | KCOV_CMP_CONST, arg1, arg2, - (uint64_t)__builtin_return_address(0)); + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp != NULL) + trace_cmp(COV_CMP_SIZE(3) | COV_CMP_CONST, arg1, arg2, + (uint64_t)__builtin_return_address(0)); } /* @@ -361,316 +203,35 @@ void __sanitizer_cov_trace_switch(uint64_t val, uint64_t *cases) { uint64_t i, count, ret, type; + cov_trace_cmp_t trace_cmp; + trace_cmp = (cov_trace_cmp_t)atomic_load_ptr(&cov_trace_cmp); + if (trace_cmp == NULL) + return; + count = cases[0]; ret = (uint64_t)__builtin_return_address(0); switch (cases[1]) { case 8: - type = KCOV_CMP_SIZE(0); + type = COV_CMP_SIZE(0); break; case 16: - type = KCOV_CMP_SIZE(1); + type = COV_CMP_SIZE(1); break; case 32: - type = KCOV_CMP_SIZE(2); + type = COV_CMP_SIZE(2); break; case 64: - type = KCOV_CMP_SIZE(3); + type = COV_CMP_SIZE(3); break; default: return; } - val |= KCOV_CMP_CONST; + val |= COV_CMP_CONST; for (i = 0; i < count; i++) if (!trace_cmp(type, val, cases[i + 2], ret)) return; } - -/* - * The fd is being closed, cleanup everything we can. - */ -static void -kcov_mmap_cleanup(void *arg) -{ - struct kcov_info *info = arg; - struct thread *thread; - - mtx_lock_spin(&kcov_lock); - /* - * Move to KCOV_STATE_DYING to stop adding new entries. - * - * If the thread is running we need to wait until thread exit to - * clean up as it may currently be adding a new entry. If this is - * the case being in KCOV_STATE_DYING will signal that the buffer - * needs to be cleaned up. - */ - atomic_store_int(&info->state, KCOV_STATE_DYING); - atomic_thread_fence_seq_cst(); - thread = info->thread; - mtx_unlock_spin(&kcov_lock); - - if (thread != NULL) - return; - - /* - * We can safely clean up the info struct as it is in the - * KCOV_STATE_DYING state with no thread associated. - * - * The KCOV_STATE_DYING stops new threads from using it. - * The lack of a thread means nothing is currently using the buffers. - */ - - if (info->kvaddr != 0) { - pmap_qremove(info->kvaddr, info->bufsize / PAGE_SIZE); - kva_free(info->kvaddr, info->bufsize); - } - if (info->bufobj != NULL && !info->mmap) - vm_object_deallocate(info->bufobj); - free(info, M_KCOV_INFO); -} - -static int -kcov_open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - struct kcov_info *info; - int error; - - info = malloc(sizeof(struct kcov_info), M_KCOV_INFO, M_ZERO | M_WAITOK); - info->state = KCOV_STATE_OPEN; - info->thread = NULL; - info->mode = -1; - info->mmap = false; - - if ((error = devfs_set_cdevpriv(info, kcov_mmap_cleanup)) != 0) - kcov_mmap_cleanup(info); - - return (error); -} - -static int -kcov_close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - struct kcov_info *info; - int error; - - if ((error = devfs_get_cdevpriv((void **)&info)) != 0) - return (error); - - KASSERT(info != NULL, ("kcov_close with no kcov_info structure")); - - /* Trying to close, but haven't disabled */ - if (info->state == KCOV_STATE_RUNNING) - return (EBUSY); - - return (0); -} - -static int -kcov_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, - struct vm_object **object, int nprot) -{ - struct kcov_info *info; - int error; - - if ((nprot & (PROT_EXEC | PROT_READ | PROT_WRITE)) != - (PROT_READ | PROT_WRITE)) - return (EINVAL); - - if ((error = devfs_get_cdevpriv((void **)&info)) != 0) - return (error); - - if (info->kvaddr == 0 || size / KCOV_ELEMENT_SIZE != info->entries || - info->mmap != false) - return (EINVAL); - - info->mmap = true; - *offset = 0; - *object = info->bufobj; - return (0); -} - -static int -kcov_alloc(struct kcov_info *info, size_t entries) -{ - size_t n, pages; - vm_page_t *m; - - KASSERT(info->kvaddr == 0, ("kcov_alloc: Already have a buffer")); - KASSERT(info->state == KCOV_STATE_OPEN, - ("kcov_alloc: Not in open state (%x)", info->state)); - - if (entries < 2 || entries > kcov_max_entries) - return (EINVAL); - - /* Align to page size so mmap can't access other kernel memory */ - info->bufsize = roundup2(entries * KCOV_ELEMENT_SIZE, PAGE_SIZE); - pages = info->bufsize / PAGE_SIZE; - - if ((info->kvaddr = kva_alloc(info->bufsize)) == 0) - return (ENOMEM); - - info->bufobj = vm_pager_allocate(OBJT_PHYS, 0, info->bufsize, - PROT_READ | PROT_WRITE, 0, curthread->td_ucred); - - m = malloc(sizeof(*m) * pages, M_TEMP, M_WAITOK); - VM_OBJECT_WLOCK(info->bufobj); - for (n = 0; n < pages; n++) { - m[n] = vm_page_grab(info->bufobj, n, - VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_WIRED); - m[n]->valid = VM_PAGE_BITS_ALL; - } - VM_OBJECT_WUNLOCK(info->bufobj); - pmap_qenter(info->kvaddr, m, pages); - free(m, M_TEMP); - - info->entries = entries; - - return (0); -} - -static int -kcov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag __unused, - struct thread *td) -{ - struct kcov_info *info; - int mode, error; - - if ((error = devfs_get_cdevpriv((void **)&info)) != 0) - return (error); - - if (cmd == KIOSETBUFSIZE) { - /* - * Set the size of the coverage buffer. Should be called - * before enabling coverage collection for that thread. - */ - if (info->state != KCOV_STATE_OPEN) { - return (EBUSY); - } - error = kcov_alloc(info, *(u_int *)data); - if (error == 0) - info->state = KCOV_STATE_READY; - return (error); - } - - mtx_lock_spin(&kcov_lock); - switch (cmd) { - case KIOENABLE: - if (info->state != KCOV_STATE_READY) { - error = EBUSY; - break; - } - if (td->td_kcov_info != NULL) { - error = EINVAL; - break; - } - mode = *(int *)data; - if (mode != KCOV_MODE_TRACE_PC && mode != KCOV_MODE_TRACE_CMP) { - error = EINVAL; - break; - } - KASSERT(info->thread == NULL, - ("Enabling kcov when already enabled")); - info->thread = td; - info->mode = mode; - /* - * Ensure the mode has been set before starting coverage - * tracing. - */ - atomic_store_rel_int(&info->state, KCOV_STATE_RUNNING); - td->td_kcov_info = info; - break; - case KIODISABLE: - /* Only the currently enabled thread may disable itself */ - if (info->state != KCOV_STATE_RUNNING || - info != td->td_kcov_info) { - error = EINVAL; - break; - } - td->td_kcov_info = NULL; - atomic_store_int(&info->state, KCOV_STATE_READY); - /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 29 11:18:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4264C14B81E4; Tue, 29 Jan 2019 11:18:42 +0000 (UTC) (envelope-from ae@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 D90BB81209; Tue, 29 Jan 2019 11:18:41 +0000 (UTC) (envelope-from ae@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 CAC736D3F; Tue, 29 Jan 2019 11:18:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0TBIfS1005809; Tue, 29 Jan 2019 11:18:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TBIfdQ005808; Tue, 29 Jan 2019 11:18:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201901291118.x0TBIfdQ005808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 29 Jan 2019 11:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343551 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 343551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D90BB81209 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 11:18:42 -0000 Author: ae Date: Tue Jan 29 11:18:41 2019 New Revision: 343551 URL: https://svnweb.freebsd.org/changeset/base/343551 Log: Fix the bug introduced in r342908, that causes problems with dynamic handling for protocols without ports numbers. Since port numbers were uninitialized for protocols like ICMP/ICMPv6, ipfw_chk() used some non-zero values to create dynamic states, and due this it failed to match replies with created states. Reported by: Oliver Hartmann, Boris Lytochkin Obtained from: Yandex LLC X-MFC after: r342908 Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Tue Jan 29 11:04:17 2019 (r343550) +++ head/sys/netpfil/ipfw/ip_fw2.c Tue Jan 29 11:18:41 2019 (r343551) @@ -1410,6 +1410,7 @@ ipfw_chk(struct ip_fw_args *args) dst_ip.s_addr = 0; /* make sure it is initialized */ src_ip.s_addr = 0; /* make sure it is initialized */ + src_port = dst_port = 0; pktlen = m->m_pkthdr.len; DYN_INFO_INIT(&dyn_info); @@ -1688,7 +1689,6 @@ do { \ args->f_id.dst_ip = ntohl(dst_ip.s_addr); } else { proto = 0; - src_port = dst_port = 0; dst_ip.s_addr = src_ip.s_addr = 0; args->f_id.addr_type = 1; /* XXX */ From owner-svn-src-head@freebsd.org Tue Jan 29 14:31:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C5F14BF302; Tue, 29 Jan 2019 14:31:42 +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 B4E4288C8D; Tue, 29 Jan 2019 14:31:41 +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 9E43B8FCE; Tue, 29 Jan 2019 14:31:41 +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 x0TEVfMX009788; Tue, 29 Jan 2019 14:31:41 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TEVfKx009787; Tue, 29 Jan 2019 14:31:41 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901291431.x0TEVfKx009787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 29 Jan 2019 14:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343552 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 343552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4E4288C8D 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.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 14:31:42 -0000 Author: vmaffione Date: Tue Jan 29 14:31:41 2019 New Revision: 343552 URL: https://svnweb.freebsd.org/changeset/base/343552 Log: vtnet: fix typo in vtnet_free_taskqueues Because of a typo, the code was mistakenly resetting the vtnrx_vq pointer rather than vtntx_tq. Reviewed by: bryanv MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D19015 Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Tue Jan 29 11:18:41 2019 (r343551) +++ head/sys/dev/virtio/network/if_vtnet.c Tue Jan 29 14:31:41 2019 (r343552) @@ -2748,7 +2748,7 @@ vtnet_free_taskqueues(struct vtnet_softc *sc) rxq = &sc->vtnet_rxqs[i]; if (rxq->vtnrx_tq != NULL) { taskqueue_free(rxq->vtnrx_tq); - rxq->vtnrx_vq = NULL; + rxq->vtnrx_tq = NULL; } txq = &sc->vtnet_txqs[i]; From owner-svn-src-head@freebsd.org Tue Jan 29 16:32:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C1C14C2C2F; Tue, 29 Jan 2019 16:32:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6785D8DFE2; Tue, 29 Jan 2019 16:32:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x435.google.com with SMTP id 64so9887070pfr.9; Tue, 29 Jan 2019 08:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XCl6F1BQVQFSNDbx3lMhYp7ZDfnKATPB1wv5xLLNN9w=; b=GWSRULKJZoX54zCuFALhHbSNywntovadhVHkCL0vuxFzkx+CsskbfXdXSIy1Wkdx4h BrdJwCvjDH7lL+TV1+gb9KaJOI/ishQTKB02Tfarh47Jry0AoFoOm0nPTMyRzxHDzHTV kNEvJ17zESLJt409oD4FmDzlLPIk7g2SMRvqmjlenTsoNzHVwl2Ct/+sMDAoZOptcNIP OzgaeRvKf9mrS93S4rTqIH4IFcevOP46QKOPGoFicDh7FaXfkUZUEHkMk/zDacdfWgbh jcjPjFGmJCOCe8DwjEhKaw28aeGPlukTX08kGSDeq2d2Hj/z0ztZ2qj3TKXNsQpj71o6 W5Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=XCl6F1BQVQFSNDbx3lMhYp7ZDfnKATPB1wv5xLLNN9w=; b=l70HiWNZkhVgxIV91VKqqR03aE9yE41s8OjMtL3ALS4XraN9j6txzJi9CG4m5vjAga TyDWDIgEJ4b+yoOd3GLTErgratEzOrxV2PedS5HIdiSni0wpiYZUCc252Dc8j0BYzi5M UVos+xucCuOiLs2oIknx/AA7sxVIwiXxUQZeQ4kMIEHwRjBKSZhcCJi6synYwwkKeWry Wp0cQ05HAVmcos4f+AyCVb6znqbdt18KdyjCa3+fHtxVWkmGq1Q2u+CHcjkiUvYUKNEu P/Tkb0sJN1yLs76wKBQJqyIRJ4ARRli5/mzPn592Beeq18M0S/a3Fg91VJ+iygjLLGeO uNpw== X-Gm-Message-State: AJcUukeuJ9F1EkHkYXQ2Hmmp8asrA9mSXbw4atXN5hsWyyFEMD/dj4Qk BWhLwan3QWfqFSrRgtwBFFMKAkwU X-Google-Smtp-Source: ALg8bN7TDicPC04fh5JxGSSgb/emOZmq9LdBnx1seSIZKwlYUnrMxI6TG8LOEJaCDvGq7HgwbVDNOg== X-Received: by 2002:a63:e001:: with SMTP id e1mr18079879pgh.39.1548779572736; Tue, 29 Jan 2019 08:32:52 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b68sm50796913pfg.160.2019.01.29.08.32.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 08:32:52 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: Date: Tue, 29 Jan 2019 08:32:51 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> References: <201901290408.x0T48oJQ080243@repo.freebsd.org> To: Kyle Evans X-Rspamd-Queue-Id: 6785D8DFE2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 16:32:55 -0000 > On Jan 28, 2019, at 20:10, Kyle Evans wrote: >=20 >> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote: >>=20 >> Author: kevans >> Date: Tue Jan 29 04:08:49 2019 >> New Revision: 343543 >> URL: https://svnweb.freebsd.org/changeset/base/343543 >>=20 >> Log: >> bectl(8) test: Force destroy the zpool in cleanup >>=20 >> This is a wild guess as to why bectl tests failed once upon a time in CI= , >> given no apparent way to see a transcript of cleanup routines with Kyua.= The >> bectl tests construct a new, clean zpool for every test. The failure >> indicated was because of a mount that was leftover from a previous test,= but >> the previous test had succeeded so it's not clear how the mount remained= >> leftover unless the `zpool get health ${pool}` had somehow failed. >>=20 >=20 > I left out: the tests are supposed to be constructed to clean up any > mounts that were left over in the course of the test, hence the > assumption that the failure lies in the cleanup. Hi Kyle, The tests use a deterministic zpool name defined locally (not globally), and= will only destroy the zpool if =E2=80=9Czpool get health=E2=80=9D succeeds.= The tests will work the first time (when the zpool doesn=E2=80=99t exist), b= ut I believe they=E2=80=99re actually introducing nondeterminism by accident= . I will propose a fix for this. There=E2=80=99s a way to decipher why things failed from /var/log/messages a= nd kyua output. It=E2=80=99s just nontrivial to those who don=E2=80=99t know= what to look for. Can you please provide a failing ci run? Cheers, -Enji= From owner-svn-src-head@freebsd.org Tue Jan 29 16:35:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 850A114C2EA0; Tue, 29 Jan 2019 16:35:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2CCB8E359; Tue, 29 Jan 2019 16:35:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52b.google.com with SMTP id z10so8957294pgp.7; Tue, 29 Jan 2019 08:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=va/A+/JvGrHs7Kh2Jw+9KqvPvvVWrAjy4vh12s3pA5c=; b=b1I5qrRNnrESMFGcXpmzTvXDMdcZy2ImwvmER/P9CTrSy94Uiu2NKsj11QqrVJlbPu FVXuuLQMN5cVpJWPzcnaPzuieXC0Rmj8VZVAOOBeHfGe4E+ndzDim8BaAgN0RvjwY/5Q 4FQJMQb5QUzDSDUEF2J+OciTUXVpPRykWtvdu0Wv5Y1XjX/pe+3zMSBctQNAnu0F/Th8 BWeNy4/IbiJI3lKYEsxw/LmAinekx+xq/TTVpi9nUHTAzL9NR2KRfKNFtX+MOYZfSo4v Bb5F3SldDo7dJTbczmwprP7yg5qVV7OTxxLDwoaEPbBQjl9+oNJvjAlkAg0JoInHXVXl 577Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=va/A+/JvGrHs7Kh2Jw+9KqvPvvVWrAjy4vh12s3pA5c=; b=e4SKWEoPJTrtoplAOETlCOTSPDHSEELNhAQLZALFFCHUk245VAB2DtKCQXriWtRpGl nTHWqNwOUrC+aG23WG2AEELc2x+GDCuqcHF01Ymq28vA5f94FoOvVcP/cc3mMcR0DBX7 8X5DXRPiKGJrMxE+2XIIl2W/G0b0bNtl+jc85xvaAoeji6ulRg+hJytHP835ji2mVxUB YubweFEGXXmgCf7t+6rk4cS/YSTC+ZeqTrvDyWl1gHsocez5V7h4C2wNE1UAabPrZc8F l2OnSRMdMnPNaRi0XpL/Wu7qR/PqXxRZOXuRqnyZnGDJZM7Ct9UE51zkX22+zezrfmP3 t1fg== X-Gm-Message-State: AJcUukcdIbHZJls9EBZ8REBJadLWMWQBxUmyOoH4PVRh0AQSADh5jRVL YKiSGtjPkb6O5XVHw0be3Oi1RYuy X-Google-Smtp-Source: ALg8bN4jbZheOL7YSMmibtOvr3XFnr/7c5Tohx94CyhZ7A/fOWyxdnJsoG4Stk1djyjZCieUb3cqQQ== X-Received: by 2002:a63:1d59:: with SMTP id d25mr24702061pgm.180.1548779732733; Tue, 29 Jan 2019 08:35:32 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m3sm70950053pff.173.2019.01.29.08.35.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 08:35:31 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: <201901290431.x0T4VrZm006702@pdx.rh.CN85.dnsmgr.net> Date: Tue, 29 Jan 2019 08:35:31 -0800 Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <82187F03-C50D-4430-9764-ABA6E28125E9@gmail.com> References: <201901290431.x0T4VrZm006702@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Rspamd-Queue-Id: F2CCB8E359 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 16:35:34 -0000 On Jan 28, 2019, at 20:31, Rodney W. Grimes = wrote: >>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote: >>>=20 >>> Author: kevans >>> Date: Tue Jan 29 04:08:49 2019 >>> New Revision: 343543 >>> URL: https://svnweb.freebsd.org/changeset/base/343543 >>>=20 >>> Log: >>> bectl(8) test: Force destroy the zpool in cleanup >>>=20 >>> This is a wild guess as to why bectl tests failed once upon a time in C= I, >>> given no apparent way to see a transcript of cleanup routines with Kyua= . The >>> bectl tests construct a new, clean zpool for every test. The failure >>> indicated was because of a mount that was leftover from a previous test= , but >>> the previous test had succeeded so it's not clear how the mount remaine= d >>> leftover unless the `zpool get health ${pool}` had somehow failed. >>>=20 >>=20 >> I left out: the tests are supposed to be constructed to clean up any >> mounts that were left over in the course of the test, hence the >> assumption that the failure lies in the cleanup. Hi Rod, > =46rom my experience as a hardware test engineer the test > setup was required to make sure any of those assumptions > are valid. Meaning that the test would have to validate > that no left over cruft was going to interfere with the > test about to be run. >=20 > Ie, you should probably do a force destroy of the pool > *before* the test too. While this approach makes sense and is valid, it would leave open/orphaned r= esources after each test run (in this case a single zpool). It=E2=80=99s bes= t to fix the underlying issue with how the test formulates, sets up, and tea= rs down the zpool. Cheers, -Enji= From owner-svn-src-head@freebsd.org Tue Jan 29 16:40:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24F6F14C31CC; Tue, 29 Jan 2019 16:40:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B99BF8E7A0; Tue, 29 Jan 2019 16:40:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6979710824; Tue, 29 Jan 2019 16:40:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f171.google.com with SMTP id s5-v6so18017547ljd.12; Tue, 29 Jan 2019 08:40:05 -0800 (PST) X-Gm-Message-State: AJcUukemCO8bty3C4lv+aUoUkyrfEomP1N/0Xxq0auw9LSNCGxMe6FK2 yhxr2E6dM5PsJiU777zVab0aOlAffyLASLev/Us= X-Google-Smtp-Source: ALg8bN6iZJcgizaImowYgDy6cjL843RLSuA7Vx4EfpfH57iUWxVO/zOICQ2ziiaAkyz8AybQQPqpEFW5+eBRsbVJky8= X-Received: by 2002:a2e:5b93:: with SMTP id m19-v6mr22763896lje.115.1548780003775; Tue, 29 Jan 2019 08:40:03 -0800 (PST) MIME-Version: 1.0 References: <201901290408.x0T48oJQ080243@repo.freebsd.org> <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> In-Reply-To: <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> From: Kyle Evans Date: Tue, 29 Jan 2019 10:39:25 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343543 - head/sbin/bectl/tests To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: B99BF8E7A0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 16:40:06 -0000 On Tue, Jan 29, 2019 at 10:32 AM Enji Cooper wrote: > > > > On Jan 28, 2019, at 20:10, Kyle Evans wrote: > > > >> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote= : > >> > >> Author: kevans > >> Date: Tue Jan 29 04:08:49 2019 > >> New Revision: 343543 > >> URL: https://svnweb.freebsd.org/changeset/base/343543 > >> > >> Log: > >> bectl(8) test: Force destroy the zpool in cleanup > >> > >> This is a wild guess as to why bectl tests failed once upon a time in= CI, > >> given no apparent way to see a transcript of cleanup routines with Ky= ua. The > >> bectl tests construct a new, clean zpool for every test. The failure > >> indicated was because of a mount that was leftover from a previous te= st, but > >> the previous test had succeeded so it's not clear how the mount remai= ned > >> leftover unless the `zpool get health ${pool}` had somehow failed. > >> > > > > I left out: the tests are supposed to be constructed to clean up any > > mounts that were left over in the course of the test, hence the > > assumption that the failure lies in the cleanup. > > Hi Kyle, > > The tests use a deterministic zpool name defined locally (not globally), = and will only destroy the zpool if =E2=80=9Czpool get health=E2=80=9D succe= eds. > > The tests will work the first time (when the zpool doesn=E2=80=99t exist)= , but I believe they=E2=80=99re actually introducing nondeterminism by acci= dent. I will propose a fix for this. > > There=E2=80=99s a way to decipher why things failed from /var/log/message= s and kyua output. It=E2=80=99s just nontrivial to those who don=E2=80=99t = know what to look for. Can you please provide a failing ci run? > Hi, Thanks! Any help is appreciated -- my inquiry to -testing@ in response to the weekly report where the failing test [1] was mentioned has been met with silence. The failure is consistent in the i386-test job, but amd64-test sees nothing of the sort (and neither does my local testing). [1] https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/426/testReport/s= bin.bectl/bectl_test/bectl_mount/ From owner-svn-src-head@freebsd.org Tue Jan 29 16:55:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7BE114C39D7; Tue, 29 Jan 2019 16:55:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 578FF8F229; Tue, 29 Jan 2019 16:55:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x443.google.com with SMTP id 64so9917794pfr.9; Tue, 29 Jan 2019 08:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UHkzr4i7STaDwuO5O8TIk9jO67MasdBHe0j9XjyZelI=; b=JOUFlKSj7ocobwvddmVlUvokjPj7BJfjHgMgOak23EVvYFljPTD+kQJMpacL7xSAlM 10qNFW7UlYrETSvrBn5xnJz3ogvcMZaecq/ZzsH4yfZZZMVbEpSPy0PMPXpJJvCpzu9T Qn9iQ6IjRb+n/x+rFTWwYsQFUihdoLvHh68Cs27B3Jr4HARzFpYl14l/FY9ZcYPeEWY3 +0+gjOOEikrbb6s4BNzd26DDPcTD8vnYwoB74eqFD0ct/fMnL4JZ++bE+P3QfHcfxdhG BQtfetUeQ8cRawqEm+Fk93vZDb4W/D37XbVqUTbM25/DyYPicdTsdTE5+YgOKke/8d2d qUug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UHkzr4i7STaDwuO5O8TIk9jO67MasdBHe0j9XjyZelI=; b=r9lMtxr8bNYzRXK/YNw1aTgRRRUOF/+fU6gooQZrjff4xrDsb03bhcpoI748LFweTB r6b340uRs3SkfVJ7dUZsE/Kmum0z3Pw7ROxDRtcrVAmTb9rHex+q310tdeYqM6KRVoQl Z+ZLj+MlAd345ZM6zwKgUE62IKJcJPEajJYQ/t0Je/JvRUwKZ/P1JPiZPI7jVaWy9ORy 0e0Y3vbHQ0AF2Hk+XwAw39RSyETLy//0FVXFM8qQcdN1SJwbWz3gJSpzcj0ezteXnzsC ZN/kM7xD+nm5zGRg/+DA714DZttnEWlorXsm+tqaasSiqA5Fphu3Jldd6i+GmP5t/Rrv GXSQ== X-Gm-Message-State: AJcUukcJ1KF28SddnzyR2hWKBXxKvSE/xsc4FRYHuI+kv/b2EWV8W01T Xv0CbRrBhKT96mWHt5ON/TWq46e6 X-Google-Smtp-Source: ALg8bN5wiOJqF2zQWmX2oRaZI/B0hYLrEW7wtONyQE8ex3epUoJH1xkXfWmr7B02fOjjilgZFZZg+Q== X-Received: by 2002:a63:374e:: with SMTP id g14mr24878591pgn.59.1548780920941; Tue, 29 Jan 2019 08:55:20 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b2sm65024669pfm.3.2019.01.29.08.55.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 08:55:20 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: Date: Tue, 29 Jan 2019 08:55:19 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> References: <201901290408.x0T48oJQ080243@repo.freebsd.org> <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> To: Kyle Evans X-Rspamd-Queue-Id: 578FF8F229 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.973,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 16:55:23 -0000 > On Jan 29, 2019, at 08:39, Kyle Evans wrote: >=20 >> On Tue, Jan 29, 2019 at 10:32 AM Enji Cooper wrot= e: >>=20 >>=20 >>>> On Jan 28, 2019, at 20:10, Kyle Evans wrote: >>>>=20 >>>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote:= >>>>=20 >>>> Author: kevans >>>> Date: Tue Jan 29 04:08:49 2019 >>>> New Revision: 343543 >>>> URL: https://svnweb.freebsd.org/changeset/base/343543 >>>>=20 >>>> Log: >>>> bectl(8) test: Force destroy the zpool in cleanup >>>>=20 >>>> This is a wild guess as to why bectl tests failed once upon a time in C= I, >>>> given no apparent way to see a transcript of cleanup routines with Kyua= . The >>>> bectl tests construct a new, clean zpool for every test. The failure >>>> indicated was because of a mount that was leftover from a previous test= , but >>>> the previous test had succeeded so it's not clear how the mount remaine= d >>>> leftover unless the `zpool get health ${pool}` had somehow failed. >>>>=20 >>>=20 >>> I left out: the tests are supposed to be constructed to clean up any >>> mounts that were left over in the course of the test, hence the >>> assumption that the failure lies in the cleanup. >>=20 >> Hi Kyle, >>=20 >> The tests use a deterministic zpool name defined locally (not globally), a= nd will only destroy the zpool if =E2=80=9Czpool get health=E2=80=9D succeed= s. >>=20 >> The tests will work the first time (when the zpool doesn=E2=80=99t exist)= , but I believe they=E2=80=99re actually introducing nondeterminism by accid= ent. I will propose a fix for this. >>=20 >> There=E2=80=99s a way to decipher why things failed from /var/log/message= s and kyua output. It=E2=80=99s just nontrivial to those who don=E2=80=99t k= now what to look for. Can you please provide a failing ci run? >>=20 >=20 > Hi, >=20 > Thanks! Any help is appreciated -- my inquiry to -testing@ in response > to the weekly report where the failing test [1] was mentioned has been > met with silence. The failure is consistent in the i386-test job, but > amd64-test sees nothing of the sort (and neither does my local > testing). Thanks for the reminder to rejoin that list. > [1] https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/426/testReport/= sbin.bectl/bectl_test/bectl_mount/ It=E2=80=99s pretty obvious from the above run what=E2=80=99s going on from t= he output. A similarly named zpool (same prefix; suffixed with a 2) is being= matched by grep, even though the test sets up one with a suffix in the prec= eding steps. It=E2=80=99s probably and issue with timing and the bhyve implementation for= amd64 vs i386, or something else. Cheers, -Enji= From owner-svn-src-head@freebsd.org Tue Jan 29 16:56:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB2CE14C3A3D; Tue, 29 Jan 2019 16:56:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 450C38F39D; Tue, 29 Jan 2019 16:56:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x643.google.com with SMTP id t13so9579946ply.13; Tue, 29 Jan 2019 08:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+vrjYVxwx9y0Cghknta1Susa+aaACase9rFL9irXzlY=; b=Iu0T1xNhe/ah/8NyFAi8KjC4NmGl8/BqrtG6/xW4GZhEmHFk8cRwYQh812zU8yWN7K i7h0avj6ChLf92k4nCYgaXh/2y2rfsvfG4Vc0hvrGoc4BRhPMOxJ0b2iVdXTOzCkjTXG /Z4l76Q59i7+ZqvV20IDkMD/cShlGS96Zt0yMH0CJ5UThRD7lDOolmnpWmapqsA24nCW ptJ7j/lisE9DgXbf35AXOzJFAau1p/bPG060XPR2uNTSR47vXk3iJ4E3vGbwmO1e0MaZ +hcoJRIKBDTIEs5EIwVZKnn4/VqzAAMVJxTjzZewicXNrGST+m4ytJ//YbnAVv79rgB9 6WzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+vrjYVxwx9y0Cghknta1Susa+aaACase9rFL9irXzlY=; b=OgfEiejerJT+Vba0q0bNcYGWMGp0hxR+xyyCJvG2xB/CGQjw1jeQQd8LCZZd66jp29 3QhDFXGISKCfecUz6ls3bpl9s9qNlRVgUiJK7FJF+/5tPB5bO/TdY0N4KD/5dRR4BKcV 7FHQ4s9E/3RcD6QDFV4Iq/9qWmg12qpBq6kJF0DHqifp1YtoSyZtvxRXTKNbZ15o6Z9/ a9KqrNXbT5GgH+25z/4xeI96wNGsW2ioxYehjkRyW6T+34mxGYBSCK1/NRfDsYFcgdtP 4LtkmS5AhkJaG1nxLWi1NCfor67lkitmr7+9d17OUJgtuDWLe67QOGWDOtTfb3luWuqd yHqQ== X-Gm-Message-State: AJcUuke0s2tD3Tm76YM8N+RpDTIVFqP71YYRBZ6awcokjYlaUo09K6Md zVQzO0wuNQ/Fe2ZaUGXRMCRyUpat X-Google-Smtp-Source: ALg8bN59OvKTkl+CQLnuZD/P46Y+5mN6Ralau4aYP4BS14Tx+5kHmQpU+W2ZNn/NvEtvPnOrEZzHDQ== X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr27073375plb.244.1548780995042; Tue, 29 Jan 2019 08:56:35 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n21sm51923891pfg.84.2019.01.29.08.56.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 08:56:34 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> Date: Tue, 29 Jan 2019 08:56:33 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <75B5E02D-7BE6-4D6F-BF7A-241E7CF16A5E@gmail.com> References: <201901290408.x0T48oJQ080243@repo.freebsd.org> <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> To: Kyle Evans X-Rspamd-Queue-Id: 450C38F39D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 16:56:37 -0000 > On Jan 29, 2019, at 08:55, Enji Cooper wrote: >=20 >=20 >>> On Jan 29, 2019, at 08:39, Kyle Evans wrote: >>>=20 >>> On Tue, Jan 29, 2019 at 10:32 AM Enji Cooper wro= te: >>>=20 >>>=20 >>>>> On Jan 28, 2019, at 20:10, Kyle Evans wrote: >>>>>=20 >>>>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote= : >>>>>=20 >>>>> Author: kevans >>>>> Date: Tue Jan 29 04:08:49 2019 >>>>> New Revision: 343543 >>>>> URL: https://svnweb.freebsd.org/changeset/base/343543 >>>>>=20 >>>>> Log: >>>>> bectl(8) test: Force destroy the zpool in cleanup >>>>>=20 >>>>> This is a wild guess as to why bectl tests failed once upon a time in C= I, >>>>> given no apparent way to see a transcript of cleanup routines with Kyu= a. The >>>>> bectl tests construct a new, clean zpool for every test. The failure >>>>> indicated was because of a mount that was leftover from a previous tes= t, but >>>>> the previous test had succeeded so it's not clear how the mount remain= ed >>>>> leftover unless the `zpool get health ${pool}` had somehow failed. >>>>>=20 >>>>=20 >>>> I left out: the tests are supposed to be constructed to clean up any >>>> mounts that were left over in the course of the test, hence the >>>> assumption that the failure lies in the cleanup. >>>=20 >>> Hi Kyle, >>>=20 >>> The tests use a deterministic zpool name defined locally (not globally),= and will only destroy the zpool if =E2=80=9Czpool get health=E2=80=9D succe= eds. >>>=20 >>> The tests will work the first time (when the zpool doesn=E2=80=99t exist= ), but I believe they=E2=80=99re actually introducing nondeterminism by acci= dent. I will propose a fix for this. >>>=20 >>> There=E2=80=99s a way to decipher why things failed from /var/log/messag= es and kyua output. It=E2=80=99s just nontrivial to those who don=E2=80=99t k= now what to look for. Can you please provide a failing ci run? >>>=20 >>=20 >> Hi, >>=20 >> Thanks! Any help is appreciated -- my inquiry to -testing@ in response >> to the weekly report where the failing test [1] was mentioned has been >> met with silence. The failure is consistent in the i386-test job, but >> amd64-test sees nothing of the sort (and neither does my local >> testing). >=20 > Thanks for the reminder to rejoin that list. >=20 >> [1] https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/426/testReport= /sbin.bectl/bectl_test/bectl_mount/ >=20 > It=E2=80=99s pretty obvious from the above run what=E2=80=99s going on fro= m the output. A similarly named zpool (same prefix; suffixed with a 2) is be= ing matched by grep, even though the test sets up one with a suffix in the p= receding steps. *without a suffix. My bad.= From owner-svn-src-head@freebsd.org Tue Jan 29 17:04:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D1DF14C41E6; Tue, 29 Jan 2019 17:04:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4A438FAE2; Tue, 29 Jan 2019 17:04:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0TH46MA009224; Tue, 29 Jan 2019 09:04:06 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0TH465F009223; Tue, 29 Jan 2019 09:04:06 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901291704.x0TH465F009223@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343543 - head/sbin/bectl/tests In-Reply-To: <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> To: Enji Cooper Date: Tue, 29 Jan 2019 09:04:06 -0800 (PST) CC: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: E4A438FAE2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 17:04:11 -0000 > > On Jan 29, 2019, at 08:39, Kyle Evans wrote: > > > >> On Tue, Jan 29, 2019 at 10:32 AM Enji Cooper wrote: > >> > >> > >>>> On Jan 28, 2019, at 20:10, Kyle Evans wrote: > >>>> > >>>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote: > >>>> > >>>> Author: kevans > >>>> Date: Tue Jan 29 04:08:49 2019 > >>>> New Revision: 343543 > >>>> URL: https://svnweb.freebsd.org/changeset/base/343543 > >>>> > >>>> Log: > >>>> bectl(8) test: Force destroy the zpool in cleanup > >>>> > >>>> This is a wild guess as to why bectl tests failed once upon a time in CI, > >>>> given no apparent way to see a transcript of cleanup routines with Kyua. The > >>>> bectl tests construct a new, clean zpool for every test. The failure > >>>> indicated was because of a mount that was leftover from a previous test, but > >>>> the previous test had succeeded so it's not clear how the mount remained > >>>> leftover unless the `zpool get health ${pool}` had somehow failed. > >>>> > >>> > >>> I left out: the tests are supposed to be constructed to clean up any > >>> mounts that were left over in the course of the test, hence the > >>> assumption that the failure lies in the cleanup. > >> > >> Hi Kyle, > >> > >> The tests use a deterministic zpool name defined locally (not globally), and will only destroy the zpool if ?zpool get health? succeeds. > >> > >> The tests will work the first time (when the zpool doesn?t exist), but I believe they?re actually introducing nondeterminism by accident. I will propose a fix for this. > >> > >> There?s a way to decipher why things failed from /var/log/messages and kyua output. It?s just nontrivial to those who don?t know what to look for. Can you please provide a failing ci run? > >> > > > > Hi, > > > > Thanks! Any help is appreciated -- my inquiry to -testing@ in response > > to the weekly report where the failing test [1] was mentioned has been > > met with silence. The failure is consistent in the i386-test job, but > > amd64-test sees nothing of the sort (and neither does my local > > testing). > > Thanks for the reminder to rejoin that list. > > > [1] https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/426/testReport/sbin.bectl/bectl_test/bectl_mount/ > > It?s pretty obvious from the above run what?s going on from the output. A similarly named zpool (same prefix; suffixed with a 2) is being matched by grep, even though the test sets up one with a suffix in the preceding steps. > > It?s probably and issue with timing and the bhyve implementation for amd64 vs i386, or something else. There is not a i386 mode of bhyve, ie all guests run in the same 64 bit virtualization and no part of the hyperviser knows if the guest is executing 32 bit or 64 bit code. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jan 29 17:06:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D5E14C42EE; Tue, 29 Jan 2019 17:06:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DEF18FCA1; Tue, 29 Jan 2019 17:06:46 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0TH6iZ0009240; Tue, 29 Jan 2019 09:06:44 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0TH6iKg009239; Tue, 29 Jan 2019 09:06:44 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901291706.x0TH6iKg009239@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343543 - head/sbin/bectl/tests In-Reply-To: <82187F03-C50D-4430-9764-ABA6E28125E9@gmail.com> To: Enji Cooper Date: Tue, 29 Jan 2019 09:06:44 -0800 (PST) CC: rgrimes@freebsd.org, Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 7DEF18FCA1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 17:06:47 -0000 [ Charset UTF-8 unsupported, converting... ] > On Jan 28, 2019, at 20:31, Rodney W. Grimes wrote: > > >>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote: > >>> > >>> Author: kevans > >>> Date: Tue Jan 29 04:08:49 2019 > >>> New Revision: 343543 > >>> URL: https://svnweb.freebsd.org/changeset/base/343543 > >>> > >>> Log: > >>> bectl(8) test: Force destroy the zpool in cleanup > >>> > >>> This is a wild guess as to why bectl tests failed once upon a time in CI, > >>> given no apparent way to see a transcript of cleanup routines with Kyua. The > >>> bectl tests construct a new, clean zpool for every test. The failure > >>> indicated was because of a mount that was leftover from a previous test, but > >>> the previous test had succeeded so it's not clear how the mount remained > >>> leftover unless the `zpool get health ${pool}` had somehow failed. > >>> > >> > >> I left out: the tests are supposed to be constructed to clean up any > >> mounts that were left over in the course of the test, hence the > >> assumption that the failure lies in the cleanup. > > Hi Rod, > > > From my experience as a hardware test engineer the test > > setup was required to make sure any of those assumptions > > are valid. Meaning that the test would have to validate > > that no left over cruft was going to interfere with the > > test about to be run. > > > > Ie, you should probably do a force destroy of the pool > > *before* the test too. > > While this approach makes sense and is valid, it would leave open/orphaned resources after each test run (in this case a single zpool). It?s best to fix the underlying issue with how the test formulates, sets up, and tears down the zpool. I did not advocate in any way that the post run cleanup should be removed. Infact you should have both a pre-test assurance that the environment is correct and a post-test cleanup trying to removall all artifacts. You can fix the current issue, but eventually if you get enough testing going on your going to start to find that things fail in ways that do not clean up (machine crash is one instance) and not doing a pretest cleanup is eventually going to run aground of this pitfall. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jan 29 17:11:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92BC114C44C9; Tue, 29 Jan 2019 17:11:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3812C8FF8A; Tue, 29 Jan 2019 17:11:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DD0D710C7B; Tue, 29 Jan 2019 17:11:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f50.google.com with SMTP id z13so15187836lfe.11; Tue, 29 Jan 2019 09:11:34 -0800 (PST) X-Gm-Message-State: AJcUukdx5OKD+gMmpDnxywRkO6eT5i3qgJMk31ZYz0W5h7PQ5wc0W9gu DIu781LhbErQ0UFY85c3/5Cqp6VMloxNmepF3Q8= X-Google-Smtp-Source: ALg8bN4K3zDtVUgUJ7xt59Mc32/gSFCsPuu2MqkYkDA29760BNe61Miok2AquSxkIhBGvK3BN4qf9JPXh29RCDmq+vY= X-Received: by 2002:a19:920a:: with SMTP id u10mr13650337lfd.122.1548781893401; Tue, 29 Jan 2019 09:11:33 -0800 (PST) MIME-Version: 1.0 References: <201901290408.x0T48oJQ080243@repo.freebsd.org> <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> In-Reply-To: <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> From: Kyle Evans Date: Tue, 29 Jan 2019 11:10:55 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343543 - head/sbin/bectl/tests To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 3812C8FF8A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 17:11:35 -0000 On Tue, Jan 29, 2019 at 10:55 AM Enji Cooper wrote: > > > > On Jan 29, 2019, at 08:39, Kyle Evans wrote: > > > >> On Tue, Jan 29, 2019 at 10:32 AM Enji Cooper w= rote: > >> > >> > >>>> On Jan 28, 2019, at 20:10, Kyle Evans wrote: > >>>> > >>>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wro= te: > >>>> > >>>> Author: kevans > >>>> Date: Tue Jan 29 04:08:49 2019 > >>>> New Revision: 343543 > >>>> URL: https://svnweb.freebsd.org/changeset/base/343543 > >>>> > >>>> Log: > >>>> bectl(8) test: Force destroy the zpool in cleanup > >>>> > >>>> This is a wild guess as to why bectl tests failed once upon a time i= n CI, > >>>> given no apparent way to see a transcript of cleanup routines with K= yua. The > >>>> bectl tests construct a new, clean zpool for every test. The failure > >>>> indicated was because of a mount that was leftover from a previous t= est, but > >>>> the previous test had succeeded so it's not clear how the mount rema= ined > >>>> leftover unless the `zpool get health ${pool}` had somehow failed. > >>>> > >>> > >>> I left out: the tests are supposed to be constructed to clean up any > >>> mounts that were left over in the course of the test, hence the > >>> assumption that the failure lies in the cleanup. > >> > >> Hi Kyle, > >> > >> The tests use a deterministic zpool name defined locally (not globally= ), and will only destroy the zpool if =E2=80=9Czpool get health=E2=80=9D su= cceeds. > >> > >> The tests will work the first time (when the zpool doesn=E2=80=99t exi= st), but I believe they=E2=80=99re actually introducing nondeterminism by a= ccident. I will propose a fix for this. > >> > >> There=E2=80=99s a way to decipher why things failed from /var/log/mess= ages and kyua output. It=E2=80=99s just nontrivial to those who don=E2=80= =99t know what to look for. Can you please provide a failing ci run? > >> > > > > Hi, > > > > Thanks! Any help is appreciated -- my inquiry to -testing@ in response > > to the weekly report where the failing test [1] was mentioned has been > > met with silence. The failure is consistent in the i386-test job, but > > amd64-test sees nothing of the sort (and neither does my local > > testing). > > Thanks for the reminder to rejoin that list. > > > [1] https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/426/testRepo= rt/sbin.bectl/bectl_test/bectl_mount/ > > It=E2=80=99s pretty obvious from the above run what=E2=80=99s going on fr= om the output. A similarly named zpool (same prefix; suffixed with a 2) is = being matched by grep, even though the test sets up one with a suffix in th= e preceding steps. > Right- this is the part that makes sense to me. =3D) The 'default2' BE is clearly a leftover from a previous test, but it should've been unmounted in the process and the zpool cleaned up. What's not clear is how the cleanup routine is failing; the `zpool get health` shouldn't have any reason to fail (though I can't test it here, apparently =3D() and `zpool destroy -f` should've unmounted this BE even if that hadn't happened throughout the course of the test, but the failure remains (even if probably incorrectly fixed) following the above commit. Setting the zpool name globally with a suffix unique to this test would likely be a great idea -- I think there's something else going on as well, though. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Tue Jan 29 17:22:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14EA714C4BFC; Tue, 29 Jan 2019 17:22:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84328909D4; Tue, 29 Jan 2019 17:22:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x530.google.com with SMTP id s198so9024927pgs.2; Tue, 29 Jan 2019 09:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Vp4l/K+Fnrb8e44iB/TiH9kTpIZXmGX+SUqaIprRB88=; b=ossRZMynZfe10b8zzNhavRzpXp54bf0qBKW6L6uKw82f8vWcGH2SQ31YyHxGOtOouU E3RcONx2Qld9fCWJmzwG6MX8sG7pJwKFdhKO6j+q5UsoZU8+LqC6UQ2MiLjYr8oywLxr 9WO02oZTc3JGy6Y13mP+vwemO0DEevSpzdeVob8qrxArxLA2lqyltH/Vyov9co9azZwV kNc1cwnubCC2Y6P3v5v5TqEMuiLPnnDetTCFO2XJsBE9etIKQtJ1dFnr7gfKS0C76WwG HWDP5JuQhjdcLVtXGEqgVTteCUypMXpVK/1zMd3/U/XXxthbKm5MBYt0t3Z/bv+a9TqZ lwrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Vp4l/K+Fnrb8e44iB/TiH9kTpIZXmGX+SUqaIprRB88=; b=FWbWV3VLqA3CW0p4GE/K1eOW/0+lng2W4ELmafwW+VuP3wEBN/2tPS6EqihpXMucva /RDP0BXBsYOnUQVK0kTbrlizicn62JW9+ZUziSC3uHje1XCtouSrlDjnGQbgYlDiS3Il 38OsOUNjUamoQ3PhrdUyQHYfx7fg3ENEqP8GVCks3f1JUw8aCdrZvK+2tn8V4XVY6P8G Cpr/7DhiDLKWGiQuPr6tx+Ma08WJ8Y5g/5+AIeeRSu1vDi5U+kH7jIggo5vxE2AxWe+I aThaug7KmwiAFEwkTQqjDJVfDgkahbusNZLZE0ys81VkOEGTkcMfytVr7PqzLpW+o/Vx xXsg== X-Gm-Message-State: AJcUukdmFqMvuakffSoiBRWiuVnk/SlN2SrMWc/MFicUZWqHklPyHxFg O62rDuimGRsA35Rl4KVp5v8c1LNk X-Google-Smtp-Source: ALg8bN4ahj9F2gvJI5yCwza5c8TExlbmvUotqVWOV9irrA/9Qi/7kZQztY/andcGcAxZpFdgS3wO3w== X-Received: by 2002:a62:a1a:: with SMTP id s26mr27237656pfi.31.1548782519100; Tue, 29 Jan 2019 09:21:59 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id w136sm54046911pfd.169.2019.01.29.09.21.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 09:21:58 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: Date: Tue, 29 Jan 2019 09:21:57 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1BE1B458-7AEA-412F-AD52-1E5554080422@gmail.com> References: <201901290408.x0T48oJQ080243@repo.freebsd.org> <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> To: Kyle Evans X-Rspamd-Queue-Id: 84328909D4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 17:22:01 -0000 > On Jan 29, 2019, at 09:10, Kyle Evans wrote: >=20 >> On Tue, Jan 29, 2019 at 10:55 AM Enji Cooper wrot= e: >>=20 >>=20 >>>> On Jan 29, 2019, at 08:39, Kyle Evans wrote: >>>>=20 >>>> On Tue, Jan 29, 2019 at 10:32 AM Enji Cooper wr= ote: >>>>=20 >>>>=20 >>>>>> On Jan 28, 2019, at 20:10, Kyle Evans wrote: >>>>>>=20 >>>>>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrot= e: >>>>>>=20 >>>>>> Author: kevans >>>>>> Date: Tue Jan 29 04:08:49 2019 >>>>>> New Revision: 343543 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/343543 >>>>>>=20 >>>>>> Log: >>>>>> bectl(8) test: Force destroy the zpool in cleanup >>>>>>=20 >>>>>> This is a wild guess as to why bectl tests failed once upon a time in= CI, >>>>>> given no apparent way to see a transcript of cleanup routines with Ky= ua. The >>>>>> bectl tests construct a new, clean zpool for every test. The failure >>>>>> indicated was because of a mount that was leftover from a previous te= st, but >>>>>> the previous test had succeeded so it's not clear how the mount remai= ned >>>>>> leftover unless the `zpool get health ${pool}` had somehow failed. >>>>>>=20 >>>>>=20 >>>>> I left out: the tests are supposed to be constructed to clean up any >>>>> mounts that were left over in the course of the test, hence the >>>>> assumption that the failure lies in the cleanup. >>>>=20 >>>> Hi Kyle, >>>>=20 >>>> The tests use a deterministic zpool name defined locally (not globally)= , and will only destroy the zpool if =E2=80=9Czpool get health=E2=80=9D succ= eeds. >>>>=20 >>>> The tests will work the first time (when the zpool doesn=E2=80=99t exis= t), but I believe they=E2=80=99re actually introducing nondeterminism by acc= ident. I will propose a fix for this. >>>>=20 >>>> There=E2=80=99s a way to decipher why things failed from /var/log/messa= ges and kyua output. It=E2=80=99s just nontrivial to those who don=E2=80=99t= know what to look for. Can you please provide a failing ci run? >>>>=20 >>>=20 >>> Hi, >>>=20 >>> Thanks! Any help is appreciated -- my inquiry to -testing@ in response >>> to the weekly report where the failing test [1] was mentioned has been >>> met with silence. The failure is consistent in the i386-test job, but >>> amd64-test sees nothing of the sort (and neither does my local >>> testing). >>=20 >> Thanks for the reminder to rejoin that list. >>=20 >>> [1] https://ci.freebsd.org/job/FreeBSD-stable-12-i386-test/426/testRepor= t/sbin.bectl/bectl_test/bectl_mount/ >>=20 >> It=E2=80=99s pretty obvious from the above run what=E2=80=99s going on fr= om the output. A similarly named zpool (same prefix; suffixed with a 2) is b= eing matched by grep, even though the test sets up one with a suffix in the p= receding steps. >>=20 >=20 > Right- this is the part that makes sense to me. =3D) The 'default2' BE > is clearly a leftover from a previous test, but it should've been > unmounted in the process and the zpool cleaned up. >=20 > What's not clear is how the cleanup routine is failing; the `zpool get > health` shouldn't have any reason to fail (though I can't test it > here, apparently =3D() and `zpool destroy -f` should've unmounted this > BE even if that hadn't happened throughout the course of the test, but > the failure remains (even if probably incorrectly fixed) following the > above commit. >=20 > Setting the zpool name globally with a suffix unique to this test > would likely be a great idea -- I think there's something else going > on as well, though. My comment about the zpool name being defined locally to tests as opposed is= globally is probably what=E2=80=99s tripping you up. The cleanup function i= s not run in the same shell context as the test. > Thanks, >=20 > Kyle Evans From owner-svn-src-head@freebsd.org Tue Jan 29 17:28:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B33D14C4EC9; Tue, 29 Jan 2019 17:28:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 871FD90DD6; Tue, 29 Jan 2019 17:28:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x631.google.com with SMTP id u18so9640469plq.7; Tue, 29 Jan 2019 09:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=jzjVYJLJIiarPfNOy0TXSskJEkw1j8yXcXNN4W3h7/o=; b=Y6exSORDKxi3EiSOPAUslFKyfQ8RoDbSjjw7gxzjXh/gHARPpMTWpv4FZw/BGa27sZ zOT+Q3B8lq+f6uh3zaV4ClFnd5sV379mWUCbT73tC/LqctT4Dwys0k8IxLodfN7x1EH1 J1XJ6Q7x28MpdqzCNXl9CGrJFmakpUUhVtsuE+uD9o6TAT6tjpYuTg+wrLdwemyrhfZp D0pXwiAvCmZuvHLnZSKgAd5X2sikA8pL0XJ3+jhVzHRCt/CTnJbg7egFp3M4rNOKMF1e CEW8j2gaEqLPzlpdHVHrB3wr0x1v64tQZ4KyzPDL6I6Mcn4GqGFGx5Po4HaE3uCjEPdT oa3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=jzjVYJLJIiarPfNOy0TXSskJEkw1j8yXcXNN4W3h7/o=; b=IV9zAIwSZ4PRmFjt3CqzFZPxTB9Yfc6lKjCh1HbvTE2uxmgdEl3uBiibtkafddtaoj cLdKYy38I5WBFnt2pmuhnyLSDSoT+yx/KQMO3U3LxwK0ak1cdyfI+7ismCf047437Wqq gtMlmILwXNqLOyDi7UpQDSsTV6+6aX2Kz5BPlqg0dHWcogfWVBjUyaC85vsN5xLKQdHw g96HvwBczW5vrWNM4FYHqEcezG8HRlMPr7KzT+AqzxzkSX7h3cAtUdViSslSlXzFebhm d92OkcxzFC3c4uIdrxzgX2aCiREjjP1e4fN4pS/jZUFEiSc8frsoVBc4gs0f+YYKa0Ij NJ/w== X-Gm-Message-State: AJcUukczHV2g5PDKjT8uVm4qIdEKdBOUn4ReMTciy5js3J9WAG0tHrc9 qeXolguO3Xuf39bOnUmdrTNJoXdz X-Google-Smtp-Source: ALg8bN5Zpvzhf3nN0SN3593twkIj7sfBMkE7ta4uRTdbeShCDx5aeLPaFiM6UENHro0wLqHK2URCEA== X-Received: by 2002:a17:902:2c03:: with SMTP id m3mr25597382plb.6.1548782937101; Tue, 29 Jan 2019 09:28:57 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a90sm61375989pfj.109.2019.01.29.09.28.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 09:28:56 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: <201901291706.x0TH6iKg009239@pdx.rh.CN85.dnsmgr.net> Date: Tue, 29 Jan 2019 09:28:55 -0800 Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <84917F83-B4CD-4AD3-97EA-528366468880@gmail.com> References: <201901291706.x0TH6iKg009239@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Rspamd-Queue-Id: 871FD90DD6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.980,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 17:28:59 -0000 > On Jan 29, 2019, at 09:06, Rodney W. Grimes wrote: >=20 > [ Charset UTF-8 unsupported, converting... ] >> On Jan 28, 2019, at 20:31, Rodney W. Grimes wrote: >>=20 >>>>> On Mon, Jan 28, 2019 at 10:09 PM Kyle Evans wrote= : >>>>>=20 >>>>> Author: kevans >>>>> Date: Tue Jan 29 04:08:49 2019 >>>>> New Revision: 343543 >>>>> URL: https://svnweb.freebsd.org/changeset/base/343543 >>>>>=20 >>>>> Log: >>>>> bectl(8) test: Force destroy the zpool in cleanup >>>>>=20 >>>>> This is a wild guess as to why bectl tests failed once upon a time in C= I, >>>>> given no apparent way to see a transcript of cleanup routines with Kyu= a. The >>>>> bectl tests construct a new, clean zpool for every test. The failure >>>>> indicated was because of a mount that was leftover from a previous tes= t, but >>>>> the previous test had succeeded so it's not clear how the mount remain= ed >>>>> leftover unless the `zpool get health ${pool}` had somehow failed. >>>>>=20 >>>>=20 >>>> I left out: the tests are supposed to be constructed to clean up any >>>> mounts that were left over in the course of the test, hence the >>>> assumption that the failure lies in the cleanup. >>=20 >> Hi Rod, >>=20 >>> =46rom my experience as a hardware test engineer the test >>> setup was required to make sure any of those assumptions >>> are valid. Meaning that the test would have to validate >>> that no left over cruft was going to interfere with the >>> test about to be run. >>>=20 >>> Ie, you should probably do a force destroy of the pool >>> *before* the test too. >>=20 >> While this approach makes sense and is valid, it would leave open/orphane= d resources after each test run (in this case a single zpool). It?s best to f= ix the underlying issue with how the test formulates, sets up, and tears dow= n the zpool. >=20 > I did not advocate in any way that the post run cleanup > should be removed. Infact you should have both a pre-test > assurance that the environment is correct and a post-test > cleanup trying to removall all artifacts. >=20 > You can fix the current issue, but eventually if you get > enough testing going on your going to start to find that > things fail in ways that do not clean up (machine crash > is one instance) and not doing a pretest cleanup is eventually > going to run aground of this pitfall. I understand what you mean, but we don=E2=80=99t have to worry about this. O= ur CI runs don=E2=80=99t persist today as the bhyve instance is setup at sta= rt and torn down at exit (it was a problem in the first few iterations). Fur= thermore, resources like zpools that the bectl tests construct are should tr= ansient in nature at import (don=E2=80=99t affect the zpool.cache file), mea= ning that it should not be reconnected on the next boot. Assuming $TMPDIR is set to /tmp (or unset for that matter) and a standard rc= .conf configuration (or better yet, a tmpfs/md-backed filesystem), all lefto= ver remnants on disk will be cleaned up at next boot on test hosts that are m= ore persistent. Cheers, -Enji= From owner-svn-src-head@freebsd.org Tue Jan 29 17:58:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C576114C5A31; Tue, 29 Jan 2019 17:58:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8EF921A3; Tue, 29 Jan 2019 17:58:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id A6649110D2; Tue, 29 Jan 2019 17:58:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests To: rgrimes@freebsd.org, Enji Cooper Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901291704.x0TH465F009223@pdx.rh.CN85.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <33683228-91fe-5956-7fd3-ce7b8947bed0@FreeBSD.org> Date: Tue, 29 Jan 2019 09:58:46 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201901291704.x0TH465F009223@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D8EF921A3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 17:58:59 -0000 On 1/29/19 9:04 AM, Rodney W. Grimes wrote: >>> On Jan 29, 2019, at 08:39, Kyle Evans wrote: >> It?s probably and issue with timing and the bhyve implementation for amd64 vs i386, or something else. > > There is not a i386 mode of bhyve, ie all guests run in the same 64 bit > virtualization and no part of the hyperviser knows if the guest is > executing 32 bit or 64 bit code. While I doubt the i386 vs amd64 bits matter, it's not true that the hypervisor doesn't know. The code to handle instruction emulation has to know since it has to walk the page tables to map guest virtual addresses to guest physical addresses. As a result, that part of bhyve knows about no paging vs 32-bit paging vs PAE paging vs 64-bit paging. (Thankfully it doesn't have to reason about real vs protected mode as we get the faulting virtual address which is after the hardware has handled segmentation.) -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Jan 29 18:09:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0268E14C5EC0; Tue, 29 Jan 2019 18:09:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 545D19299A; Tue, 29 Jan 2019 18:09:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0TI8vU4009505; Tue, 29 Jan 2019 10:08:57 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0TI8vRv009504; Tue, 29 Jan 2019 10:08:57 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901291808.x0TI8vRv009504@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343543 - head/sbin/bectl/tests In-Reply-To: <33683228-91fe-5956-7fd3-ce7b8947bed0@FreeBSD.org> To: John Baldwin Date: Tue, 29 Jan 2019 10:08:57 -0800 (PST) CC: rgrimes@freebsd.org, Enji Cooper , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 545D19299A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 18:09:03 -0000 [ Charset UTF-8 unsupported, converting... ] > On 1/29/19 9:04 AM, Rodney W. Grimes wrote: > >>> On Jan 29, 2019, at 08:39, Kyle Evans wrote: > >> It?s probably and issue with timing and the bhyve implementation for amd64 vs i386, or something else. > > > > There is not a i386 mode of bhyve, ie all guests run in the same 64 bit > > virtualization and no part of the hyperviser knows if the guest is > > executing 32 bit or 64 bit code. > > While I doubt the i386 vs amd64 bits matter, it's not true that the hypervisor > doesn't know. The code to handle instruction emulation has to know since it > has to walk the page tables to map guest virtual addresses to guest > physical addresses. As a result, that part of bhyve knows about no paging > vs 32-bit paging vs PAE paging vs 64-bit paging. (Thankfully it doesn't > have to reason about real vs protected mode as we get the faulting virtual > address which is after the hardware has handled segmentation.) I forgot about that, but it is not as if there is some great difference between running i386 or amd64 code inside bhyve. Other than some very small places like the instruction emulation, they are treated the same, and most of what is going on is purely done in the hardware of the CPU with respect to i386 vs amd64. Does a drop in and out of real mode even take a VMexit? You can also run real, 32bit or 64bit code all in the same bhyve instance and bhyve, other than the emulation really cares little about what your doingm, correct? Some people get the idea that because in VirtualBox, or Vmware you specify the guest as some 32 bit flavor or some 64 bit flavor of some OS that there are mass differences. You can tell ESXi that you have a 64 bit FreeBSD guest and load the 32 bit version in there and it runs just fine. IIRC you can even tell it you have a 32 bit guest, set the nested bit in your .vmx file and go run FreeBSD 64 bit with bhyuve guests inside it. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jan 29 19:42:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8691B14C94BA; Tue, 29 Jan 2019 19:42:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 047F296A24; Tue, 29 Jan 2019 19:42:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52d.google.com with SMTP id g189so9187779pgc.5; Tue, 29 Jan 2019 11:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=1+1GugW1X60E5vneE6bYddXyzY7pRPpyj22XJ3ZLupg=; b=I6zZhoGQAt+Kpgv94p2sp6zOp3wzVxjWRAl1TkLTJ8xrnAepGm5cs8v/9rv+Us1xfK 3EMpz1OU0r7Y9o73sc7TY15Da7KZpYB3U7A9dzrnHQt9BG1pj79EAf4M0oyA5ilPvY2c kLfWeelb9i+EjNnM3txR/Dw6+sI2+lZfrZZ7AFbaKiaV9N+P5CAK+7zTZY5ks61ED6Vq XudcNyhl/KOAr8OogB9NjEyG9ts9cwh6N66MUJ5AkcEGgKf2M9crkQtUpy0XYCG53208 qQF9b97i2T+8iNa37jyX3mucxxVKitnOkdgUbqKVOmz8k0h+HB3PYYMe7MboQDGRnnvH 7XJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=1+1GugW1X60E5vneE6bYddXyzY7pRPpyj22XJ3ZLupg=; b=KxEQD3fFywpiKaFl/Lq6VgznZSGbOidY9glpoN3xjG7bn5beV0+pUTaOC99wdENmK5 pVGMbii4U4Axsh7+R454lF5jalrAyNTwGuy7n743IV9emGwkwvCNo/91j/ERAaa0ipKY oxbrenayxTMPvaoQmFN2mAizDR0QoIJU0AyO6ieTGdIqeVp36cjRHnfVLPU8XEXQsvHg gkaPmYe1Wor9/X82midc0k6pRRwOIhwUD5UDNBZrVyDbDVbI4ptXxRie0w4twTYT8v08 IJyXsb1iQ94mGBY+XOqQ7j12JLnMh2agtO9ytz2TXjQzHyeGk8fplGXznpcBKcX9Jotj QzHQ== X-Gm-Message-State: AJcUukeQgX7JlCZe38qZ3JBZJlj4H+im2EzoQBQS+/WHZUK6rDzRIhfM R5K2HtR9mtUmRBya/pZKUCjOvxPI X-Google-Smtp-Source: ALg8bN46xGa/FyGFBuXMKdDvTCprEZe7646yjaiMmd2dFFR+cJZdtHwGfRmCJ9PFCYxMcaBa57YDog== X-Received: by 2002:a63:d104:: with SMTP id k4mr24326712pgg.227.1548790919509; Tue, 29 Jan 2019 11:41:59 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id x2sm49415488pfx.78.2019.01.29.11.41.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 11:41:58 -0800 (PST) From: Enji Cooper Message-Id: <89DD44B2-1A74-4FD4-9B66-26D924005892@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r343543 - head/sbin/bectl/tests Date: Tue, 29 Jan 2019 11:41:57 -0800 In-Reply-To: <1BE1B458-7AEA-412F-AD52-1E5554080422@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Kyle Evans References: <201901290408.x0T48oJQ080243@repo.freebsd.org> <674E01AB-49C7-4B40-B2FD-6EB4AFEAB1FD@gmail.com> <5687EE07-74FB-4233-B51D-C8948641E8CB@gmail.com> <1BE1B458-7AEA-412F-AD52-1E5554080422@gmail.com> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 047F296A24 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 19:42:02 -0000 > On Jan 29, 2019, at 9:21 AM, Enji Cooper = wrote: =E2=80=A6 >> Right- this is the part that makes sense to me. =3D) The 'default2' = BE >> is clearly a leftover from a previous test, but it should've been >> unmounted in the process and the zpool cleaned up. >>=20 >> What's not clear is how the cleanup routine is failing; the `zpool = get >> health` shouldn't have any reason to fail (though I can't test it >> here, apparently =3D() and `zpool destroy -f` should've unmounted = this >> BE even if that hadn't happened throughout the course of the test, = but >> the failure remains (even if probably incorrectly fixed) following = the >> above commit. >>=20 >> Setting the zpool name globally with a suffix unique to this test >> would likely be a great idea -- I think there's something else going >> on as well, though. >=20 > My comment about the zpool name being defined locally to tests as = opposed is globally is probably what=E2=80=99s tripping you up. The = cleanup function is not run in the same shell context as the test. I submitted a proposed fix here: https://reviews.freebsd.org/D19024 = . After doing some more thinking, it dawned on me that these tests might = not be running in parallel, which (because they weren=E2=80=99t using = unique names) could be clashing with parallel executing tests. -Enji= From owner-svn-src-head@freebsd.org Tue Jan 29 19:54:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 252A514C9B59; Tue, 29 Jan 2019 19:54:38 +0000 (UTC) (envelope-from gonzo@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 C00849724F; Tue, 29 Jan 2019 19:54:37 +0000 (UTC) (envelope-from gonzo@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 B4B3EC9E8; Tue, 29 Jan 2019 19:54:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0TJsb0Y084944; Tue, 29 Jan 2019 19:54:37 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TJsb5d084943; Tue, 29 Jan 2019 19:54:37 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901291954.x0TJsb5d084943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 29 Jan 2019 19:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343560 - head/usr.bin/calendar/calendars/de_AT.ISO_8859-15 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/calendar/calendars/de_AT.ISO_8859-15 X-SVN-Commit-Revision: 343560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C00849724F 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 19:54:38 -0000 Author: gonzo Date: Tue Jan 29 19:54:37 2019 New Revision: 343560 URL: https://svnweb.freebsd.org/changeset/base/343560 Log: calendar(1): Fix Aschermittwoch date for Austrian calendar PR: 165516 Submitted by: jhs@berklix.com MFC after: 1 week Modified: head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag Modified: head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag ============================================================================== --- head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag Tue Jan 29 18:18:55 2019 (r343559) +++ head/usr.bin/calendar/calendars/de_AT.ISO_8859-15/calendar.feiertag Tue Jan 29 19:54:37 2019 (r343560) @@ -37,7 +37,7 @@ Easter+60 Fronleichnam /* Gedenktage - nicht arbeitsfreie Feiertage */ 02/14 Valentinstag -02/WednesdayLast Aschermittwoch +Easter-46 Aschermittwoch Easter-7 Palmsonntag Nov Sun+3 Totensonntag Nov Sun+4 1. Advent From owner-svn-src-head@freebsd.org Tue Jan 29 20:10:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3A7314CA2DA; Tue, 29 Jan 2019 20:10:28 +0000 (UTC) (envelope-from obrien@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 75BF797B78; Tue, 29 Jan 2019 20:10:28 +0000 (UTC) (envelope-from obrien@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 64BFBCBBE; Tue, 29 Jan 2019 20:10:28 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0TKAS92090827; Tue, 29 Jan 2019 20:10:28 GMT (envelope-from obrien@FreeBSD.org) Received: (from obrien@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TKAR6G090826; Tue, 29 Jan 2019 20:10:27 GMT (envelope-from obrien@FreeBSD.org) Message-Id: <201901292010.x0TKAR6G090826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: obrien set sender to obrien@FreeBSD.org using -f From: "David E. O'Brien" Date: Tue, 29 Jan 2019 20:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343561 - in head/sys: arm64/include riscv/include X-SVN-Group: head X-SVN-Commit-Author: obrien X-SVN-Commit-Paths: in head/sys: arm64/include riscv/include X-SVN-Commit-Revision: 343561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75BF797B78 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.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 20:10:29 -0000 Author: obrien Date: Tue Jan 29 20:10:27 2019 New Revision: 343561 URL: https://svnweb.freebsd.org/changeset/base/343561 Log: Follow arm[32] and sparc64 KAPI and provide the FreeBSD standard spelling across all architectures for this header. Reviewed by: stevek Obtained from: Juniper Networks Added: head/sys/arm64/include/sigframe.h - copied unchanged from r343560, head/sys/arm/include/sigframe.h head/sys/riscv/include/sigframe.h - copied unchanged from r343560, head/sys/arm/include/sigframe.h Copied: head/sys/arm64/include/sigframe.h (from r343560, head/sys/arm/include/sigframe.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/sigframe.h Tue Jan 29 20:10:27 2019 (r343561, copy of r343560, head/sys/arm/include/sigframe.h) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include Copied: head/sys/riscv/include/sigframe.h (from r343560, head/sys/arm/include/sigframe.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/sigframe.h Tue Jan 29 20:10:27 2019 (r343561, copy of r343560, head/sys/arm/include/sigframe.h) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include From owner-svn-src-head@freebsd.org Tue Jan 29 20:35:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C268A14CAF6F; Tue, 29 Jan 2019 20:35:10 +0000 (UTC) (envelope-from mav@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 663F36A202; Tue, 29 Jan 2019 20:35:10 +0000 (UTC) (envelope-from mav@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 0FCD3D106; Tue, 29 Jan 2019 20:35:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0TKZ9T4006530; Tue, 29 Jan 2019 20:35:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TKZ9Yj006529; Tue, 29 Jan 2019 20:35:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901292035.x0TKZ9Yj006529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Jan 2019 20:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343562 - head/sys/dev/nvd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvd X-SVN-Commit-Revision: 343562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 663F36A202 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.998,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)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 20:35:11 -0000 Author: mav Date: Tue Jan 29 20:35:09 2019 New Revision: 343562 URL: https://svnweb.freebsd.org/changeset/base/343562 Log: Reimplement BIO_ORDERED handling in nvd(4). This fixes BIO_ORDERED semantics while also improving performance by: - sleeping also before BIO_ORDERED bio, as defined, not only after; - not queueing BIO_ORDERED bio to taskqueue if no other bios running; - waking up sleeping taskqueue explicitly rather then rely on polling. On Samsung SSD 970 PRO this shows sync write latency, measured with `diskinfo -wS`, reduction from ~2ms to ~1.1ms by not sleeping without reason till next HZ tick. On the same device ZFS pool with 8 ZVOLs synchronously writing 4KB blocks shows ~950 IOPS instead of ~750 IOPS before. I suspect ZFS does not need BIO_ORDERED on BIO_FLUSH at all, but that will be next question. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Tue Jan 29 20:10:27 2019 (r343561) +++ head/sys/dev/nvd/nvd.c Tue Jan 29 20:35:09 2019 (r343562) @@ -82,6 +82,7 @@ struct nvd_disk { struct nvme_namespace *ns; uint32_t cur_depth; +#define NVD_ODEPTH (1 << 31) uint32_t ordered_in_flight; u_int unit; @@ -181,39 +182,50 @@ nvd_unload() mtx_destroy(&nvd_lock); } -static int +static void nvd_bio_submit(struct nvd_disk *ndisk, struct bio *bp) { int err; bp->bio_driver1 = NULL; - atomic_add_int(&ndisk->cur_depth, 1); + if (__predict_false(bp->bio_flags & BIO_ORDERED)) + atomic_add_int(&ndisk->cur_depth, NVD_ODEPTH); + else + atomic_add_int(&ndisk->cur_depth, 1); err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); if (err) { - atomic_add_int(&ndisk->cur_depth, -1); - if (__predict_false(bp->bio_flags & BIO_ORDERED)) + if (__predict_false(bp->bio_flags & BIO_ORDERED)) { + atomic_add_int(&ndisk->cur_depth, -NVD_ODEPTH); atomic_add_int(&ndisk->ordered_in_flight, -1); + wakeup(&ndisk->cur_depth); + } else { + if (atomic_fetchadd_int(&ndisk->cur_depth, -1) == 1 && + __predict_false(ndisk->ordered_in_flight != 0)) + wakeup(&ndisk->cur_depth); + } bp->bio_error = err; bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; biodone(bp); - return (-1); } - - return (0); } static void nvd_strategy(struct bio *bp) { - struct nvd_disk *ndisk; + struct nvd_disk *ndisk = (struct nvd_disk *)bp->bio_disk->d_drv1; - ndisk = (struct nvd_disk *)bp->bio_disk->d_drv1; - - if (__predict_false(bp->bio_flags & BIO_ORDERED)) - atomic_add_int(&ndisk->ordered_in_flight, 1); - - if (__predict_true(ndisk->ordered_in_flight == 0)) { + /* + * bio with BIO_ORDERED flag must be executed after all previous + * bios in the queue, and before any successive bios. + */ + if (__predict_false(bp->bio_flags & BIO_ORDERED)) { + if (atomic_fetchadd_int(&ndisk->ordered_in_flight, 1) == 0 && + ndisk->cur_depth == 0 && bioq_first(&ndisk->bioq) == NULL) { + nvd_bio_submit(ndisk, bp); + return; + } + } else if (__predict_true(ndisk->ordered_in_flight == 0)) { nvd_bio_submit(ndisk, bp); return; } @@ -281,28 +293,27 @@ nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, static int nvd_dump(void *arg, void *virt, vm_offset_t phys, off_t offset, size_t len) { - struct nvd_disk *ndisk; - struct disk *dp; + struct disk *dp = arg; + struct nvd_disk *ndisk = dp->d_drv1; - dp = arg; - ndisk = dp->d_drv1; - return (nvme_ns_dump(ndisk->ns, virt, offset, len)); } static void nvd_done(void *arg, const struct nvme_completion *cpl) { - struct bio *bp; - struct nvd_disk *ndisk; + struct bio *bp = (struct bio *)arg; + struct nvd_disk *ndisk = bp->bio_disk->d_drv1; - bp = (struct bio *)arg; - - ndisk = bp->bio_disk->d_drv1; - - atomic_add_int(&ndisk->cur_depth, -1); - if (__predict_false(bp->bio_flags & BIO_ORDERED)) + if (__predict_false(bp->bio_flags & BIO_ORDERED)) { + atomic_add_int(&ndisk->cur_depth, -NVD_ODEPTH); atomic_add_int(&ndisk->ordered_in_flight, -1); + wakeup(&ndisk->cur_depth); + } else { + if (atomic_fetchadd_int(&ndisk->cur_depth, -1) == 1 && + __predict_false(ndisk->ordered_in_flight != 0)) + wakeup(&ndisk->cur_depth); + } biodone(bp); } @@ -320,22 +331,23 @@ nvd_bioq_process(void *arg, int pending) if (bp == NULL) break; - if (nvd_bio_submit(ndisk, bp) != 0) { - continue; + if (__predict_false(bp->bio_flags & BIO_ORDERED)) { + /* + * bio with BIO_ORDERED flag set must be executed + * after all previous bios. + */ + while (ndisk->cur_depth > 0) + tsleep(&ndisk->cur_depth, 0, "nvdorb", 1); + } else { + /* + * bio with BIO_ORDERED flag set must be completed + * before proceeding with additional bios. + */ + while (ndisk->cur_depth >= NVD_ODEPTH) + tsleep(&ndisk->cur_depth, 0, "nvdora", 1); } -#ifdef BIO_ORDERED - /* - * BIO_ORDERED flag dictates that the bio with BIO_ORDERED - * flag set must be completed before proceeding with - * additional bios. - */ - if (bp->bio_flags & BIO_ORDERED) { - while (ndisk->cur_depth > 0) { - pause("nvd flush", 1); - } - } -#endif + nvd_bio_submit(ndisk, bp); } } From owner-svn-src-head@freebsd.org Tue Jan 29 20:50:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C1E014CB498; Tue, 29 Jan 2019 20:50:30 +0000 (UTC) (envelope-from mav@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 A87396AB4D; Tue, 29 Jan 2019 20:50:29 +0000 (UTC) (envelope-from mav@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 9AFC0D2B9; Tue, 29 Jan 2019 20:50:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0TKoToa011957; Tue, 29 Jan 2019 20:50:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TKoTCD011956; Tue, 29 Jan 2019 20:50:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901292050.x0TKoTCD011956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Jan 2019 20:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343563 - head/sys/dev/nvd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvd X-SVN-Commit-Revision: 343563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A87396AB4D 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 20:50:30 -0000 Author: mav Date: Tue Jan 29 20:50:29 2019 New Revision: 343563 URL: https://svnweb.freebsd.org/changeset/base/343563 Log: Fix GCC build, failed due to false integer overflow in r343562. MFC after: 2 weeks Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Tue Jan 29 20:35:09 2019 (r343562) +++ head/sys/dev/nvd/nvd.c Tue Jan 29 20:50:29 2019 (r343563) @@ -82,7 +82,7 @@ struct nvd_disk { struct nvme_namespace *ns; uint32_t cur_depth; -#define NVD_ODEPTH (1 << 31) +#define NVD_ODEPTH (1 << 30) uint32_t ordered_in_flight; u_int unit; From owner-svn-src-head@freebsd.org Tue Jan 29 22:11:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FBD914A9D9F; Tue, 29 Jan 2019 22:11:14 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03BC86DA00; Tue, 29 Jan 2019 22:11:13 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x0TMB6t3095930 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 30 Jan 2019 00:11:09 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x0TMB6t3095930 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x0TMB6gY095929; Wed, 30 Jan 2019 00:11:06 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Wed, 30 Jan 2019 00:11:06 +0200 From: Konstantin Belousov To: "David E. O'Brien" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343561 - in head/sys: arm64/include riscv/include Message-ID: <20190129221106.GN24863@kib.kiev.ua> References: <201901292010.x0TKAR6G090826@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901292010.x0TKAR6G090826@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 22:11:14 -0000 On Tue, Jan 29, 2019 at 08:10:27PM +0000, David E. O'Brien wrote: > Author: obrien > Date: Tue Jan 29 20:10:27 2019 > New Revision: 343561 > URL: https://svnweb.freebsd.org/changeset/base/343561 > > Log: > Follow arm[32] and sparc64 KAPI and provide the FreeBSD standard spelling > across all architectures for this header. > > Reviewed by: stevek > Obtained from: Juniper Networks > > Added: > head/sys/arm64/include/sigframe.h > - copied unchanged from r343560, head/sys/arm/include/sigframe.h > head/sys/riscv/include/sigframe.h > - copied unchanged from r343560, head/sys/arm/include/sigframe.h > > Copied: head/sys/arm64/include/sigframe.h (from r343560, head/sys/arm/include/sigframe.h) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm64/include/sigframe.h Tue Jan 29 20:10:27 2019 (r343561, copy of r343560, head/sys/arm/include/sigframe.h) > @@ -0,0 +1,2 @@ > +/* $FreeBSD$ */ > +#include > > Copied: head/sys/riscv/include/sigframe.h (from r343560, head/sys/arm/include/sigframe.h) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/riscv/include/sigframe.h Tue Jan 29 20:10:27 2019 (r343561, copy of r343560, head/sys/arm/include/sigframe.h) > @@ -0,0 +1,2 @@ > +/* $FreeBSD$ */ > +#include All other architectures are careful to only provide sigframe definition in machine/sigframe.h. For instance trapframes are not exposed. This is the main reason why frame.h and sigframe.h both exist. From owner-svn-src-head@freebsd.org Tue Jan 29 22:40:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69E0614AAB03; Tue, 29 Jan 2019 22:40:44 +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 0D4C56E9B8; Tue, 29 Jan 2019 22:40:44 +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 011C3E565; Tue, 29 Jan 2019 22:40:44 +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 x0TMehbt069083; Tue, 29 Jan 2019 22:40:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TMehlO069079; Tue, 29 Jan 2019 22:40:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901292240.x0TMehlO069079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Jan 2019 22:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343564 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 343564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D4C56E9B8 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 22:40:44 -0000 Author: kib Date: Tue Jan 29 22:40:42 2019 New Revision: 343564 URL: https://svnweb.freebsd.org/changeset/base/343564 Log: Adjust posix symbols from rtld-elf/malloc.c with the __crt_ prefix. This allows to reuse the allocator in other environments that get malloc(3) and related functions from libc or interposer. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18988 Modified: head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/libexec/rtld-elf/xmalloc.c Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Tue Jan 29 20:50:29 2019 (r343563) +++ head/libexec/rtld-elf/malloc.c Tue Jan 29 22:40:42 2019 (r343564) @@ -153,7 +153,7 @@ botch(s) */ void * -malloc(size_t nbytes) +__crt_malloc(size_t nbytes) { union overhead *op; int bucket; @@ -236,7 +236,7 @@ malloc(size_t nbytes) } void * -calloc(size_t num, size_t size) +__crt_calloc(size_t num, size_t size) { void *ret; @@ -245,7 +245,7 @@ calloc(size_t num, size_t size) return (NULL); } - if ((ret = malloc(num * size)) != NULL) + if ((ret = __crt_malloc(num * size)) != NULL) memset(ret, 0, num * size); return (ret); @@ -298,7 +298,7 @@ morecore(int bucket) } void -free(void * cp) +__crt_free(void *cp) { int size; union overhead *op; @@ -339,7 +339,7 @@ free(void * cp) static int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ void * -realloc(void *cp, size_t nbytes) +__crt_realloc(void *cp, size_t nbytes) { u_int onb; int i; @@ -348,7 +348,7 @@ realloc(void *cp, size_t nbytes) int was_alloced = 0; if (cp == NULL) - return (malloc(nbytes)); + return (__crt_malloc(nbytes)); op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); if (op->ov_magic == MAGIC) { was_alloced++; @@ -393,10 +393,10 @@ realloc(void *cp, size_t nbytes) #endif return(cp); } else - free(cp); + __crt_free(cp); } - if ((res = malloc(nbytes)) == NULL) - return (NULL); + if ((res = __crt_malloc(nbytes)) == NULL) + return (NULL); if (cp != res) /* common optimization if "compacting" */ bcopy(cp, res, (nbytes < onb) ? nbytes : onb); return (res); @@ -467,9 +467,11 @@ morepages(int n) caddr_t addr = (caddr_t) (((long)pagepool_start + pagesz - 1) & ~(pagesz - 1)); if (munmap(addr, pagepool_end - addr) != 0) { +#ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": " "morepages: cannot munmap %p: %s\n", addr, rtld_strerror(errno)); +#endif } } @@ -478,9 +480,11 @@ morepages(int n) if ((pagepool_start = mmap(0, n * pagesz, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, fd, 0)) == (caddr_t)-1) { +#ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": morepages: " "cannot mmap anonymous memory: %s\n", rtld_strerror(errno)); +#endif return 0; } pagepool_end = pagepool_start + n * pagesz; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 29 20:50:29 2019 (r343563) +++ head/libexec/rtld-elf/rtld.c Tue Jan 29 22:40:42 2019 (r343564) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "paths.h" #include "rtld_tls.h" #include "rtld_printf.h" +#include "rtld_malloc.h" #include "rtld_utrace.h" #include "notes.h" @@ -5636,4 +5637,33 @@ bzero(void *dest, size_t len) for (i = 0; i < len; i++) ((char *)dest)[i] = 0; +} + +/* malloc */ +void * +malloc(size_t nbytes) +{ + + return (__crt_malloc(nbytes)); +} + +void * +calloc(size_t num, size_t size) +{ + + return (__crt_calloc(num, size)); +} + +void +free(void *cp) +{ + + __crt_free(cp); +} + +void * +realloc(void *cp, size_t nbytes) +{ + + return (__crt_realloc(cp, nbytes)); } Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Tue Jan 29 20:50:29 2019 (r343563) +++ head/libexec/rtld-elf/rtld.h Tue Jan 29 22:40:42 2019 (r343564) @@ -409,4 +409,9 @@ void pre_init(void); void init_pltgot(Obj_Entry *); void allocate_initial_tls(Obj_Entry *); +void *__crt_calloc(size_t num, size_t size); +void __crt_free(void *cp); +void *__crt_malloc(size_t nbytes); +void *__crt_realloc(void *cp, size_t nbytes); + #endif /* } */ Modified: head/libexec/rtld-elf/xmalloc.c ============================================================================== --- head/libexec/rtld-elf/xmalloc.c Tue Jan 29 20:50:29 2019 (r343563) +++ head/libexec/rtld-elf/xmalloc.c Tue Jan 29 22:40:42 2019 (r343564) @@ -33,13 +33,14 @@ #include #include "rtld.h" #include "rtld_printf.h" +#include "rtld_malloc.h" void * xcalloc(size_t number, size_t size) { void *p; - p = calloc(number, size); + p = __crt_calloc(number, size); if (p == NULL) { rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); _exit(1); @@ -50,12 +51,15 @@ xcalloc(size_t number, size_t size) void * xmalloc(size_t size) { - void *p = malloc(size); - if (p == NULL) { - rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); - _exit(1); - } - return p; + + void *p; + + p = __crt_malloc(size); + if (p == NULL) { + rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); + _exit(1); + } + return (p); } char * From owner-svn-src-head@freebsd.org Tue Jan 29 22:45:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C096C14AAEBD; Tue, 29 Jan 2019 22:45:25 +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 67ADD6EEB4; Tue, 29 Jan 2019 22:45:25 +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 403B4E710; Tue, 29 Jan 2019 22:45:25 +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 x0TMjPgo074025; Tue, 29 Jan 2019 22:45:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TMjPeB074024; Tue, 29 Jan 2019 22:45:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901292245.x0TMjPeB074024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Jan 2019 22:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343565 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 343565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67ADD6EEB4 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 22:45:26 -0000 Author: kib Date: Tue Jan 29 22:45:24 2019 New Revision: 343565 URL: https://svnweb.freebsd.org/changeset/base/343565 Log: Add header file missed in r343564. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18988 Added: head/libexec/rtld-elf/rtld_malloc.h (contents, props changed) Added: head/libexec/rtld-elf/rtld_malloc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/rtld_malloc.h Tue Jan 29 22:45:24 2019 (r343565) @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef RTLD_MALLOC_H +#define RTLD_MALLOC_H + +void *__crt_calloc(size_t num, size_t size); +void __crt_free(void *cp); +void *__crt_malloc(size_t nbytes); +void *__crt_realloc(void *cp, size_t nbytes); + +extern int npagesizes; +extern size_t *pagesizes; + +#endif From owner-svn-src-head@freebsd.org Tue Jan 29 22:46:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5094614AAF5B; Tue, 29 Jan 2019 22:46:47 +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 EB8496F0B6; Tue, 29 Jan 2019 22:46:46 +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 99D56E74D; Tue, 29 Jan 2019 22:46:46 +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 x0TMkkWV074129; Tue, 29 Jan 2019 22:46:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0TMkjQH074121; Tue, 29 Jan 2019 22:46:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901292246.x0TMkjQH074121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Jan 2019 22:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343566 - in head/lib/libthr: . thread X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/lib/libthr: . thread X-SVN-Commit-Revision: 343566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB8496F0B6 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 22:46:47 -0000 Author: kib Date: Tue Jan 29 22:46:44 2019 New Revision: 343566 URL: https://svnweb.freebsd.org/changeset/base/343566 Log: Untangle jemalloc and mutexes initialization. The need to use libc malloc(3) from some places in libthr always caused issues. For instance, per-thread key allocation was switched to use plain mmap(2) to get storage, because some third party mallocs used keys for implementation of calloc(3). Even more important, libthr calls calloc(3) during initialization of pthread mutexes, and jemalloc uses pthread mutexes. Jemalloc provides some way to both postpone the initialization, and to make initialization to use specialized allocator, but this is very fragile and often breaks. See the referenced PR for another example. Add the small malloc implementation used by rtld, to libthr. Use it in thr_spec.c and for mutexes initialization. This avoids the issues with mutual dependencies between malloc and libthr in principle. The drawback is that some more allocations are not interceptable for alternate malloc implementations. There should be not too much memory use from this allocator, and the alternative, direct use of mmap(2) is obviously worse. PR: 235211 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18988 Added: head/lib/libthr/thread/thr_malloc.c (contents, props changed) Modified: head/lib/libthr/Makefile head/lib/libthr/thread/Makefile.inc head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_mutex.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_spec.c Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Tue Jan 29 22:45:24 2019 (r343565) +++ head/lib/libthr/Makefile Tue Jan 29 22:46:44 2019 (r343566) @@ -27,6 +27,7 @@ CFLAGS+=-I${SRCTOP}/lib/libthread_db CFLAGS+=-Winline CFLAGS.thr_stack.c+= -Wno-cast-align +CFLAGS.malloc.c+= -Wno-cast-align .include .if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300) CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations @@ -50,12 +51,14 @@ CFLAGS+=-D_PTHREADS_INVARIANTS PRECIOUSLIB= .PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH} +.PATH: ${SRCTOP}/libexec/rtld-elf .if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc) .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" .endif .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" +SRCS+= malloc.c .if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a Modified: head/lib/libthr/thread/Makefile.inc ============================================================================== --- head/lib/libthr/thread/Makefile.inc Tue Jan 29 22:45:24 2019 (r343565) +++ head/lib/libthr/thread/Makefile.inc Tue Jan 29 22:46:44 2019 (r343566) @@ -31,6 +31,7 @@ SRCS+= \ thr_kern.c \ thr_kill.c \ thr_main_np.c \ + thr_malloc.c \ thr_multi_np.c \ thr_mutex.c \ thr_mutexattr.c \ Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Tue Jan 29 22:45:24 2019 (r343565) +++ head/lib/libthr/thread/thr_fork.c Tue Jan 29 22:46:44 2019 (r343566) @@ -170,6 +170,7 @@ __thr_fork(void) */ if (_thr_isthreaded() != 0) { was_threaded = 1; + __thr_malloc_prefork(curthread); _malloc_prefork(); __thr_pshared_atfork_pre(); _rtld_atfork_pre(rtld_locks); @@ -197,6 +198,10 @@ __thr_fork(void) */ curthread->tlflags &= ~TLFLAGS_IN_TDLIST; + /* before thr_self() */ + if (was_threaded) + __thr_malloc_postfork(curthread); + /* child is a new kernel thread. */ thr_self(&curthread->tid); @@ -241,6 +246,7 @@ __thr_fork(void) _thr_signal_postfork(); if (was_threaded) { + __thr_malloc_postfork(curthread); _rtld_atfork_post(rtld_locks); __thr_pshared_atfork_post(); _malloc_postfork(); Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Tue Jan 29 22:45:24 2019 (r343565) +++ head/lib/libthr/thread/thr_init.c Tue Jan 29 22:46:44 2019 (r343566) @@ -461,6 +461,7 @@ init_private(void) */ if (init_once == 0) { __thr_pshared_init(); + __thr_malloc_init(); /* Find the stack top */ mib[0] = CTL_KERN; mib[1] = KERN_USRSTACK; Added: head/lib/libthr/thread/thr_malloc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/thread/thr_malloc.c Tue Jan 29 22:46:44 2019 (r343566) @@ -0,0 +1,137 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "thr_private.h" + +int npagesizes; +size_t *pagesizes; +static size_t pagesizes_d[2]; +static struct umutex thr_malloc_umtx; + +void +__thr_malloc_init(void) +{ + + npagesizes = getpagesizes(pagesizes_d, nitems(pagesizes_d)); + if (npagesizes == -1) { + npagesizes = 1; + pagesizes_d[0] = PAGE_SIZE; + } + pagesizes = pagesizes_d; + _thr_umutex_init(&thr_malloc_umtx); +} + +static void +thr_malloc_lock(struct pthread *curthread) +{ + + curthread->locklevel++; + _thr_umutex_lock(&thr_malloc_umtx, TID(curthread)); +} + +static void +thr_malloc_unlock(struct pthread *curthread) +{ + + _thr_umutex_unlock(&thr_malloc_umtx, TID(curthread)); + curthread->locklevel--; + _thr_ast(curthread); +} + +void * +__thr_calloc(size_t num, size_t size) +{ + struct pthread *curthread; + void *res; + + curthread = _get_curthread(); + thr_malloc_lock(curthread); + res = __crt_calloc(num, size); + thr_malloc_unlock(curthread); + return (res); +} + +void +__thr_free(void *cp) +{ + struct pthread *curthread; + + curthread = _get_curthread(); + thr_malloc_lock(curthread); + __crt_free(cp); + thr_malloc_unlock(curthread); +} + +void * +__thr_malloc(size_t nbytes) +{ + struct pthread *curthread; + void *res; + + curthread = _get_curthread(); + thr_malloc_lock(curthread); + res = __crt_malloc(nbytes); + thr_malloc_unlock(curthread); + return (res); +} + +void * +__thr_realloc(void *cp, size_t nbytes) +{ + struct pthread *curthread; + void *res; + + curthread = _get_curthread(); + thr_malloc_lock(curthread); + res = __crt_realloc(cp, nbytes); + thr_malloc_unlock(curthread); + return (res); +} + +void +__thr_malloc_prefork(struct pthread *curthread) +{ + + _thr_umutex_lock(&thr_malloc_umtx, TID(curthread)); +} + +void +__thr_malloc_postfork(struct pthread *curthread) +{ + + _thr_umutex_unlock(&thr_malloc_umtx, TID(curthread)); +} Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Tue Jan 29 22:45:24 2019 (r343565) +++ head/lib/libthr/thread/thr_mutex.c Tue Jan 29 22:46:44 2019 (r343566) @@ -306,10 +306,11 @@ init_static(struct pthread *thread, pthread_mutex_t *m THR_LOCK_ACQUIRE(thread, &_mutex_static_lock); if (*mutex == THR_MUTEX_INITIALIZER) - ret = mutex_init(mutex, &_pthread_mutexattr_default, calloc); + ret = mutex_init(mutex, &_pthread_mutexattr_default, + __thr_calloc); else if (*mutex == THR_ADAPTIVE_MUTEX_INITIALIZER) ret = mutex_init(mutex, &_pthread_mutexattr_adaptive_default, - calloc); + __thr_calloc); else ret = 0; THR_LOCK_RELEASE(thread, &_mutex_static_lock); @@ -390,7 +391,7 @@ __pthread_mutex_init(pthread_mutex_t * __restrict mute if (mutex_attr == NULL || (*mutex_attr)->m_pshared == PTHREAD_PROCESS_PRIVATE) { return (mutex_init(mutex, mutex_attr ? *mutex_attr : NULL, - calloc)); + __thr_calloc)); } pmtx = __thr_pshared_offpage(__DECONST(void *, mutex), 1); if (pmtx == NULL) @@ -483,7 +484,7 @@ _pthread_mutex_destroy(pthread_mutex_t *mutex) } else { *mutex = THR_MUTEX_DESTROYED; mutex_assert_not_owned(_get_curthread(), m); - free(m); + __thr_free(m); ret = 0; } } Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Tue Jan 29 22:45:24 2019 (r343565) +++ head/lib/libthr/thread/thr_private.h Tue Jan 29 22:46:44 2019 (r343566) @@ -1003,6 +1003,14 @@ void __thr_pshared_destroy(void *key) __hidden; void __thr_pshared_atfork_pre(void) __hidden; void __thr_pshared_atfork_post(void) __hidden; +void *__thr_calloc(size_t num, size_t size); +void __thr_free(void *cp); +void *__thr_malloc(size_t nbytes); +void *__thr_realloc(void *cp, size_t nbytes); +void __thr_malloc_init(void); +void __thr_malloc_prefork(struct pthread *curthread); +void __thr_malloc_postfork(struct pthread *curthread); + __END_DECLS __NULLABILITY_PRAGMA_POP Modified: head/lib/libthr/thread/thr_spec.c ============================================================================== --- head/lib/libthr/thread/thr_spec.c Tue Jan 29 22:45:24 2019 (r343565) +++ head/lib/libthr/thread/thr_spec.c Tue Jan 29 22:46:44 2019 (r343566) @@ -155,8 +155,7 @@ _thread_cleanupspecific(void) } } THR_LOCK_RELEASE(curthread, &_keytable_lock); - munmap(curthread->specific, PTHREAD_KEYS_MAX * sizeof(struct - pthread_specific_elem)); + __thr_free(curthread->specific); curthread->specific = NULL; if (curthread->specific_data_count > 0) { stderr_debug("Thread %p has exited with leftover " @@ -179,10 +178,9 @@ _pthread_setspecific(pthread_key_t userkey, const void pthread = _get_curthread(); if (pthread->specific == NULL) { - tmp = mmap(NULL, PTHREAD_KEYS_MAX * - sizeof(struct pthread_specific_elem), - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); - if (tmp == MAP_FAILED) + tmp = __thr_calloc(PTHREAD_KEYS_MAX, + sizeof(struct pthread_specific_elem)); + if (tmp == NULL) return (ENOMEM); pthread->specific = tmp; } From owner-svn-src-head@freebsd.org Wed Jan 30 02:07:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8399914B0061; Wed, 30 Jan 2019 02:07:18 +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 2DC12750F7; Wed, 30 Jan 2019 02:07:18 +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 EFD4C189BE; Wed, 30 Jan 2019 02:07:17 +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 x0U27HDa077134; Wed, 30 Jan 2019 02:07:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0U27EYT077113; Wed, 30 Jan 2019 02:07:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901300207.x0U27EYT077113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Jan 2019 02:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343567 - in head: lib/libkvm sys/conf sys/dev/dcons sys/dev/fb sys/dev/syscons sys/i386/acpica sys/i386/i386 sys/i386/include sys/i386/pci sys/x86/acpica sys/x86/include sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libkvm sys/conf sys/dev/dcons sys/dev/fb sys/dev/syscons sys/i386/acpica sys/i386/i386 sys/i386/include sys/i386/pci sys/x86/acpica sys/x86/include sys/x86/x86 X-SVN-Commit-Revision: 343567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DC12750F7 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 02:07:19 -0000 Author: kib Date: Wed Jan 30 02:07:13 2019 New Revision: 343567 URL: https://svnweb.freebsd.org/changeset/base/343567 Log: i386: Merge PAE and non-PAE pmaps into same kernel. Effectively all i386 kernels now have two pmaps compiled in: one managing PAE pagetables, and another non-PAE. The implementation is selected at cold time depending on the CPU features. The vm_paddr_t is always 64bit now. As result, nx bit can be used on all capable CPUs. Option PAE only affects the bus_addr_t: it is still 32bit for non-PAE configs, for drivers compatibility. Kernel layout, esp. max kernel address, low memory PDEs and max user address (same as trampoline start) are now same for PAE and for non-PAE regardless of the type of page tables used. Non-PAE kernel (when using PAE pagetables) can handle physical memory up to 24G now, larger memory requires re-tuning the KVA consumers and instead the code caps the maximum at 24G. Unfortunately, a lot of drivers do not use busdma(9) properly so by default even 4G barrier is not easy. There are two tunables added: hw.above4g_allow and hw.above24g_allow, the first one is kept enabled for now to evaluate the status on HEAD, second is only for dev use. i386 now creates three freelists if there is any memory above 4G, to allow proper bounce pages allocation. Also, VM_KMEM_SIZE_SCALE changed from 3 to 1. The PAE_TABLES kernel config option is retired. In collaboarion with: pho Discussed with: emaste Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18894 Added: head/sys/i386/i386/minidump_machdep_base.c - copied, changed from r343566, head/sys/i386/i386/minidump_machdep.c head/sys/i386/i386/minidump_machdep_nopae.c - copied, changed from r343566, head/sys/i386/i386/minidump_machdep.c head/sys/i386/i386/minidump_machdep_pae.c - copied, changed from r343566, head/sys/i386/i386/minidump_machdep.c head/sys/i386/i386/pmap_base.c (contents, props changed) head/sys/i386/i386/pmap_nopae.c (contents, props changed) head/sys/i386/i386/pmap_pae.c (contents, props changed) head/sys/i386/include/pmap_base.h (contents, props changed) head/sys/i386/include/pmap_nopae.h (contents, props changed) head/sys/i386/include/pmap_pae.h (contents, props changed) Modified: head/lib/libkvm/kvm_i386.h head/sys/conf/files.i386 head/sys/conf/options.i386 head/sys/dev/dcons/dcons_os.c head/sys/dev/fb/fb.c head/sys/dev/fb/fbreg.h head/sys/dev/fb/vga.c head/sys/dev/fb/vgareg.h head/sys/dev/syscons/syscons.c head/sys/i386/acpica/acpi_machdep.c head/sys/i386/i386/bios.c head/sys/i386/i386/copyout.c head/sys/i386/i386/genassym.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/i386/mem.c head/sys/i386/i386/minidump_machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/mpboot.s head/sys/i386/i386/pmap.c head/sys/i386/i386/trap.c head/sys/i386/i386/vm86.c head/sys/i386/i386/vm86bios.s head/sys/i386/i386/vm_machdep.c head/sys/i386/include/md_var.h head/sys/i386/include/param.h head/sys/i386/include/pmap.h head/sys/i386/include/vm86.h head/sys/i386/include/vmparam.h head/sys/i386/pci/pci_cfgreg.c head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/include/_types.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/lib/libkvm/kvm_i386.h ============================================================================== --- head/lib/libkvm/kvm_i386.h Tue Jan 29 22:46:44 2019 (r343566) +++ head/lib/libkvm/kvm_i386.h Wed Jan 30 02:07:13 2019 (r343567) @@ -67,14 +67,16 @@ typedef uint64_t i386_pde_pae_t; _Static_assert(PAGE_SHIFT == I386_PAGE_SHIFT, "PAGE_SHIFT mismatch"); _Static_assert(PAGE_SIZE == I386_PAGE_SIZE, "PAGE_SIZE mismatch"); _Static_assert(PAGE_MASK == I386_PAGE_MASK, "PAGE_MASK mismatch"); +#if 0 _Static_assert(NPTEPG == I386_NPTEPG, "NPTEPG mismatch"); -_Static_assert(PDRSHIFT == I386_PDRSHIFT, "PDRSHIFT mismatch"); _Static_assert(NBPDR == I386_NBPDR, "NBPDR mismatch"); +#endif +_Static_assert(PDRSHIFT_NOPAE == I386_PDRSHIFT, "PDRSHIFT mismatch"); _Static_assert(PG_V == I386_PG_V, "PG_V mismatch"); _Static_assert(PG_PS == I386_PG_PS, "PG_PS mismatch"); -_Static_assert((u_int)PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch"); -_Static_assert(PG_PS_FRAME == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch"); +_Static_assert((u_int)PG_FRAME_NOPAE == I386_PG_FRAME, "PG_FRAME mismatch"); +_Static_assert(PG_PS_FRAME_NOPAE == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch"); #endif int _i386_native(kvm_t *); Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/conf/files.i386 Wed Jan 30 02:07:13 2019 (r343567) @@ -492,12 +492,16 @@ i386/i386/longrun.c optional cpu_enable_longrun i386/i386/machdep.c standard i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard +i386/i386/minidump_machdep_pae.c standard +i386/i386/minidump_machdep_nopae.c standard i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mpboot.s optional smp i386/i386/npx.c standard i386/i386/perfmon.c optional perfmon -i386/i386/pmap.c standard +i386/i386/pmap_base.c standard +i386/i386/pmap_nopae.c standard +i386/i386/pmap_pae.c standard i386/i386/prof_machdep.c optional profiling-routine i386/i386/ptrace_machdep.c standard i386/i386/sigtramp.s standard Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/conf/options.i386 Wed Jan 30 02:07:13 2019 (r343567) @@ -33,11 +33,6 @@ KVA_PAGES opt_global.h # Physical address extensions and support for >4G ram. As above. PAE opt_global.h -# Use PAE page tables, but limit memory support to 4GB. -# This keeps the i386 non-PAE KBI, in particular, drivers see -# 32bit vm_paddr_t. -PAE_TABLES opt_global.h - TIMER_FREQ opt_clock.h CPU_ATHLON_SSE_HACK opt_cpu.h Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/dev/dcons/dcons_os.c Wed Jan 30 02:07:13 2019 (r343567) @@ -309,7 +309,7 @@ dcons_drv_init(int stage) * Allow read/write access to dcons buffer. */ for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE) - *vtopte(PMAP_MAP_LOW + pa) |= PG_RW; + pmap_ksetrw(PMAP_MAP_LOW + pa); invltlb(); #endif /* XXX P to V */ Modified: head/sys/dev/fb/fb.c ============================================================================== --- head/sys/dev/fb/fb.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/dev/fb/fb.c Wed Jan 30 02:07:13 2019 (r343567) @@ -513,7 +513,7 @@ int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp } int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_ooffset_t offset, - vm_offset_t *paddr, int prot, vm_memattr_t *memattr) + vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { return vidd_mmap(adp, offset, paddr, prot, memattr); } Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/dev/fb/fbreg.h Wed Jan 30 02:07:13 2019 (r343567) @@ -327,7 +327,7 @@ int genfbwrite(genfb_softc_t *sc, video_adapter_t *ad int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp, u_long cmd, caddr_t arg, int flag, struct thread *td); int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, - vm_ooffset_t offset, vm_offset_t *paddr, + vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); #endif /* FB_INSTALL_CDEV */ Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/dev/fb/vga.c Wed Jan 30 02:07:13 2019 (r343567) @@ -147,7 +147,7 @@ vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cm int vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset, - vm_offset_t *paddr, int prot, vm_memattr_t *memattr) + vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot, memattr); } Modified: head/sys/dev/fb/vgareg.h ============================================================================== --- head/sys/dev/fb/vgareg.h Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/dev/fb/vgareg.h Wed Jan 30 02:07:13 2019 (r343567) @@ -91,7 +91,7 @@ int vga_write(struct cdev *dev, vga_softc_t *sc, stru int vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cmd, caddr_t arg, int flag, struct thread *td); int vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset, - vm_offset_t *paddr, int prot, vm_memattr_t *memattr); + vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); #endif extern int (*vga_sub_configure)(int flags); Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/dev/syscons/syscons.c Wed Jan 30 02:07:13 2019 (r343567) @@ -291,7 +291,7 @@ ec_putc(int c) #ifdef __amd64__ fb = KERNBASE + 0xb8000; #else /* __i386__ */ - fb = PMAP_MAP_LOW + 0xb8000; + fb = pmap_get_map_low() + 0xb8000; #endif xsize = 80; ysize = 25; Modified: head/sys/i386/acpica/acpi_machdep.c ============================================================================== --- head/sys/i386/acpica/acpi_machdep.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/acpica/acpi_machdep.c Wed Jan 30 02:07:13 2019 (r343567) @@ -134,7 +134,7 @@ table_map(vm_paddr_t pa, int offset, vm_offset_t lengt off = pa & PAGE_MASK; length = round_page(length + off); - pa = pa & PG_FRAME; + pa = pmap_pg_frame(pa); va = (vm_offset_t)pmap_kenter_temporary(pa, offset) + (offset * PAGE_SIZE); data = (void *)(va + off); Modified: head/sys/i386/i386/bios.c ============================================================================== --- head/sys/i386/i386/bios.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/bios.c Wed Jan 30 02:07:13 2019 (r343567) @@ -329,9 +329,7 @@ bios16(struct bios_args *args, char *fmt, ...) va_list ap; int flags = BIOSCODE_FLAG | BIOSDATA_FLAG; u_int i, arg_start, arg_end; - pt_entry_t *pte; - pd_entry_t *ptd, orig_ptd; - + void *bios16_pmap_handle; arg_start = 0xffffffff; arg_end = 0; @@ -388,18 +386,10 @@ bios16(struct bios_args *args, char *fmt, ...) args->seg.args.limit = 0xffff; } - args->seg.code32.base = (u_int)&bios16_jmp & PG_FRAME; + args->seg.code32.base = pmap_pg_frame((u_int)&bios16_jmp); args->seg.code32.limit = 0xffff; - /* - * no page table, so create one and install it. - */ - pte = (pt_entry_t *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK); - ptd = IdlePTD; - *pte = vm86phystk | PG_RW | PG_V; - orig_ptd = *ptd; - *ptd = vtophys(pte) | PG_RW | PG_V; - pmap_invalidate_all(kernel_pmap); /* XXX insurance for now */ + bios16_pmap_handle = pmap_bios16_enter(); stack_top = stack; va_start(ap, fmt); @@ -451,13 +441,7 @@ bios16(struct bios_args *args, char *fmt, ...) bioscall_vector.vec16.segment = GSEL(GBIOSCODE16_SEL, SEL_KPL); i = bios16_call(&args->r, stack_top); - - *ptd = orig_ptd; /* remove page table */ - /* - * XXX only needs to be invlpg(0) but that doesn't work on the 386 - */ - pmap_invalidate_all(kernel_pmap); - free(pte, M_TEMP); /* ... and free it */ + pmap_bios16_leave(bios16_pmap_handle); return (i); } Modified: head/sys/i386/i386/copyout.c ============================================================================== --- head/sys/i386/i386/copyout.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/copyout.c Wed Jan 30 02:07:13 2019 (r343567) @@ -47,12 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(PAE) || defined(PAE_TABLES) -#define KCR3 ((u_int)IdlePDPT) -#else -#define KCR3 ((u_int)IdlePTD) -#endif - int copyin_fast(const void *udaddr, void *kaddr, size_t len, u_int); static int (*copyin_fast_tramp)(const void *, void *, size_t, u_int); int copyout_fast(const void *kaddr, void *udaddr, size_t len, u_int); @@ -103,7 +97,6 @@ cp_slow0(vm_offset_t uva, size_t len, bool write, { struct pcpu *pc; vm_page_t m[2]; - pt_entry_t *pte; vm_offset_t kaddr; int error, i, plen; bool sleepable; @@ -128,12 +121,7 @@ cp_slow0(vm_offset_t uva, size_t len, bool write, sx_xlock(&pc->pc_copyout_slock); kaddr = pc->pc_copyout_saddr; } - for (i = 0, pte = vtopte(kaddr); i < plen; i++, pte++) { - *pte = PG_V | PG_RW | PG_A | PG_M | VM_PAGE_TO_PHYS(m[i]) | - pmap_cache_bits(kernel_pmap, pmap_page_get_memattr(m[i]), - FALSE); - invlpg(kaddr + ptoa(i)); - } + pmap_cp_slow0_map(kaddr, plen, m); kaddr += uva - trunc_page(uva); f(kaddr, arg); sched_unpin(); @@ -225,7 +213,7 @@ copyin(const void *udaddr, void *kaddr, size_t len) (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS) return (EFAULT); if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ && - copyin_fast_tramp(udaddr, kaddr, len, KCR3) == 0)) + copyin_fast_tramp(udaddr, kaddr, len, pmap_get_kcr3()) == 0)) return (0); for (plen = 0, uc = (vm_offset_t)udaddr, ca.kc = (vm_offset_t)kaddr; plen < len; uc += ca.len, ca.kc += ca.len, plen += ca.len) { @@ -260,7 +248,7 @@ copyout(const void *kaddr, void *udaddr, size_t len) (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS) return (EFAULT); if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ && - copyout_fast_tramp(kaddr, udaddr, len, KCR3) == 0)) + copyout_fast_tramp(kaddr, udaddr, len, pmap_get_kcr3()) == 0)) return (0); for (plen = 0, uc = (vm_offset_t)udaddr, ca.kc = (vm_offset_t)kaddr; plen < len; uc += ca.len, ca.kc += ca.len, plen += ca.len) { @@ -296,7 +284,7 @@ fubyte(volatile const void *base) (uintptr_t)base + sizeof(uint8_t) > VM_MAXUSER_ADDRESS) return (-1); if (fast_copyout) { - res = fubyte_fast_tramp(base, KCR3); + res = fubyte_fast_tramp(base, pmap_get_kcr3()); if (res != -1) return (res); } @@ -322,7 +310,7 @@ fuword16(volatile const void *base) (uintptr_t)base + sizeof(uint16_t) > VM_MAXUSER_ADDRESS) return (-1); if (fast_copyout) { - res = fuword16_fast_tramp(base, KCR3); + res = fuword16_fast_tramp(base, pmap_get_kcr3()); if (res != -1) return (res); } @@ -348,7 +336,7 @@ fueword(volatile const void *base, long *val) (uintptr_t)base + sizeof(*val) > VM_MAXUSER_ADDRESS) return (-1); if (fast_copyout) { - if (fueword_fast_tramp(base, val, KCR3) == 0) + if (fueword_fast_tramp(base, val, pmap_get_kcr3()) == 0) return (0); } if (cp_slow0((vm_offset_t)base, sizeof(long), false, fueword_slow0, @@ -383,7 +371,7 @@ subyte(volatile void *base, int byte) if ((uintptr_t)base + sizeof(uint8_t) < (uintptr_t)base || (uintptr_t)base + sizeof(uint8_t) > VM_MAXUSER_ADDRESS) return (-1); - if (fast_copyout && subyte_fast_tramp(base, byte, KCR3) == 0) + if (fast_copyout && subyte_fast_tramp(base, byte, pmap_get_kcr3()) == 0) return (0); return (cp_slow0((vm_offset_t)base, sizeof(u_char), true, subyte_slow0, &byte) != 0 ? -1 : 0); @@ -403,7 +391,8 @@ suword16(volatile void *base, int word) if ((uintptr_t)base + sizeof(uint16_t) < (uintptr_t)base || (uintptr_t)base + sizeof(uint16_t) > VM_MAXUSER_ADDRESS) return (-1); - if (fast_copyout && suword16_fast_tramp(base, word, KCR3) == 0) + if (fast_copyout && suword16_fast_tramp(base, word, pmap_get_kcr3()) + == 0) return (0); return (cp_slow0((vm_offset_t)base, sizeof(int16_t), true, suword16_slow0, &word) != 0 ? -1 : 0); @@ -423,7 +412,7 @@ suword(volatile void *base, long word) if ((uintptr_t)base + sizeof(word) < (uintptr_t)base || (uintptr_t)base + sizeof(word) > VM_MAXUSER_ADDRESS) return (-1); - if (fast_copyout && suword_fast_tramp(base, word, KCR3) == 0) + if (fast_copyout && suword_fast_tramp(base, word, pmap_get_kcr3()) == 0) return (0); return (cp_slow0((vm_offset_t)base, sizeof(long), true, suword_slow0, &word) != 0 ? -1 : 0); Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/genassym.c Wed Jan 30 02:07:13 2019 (r343567) @@ -101,21 +101,8 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES); ASSYM(PAGE_SIZE, PAGE_SIZE); -ASSYM(NPTEPG, NPTEPG); -ASSYM(NPDEPG, NPDEPG); -ASSYM(NPDEPTD, NPDEPTD); -ASSYM(NPGPTD, NPGPTD); -ASSYM(PDESIZE, sizeof(pd_entry_t)); -ASSYM(PTESIZE, sizeof(pt_entry_t)); -ASSYM(PDESHIFT, PDESHIFT); -ASSYM(PTESHIFT, PTESHIFT); ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_MASK, PAGE_MASK); -ASSYM(PDRSHIFT, PDRSHIFT); -ASSYM(PDRMASK, PDRMASK); -ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); -ASSYM(KERNBASE, KERNBASE); -ASSYM(KERNLOAD, KERNLOAD); ASSYM(PCB_CR0, offsetof(struct pcb, pcb_cr0)); ASSYM(PCB_CR2, offsetof(struct pcb, pcb_cr2)); ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3)); @@ -222,6 +209,9 @@ ASSYM(PC_KESP0, offsetof(struct pcpu, pc_kesp0)); ASSYM(PC_TRAMPSTK, offsetof(struct pcpu, pc_trampstk)); ASSYM(PC_COPYOUT_BUF, offsetof(struct pcpu, pc_copyout_buf)); ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set)); +ASSYM(PMAP_TRM_MIN_ADDRESS, PMAP_TRM_MIN_ADDRESS); +ASSYM(KERNLOAD, KERNLOAD); +ASSYM(KERNBASE, KERNBASE); #ifdef DEV_APIC ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); @@ -237,7 +227,6 @@ ASSYM(GPROC0_SEL, GPROC0_SEL); ASSYM(VM86_FRAMESIZE, sizeof(struct vm86frame)); ASSYM(VM86_STACK_SPACE, VM86_STACK_SPACE); -ASSYM(PMAP_TRM_MIN_ADDRESS, PMAP_TRM_MIN_ADDRESS); ASSYM(TRAMP_COPYOUT_SZ, TRAMP_COPYOUT_SZ); #ifdef HWPMC_HOOKS Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/initcpu.c Wed Jan 30 02:07:13 2019 (r343567) @@ -632,6 +632,7 @@ extern int elf32_nxstack; void initializecpu(void) { + uint64_t msr; switch (cpu) { #ifdef I486_CPU @@ -744,16 +745,10 @@ initializecpu(void) load_cr4(rcr4() | CR4_FXSR | CR4_XMM); cpu_fxsr = hw_instruction_sse = 1; } -#if defined(PAE) || defined(PAE_TABLES) - if ((amd_feature & AMDID_NX) != 0) { - uint64_t msr; - + if (elf32_nxstack) { msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); - pg_nx = PG_NX; - elf32_nxstack = 1; } -#endif } void Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/locore.s Wed Jan 30 02:07:13 2019 (r343567) @@ -54,15 +54,6 @@ #include "assym.inc" /* - * PTmap is recursive pagemap at top of virtual address space. - * Within PTmap, the page directory can be found (third indirection). - */ - .globl PTmap,PTD,PTDpde - .set PTmap,(PTDPTDI << PDRSHIFT) - .set PTD,PTmap + (PTDPTDI * PAGE_SIZE) - .set PTDpde,PTD + (PTDPTDI * PDESIZE) - -/* * Compiled KERNBASE location and the kernel load address, now identical. */ .globl kernbase Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/machdep.c Wed Jan 30 02:07:13 2019 (r343567) @@ -175,6 +175,8 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, int _udatasel, _ucodesel; u_int basemem; +static int above4g_allow = 1; +static int above24g_allow = 0; int cold = 1; @@ -1675,6 +1677,7 @@ static int add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap, int *physmap_idxp) { + uint64_t lim, ign; int i, insert_idx, physmap_idx; physmap_idx = *physmap_idxp; @@ -1682,13 +1685,24 @@ add_physmap_entry(uint64_t base, uint64_t length, vm_p if (length == 0) return (1); -#ifndef PAE - if (base > 0xffffffff) { - printf("%uK of memory above 4GB ignored\n", - (u_int)(length / 1024)); + lim = 0x100000000; /* 4G */ + if (pae_mode && above4g_allow) + lim = above24g_allow ? -1ULL : 0x600000000; /* 24G */ + if (base >= lim) { + printf("%uK of memory above %uGB ignored, pae %d " + "above4g_allow %d above24g_allow %d\n", + (u_int)(length / 1024), (u_int)(lim >> 30), pae_mode, + above4g_allow, above24g_allow); return (1); } -#endif + if (base + length >= lim) { + ign = base + length - lim; + length -= ign; + printf("%uK of memory above %uGB ignored, pae %d " + "above4g_allow %d above24g_allow %d\n", + (u_int)(ign / 1024), (u_int)(lim >> 30), pae_mode, + above4g_allow, above24g_allow); + } /* * Find insertion point while checking for overlap. Start off by @@ -1781,8 +1795,6 @@ add_smap_entries(struct bios_smap *smapbase, vm_paddr_ static void basemem_setup(void) { - pt_entry_t *pte; - int i; if (basemem > 640) { printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", @@ -1790,15 +1802,7 @@ basemem_setup(void) basemem = 640; } - /* - * Map pages between basemem and ISA_HOLE_START, if any, r/w into - * the vm86 page table so that vm86 can scribble on them using - * the vm86 map too. XXX: why 2 ways for this and only 1 way for - * page 0, at least as initialized here? - */ - pte = (pt_entry_t *)vm86paddr; - for (i = basemem / 4; i < 160; i++) - pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; + pmap_basemem_setup(basemem); } /* @@ -1820,7 +1824,6 @@ getmemsize(int first) int has_smap, off, physmap_idx, pa_indx, da_indx; u_long memtest; vm_paddr_t physmap[PHYSMAP_SIZE]; - pt_entry_t *pte; quad_t dcons_addr, dcons_size, physmem_tunable; int hasbrokenint12, i, res; u_int extmem; @@ -1841,6 +1844,9 @@ getmemsize(int first) */ vm_phys_add_seg((vm_paddr_t)KERNLOAD, trunc_page(first)); + TUNABLE_INT_FETCH("hw.above4g_allow", &above4g_allow); + TUNABLE_INT_FETCH("hw.above24g_allow", &above24g_allow); + /* * Check if the loader supplied an SMAP memory map. If so, * use that and do not make any VM86 calls. @@ -2031,7 +2037,6 @@ physmap_done: phys_avail[pa_indx++] = physmap[0]; phys_avail[pa_indx] = physmap[0]; dump_avail[da_indx] = physmap[0]; - pte = CMAP3; /* * Get dcons buffer address @@ -2052,7 +2057,7 @@ physmap_done: end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { int tmp, page_bad, full; - int *ptr = (int *)CADDR3; + int *ptr; full = FALSE; /* @@ -2076,8 +2081,7 @@ physmap_done: /* * map page into kernel: valid, read/write,non-cacheable */ - *pte = pa | PG_V | PG_RW | PG_N; - invltlb(); + ptr = (int *)pmap_cmap3(pa, PG_V | PG_RW | PG_N); tmp = *(int *)ptr; /* @@ -2158,8 +2162,7 @@ do_next: break; } } - *pte = 0; - invltlb(); + pmap_cmap3(0, 0); /* * XXX @@ -2414,6 +2417,7 @@ init386(int first) finishidentcpu(); /* Final stage of CPU initialization */ i386_setidt2(); + pmap_set_nx(); initializecpu(); /* Initialize CPU registers */ initializecpucache(); @@ -2508,11 +2512,7 @@ init386(int first) /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; -#if defined(PAE) || defined(PAE_TABLES) - thread0.td_pcb->pcb_cr3 = (int)IdlePDPT; -#else - thread0.td_pcb->pcb_cr3 = (int)IdlePTD; -#endif + thread0.td_pcb->pcb_cr3 = pmap_get_kcr3(); thread0.td_pcb->pcb_ext = 0; thread0.td_frame = &proc0_tf; @@ -2581,11 +2581,7 @@ machdep_init_trampoline(void) (int)dblfault_stack + PAGE_SIZE; dblfault_tss->tss_ss = dblfault_tss->tss_ss0 = dblfault_tss->tss_ss1 = dblfault_tss->tss_ss2 = GSEL(GDATA_SEL, SEL_KPL); -#if defined(PAE) || defined(PAE_TABLES) - dblfault_tss->tss_cr3 = (int)IdlePDPT; -#else - dblfault_tss->tss_cr3 = (int)IdlePTD; -#endif + dblfault_tss->tss_cr3 = pmap_get_kcr3(); dblfault_tss->tss_eip = (int)dblfault_handler; dblfault_tss->tss_eflags = PSL_KERNEL; dblfault_tss->tss_ds = dblfault_tss->tss_es = Modified: head/sys/i386/i386/mem.c ============================================================================== --- head/sys/i386/i386/mem.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/mem.c Wed Jan 30 02:07:13 2019 (r343567) @@ -148,7 +148,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags) error = uiomove((caddr_t)&ptvmmap[o], (int)c, uio); pmap_qremove((vm_offset_t)ptvmmap, 1); sx_xunlock(&memsxlock); - } return (error); Modified: head/sys/i386/i386/minidump_machdep.c ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Tue Jan 29 22:46:44 2019 (r343566) +++ head/sys/i386/i386/minidump_machdep.c Wed Jan 30 02:07:13 2019 (r343567) @@ -49,310 +49,11 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct kerneldumpheader) == 512); -#define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) -#define DEV_ALIGN(x) roundup2((off_t)(x), DEV_BSIZE) - uint32_t *vm_page_dump; int vm_page_dump_size; -static struct kerneldumpheader kdh; - -/* Handle chunked writes. */ -static size_t fragsz; -static void *dump_va; -static uint64_t counter, progress; - CTASSERT(sizeof(*vm_page_dump) == 4); - -static int -is_dumpable(vm_paddr_t pa) -{ - int i; - - for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - return (1); - } - return (0); -} - -#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) - -static int -blk_flush(struct dumperinfo *di) -{ - int error; - - if (fragsz == 0) - return (0); - - error = dump_append(di, dump_va, 0, fragsz); - fragsz = 0; - return (error); -} - -static int -blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) -{ - size_t len; - int error, i, c; - u_int maxdumpsz; - - maxdumpsz = min(di->maxiosize, MAXDUMPPGS * PAGE_SIZE); - if (maxdumpsz == 0) /* seatbelt */ - maxdumpsz = PAGE_SIZE; - error = 0; - if ((sz % PAGE_SIZE) != 0) { - printf("size not page aligned\n"); - return (EINVAL); - } - if (ptr != NULL && pa != 0) { - printf("cant have both va and pa!\n"); - return (EINVAL); - } - if (pa != 0 && (((uintptr_t)ptr) % PAGE_SIZE) != 0) { - printf("address not page aligned\n"); - return (EINVAL); - } - if (ptr != NULL) { - /* If we're doing a virtual dump, flush any pre-existing pa pages */ - error = blk_flush(di); - if (error) - return (error); - } - while (sz) { - len = maxdumpsz - fragsz; - if (len > sz) - len = sz; - counter += len; - progress -= len; - if (counter >> 24) { - printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); - counter &= (1<<24) - 1; - } - - wdog_kern_pat(WD_LASTVAL); - - if (ptr) { - error = dump_append(di, ptr, 0, len); - if (error) - return (error); - ptr += len; - sz -= len; - } else { - for (i = 0; i < len; i += PAGE_SIZE) - dump_va = pmap_kenter_temporary(pa + i, (i + fragsz) >> PAGE_SHIFT); - fragsz += len; - pa += len; - sz -= len; - if (fragsz == maxdumpsz) { - error = blk_flush(di); - if (error) - return (error); - } - } - - /* Check for user abort. */ - c = cncheckc(); - if (c == 0x03) - return (ECANCELED); - if (c != -1) - printf(" (CTRL-C to abort) "); - } - - return (0); -} - -/* A fake page table page, to avoid having to handle both 4K and 2M pages */ -static pt_entry_t fakept[NPTEPG]; - -int -minidumpsys(struct dumperinfo *di) -{ - uint64_t dumpsize; - uint32_t ptesize; - vm_offset_t va; - int error; - uint32_t bits; - uint64_t pa; - pd_entry_t *pd; - pt_entry_t *pt; - int i, j, k, bit; - struct minidumphdr mdhdr; - - counter = 0; - /* Walk page table pages, set bits in vm_page_dump */ - ptesize = 0; - for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { - /* - * We always write a page, even if it is zero. Each - * page written corresponds to 2MB of space - */ - ptesize += PAGE_SIZE; - pd = IdlePTD; /* always mapped! */ - j = va >> PDRSHIFT; - if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - /* This is an entire 2M page. */ - pa = pd[j] & PG_PS_FRAME; - for (k = 0; k < NPTEPG; k++) { - if (is_dumpable(pa)) - dump_add_page(pa); - pa += PAGE_SIZE; - } - continue; - } - if ((pd[j] & PG_V) == PG_V) { - /* set bit for each valid page in this 2MB block */ - pt = pmap_kenter_temporary(pd[j] & PG_FRAME, 0); - for (k = 0; k < NPTEPG; k++) { - if ((pt[k] & PG_V) == PG_V) { - pa = pt[k] & PG_FRAME; - if (is_dumpable(pa)) - dump_add_page(pa); - } - } - } else { - /* nothing, we're going to dump a null page */ - } - } - - /* Calculate dump size. */ - dumpsize = ptesize; - dumpsize += round_page(msgbufp->msg_size); - dumpsize += round_page(vm_page_dump_size); - for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { - bits = vm_page_dump[i]; - while (bits) { - bit = bsfl(bits); - pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + bit) * PAGE_SIZE; - /* Clear out undumpable pages now if needed */ - if (is_dumpable(pa)) { - dumpsize += PAGE_SIZE; - } else { - dump_drop_page(pa); - } - bits &= ~(1ul << bit); - } - } - dumpsize += PAGE_SIZE; - - progress = dumpsize; - - /* Initialize mdhdr */ - bzero(&mdhdr, sizeof(mdhdr)); - strcpy(mdhdr.magic, MINIDUMP_MAGIC); - mdhdr.version = MINIDUMP_VERSION; - mdhdr.msgbufsize = msgbufp->msg_size; - mdhdr.bitmapsize = vm_page_dump_size; - mdhdr.ptesize = ptesize; - mdhdr.kernbase = KERNBASE; -#if defined(PAE) || defined(PAE_TABLES) - mdhdr.paemode = 1; -#endif - - dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION, - dumpsize); - - error = dump_start(di, &kdh); - if (error != 0) - goto fail; - - printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); - - /* Dump my header */ - bzero(&fakept, sizeof(fakept)); - bcopy(&mdhdr, &fakept, sizeof(mdhdr)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); - if (error) - goto fail; - - /* Dump msgbuf up front */ - error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size)); - if (error) - goto fail; - - /* Dump bitmap */ - error = blk_write(di, (char *)vm_page_dump, 0, round_page(vm_page_dump_size)); - if (error) - goto fail; - - /* Dump kernel page table pages */ - for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { - /* We always write a page, even if it is zero */ - pd = IdlePTD; /* always mapped! */ - j = va >> PDRSHIFT; - if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - /* This is a single 2M block. Generate a fake PTP */ - pa = pd[j] & PG_PS_FRAME; - for (k = 0; k < NPTEPG; k++) { - fakept[k] = (pa + (k * PAGE_SIZE)) | PG_V | PG_RW | PG_A | PG_M; - } - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); - if (error) - goto fail; - /* flush, in case we reuse fakept in the same block */ - error = blk_flush(di); - if (error) - goto fail; - continue; - } - if ((pd[j] & PG_V) == PG_V) { - pa = pd[j] & PG_FRAME; - error = blk_write(di, 0, pa, PAGE_SIZE); - if (error) - goto fail; - } else { - bzero(fakept, sizeof(fakept)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); - if (error) - goto fail; - /* flush, in case we reuse fakept in the same block */ - error = blk_flush(di); - if (error) - goto fail; - } - } - - /* Dump memory chunks */ - /* XXX cluster it up and use blk_dump() */ - for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { - bits = vm_page_dump[i]; - while (bits) { - bit = bsfl(bits); - pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + bit) * PAGE_SIZE; - error = blk_write(di, 0, pa, PAGE_SIZE); - if (error) - goto fail; - bits &= ~(1ul << bit); - } - } - - error = blk_flush(di); - if (error) - goto fail; - - error = dump_finish(di, &kdh); - if (error != 0) - goto fail; - - printf("\nDump complete\n"); - return (0); - - fail: - if (error < 0) - error = -error; - - if (error == ECANCELED) - printf("\nDump aborted\n"); - else if (error == E2BIG || error == ENOSPC) - printf("\nDump failed. Partition too small.\n"); - else - printf("\n** DUMP FAILED (ERROR %d) **\n", error); - return (error); -} - void dump_add_page(vm_paddr_t pa) { @@ -373,5 +74,12 @@ dump_drop_page(vm_paddr_t pa) idx = pa >> 5; /* 2^5 = 32 */ bit = pa & 31; atomic_clear_int(&vm_page_dump[idx], 1ul << bit); +} + +int +minidumpsys(struct dumperinfo *di) +{ + + return (pae_mode ? minidumpsys_pae(di) : minidumpsys_nopae(di)); } Copied and modified: head/sys/i386/i386/minidump_machdep_base.c (from r343566, head/sys/i386/i386/minidump_machdep.c) ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Tue Jan 29 22:46:44 2019 (r343566, copy source) +++ head/sys/i386/i386/minidump_machdep_base.c Wed Jan 30 02:07:13 2019 (r343567) @@ -52,8 +52,8 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512); #define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) #define DEV_ALIGN(x) roundup2((off_t)(x), DEV_BSIZE) -uint32_t *vm_page_dump; -int vm_page_dump_size; +extern uint32_t *vm_page_dump; +extern int vm_page_dump_size; static struct kerneldumpheader kdh; @@ -167,6 +167,14 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t /* A fake page table page, to avoid having to handle both 4K and 2M pages */ static pt_entry_t fakept[NPTEPG]; +#ifdef PMAP_PAE_COMP +#define minidumpsys minidumpsys_pae +#define IdlePTD IdlePTD_pae +#else +#define minidumpsys minidumpsys_nopae +#define IdlePTD IdlePTD_nopae +#endif + int minidumpsys(struct dumperinfo *di) { @@ -247,9 +255,7 @@ minidumpsys(struct dumperinfo *di) mdhdr.bitmapsize = vm_page_dump_size; mdhdr.ptesize = ptesize; mdhdr.kernbase = KERNBASE; -#if defined(PAE) || defined(PAE_TABLES) - mdhdr.paemode = 1; -#endif + mdhdr.paemode = pae_mode; dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION, dumpsize); @@ -352,26 +358,3 @@ minidumpsys(struct dumperinfo *di) printf("\n** DUMP FAILED (ERROR %d) **\n", error); return (error); } - -void -dump_add_page(vm_paddr_t pa) -{ - int idx, bit; - - pa >>= PAGE_SHIFT; - idx = pa >> 5; /* 2^5 = 32 */ - bit = pa & 31; - atomic_set_int(&vm_page_dump[idx], 1ul << bit); -} - -void -dump_drop_page(vm_paddr_t pa) -{ - int idx, bit; - - pa >>= PAGE_SHIFT; - idx = pa >> 5; /* 2^5 = 32 */ - bit = pa & 31; - atomic_clear_int(&vm_page_dump[idx], 1ul << bit); -} - Copied and modified: head/sys/i386/i386/minidump_machdep_nopae.c (from r343566, head/sys/i386/i386/minidump_machdep.c) ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Tue Jan 29 22:46:44 2019 (r343566, copy source) +++ head/sys/i386/i386/minidump_machdep_nopae.c Wed Jan 30 02:07:13 2019 (r343567) @@ -1,377 +1,40 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2006 Peter Wemm + * Copyright (c) 2018 The FreeBSD Foundation * All rights reserved. * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); -#include "opt_watchdog.h" - #include -#include -#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 30 05:37:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C68EE14B494D; Wed, 30 Jan 2019 05:37:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61DEA83041; Wed, 30 Jan 2019 05:37:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 5010A251; Wed, 30 Jan 2019 05:37:09 +0000 (UTC) Date: Wed, 30 Jan 2019 05:37:09 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343566 - in head/lib/libthr: . thread Message-ID: <20190130053709.GA35927@FreeBSD.org> References: <201901292246.x0TMkjQH074121@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901292246.x0TMkjQH074121@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 61DEA83041 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.86 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.87)[-0.866,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 05:37:10 -0000 On Tue, Jan 29, 2019 at 10:46:45PM +0000, Konstantin Belousov wrote: > New Revision: 343566 > URL: https://svnweb.freebsd.org/changeset/base/343566 > > Log: > Untangle jemalloc and mutexes initialization. > > The need to use libc malloc(3) from some places in libthr always > caused issues. For instance, per-thread key allocation was switched to > use plain mmap(2) to get storage, because some third party mallocs > used keys for implementation of calloc(3). > > Even more important, libthr calls calloc(3) during initialization of > pthread mutexes, and jemalloc uses pthread mutexes. Jemalloc provides > some way to both postpone the initialization, and to make > initialization to use specialized allocator, but this is very fragile > and often breaks. See the referenced PR for another example. Could this also fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767 I wonder... Going through the "make world" now to test some Quake II. :-) ./danfe From owner-svn-src-head@freebsd.org Wed Jan 30 05:39:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A49D914B4A3B; Wed, 30 Jan 2019 05:39:48 +0000 (UTC) (envelope-from np@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 45D01831B8; Wed, 30 Jan 2019 05:39:48 +0000 (UTC) (envelope-from np@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 2BEDB1ADCB; Wed, 30 Jan 2019 05:39:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0U5dlOP086392; Wed, 30 Jan 2019 05:39:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0U5dl2H086391; Wed, 30 Jan 2019 05:39:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901300539.x0U5dl2H086391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 30 Jan 2019 05:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343569 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 343569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45D01831B8 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.928,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 05:39:48 -0000 Author: np Date: Wed Jan 30 05:39:47 2019 New Revision: 343569 URL: https://svnweb.freebsd.org/changeset/base/343569 Log: cxgbe/iw_cxgbe: Fix an address calculation in the memory registration code that was added in r342266. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Wed Jan 30 02:39:08 2019 (r343568) +++ head/sys/dev/cxgbe/iw_cxgbe/mem.c Wed Jan 30 05:39:47 2019 (r343569) @@ -207,7 +207,7 @@ _c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, if (ret) goto out; addr += dmalen >> 5; - data = (u64 *)data + dmalen; + data = (u8 *)data + dmalen; daddr = daddr + dmalen; } if (remain) From owner-svn-src-head@freebsd.org Wed Jan 30 09:44:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8267114B9E8B; Wed, 30 Jan 2019 09:44:56 +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 22A5689BCF; Wed, 30 Jan 2019 09:44:56 +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 0D6841D7E3; Wed, 30 Jan 2019 09:44:56 +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 x0U9itJs016555; Wed, 30 Jan 2019 09:44:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0U9ita6016550; Wed, 30 Jan 2019 09:44:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901300944.x0U9ita6016550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 30 Jan 2019 09:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343572 - in head: lib/libsdp usr.sbin/bluetooth/sdpd X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: lib/libsdp usr.sbin/bluetooth/sdpd X-SVN-Commit-Revision: 343572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22A5689BCF 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 09:44:56 -0000 Author: hselasky Date: Wed Jan 30 09:44:54 2019 New Revision: 343572 URL: https://svnweb.freebsd.org/changeset/base/343572 Log: Add support for Audio Sink and Audio Source profiles to sdpd(8). This allows user-space programs like virtual_oss(8) to act as a Bluetooth speaker device. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/usr.sbin/bluetooth/sdpd/audio_sink.c (contents, props changed) head/usr.sbin/bluetooth/sdpd/audio_source.c (contents, props changed) Modified: head/lib/libsdp/sdp.h head/usr.sbin/bluetooth/sdpd/Makefile head/usr.sbin/bluetooth/sdpd/profile.c Modified: head/lib/libsdp/sdp.h ============================================================================== --- head/lib/libsdp/sdp.h Wed Jan 30 07:10:33 2019 (r343571) +++ head/lib/libsdp/sdp.h Wed Jan 30 09:44:54 2019 (r343572) @@ -586,6 +586,24 @@ void sdp_print (uint32_t level, uin #define SDP_PDU_SERVICE_UNREGISTER_REQUEST 0x82 #define SDP_PDU_SERVICE_CHANGE_REQUEST 0x83 +struct sdp_audio_sink_profile +{ + uint16_t psm; + uint16_t protover; + uint16_t features; +}; +typedef struct sdp_audio_sink_profile sdp_audio_sink_profile_t; +typedef struct sdp_audio_sink_profile *sdp_audio_sink_profile_p; + +struct sdp_audio_source_profile +{ + uint16_t psm; + uint16_t protover; + uint16_t features; +}; +typedef struct sdp_audio_source_profile sdp_audio_source_profile_t; +typedef struct sdp_audio_source_profile *sdp_audio_source_profile_p; + struct sdp_dun_profile { uint8_t server_channel; Modified: head/usr.sbin/bluetooth/sdpd/Makefile ============================================================================== --- head/usr.sbin/bluetooth/sdpd/Makefile Wed Jan 30 07:10:33 2019 (r343571) +++ head/usr.sbin/bluetooth/sdpd/Makefile Wed Jan 30 09:44:54 2019 (r343572) @@ -3,7 +3,8 @@ PROG= sdpd MAN= sdpd.8 -SRCS= bgd.c dun.c ftrn.c gn.c irmc.c irmc_command.c lan.c log.c \ +SRCS= audio_sink.c audio_source.c \ + bgd.c dun.c ftrn.c gn.c irmc.c irmc_command.c lan.c log.c \ main.c nap.c opush.c panu.c profile.c provider.c sar.c scr.c \ sd.c server.c sp.c srr.c ssar.c ssr.c sur.c uuid.c Added: head/usr.sbin/bluetooth/sdpd/audio_sink.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/sdpd/audio_sink.c Wed Jan 30 09:44:54 2019 (r343572) @@ -0,0 +1,188 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Hans Petter Selasky + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#define L2CAP_SOCKET_CHECKED +#include +#include +#include +#include "profile.h" +#include "provider.h" + +static int32_t +audio_sink_profile_create_service_class_id_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + static const uint16_t service_classes[] = { + SDP_SERVICE_CLASS_AUDIO_SINK, + }; + + return (common_profile_create_service_class_id_list( + buf, eob, + (uint8_t const *)service_classes, + sizeof(service_classes))); +} + +static int32_t +audio_sink_profile_create_protocol_descriptor_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + provider_p provider = (provider_p) data; + sdp_audio_sink_profile_p audio_sink = (sdp_audio_sink_profile_p) provider->data; + + if (buf + 18 > eob) + return (-1); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(16, buf); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(6, buf); + + SDP_PUT8(SDP_DATA_UUID16, buf); + SDP_PUT16(SDP_UUID_PROTOCOL_L2CAP, buf); + + SDP_PUT8(SDP_DATA_UINT16, buf); + SDP_PUT16(audio_sink->psm, buf); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(6, buf); + + SDP_PUT8(SDP_DATA_UUID16, buf); + SDP_PUT16(SDP_UUID_PROTOCOL_AVDTP, buf); + + SDP_PUT8(SDP_DATA_UINT16, buf); + SDP_PUT16(audio_sink->protover, buf); + + return (18); +} + +static int32_t +audio_sink_profile_create_browse_group_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + + if (buf + 5 > eob) + return (-1); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(3, buf); + + SDP_PUT8(SDP_DATA_UUID16, buf); + SDP_PUT16(SDP_SERVICE_CLASS_PUBLIC_BROWSE_GROUP, buf); + + return (5); +} + +static int32_t +audio_sink_profile_create_bluetooth_profile_descriptor_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + static const uint16_t profile_descriptor_list[] = { + SDP_SERVICE_CLASS_ADVANCED_AUDIO_DISTRIBUTION, + 0x0100 + }; + + return (common_profile_create_bluetooth_profile_descriptor_list( + buf, eob, + (uint8_t const *)profile_descriptor_list, + sizeof(profile_descriptor_list))); +} + +static int32_t +audio_sink_profile_create_service_name( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + static const char service_name[] = "Audio SNK"; + + return (common_profile_create_string8( + buf, eob, + (uint8_t const *)service_name, strlen(service_name))); +} + +static int32_t +audio_sink_create_supported_features( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + provider_p provider = (provider_p) data; + sdp_audio_sink_profile_p audio_sink = (sdp_audio_sink_profile_p) provider->data; + + if (buf + 3 > eob) + return (-1); + + SDP_PUT8(SDP_DATA_UINT16, buf); + SDP_PUT16(audio_sink->features, buf); + + return (3); +} + +static int32_t +audio_sink_profile_valid(uint8_t const *data, uint32_t datalen) +{ + + if (datalen < sizeof(struct sdp_audio_sink_profile)) + return (0); + return (1); +} + +static const attr_t audio_sink_profile_attrs[] = { + {SDP_ATTR_SERVICE_RECORD_HANDLE, + common_profile_create_service_record_handle}, + {SDP_ATTR_SERVICE_CLASS_ID_LIST, + audio_sink_profile_create_service_class_id_list}, + {SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST, + audio_sink_profile_create_protocol_descriptor_list}, + {SDP_ATTR_BROWSE_GROUP_LIST, + audio_sink_profile_create_browse_group_list}, + {SDP_ATTR_LANGUAGE_BASE_ATTRIBUTE_ID_LIST, + common_profile_create_language_base_attribute_id_list}, + {SDP_ATTR_BLUETOOTH_PROFILE_DESCRIPTOR_LIST, + audio_sink_profile_create_bluetooth_profile_descriptor_list}, + {SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET, + audio_sink_profile_create_service_name}, + {SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_PROVIDER_NAME_OFFSET, + common_profile_create_service_provider_name}, + {SDP_ATTR_SUPPORTED_FEATURES, + audio_sink_create_supported_features}, + {} /* end entry */ +}; + +profile_t audio_sink_profile_descriptor = { + SDP_SERVICE_CLASS_AUDIO_SINK, + sizeof(sdp_audio_sink_profile_t), + audio_sink_profile_valid, + (attr_t const *const)&audio_sink_profile_attrs +}; Added: head/usr.sbin/bluetooth/sdpd/audio_source.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/sdpd/audio_source.c Wed Jan 30 09:44:54 2019 (r343572) @@ -0,0 +1,188 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Hans Petter Selasky + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#define L2CAP_SOCKET_CHECKED +#include +#include +#include +#include "profile.h" +#include "provider.h" + +static int32_t +audio_source_profile_create_service_class_id_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + static const uint16_t service_classes[] = { + SDP_SERVICE_CLASS_AUDIO_SOURCE, + }; + + return (common_profile_create_service_class_id_list( + buf, eob, + (uint8_t const *)service_classes, + sizeof(service_classes))); +} + +static int32_t +audio_source_profile_create_protocol_descriptor_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + provider_p provider = (provider_p) data; + sdp_audio_source_profile_p audio_source = (sdp_audio_source_profile_p) provider->data; + + if (buf + 18 > eob) + return (-1); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(16, buf); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(6, buf); + + SDP_PUT8(SDP_DATA_UUID16, buf); + SDP_PUT16(SDP_UUID_PROTOCOL_L2CAP, buf); + + SDP_PUT8(SDP_DATA_UINT16, buf); + SDP_PUT16(audio_source->psm, buf); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(6, buf); + + SDP_PUT8(SDP_DATA_UUID16, buf); + SDP_PUT16(SDP_UUID_PROTOCOL_AVDTP, buf); + + SDP_PUT8(SDP_DATA_UINT16, buf); + SDP_PUT16(audio_source->protover, buf); + + return (18); +} + +static int32_t +audio_source_profile_create_browse_group_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + + if (buf + 5 > eob) + return (-1); + + SDP_PUT8(SDP_DATA_SEQ8, buf); + SDP_PUT8(3, buf); + + SDP_PUT8(SDP_DATA_UUID16, buf); + SDP_PUT16(SDP_SERVICE_CLASS_PUBLIC_BROWSE_GROUP, buf); + + return (5); +} + +static int32_t +audio_source_profile_create_bluetooth_profile_descriptor_list( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + static const uint16_t profile_descriptor_list[] = { + SDP_SERVICE_CLASS_ADVANCED_AUDIO_DISTRIBUTION, + 0x0100 + }; + + return (common_profile_create_bluetooth_profile_descriptor_list( + buf, eob, + (uint8_t const *)profile_descriptor_list, + sizeof(profile_descriptor_list))); +} + +static int32_t +audio_source_profile_create_service_name( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + static const char service_name[] = "Audio SRC"; + + return (common_profile_create_string8( + buf, eob, + (uint8_t const *)service_name, strlen(service_name))); +} + +static int32_t +audio_source_create_supported_features( + uint8_t *buf, uint8_t const *const eob, + uint8_t const *data, uint32_t datalen) +{ + provider_p provider = (provider_p) data; + sdp_audio_source_profile_p audio_source = (sdp_audio_source_profile_p) provider->data; + + if (buf + 3 > eob) + return (-1); + + SDP_PUT8(SDP_DATA_UINT16, buf); + SDP_PUT16(audio_source->features, buf); + + return (3); +} + +static int32_t +audio_source_profile_valid(uint8_t const *data, uint32_t datalen) +{ + + if (datalen < sizeof(struct sdp_audio_source_profile)) + return (0); + return (1); +} + +static const attr_t audio_source_profile_attrs[] = { + {SDP_ATTR_SERVICE_RECORD_HANDLE, + common_profile_create_service_record_handle}, + {SDP_ATTR_SERVICE_CLASS_ID_LIST, + audio_source_profile_create_service_class_id_list}, + {SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST, + audio_source_profile_create_protocol_descriptor_list}, + {SDP_ATTR_BROWSE_GROUP_LIST, + audio_source_profile_create_browse_group_list}, + {SDP_ATTR_LANGUAGE_BASE_ATTRIBUTE_ID_LIST, + common_profile_create_language_base_attribute_id_list}, + {SDP_ATTR_BLUETOOTH_PROFILE_DESCRIPTOR_LIST, + audio_source_profile_create_bluetooth_profile_descriptor_list}, + {SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET, + audio_source_profile_create_service_name}, + {SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_PROVIDER_NAME_OFFSET, + common_profile_create_service_provider_name}, + {SDP_ATTR_SUPPORTED_FEATURES, + audio_source_create_supported_features}, + {} /* end entry */ +}; + +profile_t audio_source_profile_descriptor = { + SDP_SERVICE_CLASS_AUDIO_SOURCE, + sizeof(sdp_audio_source_profile_t), + audio_source_profile_valid, + (attr_t const *const)&audio_source_profile_attrs +}; Modified: head/usr.sbin/bluetooth/sdpd/profile.c ============================================================================== --- head/usr.sbin/bluetooth/sdpd/profile.c Wed Jan 30 07:10:33 2019 (r343571) +++ head/usr.sbin/bluetooth/sdpd/profile.c Wed Jan 30 09:44:54 2019 (r343572) @@ -48,6 +48,8 @@ profile_p profile_get_descriptor(uint16_t uuid) { + extern profile_t audio_sink_profile_descriptor; + extern profile_t audio_source_profile_descriptor; extern profile_t dun_profile_descriptor; extern profile_t ftrn_profile_descriptor; extern profile_t irmc_profile_descriptor; @@ -60,6 +62,8 @@ profile_get_descriptor(uint16_t uuid) extern profile_t panu_profile_descriptor; static const profile_p profiles[] = { + &audio_sink_profile_descriptor, + &audio_source_profile_descriptor, &dun_profile_descriptor, &ftrn_profile_descriptor, &irmc_profile_descriptor, From owner-svn-src-head@freebsd.org Wed Jan 30 11:34:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 656B214BCCF5; Wed, 30 Jan 2019 11:34:53 +0000 (UTC) (envelope-from royger@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 0DC5A8DB7A; Wed, 30 Jan 2019 11:34:53 +0000 (UTC) (envelope-from royger@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 EFC611EA78; Wed, 30 Jan 2019 11:34:52 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UBYqAx073987; Wed, 30 Jan 2019 11:34:52 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UBYqu4073984; Wed, 30 Jan 2019 11:34:52 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201901301134.x0UBYqu4073984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 30 Jan 2019 11:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343573 - in head/sys: x86/xen xen X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head/sys: x86/xen xen X-SVN-Commit-Revision: 343573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DC5A8DB7A 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 11:34:53 -0000 Author: royger Date: Wed Jan 30 11:34:52 2019 New Revision: 343573 URL: https://svnweb.freebsd.org/changeset/base/343573 Log: xen: introduce a new way to setup event channel upcall The main differences with the currently implemented method are: - Requires a local APIC EOI, since it doesn't bypass the local APIC as the previous method used to do. - Can be set to use different IDT vectors on each vCPU. Note that FreeBSD doesn't make use of this feature since the event channel IDT vector is reserved system wide. Note that the old method of setting the event channel upcall is not removed, and will be used as a fallback if this newly introduced method is not available. MFC after: 1 month Sponsored by: Citrix Systems R&D Modified: head/sys/x86/xen/hvm.c head/sys/x86/xen/xen_intr.c head/sys/xen/hvm.h Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Wed Jan 30 09:44:54 2019 (r343572) +++ head/sys/x86/xen/hvm.c Wed Jan 30 11:34:52 2019 (r343573) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -88,6 +89,12 @@ int xen_vector_callback_enabled; */ uint32_t hvm_start_flags; +/** + * Signal whether the vector injected for the event channel upcall requires to + * be EOI'ed on the local APIC. + */ +bool xen_evtchn_needs_ack; + /*------------------------------- Per-CPU Data -------------------------------*/ DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); DPCPU_DEFINE(struct vcpu_info *, vcpu_info); @@ -223,6 +230,19 @@ xen_hvm_init_shared_info_page(void) panic("HYPERVISOR_memory_op failed"); } +static int +set_percpu_callback(unsigned int vcpu) +{ + struct xen_hvm_evtchn_upcall_vector vec; + int error; + + vec.vcpu = vcpu; + vec.vector = IDT_EVTCHN; + error = HYPERVISOR_hvm_op(HVMOP_set_evtchn_upcall_vector, &vec); + + return (error != 0 ? xen_translate_error(error) : 0); +} + /* * Tell the hypervisor how to contact us for event channel callbacks. */ @@ -240,12 +260,20 @@ xen_hvm_set_callback(device_t dev) if (xen_feature(XENFEAT_hvm_callback_vector) != 0) { int error; - xhp.value = HVM_CALLBACK_VECTOR(IDT_EVTCHN); + error = set_percpu_callback(0); + if (error == 0) { + xen_evtchn_needs_ack = true; + /* Trick toolstack to think we are enlightened */ + xhp.value = 1; + } else + xhp.value = HVM_CALLBACK_VECTOR(IDT_EVTCHN); error = HYPERVISOR_hvm_op(HVMOP_set_param, &xhp); if (error == 0) { xen_vector_callback_enabled = 1; return; - } + } else if (xen_evtchn_needs_ack) + panic("Unable to setup fake HVM param: %d", error); + printf("Xen HVM callback vector registration failed (%d). " "Falling back to emulated device interrupt\n", error); } @@ -360,6 +388,7 @@ xen_hvm_init(enum xen_hvm_init_type init_type) } xen_vector_callback_enabled = 0; + xen_evtchn_needs_ack = false; xen_hvm_set_callback(NULL); /* @@ -426,6 +455,20 @@ xen_hvm_cpu_init(void) ("Xen PV domain without vcpu_id in cpuid")); PCPU_SET(vcpu_id, (regs[0] & XEN_HVM_CPUID_VCPU_ID_PRESENT) ? regs[1] : PCPU_GET(acpi_id)); + + if (xen_evtchn_needs_ack && !IS_BSP()) { + /* + * Setup the per-vpcu event channel upcall vector. This is only + * required when using the new HVMOP_set_evtchn_upcall_vector + * hypercall, which allows using a different vector for each + * vCPU. Note that FreeBSD uses the same vector for all vCPUs + * because it's not dynamically allocated. + */ + rc = set_percpu_callback(PCPU_GET(vcpu_id)); + if (rc != 0) + panic("Event channel upcall vector setup failed: %d", + rc); + } /* * Set the vCPU info. Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Wed Jan 30 09:44:54 2019 (r343572) +++ head/sys/x86/xen/xen_intr.c Wed Jan 30 11:34:52 2019 (r343573) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -620,6 +621,10 @@ xen_intr_handle_upcall(struct trapframe *trap_frame) l1 &= ~(1UL << l1i); } } + + if (xen_evtchn_needs_ack) + lapic_eoi(); + critical_exit(); } Modified: head/sys/xen/hvm.h ============================================================================== --- head/sys/xen/hvm.h Wed Jan 30 09:44:54 2019 (r343572) +++ head/sys/xen/hvm.h Wed Jan 30 11:34:52 2019 (r343573) @@ -104,5 +104,6 @@ void xen_hvm_suspend(void); void xen_hvm_resume(bool suspend_cancelled); extern uint32_t hvm_start_flags; +extern bool xen_evtchn_needs_ack; #endif /* __XEN_HVM_H__ */ From owner-svn-src-head@freebsd.org Wed Jan 30 11:40:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 347EC14BCF1D; Wed, 30 Jan 2019 11:40:14 +0000 (UTC) (envelope-from avos@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 C90B88DEE9; Wed, 30 Jan 2019 11:40:13 +0000 (UTC) (envelope-from avos@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 BC3F01EA7E; Wed, 30 Jan 2019 11:40:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UBeDwu074381; Wed, 30 Jan 2019 11:40:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UBeDjL074378; Wed, 30 Jan 2019 11:40:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901301140.x0UBeDjL074378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 30 Jan 2019 11:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343574 - in head/sys: compat/ndis dev/if_ndis X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: compat/ndis dev/if_ndis X-SVN-Commit-Revision: 343574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C90B88DEE9 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 11:40:14 -0000 Author: avos Date: Wed Jan 30 11:40:12 2019 New Revision: 343574 URL: https://svnweb.freebsd.org/changeset/base/343574 Log: Fix compilation with 'option NDISAPI + device ndis' and without 'device pccard' in the kernel config file. PR: 171532 Reported by: Robert Bonomi MFC after: 1 week Modified: head/sys/compat/ndis/ndis_var.h head/sys/dev/if_ndis/if_ndis.c head/sys/dev/if_ndis/if_ndis_pccard.c Modified: head/sys/compat/ndis/ndis_var.h ============================================================================== --- head/sys/compat/ndis/ndis_var.h Wed Jan 30 11:34:52 2019 (r343573) +++ head/sys/compat/ndis/ndis_var.h Wed Jan 30 11:40:12 2019 (r343574) @@ -1736,8 +1736,6 @@ extern int ndis_get_supported_oids(void *, ndis_oid ** extern int ndis_send_packets(void *, ndis_packet **, int); extern int ndis_send_packet(void *, ndis_packet *); extern int ndis_convert_res(void *); -extern int ndis_alloc_amem(void *); -extern void ndis_free_amem(void *); extern void ndis_free_packet(ndis_packet *); extern void ndis_free_bufs(ndis_buffer *); extern int ndis_reset_nic(void *); Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Wed Jan 30 11:34:52 2019 (r343573) +++ head/sys/dev/if_ndis/if_ndis.c Wed Jan 30 11:40:12 2019 (r343574) @@ -568,15 +568,6 @@ ndis_attach(device_t dev) callout_init(&sc->ndis_stat_callout, 1); mbufq_init(&sc->ndis_rxqueue, INT_MAX); /* XXXGL: sane maximum */ - if (sc->ndis_iftype == PCMCIABus) { - error = ndis_alloc_amem(sc); - if (error) { - device_printf(dev, "failed to allocate " - "attribute memory\n"); - goto fail; - } - } - /* Create sysctl registry nodes */ ndis_create_sysctls(sc); @@ -1097,9 +1088,6 @@ ndis_detach(device_t dev) if (ifp != NULL) if_free(ifp); - - if (sc->ndis_iftype == PCMCIABus) - ndis_free_amem(sc); if (sc->ndis_sc) ndis_destroy_dma(sc); Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 30 11:34:52 2019 (r343573) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 30 11:40:12 2019 (r343574) @@ -74,6 +74,7 @@ MODULE_DEPEND(ndis, pccard, 1, 1, 1); static int ndis_probe_pccard (device_t); static int ndis_attach_pccard (device_t); +static int ndis_detach_pccard (device_t); static struct resource_list *ndis_get_resource_list (device_t, device_t); static int ndis_devcompare (interface_type, @@ -91,7 +92,7 @@ static device_method_t ndis_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ndis_probe_pccard), DEVMETHOD(device_attach, ndis_attach_pccard), - DEVMETHOD(device_detach, ndis_detach), + DEVMETHOD(device_detach, ndis_detach_pccard), DEVMETHOD(device_shutdown, ndis_shutdown), DEVMETHOD(device_suspend, ndis_suspend), DEVMETHOD(device_resume, ndis_resume), @@ -175,6 +176,50 @@ ndis_probe_pccard(dev) return(ENXIO); } +#define NDIS_AM_RID 3 + +static int +ndis_alloc_amem(struct ndis_softc *sc) +{ + int error, rid; + + rid = NDIS_AM_RID; + sc->ndis_res_am = bus_alloc_resource_anywhere(sc->ndis_dev, + SYS_RES_MEMORY, &rid, 0x1000, RF_ACTIVE); + + if (sc->ndis_res_am == NULL) { + device_printf(sc->ndis_dev, + "failed to allocate attribute memory\n"); + return(ENXIO); + } + sc->ndis_rescnt++; + resource_list_add(&sc->ndis_rl, SYS_RES_MEMORY, rid, + rman_get_start(sc->ndis_res_am), rman_get_end(sc->ndis_res_am), + rman_get_size(sc->ndis_res_am)); + + error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->ndis_dev), + sc->ndis_dev, rid, 0, NULL); + + if (error) { + device_printf(sc->ndis_dev, + "CARD_SET_MEMORY_OFFSET() returned 0x%x\n", error); + return(error); + } + + error = CARD_SET_RES_FLAGS(device_get_parent(sc->ndis_dev), + sc->ndis_dev, SYS_RES_MEMORY, rid, PCCARD_A_MEM_ATTR); + + if (error) { + device_printf(sc->ndis_dev, + "CARD_SET_RES_FLAGS() returned 0x%x\n", error); + return(error); + } + + sc->ndis_am_rid = rid; + + return(0); +} + /* * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. @@ -251,88 +296,40 @@ ndis_attach_pccard(dev) sc->ndis_devidx = devidx; + error = ndis_alloc_amem(sc); + if (error) { + device_printf(dev, "failed to allocate attribute memory\n"); + goto fail; + } + error = ndis_attach(dev); fail: return(error); } -static struct resource_list * -ndis_get_resource_list(dev, child) - device_t dev; - device_t child; +static int +ndis_detach_pccard(device_t dev) { - struct ndis_softc *sc; + struct ndis_softc *sc = device_get_softc(dev); - sc = device_get_softc(dev); - return (&sc->ndis_rl); -} + (void) ndis_detach(dev); -#define NDIS_AM_RID 3 + if (sc->ndis_res_am != NULL) + bus_release_resource(sc->ndis_dev, SYS_RES_MEMORY, + sc->ndis_am_rid, sc->ndis_res_am); + resource_list_free(&sc->ndis_rl); -int -ndis_alloc_amem(arg) - void *arg; -{ - struct ndis_softc *sc; - int error, rid; - - if (arg == NULL) - return(EINVAL); - - sc = arg; - rid = NDIS_AM_RID; - sc->ndis_res_am = bus_alloc_resource_anywhere(sc->ndis_dev, - SYS_RES_MEMORY, &rid, 0x1000, RF_ACTIVE); - - if (sc->ndis_res_am == NULL) { - device_printf(sc->ndis_dev, - "failed to allocate attribute memory\n"); - return(ENXIO); - } - sc->ndis_rescnt++; - resource_list_add(&sc->ndis_rl, SYS_RES_MEMORY, rid, - rman_get_start(sc->ndis_res_am), rman_get_end(sc->ndis_res_am), - rman_get_size(sc->ndis_res_am)); - - error = CARD_SET_MEMORY_OFFSET(device_get_parent(sc->ndis_dev), - sc->ndis_dev, rid, 0, NULL); - - if (error) { - device_printf(sc->ndis_dev, - "CARD_SET_MEMORY_OFFSET() returned 0x%x\n", error); - return(error); - } - - error = CARD_SET_RES_FLAGS(device_get_parent(sc->ndis_dev), - sc->ndis_dev, SYS_RES_MEMORY, rid, PCCARD_A_MEM_ATTR); - - if (error) { - device_printf(sc->ndis_dev, - "CARD_SET_RES_FLAGS() returned 0x%x\n", error); - return(error); - } - - sc->ndis_am_rid = rid; - - return(0); + return (0); } -void -ndis_free_amem(arg) - void *arg; +static struct resource_list * +ndis_get_resource_list(dev, child) + device_t dev; + device_t child; { struct ndis_softc *sc; - if (arg == NULL) - return; - - sc = arg; - - if (sc->ndis_res_am != NULL) - bus_release_resource(sc->ndis_dev, SYS_RES_MEMORY, - sc->ndis_am_rid, sc->ndis_res_am); - resource_list_free(&sc->ndis_rl); - - return; + sc = device_get_softc(dev); + return (&sc->ndis_rl); } From owner-svn-src-head@freebsd.org Wed Jan 30 11:58:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17DC314BDA25; Wed, 30 Jan 2019 11:58:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A75568ECCC; Wed, 30 Jan 2019 11:58:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 957C04739; Wed, 30 Jan 2019 11:58:09 +0000 (UTC) Date: Wed, 30 Jan 2019 11:58:09 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343566 - in head/lib/libthr: . thread Message-ID: <20190130115809.GA57859@FreeBSD.org> References: <201901292246.x0TMkjQH074121@repo.freebsd.org> <20190130053709.GA35927@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190130053709.GA35927@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: A75568ECCC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.84 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.84)[-0.840,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 11:58:10 -0000 On Wed, Jan 30, 2019 at 05:37:09AM +0000, Alexey Dokuchaev wrote: > On Tue, Jan 29, 2019 at 10:46:45PM +0000, Konstantin Belousov wrote: > > New Revision: 343566 > > URL: https://svnweb.freebsd.org/changeset/base/343566 > > > > Log: > > Untangle jemalloc and mutexes initialization. > > > > The need to use libc malloc(3) from some places in libthr always > > caused issues. For instance, per-thread key allocation was switched to > > use plain mmap(2) to get storage, because some third party mallocs > > used keys for implementation of calloc(3). > > > > Even more important, libthr calls calloc(3) during initialization of > > pthread mutexes, and jemalloc uses pthread mutexes. Jemalloc provides > > some way to both postpone the initialization, and to make > > initialization to use specialized allocator, but this is very fragile > > and often breaks. See the referenced PR for another example. > > Could this also fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767 > I wonder... Going through the "make world" now to test some Quake II. :-) I've updated to the latest -CURRENT (r343572) and now Quake II starts fine again, like it was in jemalloc pre-5.0.0 times. Thank you Kostik! ./danfe From owner-svn-src-head@freebsd.org Wed Jan 30 12:32:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CE0314BF8B0; Wed, 30 Jan 2019 12:32:48 +0000 (UTC) (envelope-from avos@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 D42C768695; Wed, 30 Jan 2019 12:32:47 +0000 (UTC) (envelope-from avos@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 A18051F483; Wed, 30 Jan 2019 12:32:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UCWl2f005017; Wed, 30 Jan 2019 12:32:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UCWlVo005016; Wed, 30 Jan 2019 12:32:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901301232.x0UCWlVo005016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 30 Jan 2019 12:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343576 - head/usr.sbin/ndiscvt X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/ndiscvt X-SVN-Commit-Revision: 343576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D42C768695 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 12:32:48 -0000 Author: avos Date: Wed Jan 30 12:32:47 2019 New Revision: 343576 URL: https://svnweb.freebsd.org/changeset/base/343576 Log: ndiscvt(8): abort if no IDs were found during conversion. Checked with Broadcom driver mentioned in PR 179285. PR: 69268 Submitted by: MFC after: 5 days Modified: head/usr.sbin/ndiscvt/inf.c head/usr.sbin/ndiscvt/ndiscvt.c Modified: head/usr.sbin/ndiscvt/inf.c ============================================================================== --- head/usr.sbin/ndiscvt/inf.c Wed Jan 30 11:56:10 2019 (r343575) +++ head/usr.sbin/ndiscvt/inf.c Wed Jan 30 12:32:47 2019 (r343576) @@ -62,9 +62,9 @@ static struct assign (struct assign *); static struct section *find_section (const char *); -static void dump_deviceids_pci (void); -static void dump_deviceids_pcmcia (void); -static void dump_deviceids_usb (void); +static int dump_deviceids_pci (void); +static int dump_deviceids_pcmcia (void); +static int dump_deviceids_usb (void); static void dump_pci_id (const char *); static void dump_pcmcia_id (const char *); static void dump_usb_id (const char *); @@ -85,9 +85,11 @@ inf_parse (FILE *fp, FILE *outfp) yyin = fp; yyparse(); - dump_deviceids_pci(); - dump_deviceids_pcmcia(); - dump_deviceids_usb(); + if (dump_deviceids_pci() == 0 && + dump_deviceids_pcmcia() == 0 && + dump_deviceids_usb() == 0) + return (-1); + fprintf(outfp, "#ifdef NDIS_REGVALS\n"); dump_regvals(); fprintf(outfp, "#endif /* NDIS_REGVALS */\n"); @@ -280,7 +282,7 @@ dump_usb_id(const char *s) fprintf(ofp, "\t\\\n\t{ %s, %s, ", vidstr, pidstr); } -static void +static int dump_deviceids_pci() { struct assign *manf, *dev; @@ -370,10 +372,10 @@ done: fprintf(ofp, "\n\n"); - return; + return (found); } -static void +static int dump_deviceids_pcmcia() { struct assign *manf, *dev; @@ -463,10 +465,10 @@ done: fprintf(ofp, "\n\n"); - return; + return (found); } -static void +static int dump_deviceids_usb() { struct assign *manf, *dev; @@ -556,7 +558,7 @@ done: fprintf(ofp, "\n\n"); - return; + return (found); } static void Modified: head/usr.sbin/ndiscvt/ndiscvt.c ============================================================================== --- head/usr.sbin/ndiscvt/ndiscvt.c Wed Jan 30 11:56:10 2019 (r343575) +++ head/usr.sbin/ndiscvt/ndiscvt.c Wed Jan 30 12:32:47 2019 (r343576) @@ -372,7 +372,8 @@ main(int argc, char *argv[]) err(1, "opening .INF file '%s' failed", inffile); - inf_parse(fp, outfp); + if (inf_parse(fp, outfp) != 0) + errx(1, "creating .INF file - no entries created, are you using the correct files?"); fclose(fp); } From owner-svn-src-head@freebsd.org Wed Jan 30 13:19:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8016A14C0A1F; Wed, 30 Jan 2019 13:19:06 +0000 (UTC) (envelope-from avos@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 272806B441; Wed, 30 Jan 2019 13:19:06 +0000 (UTC) (envelope-from avos@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 190D11FB61; Wed, 30 Jan 2019 13:19:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UDJ52C026788; Wed, 30 Jan 2019 13:19:05 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UDJ5ot026786; Wed, 30 Jan 2019 13:19:05 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901301319.x0UDJ5ot026786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 30 Jan 2019 13:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343577 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 272806B441 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.998,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.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 13:19:06 -0000 Author: avos Date: Wed Jan 30 13:19:05 2019 New Revision: 343577 URL: https://svnweb.freebsd.org/changeset/base/343577 Log: rsu(4): add support for ifconfig(8) 'maxretry' option. Tested with Asus USB-N10, STA mode; maxretry 0 / 1 / 6 / 12 Checked with RTL8188EE, MONITOR mode. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Jan 30 12:32:47 2019 (r343576) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Jan 30 13:19:05 2019 (r343577) @@ -2755,7 +2755,7 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct r92s_tx_desc *txd; - uint8_t rate, ridx, type, cipher; + uint8_t rate, ridx, type, cipher, qos; int prio = 0; uint8_t which; int hasqos; @@ -2804,12 +2804,14 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no prio = M_WME_GETAC(m0); which = rsu_wme_ac_xfer_map[prio]; hasqos = 1; + qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; } else { /* Non-QoS TID */ /* XXX TODO: tid=0 for non-qos TID? */ which = rsu_wme_ac_xfer_map[WME_AC_BE]; hasqos = 0; prio = 0; + qos = 0; } qid = rsu_ac2qid[prio]; @@ -2867,6 +2869,12 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no txd->txdw2 |= htole32(R92S_TXDW2_BK); if (ismcast) txd->txdw2 |= htole32(R92S_TXDW2_BMCAST); + + if (!ismcast && (!qos || (qos & IEEE80211_QOS_ACKPOLICY) != + IEEE80211_QOS_ACKPOLICY_NOACK)) { + txd->txdw2 |= htole32(R92S_TXDW2_RTY_LMT_ENA); + txd->txdw2 |= htole32(SM(R92S_TXDW2_RTY_LMT, tp->maxretry)); + } /* Force mgmt / mcast / ucast rate if needed. */ if (rate != 0) { Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Wed Jan 30 12:32:47 2019 (r343576) +++ head/sys/dev/usb/wlan/if_rsureg.h Wed Jan 30 13:19:05 2019 (r343577) @@ -688,6 +688,9 @@ struct r92s_tx_desc { #define R92S_TXDW1_HWPC 0x80000000 uint32_t txdw2; +#define R92S_TXDW2_RTY_LMT_M 0x0000003f +#define R92S_TXDW2_RTY_LMT_S 0 +#define R92S_TXDW2_RTY_LMT_ENA 0x00000040 #define R92S_TXDW2_BMCAST 0x00000080 #define R92S_TXDW2_AGGEN 0x20000000 #define R92S_TXDW2_BK 0x40000000 From owner-svn-src-head@freebsd.org Wed Jan 30 13:21:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD1014C0C19; Wed, 30 Jan 2019 13:21:29 +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 E5CCB6B679; Wed, 30 Jan 2019 13:21:28 +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 D85AF1FBA9; Wed, 30 Jan 2019 13:21:28 +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 x0UDLS4G027760; Wed, 30 Jan 2019 13:21:28 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UDLRGP027749; Wed, 30 Jan 2019 13:21:27 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201901301321.x0UDLRGP027749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 30 Jan 2019 13:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343578 - in head/sys: dev/e1000 dev/ixgbe dev/ixl dev/vmware/vmxnet3 net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in head/sys: dev/e1000 dev/ixgbe dev/ixl dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 343578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5CCB6B679 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 13:21:29 -0000 Author: marius Date: Wed Jan 30 13:21:26 2019 New Revision: 343578 URL: https://svnweb.freebsd.org/changeset/base/343578 Log: - Stop iflib(4) from leaking MSI messages on detachment by calling bus_teardown_intr(9) before pci_release_msi(9). - Ensure that iflib(4) and associated drivers pass correct RIDs to bus_release_resource(9) by obtaining the RIDs via rman_get_rid(9) on the corresponding resources instead of using the RIDs initially passed to bus_alloc_resource_any(9) as the latter function may change those RIDs. Solely em(4) for the ioport resource (but not others) and bnxt(4) were using the correct RIDs by caching the ones returned by bus_alloc_resource_any(9). - Change the logic of iflib_msix_init() around to only map the MSI-X BAR if MSI-X is actually supported, i. e. pci_msix_count(9) returns > 0. Otherwise the "Unable to map MSIX table " message triggers for devices that simply don't support MSI-X and the user may think that something is wrong while in fact everything works as expected. - Put some (mostly redundant) debug messages emitted by iflib(4) and em(4) during attachment under bootverbose. The non-verbose output of em(4) seen during attachment now is close to the one prior to the conversion to iflib(4). - Replace various variants of spelling "MSI-X" (several in messages) with "MSI-X" as used in the PCI specifications. - Remove some trailing whitespace from messages emitted by iflib(4) and change them to consistently start with uppercase. - Remove some obsolete comments about releasing interrupts from drivers and correct a few others. Reviewed by: erj, Jacob Keller, shurd Differential Revision: https://reviews.freebsd.org/D18980 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixl/if_iavf.c head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_iw.c head/sys/dev/ixl/ixl_pf_main.c head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/net/iflib.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/e1000/if_em.c Wed Jan 30 13:21:26 2019 (r343578) @@ -293,7 +293,7 @@ static void em_disable_aspm(struct adapter *); int em_intr(void *arg); static void em_disable_promisc(if_ctx_t ctx); -/* MSIX handlers */ +/* MSI-X handlers */ static int em_if_msix_intr_assign(if_ctx_t, int); static int em_msix_link(void *); static void em_handle_link(void *context); @@ -780,7 +780,9 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_msix_bar = PCIR_BAR(EM_MSIX_BAR); scctx->isc_tx_nsegments = EM_MAX_SCATTER; scctx->isc_nrxqsets_max = scctx->isc_ntxqsets_max = em_set_num_queues(ctx); - device_printf(dev, "attach_pre capping queues at %d\n", scctx->isc_ntxqsets_max); + if (bootverbose) + device_printf(dev, "attach_pre capping queues at %d\n", + scctx->isc_ntxqsets_max); if (adapter->hw.mac.type >= igb_mac_min) { int try_second_bar; @@ -1301,7 +1303,7 @@ em_if_init(if_ctx_t ctx) em_if_set_promisc(ctx, IFF_PROMISC); e1000_clear_hw_cntrs_base_generic(&adapter->hw); - /* MSI/X configuration for 82574 */ + /* MSI-X configuration for 82574 */ if (adapter->hw.mac.type == e1000_82574) { int tmp = E1000_READ_REG(&adapter->hw, E1000_CTRL_EXT); @@ -1427,7 +1429,7 @@ em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqi /********************************************************************* * - * MSIX RX Interrupt Service routine + * MSI-X RX Interrupt Service routine * **********************************************************************/ static int @@ -1442,7 +1444,7 @@ em_msix_que(void *arg) /********************************************************************* * - * MSIX Link Fast Interrupt Service routine + * MSI-X Link Fast Interrupt Service routine * **********************************************************************/ static int @@ -1912,7 +1914,6 @@ em_allocate_pci_resources(if_ctx_t ctx) for (rid = PCIR_BAR(0); rid < PCIR_CIS;) { val = pci_read_config(dev, rid, 4); if (EM_BAR_TYPE(val) == EM_BAR_TYPE_IO) { - adapter->io_rid = rid; break; } rid += 4; @@ -1924,8 +1925,8 @@ em_allocate_pci_resources(if_ctx_t ctx) device_printf(dev, "Unable to locate IO BAR\n"); return (ENXIO); } - adapter->ioport = bus_alloc_resource_any(dev, - SYS_RES_IOPORT, &adapter->io_rid, RF_ACTIVE); + adapter->ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &rid, RF_ACTIVE); if (adapter->ioport == NULL) { device_printf(dev, "Unable to allocate bus resource: " "ioport\n"); @@ -1945,7 +1946,7 @@ em_allocate_pci_resources(if_ctx_t ctx) /********************************************************************* * - * Setup the MSIX Interrupt handlers + * Set up the MSI-X Interrupt handlers * **********************************************************************/ static int @@ -1974,7 +1975,7 @@ em_if_msix_intr_assign(if_ctx_t ctx, int msix) * Set the bit to enable interrupt * in E1000_IMS -- bits 20 and 21 * are for RX0 and RX1, note this has - * NOTHING to do with the MSIX vector + * NOTHING to do with the MSI-X vector */ if (adapter->hw.mac.type == e1000_82574) { rx_que->eims = 1 << (20 + i); @@ -2001,7 +2002,7 @@ em_if_msix_intr_assign(if_ctx_t ctx, int msix) * Set the bit to enable interrupt * in E1000_IMS -- bits 22 and 23 * are for TX0 and TX1, note this has - * NOTHING to do with the MSIX vector + * NOTHING to do with the MSI-X vector */ if (adapter->hw.mac.type == e1000_82574) { tx_que->eims = 1 << (22 + i); @@ -2050,7 +2051,7 @@ igb_configure_queues(struct adapter *adapter) E1000_GPIE_MSIX_MODE | E1000_GPIE_EIAME | E1000_GPIE_PBA | E1000_GPIE_NSICR); - /* Turn on MSIX */ + /* Turn on MSI-X */ switch (adapter->hw.mac.type) { case e1000_82580: case e1000_i350: @@ -2184,7 +2185,7 @@ em_free_pci_resources(if_ctx_t ctx) struct em_rx_queue *que = adapter->rx_queues; device_t dev = iflib_get_dev(ctx); - /* Release all msix queue resources */ + /* Release all MSI-X queue resources */ if (adapter->intr_type == IFLIB_INTR_MSIX) iflib_irq_free(ctx, &adapter->irq); @@ -2192,24 +2193,26 @@ em_free_pci_resources(if_ctx_t ctx) iflib_irq_free(ctx, &que->que_irq); } - /* First release all the interrupt resources */ if (adapter->memory != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(0), adapter->memory); + rman_get_rid(adapter->memory), adapter->memory); adapter->memory = NULL; } if (adapter->flash != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, - EM_FLASH, adapter->flash); + rman_get_rid(adapter->flash), adapter->flash); adapter->flash = NULL; } - if (adapter->ioport != NULL) + + if (adapter->ioport != NULL) { bus_release_resource(dev, SYS_RES_IOPORT, - adapter->io_rid, adapter->ioport); + rman_get_rid(adapter->ioport), adapter->ioport); + adapter->ioport = NULL; + } } -/* Setup MSI or MSI/X */ +/* Set up MSI or MSI-X */ static int em_setup_msix(if_ctx_t ctx) { @@ -2851,7 +2854,9 @@ em_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, u txr->tx_paddr = paddrs[i*ntxqs]; } - device_printf(iflib_get_dev(ctx), "allocated for %d tx_queues\n", adapter->tx_num_queues); + if (bootverbose) + device_printf(iflib_get_dev(ctx), + "allocated for %d tx_queues\n", adapter->tx_num_queues); return (0); fail: em_if_queues_free(ctx); @@ -2889,9 +2894,11 @@ em_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, u rxr->rx_base = (union e1000_rx_desc_extended *)vaddrs[i*nrxqs]; rxr->rx_paddr = paddrs[i*nrxqs]; } + + if (bootverbose) + device_printf(iflib_get_dev(ctx), + "allocated for %d rx_queues\n", adapter->rx_num_queues); - device_printf(iflib_get_dev(ctx), "allocated for %d rx_queues\n", adapter->rx_num_queues); - return (0); fail: em_if_queues_free(ctx); @@ -3133,7 +3140,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rfctl = E1000_READ_REG(hw, E1000_RFCTL); rfctl |= E1000_RFCTL_EXTEN; /* - * When using MSIX interrupts we need to throttle + * When using MSI-X interrupts we need to throttle * using the EITR register (82574 only) */ if (hw->mac.type == e1000_82574) { @@ -4007,7 +4014,7 @@ em_add_hw_stats(struct adapter *adapter) "Driver dropped packets"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "link_irq", CTLFLAG_RD, &adapter->link_irq, - "Link MSIX IRQ Handled"); + "Link MSI-X IRQ Handled"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_fail", CTLFLAG_RD, &adapter->mbuf_defrag_failed, "Defragmenting mbuf chain failed"); @@ -4524,7 +4531,7 @@ em_print_debug_info(struct adapter *adapter) /* * 82574 only: - * Write a new value to the EEPROM increasing the number of MSIX + * Write a new value to the EEPROM increasing the number of MSI-X * vectors from 3 to 5, for proper multiqueue support. */ static void @@ -4539,7 +4546,7 @@ em_enable_vectors_82574(if_ctx_t ctx) printf("Current cap: %#06x\n", edata); if (((edata & EM_NVM_MSIX_N_MASK) >> EM_NVM_MSIX_N_SHIFT) != 4) { device_printf(dev, "Writing to eeprom: increasing " - "reported MSIX vectors from 3 to 5...\n"); + "reported MSI-X vectors from 3 to 5...\n"); edata &= ~(EM_NVM_MSIX_N_MASK); edata |= 4 << EM_NVM_MSIX_N_SHIFT; e1000_write_nvm(hw, EM_NVM_PCIE_CTRL, 1, &edata); Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/e1000/if_em.h Wed Jan 30 13:21:26 2019 (r343578) @@ -352,8 +352,8 @@ /* * 82574 has a nonstandard address for EIAC - * and since its only used in MSIX, and in - * the em driver only 82574 uses MSIX we can + * and since its only used in MSI-X, and in + * the em driver only 82574 uses MSI-X we can * solve it just using this define. */ #define EM_EIAC 0x000DC @@ -468,7 +468,6 @@ struct adapter { struct resource *memory; struct resource *flash; struct resource *ioport; - int io_rid; struct resource *res; void *tag; Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/ixgbe/if_ix.c Wed Jan 30 13:21:26 2019 (r343578) @@ -2021,7 +2021,7 @@ ixgbe_if_msix_intr_assign(if_ctx_t ctx, int msix) cpu_id = rss_getcpu(i % rss_getnumbuckets()); } else { /* - * Bind the msix vector, and thus the + * Bind the MSI-X vector, and thus the * rings to the corresponding cpu. * * This just happens to match the default RSS @@ -3814,7 +3814,7 @@ ixgbe_free_pci_resources(if_ctx_t ctx) struct ix_rx_queue *que = adapter->rx_queues; device_t dev = iflib_get_dev(ctx); - /* Release all msix queue resources */ + /* Release all MSI-X queue resources */ if (adapter->intr_type == IFLIB_INTR_MSIX) iflib_irq_free(ctx, &adapter->irq); @@ -3824,13 +3824,9 @@ ixgbe_free_pci_resources(if_ctx_t ctx) } } - /* - * Free link/admin interrupt - */ if (adapter->pci_mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(0), adapter->pci_mem); - + rman_get_rid(adapter->pci_mem), adapter->pci_mem); } /* ixgbe_free_pci_resources */ /************************************************************************ Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/ixgbe/if_ixv.c Wed Jan 30 13:21:26 2019 (r343578) @@ -1132,7 +1132,7 @@ ixv_free_pci_resources(if_ctx_t ctx) struct ix_rx_queue *que = adapter->rx_queues; device_t dev = iflib_get_dev(ctx); - /* Release all msix queue resources */ + /* Release all MSI-X queue resources */ if (adapter->intr_type == IFLIB_INTR_MSIX) iflib_irq_free(ctx, &adapter->irq); @@ -1142,10 +1142,9 @@ ixv_free_pci_resources(if_ctx_t ctx) } } - /* Clean the Legacy or Link interrupt last */ if (adapter->pci_mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(0), adapter->pci_mem); + rman_get_rid(adapter->pci_mem), adapter->pci_mem); } /* ixv_free_pci_resources */ /************************************************************************ Modified: head/sys/dev/ixl/if_iavf.c ============================================================================== --- head/sys/dev/ixl/if_iavf.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/ixl/if_iavf.c Wed Jan 30 13:21:26 2019 (r343578) @@ -358,7 +358,7 @@ iavf_if_attach_pre(if_ctx_t ctx) goto err_early; } - iavf_dbg_init(sc, "Allocated PCI resources and MSIX vectors\n"); + iavf_dbg_init(sc, "Allocated PCI resources and MSI-X vectors\n"); /* * XXX: This is called by init_shared_code in the PF driver, @@ -407,7 +407,8 @@ iavf_if_attach_pre(if_ctx_t ctx) goto err_aq; } - device_printf(dev, "VSIs %d, QPs %d, MSIX %d, RSS sizes: key %d lut %d\n", + device_printf(dev, + "VSIs %d, QPs %d, MSI-X %d, RSS sizes: key %d lut %d\n", sc->vf_res->num_vsis, sc->vf_res->num_queue_pairs, sc->vf_res->max_vectors, @@ -1485,7 +1486,7 @@ iavf_free_pci_resources(struct iavf_sc *sc) struct ixl_rx_queue *rx_que = vsi->rx_queues; device_t dev = sc->dev; - /* We may get here before stations are setup */ + /* We may get here before stations are set up */ if (rx_que == NULL) goto early; @@ -1498,7 +1499,7 @@ iavf_free_pci_resources(struct iavf_sc *sc) early: if (sc->pci_mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(0), sc->pci_mem); + rman_get_rid(sc->pci_mem), sc->pci_mem); } Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/ixl/if_ixl.c Wed Jan 30 13:21:26 2019 (r343578) @@ -299,7 +299,7 @@ int ixl_limit_iwarp_msix = IXL_IW_MAX_MSIX; #endif TUNABLE_INT("hw.ixl.limit_iwarp_msix", &ixl_limit_iwarp_msix); SYSCTL_INT(_hw_ixl, OID_AUTO, limit_iwarp_msix, CTLFLAG_RDTUN, - &ixl_limit_iwarp_msix, 0, "Limit MSIX vectors assigned to iWARP"); + &ixl_limit_iwarp_msix, 0, "Limit MSI-X vectors assigned to iWARP"); #endif extern struct if_txrx ixl_txrx_hwb; @@ -684,14 +684,14 @@ ixl_if_attach_post(if_ctx_t ctx) error = ixl_iw_pf_attach(pf); if (error) { device_printf(dev, - "interfacing to iwarp driver failed: %d\n", + "interfacing to iWARP driver failed: %d\n", error); goto err; } else device_printf(dev, "iWARP ready\n"); } else - device_printf(dev, - "iwarp disabled on this device (no msix vectors)\n"); + device_printf(dev, "iWARP disabled on this device " + "(no MSI-X vectors)\n"); } else { pf->iw_enabled = false; device_printf(dev, "The device is not iWARP enabled\n"); @@ -857,7 +857,7 @@ ixl_if_init(if_ctx_t ctx) /* Set up RSS */ ixl_config_rss(pf); - /* Set up MSI/X routing and the ITR settings */ + /* Set up MSI-X routing and the ITR settings */ if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { ixl_configure_queue_intr_msix(pf); ixl_configure_itr(pf); Modified: head/sys/dev/ixl/ixl_iw.c ============================================================================== --- head/sys/dev/ixl/ixl_iw.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/ixl/ixl_iw.c Wed Jan 30 13:21:26 2019 (r343578) @@ -333,7 +333,7 @@ ixl_iw_pf_msix_init(void *pf_handle, if ((msix_info->aeq_vector < IXL_IW_VEC_BASE(pf)) || (msix_info->aeq_vector >= IXL_IW_VEC_LIMIT(pf))) { - printf("%s: invalid MSIX vector (%i) for AEQ\n", + printf("%s: invalid MSI-X vector (%i) for AEQ\n", __func__, msix_info->aeq_vector); return (EINVAL); } Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/ixl/ixl_pf_main.c Wed Jan 30 13:21:26 2019 (r343578) @@ -278,7 +278,8 @@ retry: } /* Print a subset of the capability information. */ - device_printf(dev, "PF-ID[%d]: VFs %d, MSIX %d, VF MSIX %d, QPs %d, %s\n", + device_printf(dev, + "PF-ID[%d]: VFs %d, MSI-X %d, VF MSI-X %d, QPs %d, %s\n", hw->pf_id, hw->func_caps.num_vfs, hw->func_caps.num_msix_vectors, hw->func_caps.num_msix_vectors_vf, hw->func_caps.num_tx_qp, (hw->func_caps.mdio_port_mode == 2) ? "I2C" : @@ -505,7 +506,7 @@ ixl_intr(void *arg) /********************************************************************* * - * MSIX VSI Interrupt Service routine + * MSI-X VSI Interrupt Service routine * **********************************************************************/ int @@ -524,7 +525,7 @@ ixl_msix_que(void *arg) /********************************************************************* * - * MSIX Admin Queue Interrupt Service routine + * MSI-X Admin Queue Interrupt Service routine * **********************************************************************/ int @@ -791,7 +792,7 @@ ixl_configure_intr0_msix(struct ixl_pf *pf) /* * 0x7FF is the end of the queue list. * This means we won't use MSI-X vector 0 for a queue interrupt - * in MSIX mode. + * in MSI-X mode. */ wr32(hw, I40E_PFINT_LNKLST0, 0x7FF); /* Value is in 2 usec units, so 0x3E is 62*2 = 124 usecs. */ @@ -909,12 +910,12 @@ ixl_free_pci_resources(struct ixl_pf *pf) device_t dev = iflib_get_dev(vsi->ctx); struct ixl_rx_queue *rx_que = vsi->rx_queues; - /* We may get here before stations are setup */ + /* We may get here before stations are set up */ if (rx_que == NULL) goto early; /* - ** Release all msix VSI resources: + ** Release all MSI-X VSI resources: */ iflib_irq_free(vsi->ctx, &vsi->irq); @@ -923,7 +924,7 @@ ixl_free_pci_resources(struct ixl_pf *pf) early: if (pf->pci_mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(0), pf->pci_mem); + rman_get_rid(pf->pci_mem), pf->pci_mem); } void Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Wed Jan 30 13:21:26 2019 (r343578) @@ -398,7 +398,7 @@ vmxnet3_attach_pre(if_ctx_t ctx) /* * Configure the softc context to attempt to configure the interrupt * mode now indicated by intr_config. iflib will follow the usual - * fallback path MSIX -> MSI -> LEGACY, starting at the configured + * fallback path MSI-X -> MSI -> LEGACY, starting at the configured * starting mode. */ switch (intr_config & 0x03) { @@ -620,19 +620,18 @@ static void vmxnet3_free_resources(struct vmxnet3_softc *sc) { device_t dev; - int rid; dev = sc->vmx_dev; if (sc->vmx_res0 != NULL) { - rid = PCIR_BAR(0); - bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->vmx_res0); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->vmx_res0), sc->vmx_res0); sc->vmx_res0 = NULL; } if (sc->vmx_res1 != NULL) { - rid = PCIR_BAR(1); - bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->vmx_res1); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->vmx_res1), sc->vmx_res1); sc->vmx_res1 = NULL; } } @@ -1074,7 +1073,7 @@ vmxnet3_init_shared_data(struct vmxnet3_softc *sc) ds->automask = sc->vmx_intr_mask_mode == VMXNET3_IMM_AUTO; /* * Total number of interrupt indexes we are using in the shared - * config data, even though we don't actually allocate MSIX + * config data, even though we don't actually allocate MSI-X * resources for the tx queues. Some versions of the device will * fail to initialize successfully if interrupt indexes are used in * the shared config that exceed the number of interrupts configured Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Jan 30 13:19:05 2019 (r343577) +++ head/sys/net/iflib.c Wed Jan 30 13:21:26 2019 (r343578) @@ -4409,8 +4409,8 @@ iflib_device_register(device_t dev, void *sc, if_share main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; /* XXX change for per-queue sizes */ - device_printf(dev, "using %d tx descriptors and %d rx descriptors\n", - scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); + device_printf(dev, "Using %d tx descriptors and %d rx descriptors\n", + scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); for (i = 0; i < sctx->isc_nrxqs; i++) { if (!powerof2(scctx->isc_nrxd[i])) { /* round down instead? */ @@ -4472,9 +4472,8 @@ iflib_device_register(device_t dev, void *sc, if_share MPASS(CPU_COUNT(&ctx->ifc_cpus) > 0); /* - ** Now setup MSI or MSI/X, should - ** return us the number of supported - ** vectors. (Will be 1 for MSI) + ** Now set up MSI or MSI-X, should return us the number of supported + ** vectors (will be 1 for a legacy interrupt and MSI). */ if (sctx->isc_flags & IFLIB_SKIP_MSIX) { msix = scctx->isc_vectors; @@ -4671,8 +4670,8 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; /* XXX change for per-queue sizes */ - device_printf(dev, "using %d tx descriptors and %d rx descriptors\n", - scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); + device_printf(dev, "Using %d tx descriptors and %d rx descriptors\n", + scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); for (i = 0; i < sctx->isc_nrxqs; i++) { if (!powerof2(scctx->isc_nrxd[i])) { /* round down instead? */ @@ -4928,15 +4927,15 @@ static void iflib_free_intr_mem(if_ctx_t ctx) { - if (ctx->ifc_softc_ctx.isc_intr != IFLIB_INTR_LEGACY) { - pci_release_msi(ctx->ifc_dev); - } if (ctx->ifc_softc_ctx.isc_intr != IFLIB_INTR_MSIX) { iflib_irq_free(ctx, &ctx->ifc_legacy_irq); } + if (ctx->ifc_softc_ctx.isc_intr != IFLIB_INTR_LEGACY) { + pci_release_msi(ctx->ifc_dev); + } if (ctx->ifc_msix_mem != NULL) { bus_release_resource(ctx->ifc_dev, SYS_RES_MEMORY, - ctx->ifc_softc_ctx.isc_msix_bar, ctx->ifc_msix_mem); + rman_get_rid(ctx->ifc_msix_mem), ctx->ifc_msix_mem); ctx->ifc_msix_mem = NULL; } } @@ -5763,11 +5762,13 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq void iflib_irq_free(if_ctx_t ctx, if_irq_t irq) { + if (irq->ii_tag) bus_teardown_intr(ctx->ifc_dev, irq->ii_res, irq->ii_tag); if (irq->ii_res) - bus_release_resource(ctx->ifc_dev, SYS_RES_IRQ, irq->ii_rid, irq->ii_res); + bus_release_resource(ctx->ifc_dev, SYS_RES_IRQ, + rman_get_rid(irq->ii_res), irq->ii_res); } static int @@ -5961,7 +5962,9 @@ iflib_msix_init(if_ctx_t ctx) iflib_num_tx_queues = ctx->ifc_sysctl_ntxqs; iflib_num_rx_queues = ctx->ifc_sysctl_nrxqs; - device_printf(dev, "msix_init qsets capped at %d\n", imax(scctx->isc_ntxqsets, scctx->isc_nrxqsets)); + if (bootverbose) + device_printf(dev, "msix_init qsets capped at %d\n", + imax(scctx->isc_ntxqsets, scctx->isc_nrxqsets)); bar = ctx->ifc_softc_ctx.isc_msix_bar; admincnt = sctx->isc_admin_intrcnt; @@ -5969,30 +5972,27 @@ iflib_msix_init(if_ctx_t ctx) if (scctx->isc_disable_msix) goto msi; + /* First try MSI-X */ + if ((msgs = pci_msix_count(dev)) == 0) { + if (bootverbose) + device_printf(dev, "MSI-X not supported or disabled\n"); + goto msi; + } /* * bar == -1 => "trust me I know what I'm doing" * Some drivers are for hardware that is so shoddily * documented that no one knows which bars are which * so the developer has to map all bars. This hack - * allows shoddy garbage to use msix in this framework. + * allows shoddy garbage to use MSI-X in this framework. */ if (bar != -1) { ctx->ifc_msix_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &bar, RF_ACTIVE); if (ctx->ifc_msix_mem == NULL) { - /* May not be enabled */ - device_printf(dev, "Unable to map MSIX table \n"); + device_printf(dev, "Unable to map MSI-X table\n"); goto msi; } } - /* First try MSI/X */ - if ((msgs = pci_msix_count(dev)) == 0) { /* system has msix disabled */ - device_printf(dev, "System has MSIX disabled \n"); - bus_release_resource(dev, SYS_RES_MEMORY, - bar, ctx->ifc_msix_mem); - ctx->ifc_msix_mem = NULL; - goto msi; - } #if IFLIB_DEBUG /* use only 1 qset in debug mode */ queuemsgs = min(msgs - admincnt, 1); @@ -6005,8 +6005,10 @@ iflib_msix_init(if_ctx_t ctx) queues = queuemsgs; #endif queues = imin(CPU_COUNT(&ctx->ifc_cpus), queues); - device_printf(dev, "pxm cpus: %d queue msgs: %d admincnt: %d\n", - CPU_COUNT(&ctx->ifc_cpus), queuemsgs, admincnt); + if (bootverbose) + device_printf(dev, + "intr CPUs: %d queue msgs: %d admincnt: %d\n", + CPU_COUNT(&ctx->ifc_cpus), queuemsgs, admincnt); #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ if (queues > rss_getnumbuckets()) @@ -6042,11 +6044,13 @@ iflib_msix_init(if_ctx_t ctx) rx_queues = min(rx_queues, tx_queues); } - device_printf(dev, "using %d rx queues %d tx queues \n", rx_queues, tx_queues); + device_printf(dev, "Using %d rx queues %d tx queues\n", + rx_queues, tx_queues); vectors = rx_queues + admincnt; if ((err = pci_alloc_msix(dev, &vectors)) == 0) { - device_printf(dev, "Using MSIX interrupts with %d vectors\n", vectors); + device_printf(dev, "Using MSI-X interrupts with %d vectors\n", + vectors); scctx->isc_vectors = vectors; scctx->isc_nrxqsets = rx_queues; scctx->isc_ntxqsets = tx_queues; @@ -6055,7 +6059,8 @@ iflib_msix_init(if_ctx_t ctx) return (vectors); } else { device_printf(dev, - "failed to allocate %d msix vectors, err: %d - using MSI\n", vectors, err); + "failed to allocate %d MSI-X vectors, err: %d - using MSI\n", + vectors, err); bus_release_resource(dev, SYS_RES_MEMORY, bar, ctx->ifc_msix_mem); ctx->ifc_msix_mem = NULL; @@ -6191,7 +6196,7 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) "permit #txq != #rxq"); SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "disable_msix", CTLFLAG_RWTUN, &ctx->ifc_softc_ctx.isc_disable_msix, 0, - "disable MSIX (default 0)"); + "disable MSI-X (default 0)"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "rx_budget", CTLFLAG_RWTUN, &ctx->ifc_sysctl_rx_budget, 0, "set the rx budget"); From owner-svn-src-head@freebsd.org Wed Jan 30 14:47:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31E1C14C2C1D; Wed, 30 Jan 2019 14:47:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 920BB6E4C7; Wed, 30 Jan 2019 14:47:46 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0UEliuV013591; Wed, 30 Jan 2019 06:47:44 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0UEliQq013590; Wed, 30 Jan 2019 06:47:44 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901301447.x0UEliQq013590@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343578 - in head/sys: dev/e1000 dev/ixgbe dev/ixl dev/vmware/vmxnet3 net In-Reply-To: <201901301321.x0UDLRGP027749@repo.freebsd.org> To: Marius Strobl Date: Wed, 30 Jan 2019 06:47:44 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 920BB6E4C7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 14:47:47 -0000 > Author: marius > Date: Wed Jan 30 13:21:26 2019 > New Revision: 343578 > URL: https://svnweb.freebsd.org/changeset/base/343578 > > Log: > - Stop iflib(4) from leaking MSI messages on detachment by calling > bus_teardown_intr(9) before pci_release_msi(9). > - Ensure that iflib(4) and associated drivers pass correct RIDs to > bus_release_resource(9) by obtaining the RIDs via rman_get_rid(9) > on the corresponding resources instead of using the RIDs initially > passed to bus_alloc_resource_any(9) as the latter function may > change those RIDs. Solely em(4) for the ioport resource (but not > others) and bnxt(4) were using the correct RIDs by caching the ones > returned by bus_alloc_resource_any(9). > - Change the logic of iflib_msix_init() around to only map the MSI-X > BAR if MSI-X is actually supported, i. e. pci_msix_count(9) returns > > 0. Otherwise the "Unable to map MSIX table " message triggers for > devices that simply don't support MSI-X and the user may think that > something is wrong while in fact everything works as expected. > - Put some (mostly redundant) debug messages emitted by iflib(4) > and em(4) during attachment under bootverbose. The non-verbose > output of em(4) seen during attachment now is close to the one > prior to the conversion to iflib(4). > - Replace various variants of spelling "MSI-X" (several in messages) > with "MSI-X" as used in the PCI specifications. > - Remove some trailing whitespace from messages emitted by iflib(4) > and change them to consistently start with uppercase. > - Remove some obsolete comments about releasing interrupts from > drivers and correct a few others. > > Reviewed by: erj, Jacob Keller, shurd > Differential Revision: https://reviews.freebsd.org/D18980 MFC intentions? I am sure you mean to, just not sure how soon. Does this effect any of the PR's open against em(4)/iflib(9)? Thanks, Rod > > Modified: > head/sys/dev/e1000/if_em.c > head/sys/dev/e1000/if_em.h > head/sys/dev/ixgbe/if_ix.c > head/sys/dev/ixgbe/if_ixv.c > head/sys/dev/ixl/if_iavf.c > head/sys/dev/ixl/if_ixl.c > head/sys/dev/ixl/ixl_iw.c > head/sys/dev/ixl/ixl_pf_main.c > head/sys/dev/vmware/vmxnet3/if_vmx.c > head/sys/net/iflib.c > ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jan 30 15:38:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B33C614C3CC3; Wed, 30 Jan 2019 15:38:15 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46EF66FE03; Wed, 30 Jan 2019 15:38:14 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id x0UFc8sS073547 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 30 Jan 2019 16:38:08 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id x0UFc82v073546; Wed, 30 Jan 2019 16:38:08 +0100 (CET) (envelope-from marius) Date: Wed, 30 Jan 2019 16:38:08 +0100 From: Marius Strobl To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343578 - in head/sys: dev/e1000 dev/ixgbe dev/ixl dev/vmware/vmxnet3 net Message-ID: <20190130153808.GE12067@alchemy.franken.de> References: <201901301321.x0UDLRGP027749@repo.freebsd.org> <201901301447.x0UEliQq013590@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901301447.x0UEliQq013590@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.9.2 (2017-12-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (alchemy.franken.de [0.0.0.0]); Wed, 30 Jan 2019 16:38:08 +0100 (CET) X-Rspamd-Queue-Id: 46EF66FE03 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.966,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 15:38:15 -0000 On Wed, Jan 30, 2019 at 06:47:44AM -0800, Rodney W. Grimes wrote: > > Author: marius > > Date: Wed Jan 30 13:21:26 2019 > > New Revision: 343578 > > URL: https://svnweb.freebsd.org/changeset/base/343578 > > > > Log: > > - Stop iflib(4) from leaking MSI messages on detachment by calling > > bus_teardown_intr(9) before pci_release_msi(9). > > - Ensure that iflib(4) and associated drivers pass correct RIDs to > > bus_release_resource(9) by obtaining the RIDs via rman_get_rid(9) > > on the corresponding resources instead of using the RIDs initially > > passed to bus_alloc_resource_any(9) as the latter function may > > change those RIDs. Solely em(4) for the ioport resource (but not > > others) and bnxt(4) were using the correct RIDs by caching the ones > > returned by bus_alloc_resource_any(9). > > - Change the logic of iflib_msix_init() around to only map the MSI-X > > BAR if MSI-X is actually supported, i. e. pci_msix_count(9) returns > > > 0. Otherwise the "Unable to map MSIX table " message triggers for > > devices that simply don't support MSI-X and the user may think that > > something is wrong while in fact everything works as expected. > > - Put some (mostly redundant) debug messages emitted by iflib(4) > > and em(4) during attachment under bootverbose. The non-verbose > > output of em(4) seen during attachment now is close to the one > > prior to the conversion to iflib(4). > > - Replace various variants of spelling "MSI-X" (several in messages) > > with "MSI-X" as used in the PCI specifications. > > - Remove some trailing whitespace from messages emitted by iflib(4) > > and change them to consistently start with uppercase. > > - Remove some obsolete comments about releasing interrupts from > > drivers and correct a few others. > > > > Reviewed by: erj, Jacob Keller, shurd > > Differential Revision: https://reviews.freebsd.org/D18980 > > MFC intentions? > I am sure you mean to, just not sure how soon. Probably after the 3 days minimum so we finally can start with trying to wrap up an iflib EN for 12.0. > Does this effect any of the PR's open against em(4)/iflib(9)? The above revision addresses the "Unable to map MSIX table " part of PR 234766, but not its core problem of the interface wedging. The previous switch to using bus_dma(9) and associated fixes may or may not solve the remainder of PR 234766 and some of the other PRs filed against em(4) in 12.0. PR 228827 is about device attachment with iflib(4) but misses details. Several problems with that attachment (apart from the above, e. g. also interrupt method fallback) have been fixed since that PR was filed, though. Marius From owner-svn-src-head@freebsd.org Wed Jan 30 15:51:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A9214C45E8; Wed, 30 Jan 2019 15:51:57 +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 26E5C70894; Wed, 30 Jan 2019 15:51:57 +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 C5DA52168F; Wed, 30 Jan 2019 15:51:56 +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 x0UFpuJZ006118; Wed, 30 Jan 2019 15:51:56 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UFpuSA006115; Wed, 30 Jan 2019 15:51:56 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901301551.x0UFpuSA006115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 30 Jan 2019 15:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343579 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 343579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26E5C70894 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 15:51:57 -0000 Author: vmaffione Date: Wed Jan 30 15:51:55 2019 New Revision: 343579 URL: https://svnweb.freebsd.org/changeset/base/343579 Log: netmap: fix lock order reversal related to kqueue usage When using poll(), select() or kevent() on netmap file descriptors, netmap executes the equivalent of NIOCTXSYNC and NIOCRXSYNC commands, before collecting the events that are ready. In other words, the poll/kevent callback has side effects. This is done to avoid the overhead of two system call per iteration (e.g., poll() + ioctl(NIOC*XSYNC)). When the kqueue subsystem invokes the kqueue(9) f_event callback (netmap_knrw), it holds the lock of the struct knlist object associated to the netmap port (the lock is provided at initialization, by calling knlist_init_mtx). However, netmap_knrw() may need to wake up another netmap port (or even the same one), which means that it may need to call knote(). Since knote() needs the lock of the struct knlist object associated to the to-be-wake-up netmap port, it is possible to have a lock order reversal problem (AB/BA deadlock). This change prevents the deadlock by executing the knote() call in a per-selinfo taskqueue, where it is possible to hold a mutex. Reviewed by: aleksandr.fedorov_itglobal.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18956 Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Jan 30 13:21:26 2019 (r343578) +++ head/sys/dev/netmap/netmap.c Wed Jan 30 15:51:55 2019 (r343579) @@ -830,6 +830,7 @@ netmap_krings_create(struct netmap_adapter *na, u_int struct netmap_kring *kring; u_int n[NR_TXRX]; enum txrx t; + int err = 0; if (na->tx_rings != NULL) { if (netmap_debug & NM_DEBUG_ON) @@ -869,7 +870,6 @@ netmap_krings_create(struct netmap_adapter *na, u_int for (i = 0; i < n[t]; i++) { kring = NMR(na, t)[i]; bzero(kring, sizeof(*kring)); - kring->na = na; kring->notify_na = na; kring->ring_id = i; kring->tx = t; @@ -895,13 +895,21 @@ netmap_krings_create(struct netmap_adapter *na, u_int nm_txrx2str(t), i); ND("ktx %s h %d c %d t %d", kring->name, kring->rhead, kring->rcur, kring->rtail); + err = nm_os_selinfo_init(&kring->si, kring->name); + if (err) { + netmap_krings_delete(na); + return err; + } mtx_init(&kring->q_lock, (t == NR_TX ? "nm_txq_lock" : "nm_rxq_lock"), NULL, MTX_DEF); - nm_os_selinfo_init(&kring->si); + kring->na = na; /* setting this field marks the mutex as initialized */ } - nm_os_selinfo_init(&na->si[t]); + err = nm_os_selinfo_init(&na->si[t], na->name); + if (err) { + netmap_krings_delete(na); + return err; + } } - return 0; } @@ -925,7 +933,8 @@ netmap_krings_delete(struct netmap_adapter *na) /* we rely on the krings layout described above */ for ( ; kring != na->tailroom; kring++) { - mtx_destroy(&(*kring)->q_lock); + if ((*kring)->na != NULL) + mtx_destroy(&(*kring)->q_lock); nm_os_selinfo_uninit(&(*kring)->si); } nm_os_free(na->tx_rings); Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Wed Jan 30 13:21:26 2019 (r343578) +++ head/sys/dev/netmap/netmap_freebsd.c Wed Jan 30 15:51:55 2019 (r343579) @@ -58,6 +58,7 @@ #include /* RFNOWAIT */ #include /* sched_bind() */ #include /* mp_maxid */ +#include /* taskqueue_enqueue(), taskqueue_create(), ... */ #include #include #include /* IFT_ETHER */ @@ -75,16 +76,48 @@ /* ======================== FREEBSD-SPECIFIC ROUTINES ================== */ -void nm_os_selinfo_init(NM_SELINFO_T *si) { - struct mtx *m = &si->m; - mtx_init(m, "nm_kn_lock", NULL, MTX_DEF); - knlist_init_mtx(&si->si.si_note, m); +static void +nm_kqueue_notify(void *opaque, int pending) +{ + struct nm_selinfo *si = opaque; + + /* We use a non-zero hint to distinguish this notification call + * from the call done in kqueue_scan(), which uses hint=0. + */ + KNOTE_UNLOCKED(&si->si.si_note, /*hint=*/0x100); } +int nm_os_selinfo_init(NM_SELINFO_T *si, const char *name) { + int err; + + TASK_INIT(&si->ntfytask, 0, nm_kqueue_notify, si); + si->ntfytq = taskqueue_create(name, M_NOWAIT, + taskqueue_thread_enqueue, &si->ntfytq); + if (si->ntfytq == NULL) + return -ENOMEM; + err = taskqueue_start_threads(&si->ntfytq, 1, PI_NET, "tq %s", name); + if (err) { + taskqueue_free(si->ntfytq); + si->ntfytq = NULL; + return err; + } + + snprintf(si->mtxname, sizeof(si->mtxname), "nmkl%s", name); + mtx_init(&si->m, si->mtxname, NULL, MTX_DEF); + knlist_init_mtx(&si->si.si_note, &si->m); + + return (0); +} + void nm_os_selinfo_uninit(NM_SELINFO_T *si) { - /* XXX kqueue(9) needed; these will mirror knlist_init. */ + if (si->ntfytq == NULL) { + return; /* si was not initialized */ + } + taskqueue_drain(si->ntfytq, &si->ntfytask); + taskqueue_free(si->ntfytq); + si->ntfytq = NULL; knlist_delete(&si->si.si_note, curthread, /*islocked=*/0); knlist_destroy(&si->si.si_note); /* now we don't need the mutex anymore */ @@ -1292,13 +1325,18 @@ nm_os_kctx_destroy(struct nm_kctx *nmk) /* * In addition to calling selwakeuppri(), nm_os_selwakeup() also - * needs to call KNOTE to wake up kqueue listeners. - * We use a non-zero 'hint' argument to inform the netmap_knrw() - * function that it is being called from 'nm_os_selwakeup'; this - * is necessary because when netmap_knrw() is called by the kevent - * subsystem (i.e. kevent_scan()) we also need to call netmap_poll(). - * The knote uses a private mutex associated to the 'si' (see struct - * selinfo, struct nm_selinfo, and nm_os_selinfo_init). + * needs to call knote() to wake up kqueue listeners. + * This operation is deferred to a taskqueue in order to avoid possible + * lock order reversals; these may happen because knote() grabs a + * private lock associated to the 'si' (see struct selinfo, + * struct nm_selinfo, and nm_os_selinfo_init), and nm_os_selwakeup() + * can be called while holding the lock associated to a different + * 'si'. + * When calling knote() we use a non-zero 'hint' argument to inform + * the netmap_knrw() function that it is being called from + * 'nm_os_selwakeup'; this is necessary because when netmap_knrw() is + * called by the kevent subsystem (i.e. kevent_scan()) we also need to + * call netmap_poll(). * * The netmap_kqfilter() function registers one or another f_event * depending on read or write mode. A pointer to the struct @@ -1315,11 +1353,7 @@ nm_os_selwakeup(struct nm_selinfo *si) if (netmap_verbose) nm_prinf("on knote %p", &si->si.si_note); selwakeuppri(&si->si, PI_NET); - /* We use a non-zero hint to distinguish this notification call - * from the call done in kqueue_scan(), which uses hint=0. - */ - KNOTE(&si->si.si_note, /*hint=*/0x100, - mtx_owned(&si->m) ? KNF_LISTLOCKED : 0); + taskqueue_enqueue(si->ntfytq, &si->ntfytask); } void Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Wed Jan 30 13:21:26 2019 (r343578) +++ head/sys/dev/netmap/netmap_kern.h Wed Jan 30 15:51:55 2019 (r343579) @@ -133,7 +133,10 @@ struct netmap_adapter *netmap_getna(if_t ifp); struct nm_selinfo { struct selinfo si; + struct taskqueue *ntfytq; + struct task ntfytask; struct mtx m; + char mtxname[32]; }; @@ -295,7 +298,7 @@ struct netmap_priv_d; struct nm_bdg_args; /* os-specific NM_SELINFO_T initialzation/destruction functions */ -void nm_os_selinfo_init(NM_SELINFO_T *); +int nm_os_selinfo_init(NM_SELINFO_T *, const char *name); void nm_os_selinfo_uninit(NM_SELINFO_T *); const char *nm_dump_buf(char *p, int len, int lim, char *dst); From owner-svn-src-head@freebsd.org Wed Jan 30 16:28:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE3F14C5AE9; Wed, 30 Jan 2019 16:28:28 +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 5FB7D724AB; Wed, 30 Jan 2019 16:28:28 +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 3246721C00; Wed, 30 Jan 2019 16:28:28 +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 x0UGSS3F024774; Wed, 30 Jan 2019 16:28:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UGSR3x024771; Wed, 30 Jan 2019 16:28:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901301628.x0UGSR3x024771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Jan 2019 16:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343580 - in head: lib/libthr libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libthr libexec/rtld-elf X-SVN-Commit-Revision: 343580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FB7D724AB 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 16:28:29 -0000 Author: kib Date: Wed Jan 30 16:28:27 2019 New Revision: 343580 URL: https://svnweb.freebsd.org/changeset/base/343580 Log: Rename rtld-elf/malloc.c to rtld-elf/rtld_malloc.c. Then malloc.c file name is too generic to use it for libthr.a. Sponsored by: The FreeBSD Foundation MFC after: 13 days Added: head/libexec/rtld-elf/rtld_malloc.c - copied unchanged from r343579, head/libexec/rtld-elf/malloc.c Deleted: head/libexec/rtld-elf/malloc.c Modified: head/lib/libthr/Makefile head/libexec/rtld-elf/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Wed Jan 30 15:51:55 2019 (r343579) +++ head/lib/libthr/Makefile Wed Jan 30 16:28:27 2019 (r343580) @@ -27,7 +27,7 @@ CFLAGS+=-I${SRCTOP}/lib/libthread_db CFLAGS+=-Winline CFLAGS.thr_stack.c+= -Wno-cast-align -CFLAGS.malloc.c+= -Wno-cast-align +CFLAGS.rtld_malloc.c+= -Wno-cast-align .include .if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300) CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations @@ -58,7 +58,7 @@ PRECIOUSLIB= .endif .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" -SRCS+= malloc.c +SRCS+= rtld_malloc.c .if ${MK_INSTALLLIB} != "no" SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Wed Jan 30 15:51:55 2019 (r343579) +++ head/libexec/rtld-elf/Makefile Wed Jan 30 16:28:27 2019 (r343580) @@ -14,9 +14,17 @@ PROG?= ld-elf.so.1 .if (${PROG:M*ld-elf32*} != "") TAGS+= lib32 .endif -SRCS= rtld_start.S \ - reloc.c rtld.c rtld_lock.c rtld_printf.c map_object.c \ - malloc.c xmalloc.c debug.c libmap.c +SRCS= \ + rtld_start.S \ + reloc.c \ + rtld.c \ + rtld_lock.c \ + rtld_malloc.c \ + rtld_printf.c \ + map_object.c \ + xmalloc.c \ + debug.c \ + libmap.c MAN= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding Copied: head/libexec/rtld-elf/rtld_malloc.c (from r343579, head/libexec/rtld-elf/malloc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/rtld_malloc.c Wed Jan 30 16:28:27 2019 (r343580, copy of r343579, head/libexec/rtld-elf/malloc.c) @@ -0,0 +1,494 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +/*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/ +static char *rcsid = "$FreeBSD$"; +#endif /* LIBC_SCCS and not lint */ + +/* + * malloc.c (Caltech) 2/21/82 + * Chris Kingsley, kingsley@cit-20. + * + * This is a very fast storage allocator. It allocates blocks of a small + * number of different sizes, and keeps free lists of each size. Blocks that + * don't exactly fit are passed up to the next larger size. In this + * implementation, the available sizes are 2^n-4 (or 2^n-10) bytes long. + * This is designed for use in a virtual memory environment. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "rtld.h" +#include "rtld_printf.h" +#include "paths.h" + +/* + * Pre-allocate mmap'ed pages + */ +#define NPOOLPAGES (128*1024/pagesz) +static caddr_t pagepool_start, pagepool_end; + +/* + * The overhead on a block is at least 4 bytes. When free, this space + * contains a pointer to the next free block, and the bottom two bits must + * be zero. When in use, the first byte is set to MAGIC, and the second + * byte is the size index. The remaining bytes are for alignment. + * If range checking is enabled then a second word holds the size of the + * requested block, less 1, rounded up to a multiple of sizeof(RMAGIC). + * The order of elements is critical: ov_magic must overlay the low order + * bits of ov_next, and ov_magic can not be a valid ov_next bit pattern. + */ +union overhead { + union overhead *ov_next; /* when free */ + struct { + u_char ovu_magic; /* magic number */ + u_char ovu_index; /* bucket # */ +#ifdef RCHECK + u_short ovu_rmagic; /* range magic number */ + u_int ovu_size; /* actual block size */ +#endif + } ovu; +#define ov_magic ovu.ovu_magic +#define ov_index ovu.ovu_index +#define ov_rmagic ovu.ovu_rmagic +#define ov_size ovu.ovu_size +}; + +static void morecore(int bucket); +static int morepages(int n); +static int findbucket(union overhead *freep, int srchlen); + + +#define MAGIC 0xef /* magic # on accounting info */ +#define RMAGIC 0x5555 /* magic # on range info */ + +#ifdef RCHECK +#define RSLOP sizeof (u_short) +#else +#define RSLOP 0 +#endif + +/* + * nextf[i] is the pointer to the next free block of size 2^(i+3). The + * smallest allocatable block is 8 bytes. The overhead information + * precedes the data area returned to the user. + */ +#define NBUCKETS 30 +static union overhead *nextf[NBUCKETS]; + +static int pagesz; /* page size */ +static int pagebucket; /* page size bucket */ + +#ifdef MSTATS +/* + * nmalloc[i] is the difference between the number of mallocs and frees + * for a given block size. + */ +static u_int nmalloc[NBUCKETS]; +#include +#endif + +#if defined(MALLOC_DEBUG) || defined(RCHECK) +#define ASSERT(p) if (!(p)) botch("p") +#include +static void +botch(s) + char *s; +{ + fprintf(stderr, "\r\nassertion botched: %s\r\n", s); + (void) fflush(stderr); /* just in case user buffered it */ + abort(); +} +#else +#define ASSERT(p) +#endif + +/* Debugging stuff */ +#define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) + +/* + * The array of supported page sizes is provided by the user, i.e., the + * program that calls this storage allocator. That program must initialize + * the array before making its first call to allocate storage. The array + * must contain at least one page size. The page sizes must be stored in + * increasing order. + */ + +void * +__crt_malloc(size_t nbytes) +{ + union overhead *op; + int bucket; + ssize_t n; + size_t amt; + + /* + * First time malloc is called, setup page size and + * align break pointer so all data will be page aligned. + */ + if (pagesz == 0) { + pagesz = n = pagesizes[0]; + if (morepages(NPOOLPAGES) == 0) + return NULL; + op = (union overhead *)(pagepool_start); + n = n - sizeof (*op) - ((long)op & (n - 1)); + if (n < 0) + n += pagesz; + if (n) { + pagepool_start += n; + } + bucket = 0; + amt = 8; + while ((unsigned)pagesz > amt) { + amt <<= 1; + bucket++; + } + pagebucket = bucket; + } + /* + * Convert amount of memory requested into closest block size + * stored in hash buckets which satisfies request. + * Account for space used per block for accounting. + */ + if (nbytes <= (unsigned long)(n = pagesz - sizeof (*op) - RSLOP)) { +#ifndef RCHECK + amt = 8; /* size of first bucket */ + bucket = 0; +#else + amt = 16; /* size of first bucket */ + bucket = 1; +#endif + n = -(sizeof (*op) + RSLOP); + } else { + amt = pagesz; + bucket = pagebucket; + } + while (nbytes > amt + n) { + amt <<= 1; + if (amt == 0) + return (NULL); + bucket++; + } + /* + * If nothing in hash bucket right now, + * request more memory from the system. + */ + if ((op = nextf[bucket]) == NULL) { + morecore(bucket); + if ((op = nextf[bucket]) == NULL) + return (NULL); + } + /* remove from linked list */ + nextf[bucket] = op->ov_next; + op->ov_magic = MAGIC; + op->ov_index = bucket; +#ifdef MSTATS + nmalloc[bucket]++; +#endif +#ifdef RCHECK + /* + * Record allocated size of block and + * bound space with magic numbers. + */ + op->ov_size = roundup2(nbytes, RSLOP); + op->ov_rmagic = RMAGIC; + *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; +#endif + return ((char *)(op + 1)); +} + +void * +__crt_calloc(size_t num, size_t size) +{ + void *ret; + + if (size != 0 && (num * size) / size != num) { + /* size_t overflow. */ + return (NULL); + } + + if ((ret = __crt_malloc(num * size)) != NULL) + memset(ret, 0, num * size); + + return (ret); +} + +/* + * Allocate more memory to the indicated bucket. + */ +static void +morecore(int bucket) +{ + union overhead *op; + int sz; /* size of desired block */ + int amt; /* amount to allocate */ + int nblks; /* how many blocks we get */ + + /* + * sbrk_size <= 0 only for big, FLUFFY, requests (about + * 2^30 bytes on a VAX, I think) or for a negative arg. + */ + sz = 1 << (bucket + 3); +#ifdef MALLOC_DEBUG + ASSERT(sz > 0); +#else + if (sz <= 0) + return; +#endif + if (sz < pagesz) { + amt = pagesz; + nblks = amt / sz; + } else { + amt = sz + pagesz; + nblks = 1; + } + if (amt > pagepool_end - pagepool_start) + if (morepages(amt/pagesz + NPOOLPAGES) == 0) + return; + op = (union overhead *)pagepool_start; + pagepool_start += amt; + + /* + * Add new memory allocated to that on + * free list for this hash bucket. + */ + nextf[bucket] = op; + while (--nblks > 0) { + op->ov_next = (union overhead *)((caddr_t)op + sz); + op = (union overhead *)((caddr_t)op + sz); + } +} + +void +__crt_free(void *cp) +{ + int size; + union overhead *op; + + if (cp == NULL) + return; + op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); +#ifdef MALLOC_DEBUG + ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ +#else + if (op->ov_magic != MAGIC) + return; /* sanity */ +#endif +#ifdef RCHECK + ASSERT(op->ov_rmagic == RMAGIC); + ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); +#endif + size = op->ov_index; + ASSERT(size < NBUCKETS); + op->ov_next = nextf[size]; /* also clobbers ov_magic */ + nextf[size] = op; +#ifdef MSTATS + nmalloc[size]--; +#endif +} + +/* + * When a program attempts "storage compaction" as mentioned in the + * old malloc man page, it realloc's an already freed block. Usually + * this is the last block it freed; occasionally it might be farther + * back. We have to search all the free lists for the block in order + * to determine its bucket: 1st we make one pass through the lists + * checking only the first block in each; if that fails we search + * ``realloc_srchlen'' blocks in each list for a match (the variable + * is extern so the caller can modify it). If that fails we just copy + * however many bytes was given to realloc() and hope it's not huge. + */ +static int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ + +void * +__crt_realloc(void *cp, size_t nbytes) +{ + u_int onb; + int i; + union overhead *op; + char *res; + int was_alloced = 0; + + if (cp == NULL) + return (__crt_malloc(nbytes)); + op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); + if (op->ov_magic == MAGIC) { + was_alloced++; + i = op->ov_index; + } else { + /* + * Already free, doing "compaction". + * + * Search for the old block of memory on the + * free list. First, check the most common + * case (last element free'd), then (this failing) + * the last ``realloc_srchlen'' items free'd. + * If all lookups fail, then assume the size of + * the memory block being realloc'd is the + * largest possible (so that all "nbytes" of new + * memory are copied into). Note that this could cause + * a memory fault if the old area was tiny, and the moon + * is gibbous. However, that is very unlikely. + */ + if ((i = findbucket(op, 1)) < 0 && + (i = findbucket(op, realloc_srchlen)) < 0) + i = NBUCKETS; + } + onb = 1 << (i + 3); + if (onb < (u_int)pagesz) + onb -= sizeof (*op) + RSLOP; + else + onb += pagesz - sizeof (*op) - RSLOP; + /* avoid the copy if same size block */ + if (was_alloced) { + if (i) { + i = 1 << (i + 2); + if (i < pagesz) + i -= sizeof (*op) + RSLOP; + else + i += pagesz - sizeof (*op) - RSLOP; + } + if (nbytes <= onb && nbytes > (size_t)i) { +#ifdef RCHECK + op->ov_size = roundup2(nbytes, RSLOP); + *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; +#endif + return(cp); + } else + __crt_free(cp); + } + if ((res = __crt_malloc(nbytes)) == NULL) + return (NULL); + if (cp != res) /* common optimization if "compacting" */ + bcopy(cp, res, (nbytes < onb) ? nbytes : onb); + return (res); +} + +/* + * Search ``srchlen'' elements of each free list for a block whose + * header starts at ``freep''. If srchlen is -1 search the whole list. + * Return bucket number, or -1 if not found. + */ +static int +findbucket(union overhead *freep, int srchlen) +{ + union overhead *p; + int i, j; + + for (i = 0; i < NBUCKETS; i++) { + j = 0; + for (p = nextf[i]; p && j != srchlen; p = p->ov_next) { + if (p == freep) + return (i); + j++; + } + } + return (-1); +} + +#ifdef MSTATS +/* + * mstats - print out statistics about malloc + * + * Prints two lines of numbers, one showing the length of the free list + * for each size category, the second showing the number of mallocs - + * frees for each size category. + */ +mstats(char * s) +{ + int i, j; + union overhead *p; + int totfree = 0, + totused = 0; + + fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s); + for (i = 0; i < NBUCKETS; i++) { + for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) + ; + fprintf(stderr, " %d", j); + totfree += j * (1 << (i + 3)); + } + fprintf(stderr, "\nused:\t"); + for (i = 0; i < NBUCKETS; i++) { + fprintf(stderr, " %d", nmalloc[i]); + totused += nmalloc[i] * (1 << (i + 3)); + } + fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n", + totused, totfree); +} +#endif + + +static int +morepages(int n) +{ + int fd = -1; + int offset; + + if (pagepool_end - pagepool_start > pagesz) { + caddr_t addr = (caddr_t) + (((long)pagepool_start + pagesz - 1) & ~(pagesz - 1)); + if (munmap(addr, pagepool_end - addr) != 0) { +#ifdef IN_RTLD + rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": " + "morepages: cannot munmap %p: %s\n", + addr, rtld_strerror(errno)); +#endif + } + } + + offset = (long)pagepool_start - ((long)pagepool_start & ~(pagesz - 1)); + + if ((pagepool_start = mmap(0, n * pagesz, + PROT_READ|PROT_WRITE, + MAP_ANON|MAP_PRIVATE, fd, 0)) == (caddr_t)-1) { +#ifdef IN_RTLD + rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": morepages: " + "cannot mmap anonymous memory: %s\n", + rtld_strerror(errno)); +#endif + return 0; + } + pagepool_end = pagepool_start + n * pagesz; + pagepool_start += offset; + + return n; +} From owner-svn-src-head@freebsd.org Wed Jan 30 16:29:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3721914C5B37; Wed, 30 Jan 2019 16:29:16 +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 CE7BD725DC; Wed, 30 Jan 2019 16:29:15 +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 BC86221C01; Wed, 30 Jan 2019 16:29:15 +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 x0UGTFKI024849; Wed, 30 Jan 2019 16:29:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UGTFYG024848; Wed, 30 Jan 2019 16:29:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901301629.x0UGTFYG024848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Jan 2019 16:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343581 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 343581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE7BD725DC 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 16:29:16 -0000 Author: kib Date: Wed Jan 30 16:29:15 2019 New Revision: 343581 URL: https://svnweb.freebsd.org/changeset/base/343581 Log: Remove duplicate declarations. Submitted by: bde MFC after: 2 months Modified: head/sys/i386/i386/minidump_machdep_base.c Modified: head/sys/i386/i386/minidump_machdep_base.c ============================================================================== --- head/sys/i386/i386/minidump_machdep_base.c Wed Jan 30 16:28:27 2019 (r343580) +++ head/sys/i386/i386/minidump_machdep_base.c Wed Jan 30 16:29:15 2019 (r343581) @@ -52,9 +52,6 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512); #define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) #define DEV_ALIGN(x) roundup2((off_t)(x), DEV_BSIZE) -extern uint32_t *vm_page_dump; -extern int vm_page_dump_size; - static struct kerneldumpheader kdh; /* Handle chunked writes. */ @@ -63,7 +60,6 @@ static void *dump_va; static uint64_t counter, progress; CTASSERT(sizeof(*vm_page_dump) == 4); - static int is_dumpable(vm_paddr_t pa) From owner-svn-src-head@freebsd.org Wed Jan 30 16:50:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEB014C62AD; Wed, 30 Jan 2019 16:50:54 +0000 (UTC) (envelope-from mav@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 E98E0733B0; Wed, 30 Jan 2019 16:50:53 +0000 (UTC) (envelope-from mav@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 D976C21F8D; Wed, 30 Jan 2019 16:50:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UGorhU038066; Wed, 30 Jan 2019 16:50:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UGorDo038065; Wed, 30 Jan 2019 16:50:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901301650.x0UGorDo038065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Jan 2019 16:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343582 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 343582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E98E0733B0 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.95)[-0.952,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 16:50:54 -0000 Author: mav Date: Wed Jan 30 16:50:53 2019 New Revision: 343582 URL: https://svnweb.freebsd.org/changeset/base/343582 Log: Relax BIO_FLUSH ordering in da(4), respecting BIO_ORDERED. r212160 tightened this from always using MSG_SIMPLE_Q_TAG to always MSG_ORDERED_Q_TAG. Since it also marked all BIO_FLUSH requests with BIO_ORDERED, this commit changes nothing immediately, but it returns BIO_FLUSH callers ability to actually specify ordering they really need, alike to other request types. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Jan 30 16:29:15 2019 (r343581) +++ head/sys/cam/scsi/scsi_da.c Wed Jan 30 16:50:53 2019 (r343582) @@ -3321,7 +3321,7 @@ more: scsi_synchronize_cache(&start_ccb->csio, /*retries*/1, /*cbfcnp*/dadone, - MSG_ORDERED_Q_TAG, + /*tag_action*/tag_code, /*begin_lba*/0, /*lb_count*/0, SSD_FULL_SIZE, From owner-svn-src-head@freebsd.org Wed Jan 30 16:55:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29E3D14C6566; Wed, 30 Jan 2019 16:55:03 +0000 (UTC) (envelope-from rpokala@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 C4056737E7; Wed, 30 Jan 2019 16:55:02 +0000 (UTC) (envelope-from rpokala@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 B23D522116; Wed, 30 Jan 2019 16:55:02 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UGt2Eh040663; Wed, 30 Jan 2019 16:55:02 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UGt1kf040656; Wed, 30 Jan 2019 16:55:01 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201901301655.x0UGt1kf040656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 30 Jan 2019 16:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343583 - in head: share/man/man4 sys/dev/imcsmb sys/dev/jedec_dimm X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/imcsmb sys/dev/jedec_dimm X-SVN-Commit-Revision: 343583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4056737E7 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 16:55:03 -0000 Author: rpokala Date: Wed Jan 30 16:55:00 2019 New Revision: 343583 URL: https://svnweb.freebsd.org/changeset/base/343583 Log: Remove unecessary "All rights reserved" from files under my or Panasas's copyright. When all member nations of the Buenos Aires Convention adopted the Berne Convention, the phrase "All rights reserved" became unnecessary to assert copyright. Remove it from files under my or Panasas's copyright. The files related to jedec_dimm(4) also bear avg@'s copyright; he has approved this change. Approved by: avg Sponsored by: Panasas Modified: head/share/man/man4/imcsmb.4 head/share/man/man4/jedec_dimm.4 head/sys/dev/imcsmb/imcsmb.c head/sys/dev/imcsmb/imcsmb_pci.c head/sys/dev/imcsmb/imcsmb_reg.h head/sys/dev/imcsmb/imcsmb_var.h head/sys/dev/jedec_dimm/jedec_dimm.c head/sys/dev/jedec_dimm/jedec_dimm.h Modified: head/share/man/man4/imcsmb.4 ============================================================================== --- head/share/man/man4/imcsmb.4 Wed Jan 30 16:50:53 2019 (r343582) +++ head/share/man/man4/imcsmb.4 Wed Jan 30 16:55:00 2019 (r343583) @@ -2,7 +2,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD .\" .\" Copyright (c) 2018 Panasas -.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: head/share/man/man4/jedec_dimm.4 ============================================================================== --- head/share/man/man4/jedec_dimm.4 Wed Jan 30 16:50:53 2019 (r343582) +++ head/share/man/man4/jedec_dimm.4 Wed Jan 30 16:55:00 2019 (r343583) @@ -3,7 +3,6 @@ .\" .\" Copyright (c) 2016 Andriy Gapon .\" Copyright (c) 2018 Ravi Pokala -.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: head/sys/dev/imcsmb/imcsmb.c ============================================================================== --- head/sys/dev/imcsmb/imcsmb.c Wed Jan 30 16:50:53 2019 (r343582) +++ head/sys/dev/imcsmb/imcsmb.c Wed Jan 30 16:55:00 2019 (r343583) @@ -4,7 +4,6 @@ * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) * * Copyright (c) 2017-2018 Panasas - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/imcsmb/imcsmb_pci.c ============================================================================== --- head/sys/dev/imcsmb/imcsmb_pci.c Wed Jan 30 16:50:53 2019 (r343582) +++ head/sys/dev/imcsmb/imcsmb_pci.c Wed Jan 30 16:55:00 2019 (r343583) @@ -4,7 +4,6 @@ * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) * * Copyright (c) 2017-2018 Panasas - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/imcsmb/imcsmb_reg.h ============================================================================== --- head/sys/dev/imcsmb/imcsmb_reg.h Wed Jan 30 16:50:53 2019 (r343582) +++ head/sys/dev/imcsmb/imcsmb_reg.h Wed Jan 30 16:55:00 2019 (r343583) @@ -4,7 +4,6 @@ * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) * * Copyright (c) 2017-2018 Panasas - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/imcsmb/imcsmb_var.h ============================================================================== --- head/sys/dev/imcsmb/imcsmb_var.h Wed Jan 30 16:50:53 2019 (r343582) +++ head/sys/dev/imcsmb/imcsmb_var.h Wed Jan 30 16:55:00 2019 (r343583) @@ -4,7 +4,6 @@ * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) * * Copyright (c) 2017-2018 Panasas - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/jedec_dimm/jedec_dimm.c ============================================================================== --- head/sys/dev/jedec_dimm/jedec_dimm.c Wed Jan 30 16:50:53 2019 (r343582) +++ head/sys/dev/jedec_dimm/jedec_dimm.c Wed Jan 30 16:55:00 2019 (r343583) @@ -5,7 +5,6 @@ * * Copyright (c) 2016 Andriy Gapon * Copyright (c) 2018 Panasas - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/jedec_dimm/jedec_dimm.h ============================================================================== --- head/sys/dev/jedec_dimm/jedec_dimm.h Wed Jan 30 16:50:53 2019 (r343582) +++ head/sys/dev/jedec_dimm/jedec_dimm.h Wed Jan 30 16:55:00 2019 (r343583) @@ -4,7 +4,6 @@ * Authors: Ravi Pokala (rpokala@freebsd.org) * * Copyright (c) 2018 Panasas - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Wed Jan 30 17:10:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445E914C6B58; Wed, 30 Jan 2019 17:10:55 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAC6174386; Wed, 30 Jan 2019 17:10:54 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.15] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 60A141A7F7; Wed, 30 Jan 2019 17:10:54 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.15.0.190115 Date: Wed, 30 Jan 2019 09:10:51 -0800 Subject: Re: svn commit: r343583 - in head: share/man/man4 sys/dev/imcsmb sys/dev/jedec_dimm From: Ravi Pokala To: , , Message-ID: <94714CC3-644C-45B0-99ED-DCA99F6D13F7@panasas.com> Thread-Topic: svn commit: r343583 - in head: share/man/man4 sys/dev/imcsmb sys/dev/jedec_dimm References: <201901301655.x0UGt1kf040656@repo.freebsd.org> In-Reply-To: <201901301655.x0UGt1kf040656@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-Rspamd-Queue-Id: DAC6174386 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 17:10:55 -0000 -----Original Message----- From: on behalf of Ravi Pokala Date: 2019-01-30, Wednesday at 08:55 To: , , Subject: svn commit: r343583 - in head: share/man/man4 sys/dev/imcsmb sys/dev/jedec_dimm > Author: rpokala > Date: Wed Jan 30 16:55:00 2019 > New Revision: 343583 > URL: https://svnweb.freebsd.org/changeset/base/343583 > > Log: > Remove unecessary "All rights reserved" from files under my or Panasas's > copyright. > > When all member nations of the Buenos Aires Convention adopted the Berne > Convention, the phrase "All rights reserved" became unnecessary to assert > copyright. Remove it from files under my or Panasas's copyright. The files > related to jedec_dimm(4) also bear avg@'s copyright; he has approved this > change. > > Approved by: avg > Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D19029 -Ravi (rpokala@) > Modified: > head/share/man/man4/imcsmb.4 > head/share/man/man4/jedec_dimm.4 > head/sys/dev/imcsmb/imcsmb.c > head/sys/dev/imcsmb/imcsmb_pci.c > head/sys/dev/imcsmb/imcsmb_reg.h > head/sys/dev/imcsmb/imcsmb_var.h > head/sys/dev/jedec_dimm/jedec_dimm.c > head/sys/dev/jedec_dimm/jedec_dimm.h > > Modified: head/share/man/man4/imcsmb.4 > ============================================================================== > --- head/share/man/man4/imcsmb.4 Wed Jan 30 16:50:53 2019 (r343582) > +++ head/share/man/man4/imcsmb.4 Wed Jan 30 16:55:00 2019 (r343583) > @@ -2,7 +2,6 @@ > .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD > .\" > .\" Copyright (c) 2018 Panasas > -.\" All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > > Modified: head/share/man/man4/jedec_dimm.4 > ============================================================================== > --- head/share/man/man4/jedec_dimm.4 Wed Jan 30 16:50:53 2019 (r343582) > +++ head/share/man/man4/jedec_dimm.4 Wed Jan 30 16:55:00 2019 (r343583) > @@ -3,7 +3,6 @@ > .\" > .\" Copyright (c) 2016 Andriy Gapon > .\" Copyright (c) 2018 Ravi Pokala > -.\" All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > > Modified: head/sys/dev/imcsmb/imcsmb.c > ============================================================================== > --- head/sys/dev/imcsmb/imcsmb.c Wed Jan 30 16:50:53 2019 (r343582) > +++ head/sys/dev/imcsmb/imcsmb.c Wed Jan 30 16:55:00 2019 (r343583) > @@ -4,7 +4,6 @@ > * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) > * > * Copyright (c) 2017-2018 Panasas > - * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/sys/dev/imcsmb/imcsmb_pci.c > ============================================================================== > --- head/sys/dev/imcsmb/imcsmb_pci.c Wed Jan 30 16:50:53 2019 (r343582) > +++ head/sys/dev/imcsmb/imcsmb_pci.c Wed Jan 30 16:55:00 2019 (r343583) > @@ -4,7 +4,6 @@ > * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) > * > * Copyright (c) 2017-2018 Panasas > - * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/sys/dev/imcsmb/imcsmb_reg.h > ============================================================================== > --- head/sys/dev/imcsmb/imcsmb_reg.h Wed Jan 30 16:50:53 2019 (r343582) > +++ head/sys/dev/imcsmb/imcsmb_reg.h Wed Jan 30 16:55:00 2019 (r343583) > @@ -4,7 +4,6 @@ > * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) > * > * Copyright (c) 2017-2018 Panasas > - * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/sys/dev/imcsmb/imcsmb_var.h > ============================================================================== > --- head/sys/dev/imcsmb/imcsmb_var.h Wed Jan 30 16:50:53 2019 (r343582) > +++ head/sys/dev/imcsmb/imcsmb_var.h Wed Jan 30 16:55:00 2019 (r343583) > @@ -4,7 +4,6 @@ > * Authors: Joe Kloss; Ravi Pokala (rpokala@freebsd.org) > * > * Copyright (c) 2017-2018 Panasas > - * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/sys/dev/jedec_dimm/jedec_dimm.c > ============================================================================== > --- head/sys/dev/jedec_dimm/jedec_dimm.c Wed Jan 30 16:50:53 2019 (r343582) > +++ head/sys/dev/jedec_dimm/jedec_dimm.c Wed Jan 30 16:55:00 2019 (r343583) > @@ -5,7 +5,6 @@ > * > * Copyright (c) 2016 Andriy Gapon > * Copyright (c) 2018 Panasas > - * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/sys/dev/jedec_dimm/jedec_dimm.h > ============================================================================== > --- head/sys/dev/jedec_dimm/jedec_dimm.h Wed Jan 30 16:50:53 2019 (r343582) > +++ head/sys/dev/jedec_dimm/jedec_dimm.h Wed Jan 30 16:55:00 2019 (r343583) > @@ -4,7 +4,6 @@ > * Authors: Ravi Pokala (rpokala@freebsd.org) > * > * Copyright (c) 2018 Panasas > - * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Wed Jan 30 17:11:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 197E614C6B78; Wed, 30 Jan 2019 17:11:12 +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 9B592744AC; Wed, 30 Jan 2019 17:11:10 +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 71266222E8; Wed, 30 Jan 2019 17:11:08 +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 x0UHB8ff046352; Wed, 30 Jan 2019 17:11:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UHB8Fl046351; Wed, 30 Jan 2019 17:11:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901301711.x0UHB8Fl046351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 30 Jan 2019 17:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343584 - head/sys/dev/sound/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/usb X-SVN-Commit-Revision: 343584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B592744AC 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 17:11:12 -0000 Author: hselasky Date: Wed Jan 30 17:11:08 2019 New Revision: 343584 URL: https://svnweb.freebsd.org/changeset/base/343584 Log: Export vendor specific USB MIDI device list to PnP info. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Jan 30 16:55:00 2019 (r343583) +++ head/sys/dev/sound/usb/uaudio.c Wed Jan 30 17:11:08 2019 (r343584) @@ -6285,3 +6285,4 @@ MODULE_DEPEND(uaudio, usb, 1, 1, 1); MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(uaudio, 1); USB_PNP_HOST_INFO(uaudio_devs); +USB_PNP_HOST_INFO(uaudio_vendor_midi); From owner-svn-src-head@freebsd.org Wed Jan 30 17:24:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAF3414C71D7; Wed, 30 Jan 2019 17:24:51 +0000 (UTC) (envelope-from mav@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 5D5727524C; Wed, 30 Jan 2019 17:24:51 +0000 (UTC) (envelope-from mav@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 4F6E72264F; Wed, 30 Jan 2019 17:24:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UHOpCv057278; Wed, 30 Jan 2019 17:24:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UHOp9h057277; Wed, 30 Jan 2019 17:24:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901301724.x0UHOp9h057277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Jan 2019 17:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343585 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D5727524C 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 17:24:51 -0000 Author: mav Date: Wed Jan 30 17:24:50 2019 New Revision: 343585 URL: https://svnweb.freebsd.org/changeset/base/343585 Log: Only sort requests of types that have concept of offset. Other types, such as BIO_FLUSH or BIO_ZONE, or especially new/unknown ones, may imply some degree of ordering even if strict ordering is not requested explicitly. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/kern/subr_disk.c Modified: head/sys/kern/subr_disk.c ============================================================================== --- head/sys/kern/subr_disk.c Wed Jan 30 17:11:08 2019 (r343584) +++ head/sys/kern/subr_disk.c Wed Jan 30 17:24:50 2019 (r343585) @@ -259,6 +259,17 @@ bioq_disksort(struct bio_queue_head *head, struct bio return; } + /* + * We should only sort requests of types that have concept of offset. + * Other types, such as BIO_FLUSH or BIO_ZONE, may imply some degree + * of ordering even if strict ordering is not requested explicitly. + */ + if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE && + bp->bio_cmd != BIO_DELETE) { + bioq_insert_tail(head, bp); + return; + } + if (bioq_batchsize > 0 && head->batched > bioq_batchsize) { bioq_insert_tail(head, bp); return; From owner-svn-src-head@freebsd.org Wed Jan 30 17:39:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D160614C7834; Wed, 30 Jan 2019 17:39:45 +0000 (UTC) (envelope-from mav@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 76C8075B02; Wed, 30 Jan 2019 17:39:45 +0000 (UTC) (envelope-from mav@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 68FDE227FA; Wed, 30 Jan 2019 17:39:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UHdjCU062421; Wed, 30 Jan 2019 17:39:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UHdjfC062420; Wed, 30 Jan 2019 17:39:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901301739.x0UHdjfC062420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Jan 2019 17:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343586 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 343586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76C8075B02 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 17:39:46 -0000 Author: mav Date: Wed Jan 30 17:39:44 2019 New Revision: 343586 URL: https://svnweb.freebsd.org/changeset/base/343586 Log: Remove BIO_ORDERED flag from BIO_FLUSH sent by ZFS. In all cases where ZFS sends BIO_FLUSH, it first waits for all related writes to complete, so its BIO_FLUSH does not care about strict ordering. Removal of one makes life much easier at least for NVMe driver, which hardware has no concept of request ordering, relying completely on software. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Jan 30 17:24:50 2019 (r343585) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Jan 30 17:39:44 2019 (r343586) @@ -1097,7 +1097,6 @@ sendreq: break; case ZIO_TYPE_IOCTL: bp->bio_cmd = BIO_FLUSH; - bp->bio_flags |= BIO_ORDERED; bp->bio_data = NULL; bp->bio_offset = cp->provider->mediasize; bp->bio_length = 0; From owner-svn-src-head@freebsd.org Wed Jan 30 17:44:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B0214C7A8F; Wed, 30 Jan 2019 17:44:31 +0000 (UTC) (envelope-from brooks@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 DD74A75FCC; Wed, 30 Jan 2019 17:44:30 +0000 (UTC) (envelope-from brooks@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 B48F4229BA; Wed, 30 Jan 2019 17:44:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UHiU8d067643; Wed, 30 Jan 2019 17:44:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UHiU4F067642; Wed, 30 Jan 2019 17:44:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901301744.x0UHiU4F067642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Jan 2019 17:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343587 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD74A75FCC 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 17:44:31 -0000 Author: brooks Date: Wed Jan 30 17:44:30 2019 New Revision: 343587 URL: https://svnweb.freebsd.org/changeset/base/343587 Log: Add a simple port filter to SIFTR. SIFTR does not allow any kind of filtering, but captures every packet processed by the TCP stack. Often, only a specific session or service is of interest, and doing the filtering in post-processing of the log adds to the overhead of SIFTR. This adds a new sysctl net.inet.siftr.port_filter. When set to zero, all packets get captured as previously. If set to any other value, only packets where either the source or the destination ports match, are captured in the log file. Submitted by: Richard Scheffenegger Reviewed by: Cheng Cui Differential Revision: https://reviews.freebsd.org/D18897 Modified: head/sys/netinet/siftr.c Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Wed Jan 30 17:39:44 2019 (r343586) +++ head/sys/netinet/siftr.c Wed Jan 30 17:44:30 2019 (r343587) @@ -272,6 +272,7 @@ static volatile unsigned int siftr_exit_pkt_manager_th static unsigned int siftr_enabled = 0; static unsigned int siftr_pkts_per_log = 1; static unsigned int siftr_generate_hashes = 0; +static uint16_t siftr_port_filter = 0; /* static unsigned int siftr_binary_log = 0; */ static char siftr_logfile[PATH_MAX] = "/var/log/siftr.log"; static char siftr_logfile_shadow[PATH_MAX] = "/var/log/siftr.log"; @@ -317,6 +318,10 @@ SYSCTL_UINT(_net_inet_siftr, OID_AUTO, genhashes, CTLF &siftr_generate_hashes, 0, "enable packet hash generation"); +SYSCTL_U16(_net_inet_siftr, OID_AUTO, port_filter, CTLFLAG_RW, + &siftr_port_filter, 0, + "enable packet filter on a TCP port"); + /* XXX: TODO SYSCTL_UINT(_net_inet_siftr, OID_AUTO, binary, CTLFLAG_RW, &siftr_binary_log, 0, @@ -907,6 +912,16 @@ siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet goto inp_unlock; } + /* + * Only pkts selected by the tcp port filter + * can be inserted into the pkt_queue + */ + if ((siftr_port_filter != 0) && + (siftr_port_filter != ntohs(inp->inp_lport)) && + (siftr_port_filter != ntohs(inp->inp_fport))) { + goto inp_unlock; + } + pn = malloc(sizeof(struct pkt_node), M_SIFTR_PKTNODE, M_NOWAIT|M_ZERO); if (pn == NULL) { @@ -1080,6 +1095,16 @@ siftr_chkpkt6(void *arg, struct mbuf **m, struct ifnet else ss->nskip_out_tcpcb++; + goto inp_unlock6; + } + + /* + * Only pkts selected by the tcp port filter + * can be inserted into the pkt_queue + */ + if ((siftr_port_filter != 0) && + (siftr_port_filter != ntohs(inp->inp_lport)) && + (siftr_port_filter != ntohs(inp->inp_fport))) { goto inp_unlock6; } From owner-svn-src-head@freebsd.org Wed Jan 30 18:44:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 223AA14C973A; Wed, 30 Jan 2019 18:44:46 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05861801A4; Wed, 30 Jan 2019 18:44:45 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-lf1-x12d.google.com with SMTP id c16so409472lfj.8; Wed, 30 Jan 2019 10:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kzd/f5PBm2up9bM2GwonX5WQkX5SUxI8CNWA7jJ/1ok=; b=nXOygSB1tyZ54nXBmHADYOVD7HqhO35+Hz/CAh2kpyQYti8yNclVxIM9vD7FPlZJwn Q5lu3kaeiJ3O1j/t3Ssvq7JzKhhLzKtw4KnNW51KSxOKdmP8pLjSIc39JavhyJVuJoHs NvzgcvGf94/gohA7l47w/W6N0g6GgO1DdVqOXATJZoSWxHk/raGca2gpmMMzm+cCMy8A oWItBECeycSMHhfPOII/YebMjiAL0fHFSjlL6YPM/i3TNaxUWBheRtr3G+DfIpAhLNIB Rn3ZIOf9EtQ/f83AfnF27487CB0JpXarxdZZurIVqOqAuxcxhXYBzshLrlXSky5EvoXp AcNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kzd/f5PBm2up9bM2GwonX5WQkX5SUxI8CNWA7jJ/1ok=; b=fDUwrh81AyfE1ufVj37O0cAG5HheqCCD+BN0El9gRG+7qFXyiFpM2Chx2AclZESkag cT/oxcz+dHX5fO+4CDzHA1jww2whN4+HT7WSTAqTi3nJj4PV4QQPBkdgE2c0Patp3GX8 0XeEtTEUrvXhxxNr/ng0gkDccdlRw0ySIFnlT8ASk+162tB1z5KnsvsCEiYKU9BxbIrc 83bs5k/ifIZJdeGFWuMr7N3wtVvVm3gZkfaIKPOstmr8wIrFKz0CiZO6AFYiVLFOgQD3 37ONHNIcVyZKe24ZHFtYG373yNZbJ/GWcyyQxWAzhfS7IVkbmzUlaEY71UsJo9rBOIfs PA5A== X-Gm-Message-State: AJcUukemK1EaQDwl1uc7JSuTHxGjj8oPbdkcbGrOgL842XIE6Vn9/MHj WOYUf7wyTBVEdyg+hjXJpov98hGKmbwzCCE5pQbrRw== X-Google-Smtp-Source: ALg8bN5NKiq+WxVlgrxLe+S05fPUDePOyZimmQ14r7KifTal7l/N95ExdLIWzBDMvPPoSGsA29rwO9iDXg92n0Kkj5Q= X-Received: by 2002:a19:c650:: with SMTP id w77mr25898410lff.56.1548873883105; Wed, 30 Jan 2019 10:44:43 -0800 (PST) MIME-Version: 1.0 References: <201901281245.x0SCjVpw048723@repo.freebsd.org> In-Reply-To: <201901281245.x0SCjVpw048723@repo.freebsd.org> From: Ryan Stone Date: Wed, 30 Jan 2019 13:44:32 -0500 Message-ID: Subject: Re: svn commit: r343525 - in head/sys/netinet: . tcp_stacks To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 05861801A4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=nXOygSB1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rysto32@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) smtp.mailfrom=rysto32@gmail.com X-Spamd-Result: default: False [-6.55 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[d.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; IP_SCORE(-2.66)[ip: (-8.98), ipnet: 2a00:1450::/32(-2.28), asn: 15169(-1.96), country: US(-0.07)]; NEURAL_HAM_SHORT(-0.88)[-0.882,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 18:44:46 -0000 On Mon, Jan 28, 2019 at 7:46 AM Michael Tuexen wrote: > > Author: tuexen > Date: Mon Jan 28 12:45:31 2019 > New Revision: 343525 > URL: https://svnweb.freebsd.org/changeset/base/343525 > > Log: > Fix the detection of ECN-setup SYN-ACK packets. > > RFC 3168 defines an ECN-setup SYN-ACK packet as on with the ECE flags > set and the CWR flags not set. The code was only checking if ECE flag > is set. This patch adds the check to verify that the CWR flags is not > set. Is this compatible with DCTCP? I seem to recall that it is possible for pure ACKs to be ECN marked in DCTCP. From owner-svn-src-head@freebsd.org Wed Jan 30 18:56:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF44A14C9A2F; Wed, 30 Jan 2019 18:56:46 +0000 (UTC) (envelope-from mav@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 52F57808B6; Wed, 30 Jan 2019 18:56:46 +0000 (UTC) (envelope-from mav@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 43CA82356F; Wed, 30 Jan 2019 18:56:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UIukbM004515; Wed, 30 Jan 2019 18:56:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UIukL5004514; Wed, 30 Jan 2019 18:56:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201901301856.x0UIukL5004514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Jan 2019 18:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343588 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 343588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52F57808B6 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.998,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.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 18:56:46 -0000 Author: mav Date: Wed Jan 30 18:56:45 2019 New Revision: 343588 URL: https://svnweb.freebsd.org/changeset/base/343588 Log: Remove stale now comment, forgotten in r343582. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Jan 30 17:44:30 2019 (r343587) +++ head/sys/cam/scsi/scsi_da.c Wed Jan 30 18:56:45 2019 (r343588) @@ -3314,9 +3314,7 @@ more: /* * BIO_FLUSH doesn't currently communicate * range data, so we synchronize the cache - * over the whole disk. We also force - * ordered tag semantics the flush applies - * to all previously queued I/O. + * over the whole disk. */ scsi_synchronize_cache(&start_ccb->csio, /*retries*/1, From owner-svn-src-head@freebsd.org Wed Jan 30 19:19:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7036114CA366; Wed, 30 Jan 2019 19:19:15 +0000 (UTC) (envelope-from emaste@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 15554816AE; Wed, 30 Jan 2019 19:19:15 +0000 (UTC) (envelope-from emaste@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 020D123923; Wed, 30 Jan 2019 19:19:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UJJEZS015436; Wed, 30 Jan 2019 19:19:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UJJETK015435; Wed, 30 Jan 2019 19:19:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901301919.x0UJJETK015435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Jan 2019 19:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343589 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15554816AE 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 19:19:15 -0000 Author: emaste Date: Wed Jan 30 19:19:14 2019 New Revision: 343589 URL: https://svnweb.freebsd.org/changeset/base/343589 Log: freebsd-update: regenerate man page database after update These are currently not reproducible because they're built by the makewhatis on the freebsd-update build host, not the one in the tree. Regenerate after update, and later we can avoid including it in freebsd-update data. PR: 214545, 217389 Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10482 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Jan 30 18:56:45 2019 (r343588) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Jan 30 19:19:14 2019 (r343589) @@ -2943,6 +2943,17 @@ Kernel updates have been installed. Please reboot and cap_mkdb ${BASEDIR}/etc/login.conf fi + # Rebuild man page databases, if necessary. + for D in /usr/share/man /usr/share/openssl/man; do + if [ ! -d ${BASEDIR}/$D ]; then + continue + fi + if [ -z "$(find ${BASEDIR}/$D -type f -newer ${BASEDIR}/$D/mandoc.db)" ]; then + continue; + fi + makewhatis ${BASEDIR}/$D + done + # We've finished installing the world and deleting old files # which are not shared libraries. touch $1/worlddone From owner-svn-src-head@freebsd.org Wed Jan 30 20:22:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9CDDE3E; Wed, 30 Jan 2019 20:22: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 4FA9784D22; Wed, 30 Jan 2019 20:22:34 +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 3A2C3245A9; Wed, 30 Jan 2019 20:22:34 +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 x0UKMYri053147; Wed, 30 Jan 2019 20:22:34 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UKMXHg053146; Wed, 30 Jan 2019 20:22:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901302022.x0UKMXHg053146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Jan 2019 20:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343590 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 343590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FA9784D22 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 20:22:34 -0000 Author: cy Date: Wed Jan 30 20:22:33 2019 New Revision: 343590 URL: https://svnweb.freebsd.org/changeset/base/343590 Log: When copying a NAT rule struct to userland for save by ipfs, use the length of the struct in memmove() rather than an unintialized variable. This fixes the first of two kernel page faults when ipfs is invoked. PR: 235110 Reported by: David.Boyd49@twc.com MFC after: 2 weeks Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Jan 30 19:19:14 2019 (r343589) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Jan 30 20:22:33 2019 (r343590) @@ -1866,7 +1866,7 @@ ipf_nat_getent(softc, data, getlock) */ if (nat->nat_ptr != NULL) bcopy((char *)nat->nat_ptr, (char *)&ipn->ipn_ipnat, - ipn->ipn_ipnat.in_size); + sizeof(nat->nat_ptr)); /* * If we also know the NAT entry has an associated filter rule, From owner-svn-src-head@freebsd.org Wed Jan 30 20:23:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3380AE41; Wed, 30 Jan 2019 20:23:17 +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 CB0EE84E5F; Wed, 30 Jan 2019 20:23:16 +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 B3F08245CD; Wed, 30 Jan 2019 20:23:16 +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 x0UKNGok053230; Wed, 30 Jan 2019 20:23:16 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UKNGQB053229; Wed, 30 Jan 2019 20:23:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901302023.x0UKNGQB053229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Jan 2019 20:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343591 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 343591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB0EE84E5F 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.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 20:23:17 -0000 Author: cy Date: Wed Jan 30 20:23:16 2019 New Revision: 343591 URL: https://svnweb.freebsd.org/changeset/base/343591 Log: Do not obtain an already held read lock. This causes a witness panic when ipfs is invoked. This is the second of two panics resolving PR 235110. PR: 235110 Reported by: David.Boyd49@twc.com MFC after: 2 weeks Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Jan 30 20:22:33 2019 (r343590) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Jan 30 20:23:16 2019 (r343591) @@ -1904,20 +1904,16 @@ ipf_nat_getent(softc, data, getlock) } } if (error == 0) { - if (getlock) { - READ_ENTER(&softc->ipf_nat); - getlock = 0; - } error = ipf_outobjsz(softc, data, ipn, IPFOBJ_NATSAVE, ipns.ipn_dsize); } finished: - if (getlock) { - READ_ENTER(&softc->ipf_nat); - } if (ipn != NULL) { KFREES(ipn, ipns.ipn_dsize); + } + if (getlock) { + RWLOCK_EXIT(&softc->ipf_nat); } return error; } From owner-svn-src-head@freebsd.org Wed Jan 30 20:44:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49FFE131987E; Wed, 30 Jan 2019 20:44:52 +0000 (UTC) (envelope-from emaste@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 DCFA085AD4; Wed, 30 Jan 2019 20:44:51 +0000 (UTC) (envelope-from emaste@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 CEC6024977; Wed, 30 Jan 2019 20:44:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UKipaa064622; Wed, 30 Jan 2019 20:44:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UKip73064621; Wed, 30 Jan 2019 20:44:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901302044.x0UKip73064621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Jan 2019 20:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343592 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 343592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DCFA085AD4 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 20:44:52 -0000 Author: emaste Date: Wed Jan 30 20:44:51 2019 New Revision: 343592 URL: https://svnweb.freebsd.org/changeset/base/343592 Log: readelf: decode flag bits in DT_FLAGS/DT_FLAGS_1 Decode d_val when the tag is DT_FLAGS or DT_FLAGS_1 based on the information at: https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-42444.html PR: 232983 Submitted by: Bora Ozarslan borako.ozarslan@gmail.com Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18784 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Jan 30 20:23:16 2019 (r343591) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Jan 30 20:44:51 2019 (r343592) @@ -293,6 +293,8 @@ static void dump_dwarf_ranges_foreach(struct readelf * static void dump_dwarf_str(struct readelf *re); static void dump_eflags(struct readelf *re, uint64_t e_flags); static void dump_elf(struct readelf *re); +static void dump_dt_flags_val(uint64_t d_val); +static void dump_dt_flags_1_val(uint64_t d_val); static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab); static void dump_dynamic(struct readelf *re); static void dump_liblist(struct readelf *re); @@ -2804,9 +2806,147 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32 case DT_GNU_PRELINKED: printf(" %s\n", timestamp(dyn->d_un.d_val)); break; + case DT_FLAGS: + dump_dt_flags_val(dyn->d_un.d_val); + break; + case DT_FLAGS_1: + dump_dt_flags_1_val(dyn->d_un.d_val); + break; default: printf("\n"); } +} + +static void +dump_dt_flags_val(uint64_t d_val) +{ + if (d_val & 0x1) { + d_val ^= 0x1; + printf(" ORIGIN"); + } + if (d_val & 0x2) { + d_val ^= 0x2; + printf(" SYMBOLIC"); + } + if (d_val & 0x4) { + d_val ^= 0x4; + printf(" TEXTREL"); + } + if (d_val & 0x8) { + d_val ^= 0x8; + printf(" BIND_NOW"); + } + if (d_val & 0x10) { + d_val ^= 0x10; + printf(" STATIC_TLS"); + } + if (d_val) + printf(" %lx", d_val); + printf("\n"); +} + +static void +dump_dt_flags_1_val(uint64_t d_val) +{ + if (d_val & 0x1) { + d_val ^= 0x1; + printf(" NOW"); + } + if (d_val & 0x2) { + d_val ^= 0x2; + printf(" GLOBAL"); + } + if (d_val & 0x4) { + d_val ^= 0x4; + printf(" GROUP"); + } + if (d_val & 0x8) { + d_val ^= 0x8; + printf(" NODELETE"); + } + if (d_val & 0x10) { + d_val ^= 0x10; + printf(" LOADFLTR"); + } + if (d_val & 0x20) { + d_val ^= 0x20; + printf(" INITFIRST"); + } + if (d_val & 0x40) { + d_val ^= 0x40; + printf(" NOOPEN"); + } + if (d_val & 0x80) { + d_val ^= 0x80; + printf(" ORIGIN"); + } + if (d_val & 0x100) { + d_val ^= 0x100; + printf(" DIRECT"); + } + if (d_val & 0x400) { + d_val ^= 0x400; + printf(" INTERPOSE"); + } + if (d_val & 0x800) { + d_val ^= 0x800; + printf(" NODEFLIB"); + } + if (d_val & 0x1000) { + d_val ^= 0x1000; + printf(" NODUMP"); + } + if (d_val & 0x2000) { + d_val ^= 0x2000; + printf(" CONFALT"); + } + if (d_val & 0x4000) { + d_val ^= 0x4000; + printf(" ENDFILTEE"); + } + if (d_val & 0x8000) { + d_val ^= 0x8000; + printf(" DISPRELDNE"); + } + if (d_val & 0x10000) { + d_val ^= 0x10000; + printf(" DISPRELPND"); + } + if (d_val & 0x20000) { + d_val ^= 0x20000; + printf(" NODIRECT"); + } + if (d_val & 0x40000) { + d_val ^= 0x40000; + printf(" IGNMULDEF"); + } + if (d_val & 0x80000) { + d_val ^= 0x80000; + printf(" NOKSYMS"); + } + if (d_val & 0x100000) { + d_val ^= 0x100000; + printf(" NOHDR"); + } + if (d_val & 0x200000) { + d_val ^= 0x200000; + printf(" EDITED"); + } + if (d_val & 0x400000) { + d_val ^= 0x400000; + printf(" NORELOC"); + } + if (d_val & 0x800000) { + d_val ^= 0x800000; + printf(" SYMINTPOSE"); + } + if (d_val & 0x1000000) { + d_val ^= 0x1000000; + printf(" GLOBAUDIT"); + } + if (d_val) + printf(" %lx", d_val); + printf("\n"); } static void From owner-svn-src-head@freebsd.org Wed Jan 30 21:46:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20B6F131A513; Wed, 30 Jan 2019 21:46:13 +0000 (UTC) (envelope-from emaste@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 BB68C87545; Wed, 30 Jan 2019 21:46:12 +0000 (UTC) (envelope-from emaste@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 A1258253C4; Wed, 30 Jan 2019 21:46:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ULkCIc095783; Wed, 30 Jan 2019 21:46:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ULkCTo095782; Wed, 30 Jan 2019 21:46:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901302146.x0ULkCTo095782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Jan 2019 21:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343593 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 343593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB68C87545 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 21:46:13 -0000 Author: emaste Date: Wed Jan 30 21:46:12 2019 New Revision: 343593 URL: https://svnweb.freebsd.org/changeset/base/343593 Log: readelf: fix i386 build Use %jx and (uintmax_t) cast. PR: 232983 MFC with: r343592 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Jan 30 20:44:51 2019 (r343592) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Jan 30 21:46:12 2019 (r343593) @@ -2841,7 +2841,7 @@ dump_dt_flags_val(uint64_t d_val) printf(" STATIC_TLS"); } if (d_val) - printf(" %lx", d_val); + printf(" %jx", (uintmax_t)d_val); printf("\n"); } @@ -2945,7 +2945,7 @@ dump_dt_flags_1_val(uint64_t d_val) printf(" GLOBAUDIT"); } if (d_val) - printf(" %lx", d_val); + printf(" %jx", (uintmax_t)d_val); printf("\n"); } From owner-svn-src-head@freebsd.org Thu Jan 31 00:09:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAE53133A46F; Thu, 31 Jan 2019 00:09:38 +0000 (UTC) (envelope-from davidcs@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 6BCA18B103; Thu, 31 Jan 2019 00:09:38 +0000 (UTC) (envelope-from davidcs@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 5D88026B59; Thu, 31 Jan 2019 00:09:38 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0V09cow069678; Thu, 31 Jan 2019 00:09:38 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0V09ccV069677; Thu, 31 Jan 2019 00:09:38 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201901310009.x0V09ccV069677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 31 Jan 2019 00:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343598 - in head/sys: dev/qlnx/qlnxe dev/qlnx/qlnxr modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxr X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: in head/sys: dev/qlnx/qlnxe dev/qlnx/qlnxr modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxr X-SVN-Commit-Revision: 343598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BCA18B103 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 00:09:39 -0000 Author: davidcs Date: Thu Jan 31 00:09:38 2019 New Revision: 343598 URL: https://svnweb.freebsd.org/changeset/base/343598 Log: Add RDMA (iWARP and RoCEv1) support David Somayajulu (davidcs): Overall RDMA Driver infrastructure and iWARP Anand Khoje (akhoje@marvell.com): RoCEv1 verbs implementation MFC after:5 days Added: head/sys/dev/qlnx/qlnxe/ecore_iwarp.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_ll2.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_ooo.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_rdma.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_roce.c (contents, props changed) head/sys/dev/qlnx/qlnxe/qlnx_rdma.c (contents, props changed) head/sys/dev/qlnx/qlnxe/qlnx_rdma.h (contents, props changed) head/sys/dev/qlnx/qlnxr/ head/sys/dev/qlnx/qlnxr/qlnxr_cm.c (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_cm.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_def.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_os.c (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_roce.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_user.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_verbs.c (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_verbs.h (contents, props changed) head/sys/modules/qlnx/qlnxr/ head/sys/modules/qlnx/qlnxr/Makefile (contents, props changed) Modified: head/sys/modules/qlnx/Makefile head/sys/modules/qlnx/qlnxe/Makefile Added: head/sys/dev/qlnx/qlnxe/ecore_iwarp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/qlnx/qlnxe/ecore_iwarp.c Thu Jan 31 00:09:38 2019 (r343598) @@ -0,0 +1,3970 @@ +/* + * Copyright (c) 2018-2019 Cavium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * File : ecore_iwarp.c + */ +#include +__FBSDID("$FreeBSD$"); + +#include "bcm_osal.h" +#include "ecore.h" +#include "ecore_status.h" +#include "ecore_sp_commands.h" +#include "ecore_cxt.h" +#include "ecore_rdma.h" +#include "reg_addr.h" +#include "ecore_hw.h" +#include "ecore_hsi_iwarp.h" +#include "ecore_ll2.h" +#include "ecore_ooo.h" +#ifndef LINUX_REMOVE +#include "ecore_tcp_ip.h" +#endif + +#ifdef _NTDDK_ +#pragma warning(push) +#pragma warning(disable : 28123) +#pragma warning(disable : 28167) +#endif + +/* Default values used for MPA Rev 1 */ +#define ECORE_IWARP_ORD_DEFAULT 32 +#define ECORE_IWARP_IRD_DEFAULT 32 + +#define ECORE_IWARP_MAX_FW_MSS 4120 + +struct mpa_v2_hdr { + __be16 ird; + __be16 ord; +}; + +#define MPA_V2_PEER2PEER_MODEL 0x8000 +#define MPA_V2_SEND_RTR 0x4000 /* on ird */ +#define MPA_V2_READ_RTR 0x4000 /* on ord */ +#define MPA_V2_WRITE_RTR 0x8000 +#define MPA_V2_IRD_ORD_MASK 0x3FFF + +#define MPA_REV2(_mpa_rev) (_mpa_rev == MPA_NEGOTIATION_TYPE_ENHANCED) + +#define ECORE_IWARP_INVALID_TCP_CID 0xffffffff +/* How many times fin will be sent before FW aborts and send RST */ +#define ECORE_IWARP_MAX_FIN_RT_DEFAULT 2 +#define ECORE_IWARP_RCV_WND_SIZE_MIN (0xffff) +/* INTERNAL: These numbers are derived from BRB buffer sizes to obtain optimal performance */ +#define ECORE_IWARP_RCV_WND_SIZE_BB_DEF_2_PORTS (200*1024) +#define ECORE_IWARP_RCV_WND_SIZE_BB_DEF_4_PORTS (100*1024) +#define ECORE_IWARP_RCV_WND_SIZE_AH_DEF_2_PORTS (150*1024) +#define ECORE_IWARP_RCV_WND_SIZE_AH_DEF_4_PORTS (90*1024) +#define ECORE_IWARP_MAX_WND_SCALE (14) +/* Timestamp header is the length of the timestamp option (10): + * kind:8 bit, length:8 bit, timestamp:32 bit, ack: 32bit + * rounded up to a multiple of 4 + */ +#define TIMESTAMP_HEADER_SIZE (12) + +static enum _ecore_status_t +ecore_iwarp_async_event(struct ecore_hwfn *p_hwfn, + u8 fw_event_code, + u16 OSAL_UNUSED echo, + union event_ring_data *data, + u8 fw_return_code); + +static enum _ecore_status_t +ecore_iwarp_empty_ramrod(struct ecore_hwfn *p_hwfn, + struct ecore_iwarp_listener *listener); + +static OSAL_INLINE struct ecore_iwarp_fpdu * +ecore_iwarp_get_curr_fpdu(struct ecore_hwfn *p_hwfn, u16 cid); + +/* Override devinfo with iWARP specific values */ +void +ecore_iwarp_init_devinfo(struct ecore_hwfn *p_hwfn) +{ + struct ecore_rdma_device *dev = p_hwfn->p_rdma_info->dev; + + dev->max_inline = IWARP_REQ_MAX_INLINE_DATA_SIZE; + dev->max_qp = OSAL_MIN_T(u64, + IWARP_MAX_QPS, + p_hwfn->p_rdma_info->num_qps) - + ECORE_IWARP_PREALLOC_CNT; + + dev->max_cq = dev->max_qp; + + dev->max_qp_resp_rd_atomic_resc = ECORE_IWARP_IRD_DEFAULT; + dev->max_qp_req_rd_atomic_resc = ECORE_IWARP_ORD_DEFAULT; +} + +enum _ecore_status_t +ecore_iwarp_init_hw(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) +{ + p_hwfn->rdma_prs_search_reg = PRS_REG_SEARCH_TCP; + ecore_wr(p_hwfn, p_ptt, p_hwfn->rdma_prs_search_reg, 1); + p_hwfn->b_rdma_enabled_in_prs = true; + + return 0; +} + +void +ecore_iwarp_init_fw_ramrod(struct ecore_hwfn *p_hwfn, + struct iwarp_init_func_ramrod_data *p_ramrod) +{ + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, + "ooo handle = %d\n", + p_hwfn->p_rdma_info->iwarp.ll2_ooo_handle); + + p_ramrod->iwarp.ll2_ooo_q_index = + p_hwfn->hw_info.resc_start[ECORE_LL2_QUEUE] + + p_hwfn->p_rdma_info->iwarp.ll2_ooo_handle; + + p_ramrod->tcp.max_fin_rt = ECORE_IWARP_MAX_FIN_RT_DEFAULT; + return; +} + +static enum _ecore_status_t +ecore_iwarp_alloc_cid(struct ecore_hwfn *p_hwfn, u32 *cid) +{ + enum _ecore_status_t rc; + + OSAL_SPIN_LOCK(&p_hwfn->p_rdma_info->lock); + + rc = ecore_rdma_bmap_alloc_id(p_hwfn, + &p_hwfn->p_rdma_info->cid_map, + cid); + + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->lock); + *cid += ecore_cxt_get_proto_cid_start(p_hwfn, + p_hwfn->p_rdma_info->proto); + if (rc != ECORE_SUCCESS) { + DP_NOTICE(p_hwfn, false, "Failed in allocating iwarp cid\n"); + return rc; + } + + rc = ecore_cxt_dynamic_ilt_alloc(p_hwfn, ECORE_ELEM_CXT, *cid); + + if (rc != ECORE_SUCCESS) { + OSAL_SPIN_LOCK(&p_hwfn->p_rdma_info->lock); + *cid -= ecore_cxt_get_proto_cid_start(p_hwfn, + p_hwfn->p_rdma_info->proto); + + ecore_bmap_release_id(p_hwfn, + &p_hwfn->p_rdma_info->cid_map, + *cid); + + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->lock); + } + + return rc; +} + +static void +ecore_iwarp_set_tcp_cid(struct ecore_hwfn *p_hwfn, u32 cid) +{ + cid -= ecore_cxt_get_proto_cid_start(p_hwfn, + p_hwfn->p_rdma_info->proto); + + OSAL_SPIN_LOCK(&p_hwfn->p_rdma_info->lock); + ecore_bmap_set_id(p_hwfn, + &p_hwfn->p_rdma_info->tcp_cid_map, + cid); + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->lock); +} + +/* This function allocates a cid for passive tcp ( called from syn receive) + * the reason it's separate from the regular cid allocation is because it + * is assured that these cids already have ilt alloacted. They are preallocated + * to ensure that we won't need to allocate memory during syn processing + */ +static enum _ecore_status_t +ecore_iwarp_alloc_tcp_cid(struct ecore_hwfn *p_hwfn, u32 *cid) +{ + enum _ecore_status_t rc; + + OSAL_SPIN_LOCK(&p_hwfn->p_rdma_info->lock); + + rc = ecore_rdma_bmap_alloc_id(p_hwfn, + &p_hwfn->p_rdma_info->tcp_cid_map, + cid); + + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->lock); + + *cid += ecore_cxt_get_proto_cid_start(p_hwfn, + p_hwfn->p_rdma_info->proto); + if (rc != ECORE_SUCCESS) { + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, + "can't allocate iwarp tcp cid max-count=%d\n", + p_hwfn->p_rdma_info->tcp_cid_map.max_count); + + *cid = ECORE_IWARP_INVALID_TCP_CID; + } + + return rc; +} + +/* We have two cid maps, one for tcp which should be used only from passive + * syn processing and replacing a pre-allocated ep in the list. the second + * for active tcp and for QPs. + */ +static void ecore_iwarp_cid_cleaned(struct ecore_hwfn *p_hwfn, u32 cid) +{ + cid -= ecore_cxt_get_proto_cid_start(p_hwfn, + p_hwfn->p_rdma_info->proto); + + OSAL_SPIN_LOCK(&p_hwfn->p_rdma_info->lock); + + if (cid < ECORE_IWARP_PREALLOC_CNT) { + ecore_bmap_release_id(p_hwfn, + &p_hwfn->p_rdma_info->tcp_cid_map, + cid); + } else { + ecore_bmap_release_id(p_hwfn, + &p_hwfn->p_rdma_info->cid_map, + cid); + } + + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->lock); +} + +enum _ecore_status_t +ecore_iwarp_create_qp(struct ecore_hwfn *p_hwfn, + struct ecore_rdma_qp *qp, + struct ecore_rdma_create_qp_out_params *out_params) +{ + struct iwarp_create_qp_ramrod_data *p_ramrod; + struct ecore_sp_init_data init_data; + struct ecore_spq_entry *p_ent; + enum _ecore_status_t rc; + u16 physical_queue; + u32 cid; + + qp->shared_queue = + OSAL_DMA_ALLOC_COHERENT(p_hwfn->p_dev, + &qp->shared_queue_phys_addr, + IWARP_SHARED_QUEUE_PAGE_SIZE); + if (!qp->shared_queue) { + DP_NOTICE(p_hwfn, false, + "ecore iwarp create qp failed: cannot allocate memory (shared queue).\n"); + return ECORE_NOMEM; + } else { + out_params->sq_pbl_virt = (u8 *)qp->shared_queue + + IWARP_SHARED_QUEUE_PAGE_SQ_PBL_OFFSET; + out_params->sq_pbl_phys = qp->shared_queue_phys_addr + + IWARP_SHARED_QUEUE_PAGE_SQ_PBL_OFFSET; + out_params->rq_pbl_virt = (u8 *)qp->shared_queue + + IWARP_SHARED_QUEUE_PAGE_RQ_PBL_OFFSET; + out_params->rq_pbl_phys = qp->shared_queue_phys_addr + + IWARP_SHARED_QUEUE_PAGE_RQ_PBL_OFFSET; + } + + rc = ecore_iwarp_alloc_cid(p_hwfn, &cid); + if (rc != ECORE_SUCCESS) + goto err1; + + qp->icid = (u16)cid; + + OSAL_MEMSET(&init_data, 0, sizeof(init_data)); + init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; + init_data.cid = qp->icid; + init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK; + + rc = ecore_sp_init_request(p_hwfn, &p_ent, + IWARP_RAMROD_CMD_ID_CREATE_QP, + PROTOCOLID_IWARP, &init_data); + if (rc != ECORE_SUCCESS) + return rc; + + p_ramrod = &p_ent->ramrod.iwarp_create_qp; + + SET_FIELD(p_ramrod->flags, + IWARP_CREATE_QP_RAMROD_DATA_FMR_AND_RESERVED_EN, + qp->fmr_and_reserved_lkey); + + SET_FIELD(p_ramrod->flags, + IWARP_CREATE_QP_RAMROD_DATA_SIGNALED_COMP, + qp->signal_all); + + SET_FIELD(p_ramrod->flags, + IWARP_CREATE_QP_RAMROD_DATA_RDMA_RD_EN, + qp->incoming_rdma_read_en); + + SET_FIELD(p_ramrod->flags, + IWARP_CREATE_QP_RAMROD_DATA_RDMA_WR_EN, + qp->incoming_rdma_write_en); + + SET_FIELD(p_ramrod->flags, + IWARP_CREATE_QP_RAMROD_DATA_ATOMIC_EN, + qp->incoming_atomic_en); + + SET_FIELD(p_ramrod->flags, + IWARP_CREATE_QP_RAMROD_DATA_SRQ_FLG, + qp->use_srq); + + p_ramrod->pd = qp->pd; + p_ramrod->sq_num_pages = qp->sq_num_pages; + p_ramrod->rq_num_pages = qp->rq_num_pages; + + p_ramrod->qp_handle_for_cqe.hi = OSAL_CPU_TO_LE32(qp->qp_handle.hi); + p_ramrod->qp_handle_for_cqe.lo = OSAL_CPU_TO_LE32(qp->qp_handle.lo); + + p_ramrod->cq_cid_for_sq = + OSAL_CPU_TO_LE32((p_hwfn->hw_info.opaque_fid << 16) | + qp->sq_cq_id); + p_ramrod->cq_cid_for_rq = + OSAL_CPU_TO_LE32((p_hwfn->hw_info.opaque_fid << 16) | + qp->rq_cq_id); + + p_ramrod->dpi = OSAL_CPU_TO_LE16(qp->dpi); + + physical_queue = ecore_get_cm_pq_idx(p_hwfn, PQ_FLAGS_OFLD); + p_ramrod->physical_q0 = OSAL_CPU_TO_LE16(physical_queue); + physical_queue = ecore_get_cm_pq_idx(p_hwfn, PQ_FLAGS_ACK); + p_ramrod->physical_q1 = OSAL_CPU_TO_LE16(physical_queue); + + rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL); + + if (rc != ECORE_SUCCESS) + goto err1; + + return rc; + +err1: + OSAL_DMA_FREE_COHERENT(p_hwfn->p_dev, + qp->shared_queue, + qp->shared_queue_phys_addr, + IWARP_SHARED_QUEUE_PAGE_SIZE); + + return rc; +} + +static enum _ecore_status_t +ecore_iwarp_modify_fw(struct ecore_hwfn *p_hwfn, + struct ecore_rdma_qp *qp) +{ + struct iwarp_modify_qp_ramrod_data *p_ramrod; + struct ecore_sp_init_data init_data; + struct ecore_spq_entry *p_ent; + enum _ecore_status_t rc; + + /* Get SPQ entry */ + OSAL_MEMSET(&init_data, 0, sizeof(init_data)); + init_data.cid = qp->icid; + init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; + init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK; + + rc = ecore_sp_init_request(p_hwfn, &p_ent, + IWARP_RAMROD_CMD_ID_MODIFY_QP, + p_hwfn->p_rdma_info->proto, + &init_data); + if (rc != ECORE_SUCCESS) + return rc; + + p_ramrod = &p_ent->ramrod.iwarp_modify_qp; + SET_FIELD(p_ramrod->flags, IWARP_MODIFY_QP_RAMROD_DATA_STATE_TRANS_EN, + 0x1); + if (qp->iwarp_state == ECORE_IWARP_QP_STATE_CLOSING) + p_ramrod->transition_to_state = IWARP_MODIFY_QP_STATE_CLOSING; + else + p_ramrod->transition_to_state = IWARP_MODIFY_QP_STATE_ERROR; + + rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "QP(0x%x)rc=%d\n", + qp->icid, rc); + + return rc; +} + +enum ecore_iwarp_qp_state +ecore_roce2iwarp_state(enum ecore_roce_qp_state state) +{ + switch (state) { + case ECORE_ROCE_QP_STATE_RESET: + case ECORE_ROCE_QP_STATE_INIT: + case ECORE_ROCE_QP_STATE_RTR: + return ECORE_IWARP_QP_STATE_IDLE; + case ECORE_ROCE_QP_STATE_RTS: + return ECORE_IWARP_QP_STATE_RTS; + case ECORE_ROCE_QP_STATE_SQD: + return ECORE_IWARP_QP_STATE_CLOSING; + case ECORE_ROCE_QP_STATE_ERR: + return ECORE_IWARP_QP_STATE_ERROR; + case ECORE_ROCE_QP_STATE_SQE: + return ECORE_IWARP_QP_STATE_TERMINATE; + } + return ECORE_IWARP_QP_STATE_ERROR; +} + +static enum ecore_roce_qp_state +ecore_iwarp2roce_state(enum ecore_iwarp_qp_state state) +{ + switch (state) { + case ECORE_IWARP_QP_STATE_IDLE: + return ECORE_ROCE_QP_STATE_INIT; + case ECORE_IWARP_QP_STATE_RTS: + return ECORE_ROCE_QP_STATE_RTS; + case ECORE_IWARP_QP_STATE_TERMINATE: + return ECORE_ROCE_QP_STATE_SQE; + case ECORE_IWARP_QP_STATE_CLOSING: + return ECORE_ROCE_QP_STATE_SQD; + case ECORE_IWARP_QP_STATE_ERROR: + return ECORE_ROCE_QP_STATE_ERR; + } + return ECORE_ROCE_QP_STATE_ERR; +} + +const char *iwarp_state_names[] = { + "IDLE", + "RTS", + "TERMINATE", + "CLOSING", + "ERROR", +}; + +enum _ecore_status_t +ecore_iwarp_modify_qp(struct ecore_hwfn *p_hwfn, + struct ecore_rdma_qp *qp, + enum ecore_iwarp_qp_state new_state, + bool internal) +{ + enum ecore_iwarp_qp_state prev_iw_state; + enum _ecore_status_t rc = 0; + bool modify_fw = false; + + /* modify QP can be called from upper-layer or as a result of async + * RST/FIN... therefore need to protect + */ + OSAL_SPIN_LOCK(&p_hwfn->p_rdma_info->iwarp.qp_lock); + prev_iw_state = qp->iwarp_state; + + if (prev_iw_state == new_state) { + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->iwarp.qp_lock); + return ECORE_SUCCESS; + } + + switch (prev_iw_state) { + case ECORE_IWARP_QP_STATE_IDLE: + switch (new_state) { + case ECORE_IWARP_QP_STATE_RTS: + qp->iwarp_state = ECORE_IWARP_QP_STATE_RTS; + break; + case ECORE_IWARP_QP_STATE_ERROR: + qp->iwarp_state = ECORE_IWARP_QP_STATE_ERROR; + if (!internal) + modify_fw = true; + break; + default: + break; + } + break; + case ECORE_IWARP_QP_STATE_RTS: + switch (new_state) { + case ECORE_IWARP_QP_STATE_CLOSING: + if (!internal) + modify_fw = true; + + qp->iwarp_state = ECORE_IWARP_QP_STATE_CLOSING; + break; + case ECORE_IWARP_QP_STATE_ERROR: + if (!internal) + modify_fw = true; + qp->iwarp_state = ECORE_IWARP_QP_STATE_ERROR; + break; + default: + break; + } + break; + case ECORE_IWARP_QP_STATE_ERROR: + switch (new_state) { + case ECORE_IWARP_QP_STATE_IDLE: + /* TODO: destroy flow -> need to destroy EP&QP */ + qp->iwarp_state = new_state; + break; + case ECORE_IWARP_QP_STATE_CLOSING: + /* could happen due to race... do nothing.... */ + break; + default: + rc = ECORE_INVAL; + } + break; + case ECORE_IWARP_QP_STATE_TERMINATE: + case ECORE_IWARP_QP_STATE_CLOSING: + qp->iwarp_state = new_state; + break; + default: + break; + } + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "QP(0x%x) %s --> %s %s\n", + qp->icid, + iwarp_state_names[prev_iw_state], + iwarp_state_names[qp->iwarp_state], + internal ? "internal" : " "); + + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->iwarp.qp_lock); + + if (modify_fw) + ecore_iwarp_modify_fw(p_hwfn, qp); + + return rc; +} + +enum _ecore_status_t +ecore_iwarp_fw_destroy(struct ecore_hwfn *p_hwfn, + struct ecore_rdma_qp *qp) +{ + struct ecore_sp_init_data init_data; + struct ecore_spq_entry *p_ent; + enum _ecore_status_t rc; + + /* Get SPQ entry */ + OSAL_MEMSET(&init_data, 0, sizeof(init_data)); + init_data.cid = qp->icid; + init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; + init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK; + + rc = ecore_sp_init_request(p_hwfn, &p_ent, + IWARP_RAMROD_CMD_ID_DESTROY_QP, + p_hwfn->p_rdma_info->proto, + &init_data); + if (rc != ECORE_SUCCESS) + return rc; + + rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "QP(0x%x) rc = %d\n", qp->icid, rc); + + return rc; +} + +static void ecore_iwarp_destroy_ep(struct ecore_hwfn *p_hwfn, + struct ecore_iwarp_ep *ep, + bool remove_from_active_list) +{ + OSAL_DMA_FREE_COHERENT(p_hwfn->p_dev, + ep->ep_buffer_virt, + ep->ep_buffer_phys, + sizeof(*ep->ep_buffer_virt)); + + if (remove_from_active_list) { + OSAL_SPIN_LOCK(&p_hwfn->p_rdma_info->iwarp.iw_lock); + + OSAL_LIST_REMOVE_ENTRY(&ep->list_entry, + &p_hwfn->p_rdma_info->iwarp.ep_list); + + OSAL_SPIN_UNLOCK(&p_hwfn->p_rdma_info->iwarp.iw_lock); + } + + if (ep->qp) + ep->qp->ep = OSAL_NULL; + + OSAL_FREE(p_hwfn->p_dev, ep); +} + +enum _ecore_status_t +ecore_iwarp_destroy_qp(struct ecore_hwfn *p_hwfn, + struct ecore_rdma_qp *qp) +{ + enum _ecore_status_t rc = ECORE_SUCCESS; + struct ecore_iwarp_ep *ep = qp->ep; + struct ecore_iwarp_fpdu *fpdu; + int wait_count = 0; + + fpdu = ecore_iwarp_get_curr_fpdu(p_hwfn, qp->icid); + if (fpdu && fpdu->incomplete_bytes) + DP_NOTICE(p_hwfn, false, + "Pending Partial fpdu with incomplete bytes=%d\n", + fpdu->incomplete_bytes); + + if (qp->iwarp_state != ECORE_IWARP_QP_STATE_ERROR) { + + rc = ecore_iwarp_modify_qp(p_hwfn, qp, + ECORE_IWARP_QP_STATE_ERROR, + false); + + if (rc != ECORE_SUCCESS) + return rc; + } + + /* Make sure ep is closed before returning and freeing memory. */ + if (ep) { + while (ep->state != ECORE_IWARP_EP_CLOSED) { + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, + "Waiting for ep->state to be closed...state=%x\n", + ep->state); + + OSAL_MSLEEP(100); + if (wait_count++ > 200) { + DP_NOTICE(p_hwfn, false, "ep state close timeout state=%x\n", + ep->state); + break; + } + } + + ecore_iwarp_destroy_ep(p_hwfn, ep, false); + } + + rc = ecore_iwarp_fw_destroy(p_hwfn, qp); + + if (qp->shared_queue) + OSAL_DMA_FREE_COHERENT(p_hwfn->p_dev, + qp->shared_queue, + qp->shared_queue_phys_addr, + IWARP_SHARED_QUEUE_PAGE_SIZE); + + return rc; +} + +static enum _ecore_status_t +ecore_iwarp_create_ep(struct ecore_hwfn *p_hwfn, + struct ecore_iwarp_ep **ep_out) +{ + struct ecore_iwarp_ep *ep; + enum _ecore_status_t rc; + + ep = OSAL_ZALLOC(p_hwfn->p_dev, GFP_KERNEL, sizeof(*ep)); + if (!ep) { + DP_NOTICE(p_hwfn, false, + "ecore create ep failed: cannot allocate memory (ep). rc = %d\n", + ECORE_NOMEM); + return ECORE_NOMEM; + } + + ep->state = ECORE_IWARP_EP_INIT; + + /* ep_buffer is allocated once and is structured as follows: + * [MAX_PRIV_DATA_LEN][MAX_PRIV_DATA_LEN][union async_output] + * We could have allocated this in three calls but since all together + * it is less than a page, we do one allocation and initialize pointers + * accordingly + */ + ep->ep_buffer_virt = OSAL_DMA_ALLOC_COHERENT( + p_hwfn->p_dev, + &ep->ep_buffer_phys, + sizeof(*ep->ep_buffer_virt)); + + if (!ep->ep_buffer_virt) { + DP_NOTICE(p_hwfn, false, + "ecore create ep failed: cannot allocate memory (ulp buffer). rc = %d\n", + ECORE_NOMEM); + rc = ECORE_NOMEM; + goto err; + } + + ep->sig = 0xdeadbeef; + + *ep_out = ep; + + return ECORE_SUCCESS; + +err: + OSAL_FREE(p_hwfn->p_dev, ep); + return rc; +} + +static void +ecore_iwarp_print_tcp_ramrod(struct ecore_hwfn *p_hwfn, + struct iwarp_tcp_offload_ramrod_data *p_tcp_ramrod) +{ + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, ">>> PRINT TCP RAMROD\n"); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "local_mac=%x %x %x\n", + p_tcp_ramrod->tcp.local_mac_addr_lo, + p_tcp_ramrod->tcp.local_mac_addr_mid, + p_tcp_ramrod->tcp.local_mac_addr_hi); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "remote_mac=%x %x %x\n", + p_tcp_ramrod->tcp.remote_mac_addr_lo, + p_tcp_ramrod->tcp.remote_mac_addr_mid, + p_tcp_ramrod->tcp.remote_mac_addr_hi); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "vlan_id=%x\n", + p_tcp_ramrod->tcp.vlan_id); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "flags=%x\n", + p_tcp_ramrod->tcp.flags); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "ip_version=%x\n", + p_tcp_ramrod->tcp.ip_version); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "local_ip=%x.%x.%x.%x\n", + p_tcp_ramrod->tcp.local_ip[0], + p_tcp_ramrod->tcp.local_ip[1], + p_tcp_ramrod->tcp.local_ip[2], + p_tcp_ramrod->tcp.local_ip[3]); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "remote_ip=%x.%x.%x.%x\n", + p_tcp_ramrod->tcp.remote_ip[0], + p_tcp_ramrod->tcp.remote_ip[1], + p_tcp_ramrod->tcp.remote_ip[2], + p_tcp_ramrod->tcp.remote_ip[3]); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "flow_label=%x\n", + p_tcp_ramrod->tcp.flow_label); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "ttl=%x\n", + p_tcp_ramrod->tcp.ttl); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "tos_or_tc=%x\n", + p_tcp_ramrod->tcp.tos_or_tc); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "local_port=%x\n", + p_tcp_ramrod->tcp.local_port); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "remote_port=%x\n", + p_tcp_ramrod->tcp.remote_port); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "mss=%x\n", + p_tcp_ramrod->tcp.mss); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "rcv_wnd_scale=%x\n", + p_tcp_ramrod->tcp.rcv_wnd_scale); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "connect_mode=%x\n", + p_tcp_ramrod->tcp.connect_mode); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "syn_ip_payload_length=%x\n", + p_tcp_ramrod->tcp.syn_ip_payload_length); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "syn_phy_addr_lo=%x\n", + p_tcp_ramrod->tcp.syn_phy_addr_lo); + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "syn_phy_addr_hi=%x\n", + p_tcp_ramrod->tcp.syn_phy_addr_hi); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, "<<p_rdma_info->iwarp; + struct iwarp_tcp_offload_ramrod_data *p_tcp_ramrod; + struct ecore_sp_init_data init_data; + struct ecore_spq_entry *p_ent; + dma_addr_t async_output_phys; + dma_addr_t in_pdata_phys; + enum _ecore_status_t rc; + u16 physical_q; + u8 tcp_flags; + int i; + + OSAL_MEMSET(&init_data, 0, sizeof(init_data)); + init_data.cid = ep->tcp_cid; + init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; + + if (ep->connect_mode == TCP_CONNECT_PASSIVE) { + init_data.comp_mode = ECORE_SPQ_MODE_CB; + } else { + init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK; + } + + rc = ecore_sp_init_request(p_hwfn, &p_ent, + IWARP_RAMROD_CMD_ID_TCP_OFFLOAD, + PROTOCOLID_IWARP, &init_data); + if (rc != ECORE_SUCCESS) + return rc; + + p_tcp_ramrod = &p_ent->ramrod.iwarp_tcp_offload; + + /* Point to the "second half" of the ulp buffer */ + in_pdata_phys = ep->ep_buffer_phys + + OFFSETOF(struct ecore_iwarp_ep_memory, in_pdata); + p_tcp_ramrod->iwarp.incoming_ulp_buffer.addr.hi = + DMA_HI_LE(in_pdata_phys); + p_tcp_ramrod->iwarp.incoming_ulp_buffer.addr.lo = + DMA_LO_LE(in_pdata_phys); + p_tcp_ramrod->iwarp.incoming_ulp_buffer.len = + OSAL_CPU_TO_LE16(sizeof(ep->ep_buffer_virt->in_pdata)); + + async_output_phys = ep->ep_buffer_phys + + OFFSETOF(struct ecore_iwarp_ep_memory, async_output); + + p_tcp_ramrod->iwarp.async_eqe_output_buf.hi = + DMA_HI_LE(async_output_phys); + p_tcp_ramrod->iwarp.async_eqe_output_buf.lo = + DMA_LO_LE(async_output_phys); + p_tcp_ramrod->iwarp.handle_for_async.hi = OSAL_CPU_TO_LE32(PTR_HI(ep)); + p_tcp_ramrod->iwarp.handle_for_async.lo = OSAL_CPU_TO_LE32(PTR_LO(ep)); + + physical_q = ecore_get_cm_pq_idx(p_hwfn, PQ_FLAGS_OFLD); + p_tcp_ramrod->iwarp.physical_q0 = OSAL_CPU_TO_LE16(physical_q); + physical_q = ecore_get_cm_pq_idx(p_hwfn, PQ_FLAGS_ACK); + p_tcp_ramrod->iwarp.physical_q1 = OSAL_CPU_TO_LE16(physical_q); + p_tcp_ramrod->iwarp.mpa_mode = iwarp_info->mpa_rev; + + ecore_set_fw_mac_addr(&p_tcp_ramrod->tcp.remote_mac_addr_hi, + &p_tcp_ramrod->tcp.remote_mac_addr_mid, + &p_tcp_ramrod->tcp.remote_mac_addr_lo, + ep->remote_mac_addr); + ecore_set_fw_mac_addr(&p_tcp_ramrod->tcp.local_mac_addr_hi, + &p_tcp_ramrod->tcp.local_mac_addr_mid, + &p_tcp_ramrod->tcp.local_mac_addr_lo, + ep->local_mac_addr); + + p_tcp_ramrod->tcp.vlan_id = OSAL_CPU_TO_LE16(ep->cm_info.vlan); + + tcp_flags = p_hwfn->p_rdma_info->iwarp.tcp_flags; + p_tcp_ramrod->tcp.flags = 0; + SET_FIELD(p_tcp_ramrod->tcp.flags, + TCP_OFFLOAD_PARAMS_OPT2_TS_EN, + !!(tcp_flags & ECORE_IWARP_TS_EN)); + + SET_FIELD(p_tcp_ramrod->tcp.flags, + TCP_OFFLOAD_PARAMS_OPT2_DA_EN, + !!(tcp_flags & ECORE_IWARP_DA_EN)); + + p_tcp_ramrod->tcp.ip_version = ep->cm_info.ip_version; + + for (i = 0; i < 4; i++) { + p_tcp_ramrod->tcp.remote_ip[i] = + OSAL_CPU_TO_LE32(ep->cm_info.remote_ip[i]); + p_tcp_ramrod->tcp.local_ip[i] = + OSAL_CPU_TO_LE32(ep->cm_info.local_ip[i]); + } + + p_tcp_ramrod->tcp.remote_port = + OSAL_CPU_TO_LE16(ep->cm_info.remote_port); + p_tcp_ramrod->tcp.local_port = OSAL_CPU_TO_LE16(ep->cm_info.local_port); + p_tcp_ramrod->tcp.mss = OSAL_CPU_TO_LE16(ep->mss); + p_tcp_ramrod->tcp.flow_label = 0; + p_tcp_ramrod->tcp.ttl = 0x40; + p_tcp_ramrod->tcp.tos_or_tc = 0; + + p_tcp_ramrod->tcp.max_rt_time = ECORE_IWARP_DEF_MAX_RT_TIME; + p_tcp_ramrod->tcp.cwnd = ECORE_IWARP_DEF_CWND_FACTOR * p_tcp_ramrod->tcp.mss; + p_tcp_ramrod->tcp.ka_max_probe_cnt = ECORE_IWARP_DEF_KA_MAX_PROBE_CNT; + p_tcp_ramrod->tcp.ka_timeout = ECORE_IWARP_DEF_KA_TIMEOUT; + p_tcp_ramrod->tcp.ka_interval = ECORE_IWARP_DEF_KA_INTERVAL; + + p_tcp_ramrod->tcp.rcv_wnd_scale = + (u8)p_hwfn->p_rdma_info->iwarp.rcv_wnd_scale; + p_tcp_ramrod->tcp.connect_mode = ep->connect_mode; + + if (ep->connect_mode == TCP_CONNECT_PASSIVE) { + p_tcp_ramrod->tcp.syn_ip_payload_length = + OSAL_CPU_TO_LE16(ep->syn_ip_payload_length); + p_tcp_ramrod->tcp.syn_phy_addr_hi = + DMA_HI_LE(ep->syn_phy_addr); + p_tcp_ramrod->tcp.syn_phy_addr_lo = + DMA_LO_LE(ep->syn_phy_addr); + } + + ecore_iwarp_print_tcp_ramrod(p_hwfn, p_tcp_ramrod); + + rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL); + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, + "EP(0x%x) Offload completed rc=%d\n" , ep->tcp_cid, rc); + + return rc; +} + +/* This function should be called after IWARP_EVENT_TYPE_ASYNC_CONNECT_COMPLETE + * is received. it will be called from the dpc context. + */ +static enum _ecore_status_t +ecore_iwarp_mpa_offload(struct ecore_hwfn *p_hwfn, + struct ecore_iwarp_ep *ep) +{ + struct iwarp_mpa_offload_ramrod_data *p_mpa_ramrod; + struct ecore_iwarp_info *iwarp_info; + struct ecore_sp_init_data init_data; + struct ecore_spq_entry *p_ent; + dma_addr_t async_output_phys; + dma_addr_t out_pdata_phys; + dma_addr_t in_pdata_phys; + struct ecore_rdma_qp *qp; + bool reject; + enum _ecore_status_t rc; + + if (!ep) + return ECORE_INVAL; + + qp = ep->qp; + reject = (qp == OSAL_NULL); + + OSAL_MEMSET(&init_data, 0, sizeof(init_data)); + init_data.cid = reject ? ep->tcp_cid : qp->icid; + init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; + + if (ep->connect_mode == TCP_CONNECT_ACTIVE || !ep->event_cb) + init_data.comp_mode = ECORE_SPQ_MODE_CB; + else + init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK; + + rc = ecore_sp_init_request(p_hwfn, &p_ent, + IWARP_RAMROD_CMD_ID_MPA_OFFLOAD, + PROTOCOLID_IWARP, &init_data); + + if (rc != ECORE_SUCCESS) + return rc; + + p_mpa_ramrod = &p_ent->ramrod.iwarp_mpa_offload; + out_pdata_phys = ep->ep_buffer_phys + + OFFSETOF(struct ecore_iwarp_ep_memory, out_pdata); + p_mpa_ramrod->common.outgoing_ulp_buffer.addr.hi = + DMA_HI_LE(out_pdata_phys); + p_mpa_ramrod->common.outgoing_ulp_buffer.addr.lo = + DMA_LO_LE(out_pdata_phys); + p_mpa_ramrod->common.outgoing_ulp_buffer.len = + ep->cm_info.private_data_len; + p_mpa_ramrod->common.crc_needed = p_hwfn->p_rdma_info->iwarp.crc_needed; + + p_mpa_ramrod->common.out_rq.ord = ep->cm_info.ord; + p_mpa_ramrod->common.out_rq.ird = ep->cm_info.ird; + + p_mpa_ramrod->tcp_cid = p_hwfn->hw_info.opaque_fid << 16 | ep->tcp_cid; + + in_pdata_phys = ep->ep_buffer_phys + + OFFSETOF(struct ecore_iwarp_ep_memory, in_pdata); + p_mpa_ramrod->tcp_connect_side = ep->connect_mode; + p_mpa_ramrod->incoming_ulp_buffer.addr.hi = + DMA_HI_LE(in_pdata_phys); + p_mpa_ramrod->incoming_ulp_buffer.addr.lo = + DMA_LO_LE(in_pdata_phys); + p_mpa_ramrod->incoming_ulp_buffer.len = + OSAL_CPU_TO_LE16(sizeof(ep->ep_buffer_virt->in_pdata)); + async_output_phys = ep->ep_buffer_phys + + OFFSETOF(struct ecore_iwarp_ep_memory, async_output); + p_mpa_ramrod->async_eqe_output_buf.hi = + DMA_HI_LE(async_output_phys); + p_mpa_ramrod->async_eqe_output_buf.lo = + DMA_LO_LE(async_output_phys); + p_mpa_ramrod->handle_for_async.hi = OSAL_CPU_TO_LE32(PTR_HI(ep)); + p_mpa_ramrod->handle_for_async.lo = OSAL_CPU_TO_LE32(PTR_LO(ep)); + + if (!reject) { + p_mpa_ramrod->shared_queue_addr.hi = + DMA_HI_LE(qp->shared_queue_phys_addr); + p_mpa_ramrod->shared_queue_addr.lo = + DMA_LO_LE(qp->shared_queue_phys_addr); + + p_mpa_ramrod->stats_counter_id = + RESC_START(p_hwfn, ECORE_RDMA_STATS_QUEUE) + + qp->stats_queue; + } else { + p_mpa_ramrod->common.reject = 1; + } + + iwarp_info = &p_hwfn->p_rdma_info->iwarp; + p_mpa_ramrod->rcv_wnd = iwarp_info->rcv_wnd_size; + p_mpa_ramrod->mode = ep->mpa_rev; + SET_FIELD(p_mpa_ramrod->rtr_pref, + IWARP_MPA_OFFLOAD_RAMROD_DATA_RTR_SUPPORTED, + ep->rtr_type); + + ep->state = ECORE_IWARP_EP_MPA_OFFLOADED; + rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL); + if (!reject) + ep->cid = qp->icid; /* Now they're migrated. */ + + DP_VERBOSE(p_hwfn, ECORE_MSG_RDMA, + "QP(0x%x) EP(0x%x) MPA Offload rc = %d IRD=0x%x ORD=0x%x rtr_type=%d mpa_rev=%d reject=%d\n", + reject ? 0xffff : qp->icid, ep->tcp_cid, rc, ep->cm_info.ird, + ep->cm_info.ord, ep->rtr_type, ep->mpa_rev, reject); + return rc; +} + +static void +ecore_iwarp_mpa_received(struct ecore_hwfn *p_hwfn, + struct ecore_iwarp_ep *ep) +{ + struct ecore_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; + struct ecore_iwarp_cm_event_params params; + struct mpa_v2_hdr *mpa_v2_params; + union async_output *async_data; + u16 mpa_ord, mpa_ird; + u8 mpa_hdr_size = 0; + u8 mpa_rev; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jan 31 02:49:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F542133F690; Thu, 31 Jan 2019 02:49:26 +0000 (UTC) (envelope-from kevans@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 F34AA68203; Thu, 31 Jan 2019 02:49:25 +0000 (UTC) (envelope-from kevans@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 E88B5D22; Thu, 31 Jan 2019 02:49:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0V2nPIe053967; Thu, 31 Jan 2019 02:49:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0V2nPG8053963; Thu, 31 Jan 2019 02:49:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901310249.x0V2nPG8053963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 31 Jan 2019 02:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343599 - in head/lib/libc/tests/stdlib: . dynthr_mod X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/lib/libc/tests/stdlib: . dynthr_mod X-SVN-Commit-Revision: 343599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F34AA68203 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.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 02:49:26 -0000 Author: kevans Date: Thu Jan 31 02:49:24 2019 New Revision: 343599 URL: https://svnweb.freebsd.org/changeset/base/343599 Log: libc/tests: Add test case for jemalloc/libthr bug fixed in r343566 Submitted by: Andrew Gierth (original reproducer; kevans massaged for atf) Reviewed by: kib MFC after: 2 weeks X-MFC-with: r343566 (or after) Differential Revision: https://reviews.freebsd.org/D19027 Added: head/lib/libc/tests/stdlib/dynthr_mod/ head/lib/libc/tests/stdlib/dynthr_mod/Makefile (contents, props changed) head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c (contents, props changed) head/lib/libc/tests/stdlib/dynthr_test.c (contents, props changed) Modified: head/lib/libc/tests/stdlib/Makefile Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Thu Jan 31 00:09:38 2019 (r343598) +++ head/lib/libc/tests/stdlib/Makefile Thu Jan 31 02:49:24 2019 (r343599) @@ -2,6 +2,7 @@ .include +ATF_TESTS_C+= dynthr_test ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test @@ -61,5 +62,7 @@ LIBADD.${t}+= netbsd util .endfor LIBADD.strtod_test+= m + +SUBDIR+= dynthr_mod .include Added: head/lib/libc/tests/stdlib/dynthr_mod/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/dynthr_mod/Makefile Thu Jan 31 02:49:24 2019 (r343599) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +SHLIB_NAME= dynthr_mod.so +SHLIBDIR= ${TESTSDIR} +SRCS= dynthr_mod.c +LIBADD= pthread + +TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/:H} + + +.include Added: head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c Thu Jan 31 02:49:24 2019 (r343599) @@ -0,0 +1,71 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2019 Andrew Gierth + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Though this file is initially distributed under the 2-clause BSD license, + * the author grants permission for its redistribution under alternative + * licenses as set forth at . + * This paragraph and the RELICENSE.txt file are not part of the license and + * may be omitted in redistributions. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +static pthread_t thr; + +static void * +mod_thread(void *ptr) +{ + char *volatile dummy; + + dummy = malloc(500); + return (NULL); +} + +void +mod_main(int op) +{ + int rc; + + switch (op) { + case 1: + rc = pthread_create(&thr, NULL, mod_thread, NULL); + if (rc != 0) + _exit(1); + break; + case 0: + pthread_join(thr, NULL); + break; + } +} + Added: head/lib/libc/tests/stdlib/dynthr_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/dynthr_test.c Thu Jan 31 02:49:24 2019 (r343599) @@ -0,0 +1,93 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2019 Andrew Gierth + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Though this file is initially distributed under the 2-clause BSD license, + * the author grants permission for its redistribution under alternative + * licenses as set forth at . + * This paragraph and the RELICENSE.txt file are not part of the license and + * may be omitted in redistributions. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +typedef void (modfunc_t)(int op); + +/* + * Minimal test case for PR 235158; mutual dependencies between jemalloc and + * libthr causing issues in thread creation. Specifically to this case, libthr + * uses calloc to initialize pthread mutexes, and jemalloc uses pthread mutexes. + * + * Deferred initialization provided by jemalloc proved to be fragile, causing + * issues like in the referenced PR where thread creation in a shared object + * loaded via dlopen(3) would stall unless the calling application also linked + * against pthread. + */ +ATF_TC(maintc); +ATF_TC_HEAD(maintc, tc) +{ + + atf_tc_set_md_var(tc, "timeout", "3"); +} + +ATF_TC_BODY(maintc, tc) +{ + char *libpath; + modfunc_t *func; + void *mod_handle; + const char *srcdir; + dlfunc_t rawfunc; + + srcdir = atf_tc_get_config_var(tc, "srcdir"); + if (asprintf(&libpath, "%s/dynthr_mod.so", srcdir) < 0) + atf_tc_fail("failed to construct path to libthr"); + mod_handle = dlopen(libpath, RTLD_LOCAL); + free(libpath); + if (mod_handle == NULL) + atf_tc_fail("failed to open dynthr_mod.so: %s", dlerror()); + rawfunc = dlfunc(mod_handle, "mod_main"); + if (rawfunc == NULL) + atf_tc_fail("failed to resolve function mod_main"); + func = (modfunc_t *)rawfunc; + func(1); + func(0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, maintc); + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Thu Jan 31 04:16:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C2E1341316; Thu, 31 Jan 2019 04:16:53 +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 B65016C2C7; Thu, 31 Jan 2019 04:16:52 +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 AE8C21E05; Thu, 31 Jan 2019 04:16:52 +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 x0V4Gqq6001298; Thu, 31 Jan 2019 04:16:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0V4Gq5P001297; Thu, 31 Jan 2019 04:16:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901310416.x0V4Gq5P001297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 31 Jan 2019 04:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343600 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 343600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B65016C2C7 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 04:16:53 -0000 Author: cy Date: Thu Jan 31 04:16:52 2019 New Revision: 343600 URL: https://svnweb.freebsd.org/changeset/base/343600 Log: Document the instance context pointer. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Thu Jan 31 02:49:24 2019 (r343599) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Jan 31 04:16:52 2019 (r343600) @@ -2815,7 +2815,8 @@ ipf_firewall(fin, passp) /* -2 == requires authentication */ /* Kernel: */ /* > 0 == filter error # for packet */ -/* Parameters: ip(I) - pointer to start of IPv4/6 packet */ +/* Parameters: ctx(I) - pointer to the instance context */ +/* ip(I) - pointer to start of IPv4/6 packet */ /* hlen(I) - length of header */ /* ifp(I) - pointer to interface this packet is on */ /* out(I) - 0 == packet going in, 1 == packet going out */ From owner-svn-src-head@freebsd.org Thu Jan 31 05:20:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 949D01342058; Thu, 31 Jan 2019 05:20:12 +0000 (UTC) (envelope-from kevans@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 1C5916E4A7; Thu, 31 Jan 2019 05:20:12 +0000 (UTC) (envelope-from kevans@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 0A55E2892; Thu, 31 Jan 2019 05:20:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0V5KB2J033767; Thu, 31 Jan 2019 05:20:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0V5KBXj033765; Thu, 31 Jan 2019 05:20:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901310520.x0V5KBXj033765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 31 Jan 2019 05:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343601 - in head/usr.bin/xinstall: . tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.bin/xinstall: . tests X-SVN-Commit-Revision: 343601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C5916E4A7 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 05:20:12 -0000 Author: kevans Date: Thu Jan 31 05:20:11 2019 New Revision: 343601 URL: https://svnweb.freebsd.org/changeset/base/343601 Log: install(1): Fix relative path calculation with partial common dest/src For example, from the referenced PR [1]: $ mkdir /tmp/lib/ /tmp/libexec $ touch /tmp/lib/foo.so $ install -lrs /tmp/lib/foo.so /tmp/libexec/ The common path identification bits terminate src at /tmp/lib/ and the destination at /tmp/libe. The subsequent backtracking is then incorrect, as it traverses the destination and backtraces exactly one level while eating the 'libexec' because it was previously (falsely) identified as common with 'lib'. The obvious fix would be to make sure we've actually terminated just after directory separators and rewind a character if we haven't. In the above example, we would end up rewinding to /tmp/ and subsequently doing the right thing. Test case added. PR: 235330 [1] MFC after: 1 week Modified: head/usr.bin/xinstall/tests/install_test.sh head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/tests/install_test.sh ============================================================================== --- head/usr.bin/xinstall/tests/install_test.sh Thu Jan 31 04:16:52 2019 (r343600) +++ head/usr.bin/xinstall/tests/install_test.sh Thu Jan 31 05:20:11 2019 (r343601) @@ -377,6 +377,29 @@ mkdir_simple_body() { atf_check install -d dir1/dir2/dir3 } +atf_test_case symbolic_link_relative_absolute_common +symbolic_link_relative_absolute_common_head() { + atf_set "descr" "Verify -l rs with absolute paths having common components" +} +symbolic_link_relative_absolute_common_body() { + filename=foo.so + src_path=lib + src_path_prefixed=$PWD/$src_path + dest_path=$PWD/libexec/ + src_file=$src_path_prefixed/$filename + dest_file=$dest_path/$filename + + atf_check mkdir $src_path_prefixed $dest_path + atf_check touch $src_file + atf_check install -l sr $src_file $dest_path + + dest_path_relative=$(readlink $dest_file) + src_path_relative="../lib/$filename" + if [ "$src_path_relative" != "$dest_path_relative" ]; then + atf_fail "unexpected symlink contents ('$src_path_relative' != '$dest_path_relative')" + fi +} + atf_init_test_cases() { atf_add_test_case copy_to_nonexistent atf_add_test_case copy_to_nonexistent_safe @@ -415,5 +438,6 @@ atf_init_test_cases() { atf_add_test_case symbolic_link_relative_absolute_source_and_dest1 atf_add_test_case symbolic_link_relative_absolute_source_and_dest1_double_slash atf_add_test_case symbolic_link_relative_absolute_source_and_dest2 + atf_add_test_case symbolic_link_relative_absolute_common atf_add_test_case mkdir_simple } Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Thu Jan 31 04:16:52 2019 (r343600) +++ head/usr.bin/xinstall/xinstall.c Thu Jan 31 05:20:11 2019 (r343601) @@ -673,7 +673,7 @@ makelink(const char *from_name, const char *to_name, } if (dolink & LN_RELATIVE) { - char *to_name_copy, *cp, *d, *s; + char *to_name_copy, *cp, *d, *ld, *ls, *s; if (*from_name != '/') { /* this is already a relative link */ @@ -709,8 +709,19 @@ makelink(const char *from_name, const char *to_name, free(to_name_copy); /* Trim common path components. */ - for (s = src, d = dst; *s == *d; s++, d++) + ls = ld = NULL; + for (s = src, d = dst; *s == *d; ls = s, ld = d, s++, d++) continue; + /* + * If we didn't end after a directory separator, then we've + * falsely matched the last component. For example, if one + * invoked install -lrs /lib/foo.so /libexec/ then the source + * would terminate just after the separator while the + * destination would terminate in the middle of 'libexec', + * leading to a full directory getting falsely eaten. + */ + if ((ls != NULL && *ls != '/') || (ld != NULL && *ld != '/')) + s--, d--; while (*s != '/') s--, d--; From owner-svn-src-head@freebsd.org Thu Jan 31 10:44:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89C3F1356086; Thu, 31 Jan 2019 10:44:01 +0000 (UTC) (envelope-from avos@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 3078885EC3; Thu, 31 Jan 2019 10:44:01 +0000 (UTC) (envelope-from avos@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 22E5F6434; Thu, 31 Jan 2019 10:44:01 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VAi1EX005699; Thu, 31 Jan 2019 10:44:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VAi1Pg005698; Thu, 31 Jan 2019 10:44:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901311044.x0VAi1Pg005698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 31 Jan 2019 10:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343603 - head/sys/dev/ipw X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/ipw X-SVN-Commit-Revision: 343603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3078885EC3 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.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 10:44:01 -0000 Author: avos Date: Thu Jan 31 10:44:00 2019 New Revision: 343603 URL: https://svnweb.freebsd.org/changeset/base/343603 Log: ipw(4): reuse ieee80211_tx_complete function This should partially fix 'netstat -b -I wlan0' output MFC after: 1 week Modified: head/sys/dev/ipw/if_ipw.c Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Thu Jan 31 07:08:37 2019 (r343602) +++ head/sys/dev/ipw/if_ipw.c Thu Jan 31 10:44:00 2019 (r343603) @@ -1326,10 +1326,7 @@ ipw_release_sbd(struct ipw_softc *sc, struct ipw_soft_ bus_dmamap_unload(sc->txbuf_dmat, sbuf->map); SLIST_INSERT_HEAD(&sc->free_sbuf, sbuf, next); - if (sbuf->m->m_flags & M_TXCB) - ieee80211_process_callback(sbuf->ni, sbuf->m, 0/*XXX*/); - m_freem(sbuf->m); - ieee80211_free_node(sbuf->ni); + ieee80211_tx_complete(sbuf->ni, sbuf->m, 0/*XXX*/); sc->sc_tx_timer = 0; break; From owner-svn-src-head@freebsd.org Thu Jan 31 11:12:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2DCE135763E; Thu, 31 Jan 2019 11:12:35 +0000 (UTC) (envelope-from avos@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 B3AB3872E4; Thu, 31 Jan 2019 11:12:34 +0000 (UTC) (envelope-from avos@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 031E56952; Thu, 31 Jan 2019 11:12:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VBCVb5021686; Thu, 31 Jan 2019 11:12:31 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VBCVhC021685; Thu, 31 Jan 2019 11:12:31 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901311112.x0VBCVhC021685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 31 Jan 2019 11:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343604 - head/sys/dev/bwn X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/bwn X-SVN-Commit-Revision: 343604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3AB3872E4 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.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 11:12:36 -0000 Author: avos Date: Thu Jan 31 11:12:31 2019 New Revision: 343604 URL: https://svnweb.freebsd.org/changeset/base/343604 Log: bwn(4): reuse ieee80211_tx_complete function. MFC after: 1 week Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu Jan 31 10:44:00 2019 (r343603) +++ head/sys/dev/bwn/if_bwn.c Thu Jan 31 11:12:31 2019 (r343604) @@ -6211,20 +6211,15 @@ bwn_pio_handle_txeof(struct bwn_mac *mac, tq->tq_used -= roundup(tp->tp_m->m_pkthdr.len + BWN_HDRSIZE(mac), 4); tq->tq_free++; - /* XXX ieee80211_tx_complete()? */ if (tp->tp_ni != NULL) { /* * Do any tx complete callback. Note this must * be done before releasing the node reference. */ - bwn_ratectl_tx_complete(tp->tp_ni, status); - if (tp->tp_m->m_flags & M_TXCB) - ieee80211_process_callback(tp->tp_ni, tp->tp_m, 0); - ieee80211_free_node(tp->tp_ni); - tp->tp_ni = NULL; } - m_freem(tp->tp_m); + ieee80211_tx_complete(tp->tp_ni, tp->tp_m, 0); + tp->tp_ni = NULL; tp->tp_m = NULL; TAILQ_INSERT_TAIL(&tq->tq_pktlist, tp, tp_list); From owner-svn-src-head@freebsd.org Thu Jan 31 15:07:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71EEC14ACC09; Thu, 31 Jan 2019 15:07:33 +0000 (UTC) (envelope-from emaste@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 166F292AE5; Thu, 31 Jan 2019 15:07:33 +0000 (UTC) (envelope-from emaste@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 08205906F; Thu, 31 Jan 2019 15:07:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VF7WH9045434; Thu, 31 Jan 2019 15:07:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VF7WDn045433; Thu, 31 Jan 2019 15:07:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901311507.x0VF7WDn045433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Jan 2019 15:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343606 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 343606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 166F292AE5 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 15:07:33 -0000 Author: emaste Date: Thu Jan 31 15:07:32 2019 New Revision: 343606 URL: https://svnweb.freebsd.org/changeset/base/343606 Log: Enable lld as the system linker by default on i386 The migration to LLVM's lld linker has been in progress for quite some time - I opened an LLVM tracking bug (23214) in April 2015 to track issues using lld as FreeBSD's linker, and requested the first exp-run using lld as /usr/bin/ld in November 2016. In 12.0 LLD is the system linker on amd64, arm64, and armv7. i386 was not switched initially as there were additional ports failures not found on amd64. Those have largely been addressed now, although there are a small number of issues that are still being worked on. In some of these cases having lld as the system linker makes it easier for developers and third parties to investigate failures. Thanks to antoine@ for handling the exp-runs and to everyone in the FreeBSD and LLVM communites who have fixed issues with lld to get us to this point. PR: 214864 Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jan 31 11:36:28 2019 (r343605) +++ head/share/mk/src.opts.mk Thu Jan 31 15:07:32 2019 (r343606) @@ -321,11 +321,9 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" || \ + ${__T} == "i386" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD -.elif ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP -__DEFAULT_NO_OPTIONS+=LLD_IS_LD .else __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .endif From owner-svn-src-head@freebsd.org Thu Jan 31 15:44:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE96D14ADDE8; Thu, 31 Jan 2019 15:44:49 +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 8FEE0942DD; Thu, 31 Jan 2019 15:44:49 +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 8230D9720; Thu, 31 Jan 2019 15:44:49 +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 x0VFinjg066201; Thu, 31 Jan 2019 15:44:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VFinsv066200; Thu, 31 Jan 2019 15:44:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901311544.x0VFinsv066200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 31 Jan 2019 15:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343607 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 343607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8FEE0942DD 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 15:44:50 -0000 Author: kib Date: Thu Jan 31 15:44:49 2019 New Revision: 343607 URL: https://svnweb.freebsd.org/changeset/base/343607 Log: Reserve a bit in the FreeBSD feature control note for marking the image as not compatible with ASLR. Requested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D5603 Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Jan 31 15:07:32 2019 (r343606) +++ head/sys/sys/elf_common.h Thu Jan 31 15:44:49 2019 (r343607) @@ -762,6 +762,9 @@ typedef struct { #define NT_FREEBSD_ARCH_TAG 3 #define NT_FREEBSD_FEATURE_CTL 4 +/* NT_FREEBSD_FEATURE_CTL desc[0] bits */ +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 + /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ #define NT_FPREGSET 2 /* Floating point registers. */ From owner-svn-src-head@freebsd.org Thu Jan 31 15:50:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 290C914ADF45; Thu, 31 Jan 2019 15:50:12 +0000 (UTC) (envelope-from emaste@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 BF47394558; Thu, 31 Jan 2019 15:50:11 +0000 (UTC) (envelope-from emaste@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 B3F7C974A; Thu, 31 Jan 2019 15:50:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VFoBKF066479; Thu, 31 Jan 2019 15:50:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VFoBU9066478; Thu, 31 Jan 2019 15:50:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901311550.x0VFoBU9066478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Jan 2019 15:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343608 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 343608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF47394558 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 15:50:12 -0000 Author: emaste Date: Thu Jan 31 15:50:11 2019 New Revision: 343608 URL: https://svnweb.freebsd.org/changeset/base/343608 Log: regen src.conf.5 after r343606 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jan 31 15:44:49 2019 (r343607) +++ head/share/man/man5/src.conf.5 Thu Jan 31 15:50:11 2019 (r343608) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd December 15, 2018 +.Dd January 31, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -335,6 +335,8 @@ When set, it enforces these options: .It .Va WITHOUT_CTF .It +.Va WITHOUT_LOADER_ZFS +.It .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG @@ -1045,12 +1047,12 @@ amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on -amd64/amd64, arm/armv7 and arm64/aarch64. +amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. .It Va WITHOUT_LLVM_COV Set to not build the .Xr llvm-cov 1 @@ -1082,7 +1084,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_AARCH64 Set to build LLVM target support for AArch64. The @@ -1090,7 +1092,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLVM_TARGET_ALL Set to only build the required LLVM target support. This option is preferred to specific target support options. @@ -1156,7 +1158,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_MIPS Set to build LLVM target support for MIPS. The @@ -1164,7 +1166,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLVM_TARGET_POWERPC Set to not build LLVM target support for PowerPC. The @@ -1172,7 +1174,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_POWERPC Set to build LLVM target support for PowerPC. The @@ -1180,7 +1182,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLVM_TARGET_SPARC Set to not build LLVM target support for SPARC. The @@ -1188,7 +1190,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_SPARC Set to build LLVM target support for SPARC. The @@ -1196,7 +1198,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLVM_TARGET_X86 Set to not build LLVM target support for X86. The @@ -1204,7 +1206,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_X86 Set to build LLVM target support for X86. The @@ -1212,7 +1214,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader on x86. This option is a nop on all other platforms. @@ -1259,6 +1261,13 @@ Set to build ubldr. .Pp This is a default setting on arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITH_LOADER_VERBOSE +Set to build with extra verbose debugging in the loader. +May explode already nearly too large loader over the limit. +Use with care. + +.It Va WITHOUT_LOADER_ZFS +Set to not build ZFS file system boot loader support. .It Va WITHOUT_LOCALES Set to not build localization files; see .Xr locale 1 . @@ -1890,7 +1899,7 @@ without support for the IEEE 802.1X protocol and witho support for EAP-PEAP, EAP-TLS, EAP-LEAP, and EAP-TTLS protocols (usable only via 802.1X). .It Va WITHOUT_ZFS -Set to not build ZFS file system. +Set to not build ZFS file system kernel module, libraries, and user commands. .It Va WITHOUT_ZONEINFO Set to not build the timezone database. When set, it enforces these options: From owner-svn-src-head@freebsd.org Thu Jan 31 16:11:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B74214AEE5D; Thu, 31 Jan 2019 16:11:16 +0000 (UTC) (envelope-from emaste@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 BB1769528F; Thu, 31 Jan 2019 16:11:15 +0000 (UTC) (envelope-from emaste@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 AD3B69BF1; Thu, 31 Jan 2019 16:11:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VGBF7q078381; Thu, 31 Jan 2019 16:11:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VGBFdv078380; Thu, 31 Jan 2019 16:11:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901311611.x0VGBFdv078380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Jan 2019 16:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343609 - head/usr.bin/elfdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/elfdump X-SVN-Commit-Revision: 343609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB1769528F 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 16:11:16 -0000 Author: emaste Date: Thu Jan 31 16:11:15 2019 New Revision: 343609 URL: https://svnweb.freebsd.org/changeset/base/343609 Log: elfdump: whitespace fixup in advance of other changes Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Thu Jan 31 15:50:11 2019 (r343608) +++ head/usr.bin/elfdump/elfdump.c Thu Jan 31 16:11:15 2019 (r343609) @@ -320,7 +320,7 @@ static const char *p_flags[] = { /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */ static const char * sh_types(uint64_t machine, uint64_t sht) { - static char unknown_buf[64]; + static char unknown_buf[64]; if (sht < 0x60000000) { switch (sht) { @@ -1068,11 +1068,11 @@ elf_print_note(Elf32_Ehdr *e, void *sh) name = elf_get_word(e, sh, SH_NAME); n = (char *)e + offset; fprintf(out, "\nnote (%s):\n", shstrtab + name); - while (n < ((char *)e + offset + size)) { + while (n < ((char *)e + offset + size)) { namesz = elf_get_word(e, n, N_NAMESZ); descsz = elf_get_word(e, n, N_DESCSZ); - s = n + sizeof(Elf_Note); - desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0); + s = n + sizeof(Elf_Note); + desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0); fprintf(out, "\t%s %d\n", s, desc); n += sizeof(Elf_Note) + namesz + descsz; } From owner-svn-src-head@freebsd.org Thu Jan 31 16:19:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87CC214AF021; Thu, 31 Jan 2019 16:19:05 +0000 (UTC) (envelope-from emaste@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 88BA195767; Thu, 31 Jan 2019 16:19:04 +0000 (UTC) (envelope-from emaste@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 7D9119C6B; Thu, 31 Jan 2019 16:19:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VGJ4KU081912; Thu, 31 Jan 2019 16:19:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VGJ44S081911; Thu, 31 Jan 2019 16:19:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901311619.x0VGJ44S081911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Jan 2019 16:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343610 - head/usr.bin/elfdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/elfdump X-SVN-Commit-Revision: 343610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88BA195767 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 16:19:06 -0000 Author: emaste Date: Thu Jan 31 16:19:04 2019 New Revision: 343610 URL: https://svnweb.freebsd.org/changeset/base/343610 Log: elfdump: include note type names Based on a patch submitted by Dan McGregor. PR: 228290 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Thu Jan 31 16:11:15 2019 (r343609) +++ head/usr.bin/elfdump/elfdump.c Thu Jan 31 16:19:04 2019 (r343610) @@ -317,6 +317,11 @@ static const char *p_flags[] = { "PF_X|PF_W|PF_R" }; +static const char *nt_types[] = { + "", "NT_FREEBSD_ABI_TAG", "NT_FREEBSD_NOINIT_TAG", + "NT_FREEBSD_ARCH_TAG", "NT_FREEBSD_FEATURE_CTL" +}; + /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */ static const char * sh_types(uint64_t machine, uint64_t sht) { @@ -1071,9 +1076,14 @@ elf_print_note(Elf32_Ehdr *e, void *sh) while (n < ((char *)e + offset + size)) { namesz = elf_get_word(e, n, N_NAMESZ); descsz = elf_get_word(e, n, N_DESCSZ); + type = elf_get_word(e, n, N_TYPE); + if (type < nitems(nt_types)) + nt_type = nt_types[type]; + else + nt_type = "Unknown type"; s = n + sizeof(Elf_Note); desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0); - fprintf(out, "\t%s %d\n", s, desc); + fprintf(out, "\t%s %d (%s)\n", s, desc, nt_type); n += sizeof(Elf_Note) + namesz + descsz; } } From owner-svn-src-head@freebsd.org Thu Jan 31 16:21:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8760114AF0E1; Thu, 31 Jan 2019 16:21:10 +0000 (UTC) (envelope-from emaste@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 27CDF95987; Thu, 31 Jan 2019 16:21:10 +0000 (UTC) (envelope-from emaste@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 18AFC9DD2; Thu, 31 Jan 2019 16:21:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VGL9n2082068; Thu, 31 Jan 2019 16:21:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VGL931082067; Thu, 31 Jan 2019 16:21:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901311621.x0VGL931082067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Jan 2019 16:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343611 - head/usr.bin/elfdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/elfdump X-SVN-Commit-Revision: 343611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27CDF95987 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 16:21:10 -0000 Author: emaste Date: Thu Jan 31 16:21:09 2019 New Revision: 343611 URL: https://svnweb.freebsd.org/changeset/base/343611 Log: elfdump: fix build after r343610 One patch hunk did not survive the trip from git to svn. PR: 228290 MFC with: r343610 Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Thu Jan 31 16:19:04 2019 (r343610) +++ head/usr.bin/elfdump/elfdump.c Thu Jan 31 16:21:09 2019 (r343611) @@ -1066,7 +1066,9 @@ elf_print_note(Elf32_Ehdr *e, void *sh) u_int32_t namesz; u_int32_t descsz; u_int32_t desc; + u_int32_t type; char *n, *s; + const char *nt_type; offset = elf_get_off(e, sh, SH_OFFSET); size = elf_get_size(e, sh, SH_SIZE); From owner-svn-src-head@freebsd.org Thu Jan 31 16:49:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145FC14AFBEE; Thu, 31 Jan 2019 16:49:07 +0000 (UTC) (envelope-from emaste@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 AC663968E5; Thu, 31 Jan 2019 16:49:06 +0000 (UTC) (envelope-from emaste@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 994B6A1D8; Thu, 31 Jan 2019 16:49:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VGn6ct097600; Thu, 31 Jan 2019 16:49:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VGn6ht097599; Thu, 31 Jan 2019 16:49:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901311649.x0VGn6ht097599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Jan 2019 16:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343613 - head/usr.bin/elfdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/elfdump X-SVN-Commit-Revision: 343613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC663968E5 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 16:49:07 -0000 Author: emaste Date: Thu Jan 31 16:49:06 2019 New Revision: 343613 URL: https://svnweb.freebsd.org/changeset/base/343613 Log: elfdump: use designated array initialization for note types This ensures the note type name is in the correct slot. PR: 228290 Submitted by: kib MFC with: 343610 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Thu Jan 31 16:43:35 2019 (r343612) +++ head/usr.bin/elfdump/elfdump.c Thu Jan 31 16:49:06 2019 (r343613) @@ -317,9 +317,13 @@ static const char *p_flags[] = { "PF_X|PF_W|PF_R" }; +#define NT_ELEM(x) [x] = #x, static const char *nt_types[] = { - "", "NT_FREEBSD_ABI_TAG", "NT_FREEBSD_NOINIT_TAG", - "NT_FREEBSD_ARCH_TAG", "NT_FREEBSD_FEATURE_CTL" + "", + NT_ELEM(NT_FREEBSD_ABI_TAG) + NT_ELEM(NT_FREEBSD_NOINIT_TAG) + NT_ELEM(NT_FREEBSD_ARCH_TAG) + NT_ELEM(NT_FREEBSD_FEATURE_CTL) }; /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */ @@ -1079,7 +1083,7 @@ elf_print_note(Elf32_Ehdr *e, void *sh) namesz = elf_get_word(e, n, N_NAMESZ); descsz = elf_get_word(e, n, N_DESCSZ); type = elf_get_word(e, n, N_TYPE); - if (type < nitems(nt_types)) + if (type < nitems(nt_types) && nt_types[type] != NULL) nt_type = nt_types[type]; else nt_type = "Unknown type"; From owner-svn-src-head@freebsd.org Thu Jan 31 17:04:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC8CC14B0235; Thu, 31 Jan 2019 17:04:56 +0000 (UTC) (envelope-from emaste@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 62F739715B; Thu, 31 Jan 2019 17:04:56 +0000 (UTC) (envelope-from emaste@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 5433AA545; Thu, 31 Jan 2019 17:04:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VH4upb007690; Thu, 31 Jan 2019 17:04:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VH4uoF007689; Thu, 31 Jan 2019 17:04:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901311704.x0VH4uoF007689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Jan 2019 17:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343614 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 343614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62F739715B 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 17:04:57 -0000 Author: emaste Date: Thu Jan 31 17:04:55 2019 New Revision: 343614 URL: https://svnweb.freebsd.org/changeset/base/343614 Log: readelf: dump elf note data Output format is compatible with GNU readelf's handling of unknown note types (modulo a GNU char signedness bug); future changes will add type- specific decoding. Reviewed by: kib MFC after: 1 week Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Thu Jan 31 16:49:06 2019 (r343613) +++ head/contrib/elftoolchain/readelf/readelf.c Thu Jan 31 17:04:55 2019 (r343614) @@ -3567,6 +3567,7 @@ dump_notes_content(struct readelf *re, const char *buf { Elf_Note *note; const char *end, *name; + uint32_t i; printf("\nNotes at offset %#010jx with length %#010jx:\n", (uintmax_t) off, (uintmax_t) sz); @@ -3578,7 +3579,9 @@ dump_notes_content(struct readelf *re, const char *buf return; } note = (Elf_Note *)(uintptr_t) buf; - name = (char *)(uintptr_t)(note + 1); + buf += sizeof(Elf_Note); + name = buf; + buf += roundup2(note->n_namesz, 4); /* * The name field is required to be nul-terminated, and * n_namesz includes the terminating nul in observed @@ -3596,8 +3599,11 @@ dump_notes_content(struct readelf *re, const char *buf printf(" %-13s %#010jx", name, (uintmax_t) note->n_descsz); printf(" %s\n", note_type(name, re->ehdr.e_type, note->n_type)); - buf += sizeof(Elf_Note) + roundup2(note->n_namesz, 4) + - roundup2(note->n_descsz, 4); + printf(" description data:"); + for (i = 0; i < note->n_descsz; i++) + printf(" %02x", (unsigned char)buf[i]); + printf("\n"); + buf += roundup2(note->n_descsz, 4); } } From owner-svn-src-head@freebsd.org Thu Jan 31 17:52:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31CE714B1A67; Thu, 31 Jan 2019 17:52:49 +0000 (UTC) (envelope-from glebius@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 CBDBC6A85D; Thu, 31 Jan 2019 17:52:48 +0000 (UTC) (envelope-from glebius@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 B648FAE25; Thu, 31 Jan 2019 17:52:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VHqm7n034577; Thu, 31 Jan 2019 17:52:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VHqmmq034576; Thu, 31 Jan 2019 17:52:48 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901311752.x0VHqmmq034576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 31 Jan 2019 17:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343616 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBDBC6A85D 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 17:52:49 -0000 Author: glebius Date: Thu Jan 31 17:52:48 2019 New Revision: 343616 URL: https://svnweb.freebsd.org/changeset/base/343616 Log: In zone_alloc_bucket() max argument was calculated based on uz_count. Then bucket_alloc() also selects bucket size based on uz_count. However, since zone lock is dropped, uz_count may reduce. In this case max may be greater than ub_entries and that would yield into writing beyond end of the allocation. Reported by: pho Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 31 17:06:59 2019 (r343615) +++ head/sys/vm/uma_core.c Thu Jan 31 17:52:48 2019 (r343616) @@ -2844,7 +2844,7 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do return (NULL); bucket->ub_cnt = zone->uz_import(zone->uz_arg, bucket->ub_bucket, - max, domain, flags); + MIN(max, bucket->ub_entries), domain, flags); /* * Initialize the memory if necessary. From owner-svn-src-head@freebsd.org Thu Jan 31 18:28:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FDDD14B2E98 for ; Thu, 31 Jan 2019 18:28:09 +0000 (UTC) (envelope-from strongmar66@gmail.com) Received: from mail-vs1-xe29.google.com (mail-vs1-xe29.google.com [IPv6:2607:f8b0:4864:20::e29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D16866C357 for ; Thu, 31 Jan 2019 18:28:08 +0000 (UTC) (envelope-from strongmar66@gmail.com) Received: by mail-vs1-xe29.google.com with SMTP id u11so2538543vsp.11 for ; Thu, 31 Jan 2019 10:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Ru4CcXpXUD23xIqc1a2ck3py5FNsZ57PHydgKH05EXw=; b=KgC+KfC+4AQ12eshQ0iWDTa3dDtpXNjSxtPbxdqtDk3GeHA91qy+dOlIZuaNL76saS c+YZcFfypbZBukc9EIz0poO5vtwfVwLbNJvBqXStHNg8afeXn7Mz/IGpzG4dtP3jRGUO Sw/hkRye3PYraVycMZeAob6BaPBnxlPwgXor+4SwMvJjhf+20QrjeD4CUhQl+LneOtYP qCLPWffa6+kjIy6rhY2rbQgq4Enp08iNlA5EPC058V2om91y8FYHVm5F8aOaPFDg36Xo FzE5IUkd8u8ZX/O67KzbZi4C416jTQaMh1cMiLl23Izz+PhCqUsAnkdguOXZTKEfK4nX +law== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ru4CcXpXUD23xIqc1a2ck3py5FNsZ57PHydgKH05EXw=; b=B1miZZYP74v49hyl3pNA7HBF+jabPoLdla11cOuFjke5nZDprUFIwKiENz8J4q4XP4 /31ZHQu0DrkxALXlzbuSOG58e2D9XzEDwmd0NoUPmVXEOBtF4o2jTfyHWnEDyM9ETCj2 JiCY5s7ZV/1YAg6Y4mAmUyVcVLOJ9C1EucUD9FL9U5b3osb2BR0k1LkB8JN3a+IjGQZ9 EuLoDWwNB8pRfxw5KXC+a+luIO9pEjPrWke+9WNfaSd9crEhwO5JQggGRbYTABheN/TT 2G6BKoTCdGpamN1U9R6r1d1aZwvV+BafKUTW3kq5+OuNrnrsCBf2t+S3o2jztH9ww7nJ YuWQ== X-Gm-Message-State: AJcUukdE5/IItWgQ4RavT4MXSmROpqSWikqpKoV1gPegO4yCIfmMJ5Vh 8ky79Rj/a1eHd5yEhe1bndk2bWqSm2dS9ajaNaUnHD21 X-Google-Smtp-Source: ALg8bN6qLIUBBaQrNPWml3vkNhW9AB57Y8MQRmfmN58HJVTEWSBX2FVS4N5y3QkNUoHG+4faciGdmRMWae+2tSQpsUI= X-Received: by 2002:a67:4146:: with SMTP id o67mr15852590vsa.56.1548959287891; Thu, 31 Jan 2019 10:28:07 -0800 (PST) MIME-Version: 1.0 From: Strong Mard Date: Thu, 31 Jan 2019 21:57:56 +0330 Message-ID: Subject: Support me To: svn-src-head@freebsd.org X-Rspamd-Queue-Id: D16866C357 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=KgC+KfC+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of strongmar66@gmail.com designates 2607:f8b0:4864:20::e29 as permitted sender) smtp.mailfrom=strongmar66@gmail.com X-Spamd-Result: default: False [-6.55 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[9.2.e.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.88)[ip: (-9.80), ipnet: 2607:f8b0::/32(-2.55), asn: 15169(-1.97), country: US(-0.07)]; NEURAL_HAM_SHORT(-0.66)[-0.662,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 18:28:09 -0000 Hi please support and help me From owner-svn-src-head@freebsd.org Thu Jan 31 19:06:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 703F714B49EA; Thu, 31 Jan 2019 19:06:01 +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 F2B716D5E7; Thu, 31 Jan 2019 19:06:00 +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 E2DB9BAC0; Thu, 31 Jan 2019 19:06:00 +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 x0VJ60fu072134; Thu, 31 Jan 2019 19:06:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VJ5ugd072107; Thu, 31 Jan 2019 19:05:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901311905.x0VJ5ugd072107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 31 Jan 2019 19:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343617 - in head: . share/man/man4 sys/amd64/conf sys/arm64/conf sys/conf sys/dev/ixgbe sys/i386/conf sys/mips/conf sys/modules sys/modules/iflib sys/powerpc/conf sys/powerpc/conf/dpaa... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/arm64/conf sys/conf sys/dev/ixgbe sys/i386/conf sys/mips/conf sys/modules sys/modules/iflib sys/powerpc/conf sys/powerpc/conf/dpaa sys/sparc64/conf X-SVN-Commit-Revision: 343617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2B716D5E7 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.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 19:06:01 -0000 Author: kib Date: Thu Jan 31 19:05:56 2019 New Revision: 343617 URL: https://svnweb.freebsd.org/changeset/base/343617 Log: Make iflib a loadable module. iflib is already a module, but it is unconditionally compiled into the kernel. There are drivers which do not need iflib(4), and there are situations where somebody might not want iflib in kernel because of using the corresponding driver as module. Reviewed by: marius Discussed with: erj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19041 Added: head/sys/modules/iflib/ head/sys/modules/iflib/Makefile (contents, props changed) Modified: head/UPDATING head/share/man/man4/bnxt.4 head/share/man/man4/em.4 head/share/man/man4/iavf.4 head/share/man/man4/ixgbe.4 head/share/man/man4/ixl.4 head/share/man/man4/vmx.4 head/sys/amd64/conf/GENERIC head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/dev/ixgbe/if_ixv.c head/sys/i386/conf/GENERIC head/sys/mips/conf/OCTEON1 head/sys/mips/conf/std.XLP head/sys/modules/Makefile head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE head/sys/powerpc/conf/QORIQ64 head/sys/powerpc/conf/dpaa/DPAA head/sys/sparc64/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jan 31 17:52:48 2019 (r343616) +++ head/UPDATING Thu Jan 31 19:05:56 2019 (r343617) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190131: + Iflib is no longer unconditionally compiled into the kernel. Drivers + using iflib and statically compiled into the kernel, now require + the 'device iflib' config option. For the same drivers loaded as + modules on kernels not having 'device iflib', the iflib.ko module + is loaded automatically. + 20181230: r342635 changes the way efibootmgr(8) works by requiring users to add the -b (bootnum) parameter for commands where the bootnum was previously Modified: head/share/man/man4/bnxt.4 ============================================================================== --- head/share/man/man4/bnxt.4 Thu Jan 31 17:52:48 2019 (r343616) +++ head/share/man/man4/bnxt.4 Thu Jan 31 19:05:56 2019 (r343617) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2018 +.Dd January 30, 2019 .Dt BNXT 4 .Os .Sh NAME @@ -36,6 +36,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device iflib" .Cd "device bnxt" .Ed .Pp Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Thu Jan 31 17:52:48 2019 (r343616) +++ head/share/man/man4/em.4 Thu Jan 31 19:05:56 2019 (r343617) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2018 +.Dd January 30, 2019 .Dt EM 4 .Os .Sh NAME @@ -39,9 +39,10 @@ .Nd "Intel(R) PRO/1000 Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, -place the following line in your +place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device iflib" .Cd "device em" .Ed .Pp Modified: head/share/man/man4/iavf.4 ============================================================================== --- head/share/man/man4/iavf.4 Thu Jan 31 17:52:48 2019 (r343616) +++ head/share/man/man4/iavf.4 Thu Jan 31 19:05:56 2019 (r343617) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2018 +.Dd January 30, 2019 .Dt IAVF 4 .Os .Sh NAME @@ -41,6 +41,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device iflib" .Cd "device iavf" .Ed .Pp Modified: head/share/man/man4/ixgbe.4 ============================================================================== --- head/share/man/man4/ixgbe.4 Thu Jan 31 17:52:48 2019 (r343616) +++ head/share/man/man4/ixgbe.4 Thu Jan 31 19:05:56 2019 (r343617) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd January 30, 2019 .Dt IXGBE 4 .Os .Sh NAME @@ -39,9 +39,10 @@ .Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system" .Sh SYNOPSIS To compile this driver into the kernel, -place the following line in your +place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device iflib" .Cd "device ixgbe" .Ed .Pp Modified: head/share/man/man4/ixl.4 ============================================================================== --- head/share/man/man4/ixl.4 Thu Jan 31 17:52:48 2019 (r343616) +++ head/share/man/man4/ixl.4 Thu Jan 31 19:05:56 2019 (r343617) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2018 +.Dd January 30, 2019 .Dt IXL 4 .Os .Sh NAME @@ -41,6 +41,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device iflib" .Cd "device ixl" .Ed .Pp Modified: head/share/man/man4/vmx.4 ============================================================================== --- head/share/man/man4/vmx.4 Thu Jan 31 17:52:48 2019 (r343616) +++ head/share/man/man4/vmx.4 Thu Jan 31 19:05:56 2019 (r343617) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 17, 2014 +.Dd January 30, 2019 .Dt VMX 4 .Os .Sh NAME @@ -25,9 +25,10 @@ .Nd VMware VMXNET3 Virtual Interface Controller device .Sh SYNOPSIS To compile this driver into the kernel, -place the following line in your +place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device iflib" .Cd "device vmx" .Ed .Pp Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/amd64/conf/GENERIC Thu Jan 31 19:05:56 2019 (r343617) @@ -234,14 +234,18 @@ device ppi # Parallel port interface device device puc # Multi I/O cards and multi-channel UARTs -# PCI Ethernet NICs. -device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device de # DEC/Intel DC21x4x (``Tulip'') +# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure +device iflib device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel PRO/10GbE PCIE PF Ethernet device ixv # Intel PRO/10GbE PCIE VF Ethernet device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function +device vmx # VMware VMXNET3 Ethernet + +# PCI Ethernet NICs. +device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE +device de # DEC/Intel DC21x4x (``Tulip'') device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') @@ -368,9 +372,6 @@ device hyperv # HyperV drivers # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver - -# VMware support -device vmx # VMware VMXNET3 Ethernet # Netmap provides direct access to TX/RX rings on supported NICs device netmap # netmap(4) support Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/arm64/conf/GENERIC Thu Jan 31 19:05:56 2019 (r343617) @@ -145,14 +145,17 @@ device al_pci # Annapurna Alpine PCI-E options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support +# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure +device iflib +device em # Intel PRO/1000 Gigabit Ethernet Family +device ix # Intel 10Gb Ethernet Family + # Ethernet NICs device mdio device mii device miibus # MII bus support device awg # Allwinner EMAC Gigabit Ethernet device axgbe # AMD Opteron A1100 integrated NIC -device em # Intel PRO/1000 Gigabit Ethernet Family -device ix # Intel 10Gb Ethernet Family device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device neta # Marvell Armada 370/38x/XP/3700 NIC device smc # SMSC LAN91C111 Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/conf/NOTES Thu Jan 31 19:05:56 2019 (r343617) @@ -2092,15 +2092,18 @@ device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure +device iflib +device em # Intel Pro/1000 Gigabit Ethernet +device ix # Intel Pro/10Gbe PCIE Ethernet +device ixv # Intel Pro/10Gbe PCIE Ethernet VF + # PCI Ethernet NICs. device cxgb # Chelsio T3 10 Gigabit Ethernet device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware device cxgbe # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet device cxgbev # Chelsio T4-T6 Virtual Functions device de # DEC/Intel DC21x4x (``Tulip'') -device em # Intel Pro/1000 Gigabit Ethernet -device ix # Intel Pro/10Gbe PCIE Ethernet -device ixv # Intel Pro/10Gbe PCIE Ethernet VF device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device oce # Emulex 10 GbE (OneConnect Ethernet) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/conf/files Thu Jan 31 19:05:56 2019 (r343617) @@ -4132,10 +4132,10 @@ net/if_tun.c optional tun net/if_tap.c optional tap net/if_vlan.c optional vlan net/if_vxlan.c optional vxlan inet | vxlan inet6 -net/ifdi_if.m optional ether pci -net/iflib.c optional ether pci -net/iflib_clone.c optional ether pci -net/mp_ring.c optional ether +net/ifdi_if.m optional ether pci iflib +net/iflib.c optional ether pci iflib +net/iflib_clone.c optional ether pci iflib +net/mp_ring.c optional ether iflib net/mppcc.c optional netgraph_mppc_compression net/mppcd.c optional netgraph_mppc_compression net/netisr.c standard Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/dev/ixgbe/if_ixv.c Thu Jan 31 19:05:56 2019 (r343617) @@ -144,11 +144,9 @@ static driver_t ixv_driver = { devclass_t ixv_devclass; DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0); IFLIB_PNP_INFO(pci, ixv_driver, ixv_vendor_info_array); +MODULE_DEPEND(ixv, iflib, 1, 1, 1); MODULE_DEPEND(ixv, pci, 1, 1, 1); MODULE_DEPEND(ixv, ether, 1, 1, 1); -#ifdef DEV_NETMAP -MODULE_DEPEND(ixv, netmap, 1, 1, 1); -#endif /* DEV_NETMAP */ static device_method_t ixv_if_methods[] = { DEVMETHOD(ifdi_attach_pre, ixv_if_attach_pre), Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/i386/conf/GENERIC Thu Jan 31 19:05:56 2019 (r343617) @@ -220,10 +220,14 @@ device ppi # Parallel port interface device device puc # Multi I/O cards and multi-channel UARTs +# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure +device iflib +device em # Intel PRO/1000 Gigabit Ethernet Family +device vmx # VMware VMXNET3 Ethernet + # PCI Ethernet NICs. device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device de # DEC/Intel DC21x4x (``Tulip'') -device em # Intel PRO/1000 Gigabit Ethernet Family device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') @@ -361,9 +365,6 @@ device hyperv # HyperV drivers # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver - -# VMware support -device vmx # VMware VMXNET3 Ethernet # evdev interface options EVDEV_SUPPORT # evdev support in legacy drivers Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/mips/conf/OCTEON1 Thu Jan 31 19:05:56 2019 (r343617) @@ -155,6 +155,8 @@ device octm # physical port, but may eventually provide support for DSA or similar instead. #device mv88e61xxphy # Marvell 88E61XX +device iflib + # PCI Ethernet NICs. device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel PRO/10GbE PF PCIE Ethernet Family Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/mips/conf/std.XLP Thu Jan 31 19:05:56 2019 (r343617) @@ -75,6 +75,7 @@ device ether device xlpge #device re device msk +device iflib device em # Disks Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/modules/Makefile Thu Jan 31 19:05:56 2019 (r343617) @@ -169,6 +169,7 @@ SUBDIR= \ if_tun \ if_vlan \ if_vxlan \ + iflib \ ${_iir} \ imgact_binmisc \ ${_intelspi} \ Added: head/sys/modules/iflib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/iflib/Makefile Thu Jan 31 19:05:56 2019 (r343617) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/net + +KMOD= iflib +SRCS= \ + iflib.c \ + iflib_clone.c \ + mp_ring.c +SRCS+= ifdi_if.c +SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h + +.include Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/powerpc/conf/GENERIC64 Thu Jan 31 19:05:56 2019 (r343617) @@ -159,6 +159,8 @@ device scc device uart device uart_z8530 +device iflib + # Ethernet hardware device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel PRO/10GbE PCIE PF Ethernet Family Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/powerpc/conf/MPC85XX Thu Jan 31 19:05:56 2019 (r343617) @@ -74,6 +74,7 @@ device cryptodev device da device ds1307 device ds1553 +device iflib device em device alc device ether Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/powerpc/conf/MPC85XXSPE Thu Jan 31 19:05:56 2019 (r343617) @@ -74,6 +74,7 @@ device cryptodev device da device ds1307 device ds1553 +device iflib device em device alc device ether Modified: head/sys/powerpc/conf/QORIQ64 ============================================================================== --- head/sys/powerpc/conf/QORIQ64 Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/powerpc/conf/QORIQ64 Thu Jan 31 19:05:56 2019 (r343617) @@ -81,6 +81,7 @@ device cryptodev device da device ds1307 device ds1553 +device iflib device em device alc device dpaa Modified: head/sys/powerpc/conf/dpaa/DPAA ============================================================================== --- head/sys/powerpc/conf/dpaa/DPAA Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/powerpc/conf/dpaa/DPAA Thu Jan 31 19:05:56 2019 (r343617) @@ -74,6 +74,7 @@ device sdhci # Network devices device miibus # MII bus support +device iflib device em Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu Jan 31 17:52:48 2019 (r343616) +++ head/sys/sparc64/conf/GENERIC Thu Jan 31 19:05:56 2019 (r343617) @@ -181,6 +181,8 @@ device uart # Multi-uart driver #device ppi # Parallel port interface device #device vpo # Requires scbus and da +device iflib + # PCI Ethernet NICs. #device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 adapter Gigabit Ethernet Card From owner-svn-src-head@freebsd.org Thu Jan 31 20:04:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 974F914B63D7; Thu, 31 Jan 2019 20:04:19 +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 3B0F06F77F; Thu, 31 Jan 2019 20:04:19 +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 2B94CC6BF; Thu, 31 Jan 2019 20:04:19 +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 x0VK4IHX003317; Thu, 31 Jan 2019 20:04:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VK4Inb003316; Thu, 31 Jan 2019 20:04:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901312004.x0VK4Inb003316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 31 Jan 2019 20:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343618 - head/sys/modules/iflib X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/modules/iflib X-SVN-Commit-Revision: 343618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B0F06F77F 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.998,0]; NEURAL_HAM_LONG(-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] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 20:04:19 -0000 Author: kib Date: Thu Jan 31 20:04:18 2019 New Revision: 343618 URL: https://svnweb.freebsd.org/changeset/base/343618 Log: Make iflib a loadable module: add seemingly missed header. Reported by: CI (i.e. it is not reproducable in my local builds) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/modules/iflib/Makefile Modified: head/sys/modules/iflib/Makefile ============================================================================== --- head/sys/modules/iflib/Makefile Thu Jan 31 19:05:56 2019 (r343617) +++ head/sys/modules/iflib/Makefile Thu Jan 31 20:04:18 2019 (r343618) @@ -8,6 +8,6 @@ SRCS= \ iflib_clone.c \ mp_ring.c SRCS+= ifdi_if.c -SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h +SRCS+= device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h .include From owner-svn-src-head@freebsd.org Thu Jan 31 20:16:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D42A14B66F5 for ; Thu, 31 Jan 2019 20:16:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2AB56FD96 for ; Thu, 31 Jan 2019 20:16:43 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548964830; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=GDd9eKqMqyHCZoVCx65OSdhUKXLBMFsAToKvIZpmViJ2yD199mfsFwn0uHiwz0Frxqd4NtJyraHAW tbwakdp/420JeebeoYI6jgYjlcT5b7MaZqwC1HsI8s1ou5pQGRV/jIdqNdr0KskpJvLiDRyU/jpBQ0 qIqna/qbjHqZFSlIXWE7j+mtP9Vp1WVaLkvexIhB8HT1mUTzLL4e2d460RLdyOfDXHkSmmRMg0Xauf vApiJY9W1aqZ4hSZb1jOGq+jigoeGnHt5et4T0WdaTkA8t9DykXAtnHxNsIpj544FqPUA2R2VOaPhj HAJ66681wpYEjCqU5AE1Lb10Q5lL3rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=bG4fm4ipxwAw9aGhRuaR1AFjYUpoC7dNmteB4/aOXr4=; b=XdLbKWUBDSoceC2WahfOIeWJpjV5ARnNmdavUCU1bRDiFE2UdvFekibaWAcwi4DCWF/PApQvT66Sm 01+M5BbvV4WX8W1NcrYRUPKUoa5lq0xSLgcNsy1Gk8yPLclOcTX6r6EBP3MeXoLdLQXBiKnSsH0yoC ruDOTRtjmUM31lj3BvAscJdCS6IsrS4XEOytLx1lYIxsem60i6tW27ORw47KURYVZvLSzK90BHgwff /bQHVjYMm4JsVFlmclsdsAKrLj6f5XrzHrqV0nGMFDu2Biq79LimLTufqxjIXYF6hEYw18Dl7djejb 6EgLQFfLyEoaMFzV86X7iT5Voa5WWPA== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=bG4fm4ipxwAw9aGhRuaR1AFjYUpoC7dNmteB4/aOXr4=; b=g5QUyvqxbdg4KYqWNCcV3R8SrnUSz6sx3WdTsnlxfzKTdXebPEqhWemAU63mQmu+qnIiIXoq70xeI IHpC++XKMbK4UMWvjr104oD1D5mwQ4IsdU69ttln6stOv9g7ve3x54bDasZPUxT8X9q4FTO89b0Knm mHwCNbKB2rtZJWiisMT4lYY1DctDYR20/L/4Di3J2rqKsMCYd+bn2aFwjKAqXhDuF8ZKtkLaw3E4hQ ysrr306KRbbE1gJEozs2LX4I93zM9nXLoQfg65ARYRQXh2pBA2vbKKr5lyaLSRLEyhx5TBppYnZJ7x 50VDVdLHqq7XODd2BzsNWEZO98O59iA== X-MHO-RoutePath: aGlwcGll X-MHO-User: dab42310-2592-11e9-803b-31925da7267c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id dab42310-2592-11e9-803b-31925da7267c; Thu, 31 Jan 2019 20:00:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0VK0RiA022585; Thu, 31 Jan 2019 13:00:27 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r343617 - in head: . share/man/man4 sys/amd64/conf sys/arm64/conf sys/conf sys/dev/ixgbe sys/i386/conf sys/mips/conf sys/modules sys/modules/iflib sys/powerpc/conf sys/powerpc/conf/dpaa... From: Ian Lepore To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 31 Jan 2019 13:00:27 -0700 In-Reply-To: <201901311905.x0VJ5ugd072107@repo.freebsd.org> References: <201901311905.x0VJ5ugd072107@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: B2AB56FD96 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.995,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 20:16:44 -0000 On Thu, 2019-01-31 at 19:05 +0000, Konstantin Belousov wrote: > +SRCS+= ifdi_if.c > +SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h ifdi_if.h appears twice. -- Ian From owner-svn-src-head@freebsd.org Thu Jan 31 20:22:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C7C14B69C2 for ; Thu, 31 Jan 2019 20:22:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788F6703BA for ; Thu, 31 Jan 2019 20:22:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548966161; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=PAkDY+gklvxFNyo61cRralu8hzin9zEVz3nEuqY3kqOCJ1tfUjOzwlXcwlFisQQWVwNM4JoklV2aO 2QPb1eJjN/2lCDIeaUDL4NipyqoSwqYwnq1brAbj/TBG/AFvVJPAX3wZhNjBbrHRAgJ4oXqIqGqbls 3R/J1Y6CJwwJi/PWAz5ZxP1yeYsFYmR/i49pGDwzggWZ6zsTiwCVn6kSamiun0fLn4a7xKLi97SvE4 YQ6jIU8Ccc/m/xWs74EkHPjf0cNe6l0/aUNhFn+oS2RzF7wG3DJCH6zFoz0Bju9G8ytBlVqJZku0zA PFN2JFBF9xSWXjI1qGZWp2pQl0a483Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=z5R099+Ffp74c1+RaHGTY+UyeSXqAdbJer4KPSJYOUA=; b=hIgy1tJeufk3INIemSkH+jj8h3wTQb4jXSgwVbE6xUJalFU3SXjHTsjw6+HYBdX8zOOVuzu8mThSF IStiOfhRk+o1RxBedSFCYbAFnr8b3A90Bywn2CGq/KY4wH0BmljmBmi+3gi4OJ/JAM4I12OuEsCTvJ uc8LBes8JLTe+iLeCuk2xpK5B3VOJLs8c3gKGMjG7cNSyC0FcLd3XR0rC/AioWi7iogdtf37R+sndY /RRiesuJyEp4VRhVF136zpnSXYmtml8QE/Wf5Ns3RQCp4zlfLYzaiXxo8eit9KcSG0ubuwHsmYemby mHC8qFJ0tft/XgPkUkA5ZgtCRY6N6yA== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=z5R099+Ffp74c1+RaHGTY+UyeSXqAdbJer4KPSJYOUA=; b=BsstfxpOe3KatfmVuKxakYi91GLZMJ70Dg9jr1JNHDf4ed4HD9W4QT/4ESqLRupflAI33N+yCEYSG tHWZnfdUXIOdYCSSpaxn71jMJiSbmujX9lX5Vu1I1TZFDt9vlv9nPr6xM9puje7x2dJOyAwy4QsvLr CofmqpqSqoZa0rgT3vPli6sH1wPrtBvcWKu9xmFrb4O5IzCaMcqVl+uRYjW78WRwdajuE4JA1/8QE9 5gt2mD5sHfNn06k8xlswkzj2IKGPNEZwyK5ZatZY1BdixNhZaKonoyKTcH5xz7bait9C9V1HYmoWkp EHUzVyRsg3I7+JyJgNvjsZtc5/OpemQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: f39f1185-2595-11e9-803b-31925da7267c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id f39f1185-2595-11e9-803b-31925da7267c; Thu, 31 Jan 2019 20:22:39 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0VKMbei022642; Thu, 31 Jan 2019 13:22:37 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <4ff98976802eeff424f514c088e1cd75a95aff65.camel@freebsd.org> Subject: Re: svn commit: r343617 - in head: . share/man/man4 sys/amd64/conf sys/arm64/conf sys/conf sys/dev/ixgbe sys/i386/conf sys/mips/conf sys/modules sys/modules/iflib sys/powerpc/conf sys/powerpc/conf/dpaa... From: Ian Lepore To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 31 Jan 2019 13:22:37 -0700 In-Reply-To: References: <201901311905.x0VJ5ugd072107@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 788F6703BA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 20:22:45 -0000 On Thu, 2019-01-31 at 13:00 -0700, Ian Lepore wrote: > On Thu, 2019-01-31 at 19:05 +0000, Konstantin Belousov wrote: > > +SRCS+= ifdi_if.c > > +SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h > > ifdi_if.h appears twice. > Oops, nevermind. Right after sending that, I realized one is a .c and the other a .h. -- Ian From owner-svn-src-head@freebsd.org Thu Jan 31 21:04:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AE7814B7BC4; Thu, 31 Jan 2019 21:04:53 +0000 (UTC) (envelope-from glebius@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 E2D0671B6B; Thu, 31 Jan 2019 21:04:52 +0000 (UTC) (envelope-from glebius@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 D8AE9D167; Thu, 31 Jan 2019 21:04:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VL4qKA034658; Thu, 31 Jan 2019 21:04:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VL4ob6034648; Thu, 31 Jan 2019 21:04:50 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901312104.x0VL4ob6034648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 31 Jan 2019 21:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343619 - in head/sys: net netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: net netpfil/ipfw X-SVN-Commit-Revision: 343619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2D0671B6B 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 21:04:53 -0000 Author: glebius Date: Thu Jan 31 21:04:50 2019 New Revision: 343619 URL: https://svnweb.freebsd.org/changeset/base/343619 Log: Revert r316461: Remove "IPFW static rules" rmlock, and use pfil's global lock. The pfil(9) system is about to be converted to epoch(9) synchronization, so we need [temporarily] go back with ipfw internal locking. Discussed with: ae Modified: head/sys/net/pfil.c head/sys/net/pfil.h head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_iface.c head/sys/netpfil/ipfw/ip_fw_nat.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/netpfil/ipfw/ip_fw_table.c head/sys/netpfil/ipfw/ip_fw_table_value.c Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/net/pfil.c Thu Jan 31 21:04:50 2019 (r343619) @@ -64,6 +64,7 @@ LIST_HEAD(pfilheadhead, pfil_head); VNET_DEFINE(struct pfilheadhead, pfil_head_list); #define V_pfil_head_list VNET(pfil_head_list) VNET_DEFINE(struct rmlock, pfil_lock); +#define V_pfil_lock VNET(pfil_lock) #define PFIL_LOCK_INIT_REAL(l, t) \ rm_init_flags(l, "PFil " t " rmlock", RM_RECURSE) Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/net/pfil.h Thu Jan 31 21:04:50 2019 (r343619) @@ -40,7 +40,6 @@ #include #include #include -#include struct mbuf; struct ifnet; @@ -100,9 +99,6 @@ struct pfil_head { #define ph_ifnet ph_un.phu_ptr LIST_ENTRY(pfil_head) ph_list; }; - -VNET_DECLARE(struct rmlock, pfil_lock); -#define V_pfil_lock VNET(pfil_lock) /* Public functions for pfil hook management by packet filters. */ struct pfil_head *pfil_head_get(int, u_long); Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw2.c Thu Jan 31 21:04:50 2019 (r343619) @@ -1404,6 +1404,7 @@ ipfw_chk(struct ip_fw_args *args) int is_ipv4 = 0; int done = 0; /* flag to exit the outer loop */ + IPFW_RLOCK_TRACKER; if (m->m_flags & M_SKIP_FIREWALL || (! V_ipfw_vnet_ready)) return (IP_FW_PASS); /* accept */ Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Jan 31 21:04:50 2019 (r343619) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/netpfil/ipfw/ip_fw_iface.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_iface.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw_iface.c Thu Jan 31 21:04:50 2019 (r343619) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_nat.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw_nat.c Thu Jan 31 21:04:50 2019 (r343619) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw_private.h Thu Jan 31 21:04:50 2019 (r343619) @@ -312,6 +312,8 @@ struct ip_fw_chain { void **srvstate; /* runtime service mappings */ #if defined( __linux__ ) || defined( _WIN32 ) spinlock_t rwmtx; +#else + struct rmlock rwmtx; #endif int static_len; /* total len of static rules (v0) */ uint32_t gencnt; /* NAT generation count */ @@ -452,23 +454,25 @@ struct ipfw_ifc { #define IPFW_PF_RUNLOCK(p) IPFW_RUNLOCK(p) #else /* FreeBSD */ #define IPFW_LOCK_INIT(_chain) do { \ + rm_init_flags(&(_chain)->rwmtx, "IPFW static rules", RM_RECURSE); \ rw_init(&(_chain)->uh_lock, "IPFW UH lock"); \ } while (0) #define IPFW_LOCK_DESTROY(_chain) do { \ + rm_destroy(&(_chain)->rwmtx); \ rw_destroy(&(_chain)->uh_lock); \ } while (0) -#define IPFW_RLOCK_ASSERT(_chain) rm_assert(&V_pfil_lock, RA_RLOCKED) -#define IPFW_WLOCK_ASSERT(_chain) rm_assert(&V_pfil_lock, RA_WLOCKED) +#define IPFW_RLOCK_ASSERT(_chain) rm_assert(&(_chain)->rwmtx, RA_RLOCKED) +#define IPFW_WLOCK_ASSERT(_chain) rm_assert(&(_chain)->rwmtx, RA_WLOCKED) #define IPFW_RLOCK_TRACKER struct rm_priotracker _tracker -#define IPFW_RLOCK(p) rm_rlock(&V_pfil_lock, &_tracker) -#define IPFW_RUNLOCK(p) rm_runlock(&V_pfil_lock, &_tracker) -#define IPFW_WLOCK(p) rm_wlock(&V_pfil_lock) -#define IPFW_WUNLOCK(p) rm_wunlock(&V_pfil_lock) -#define IPFW_PF_RLOCK(p) -#define IPFW_PF_RUNLOCK(p) +#define IPFW_RLOCK(p) rm_rlock(&(p)->rwmtx, &_tracker) +#define IPFW_RUNLOCK(p) rm_runlock(&(p)->rwmtx, &_tracker) +#define IPFW_WLOCK(p) rm_wlock(&(p)->rwmtx) +#define IPFW_WUNLOCK(p) rm_wunlock(&(p)->rwmtx) +#define IPFW_PF_RLOCK(p) IPFW_RLOCK(p) +#define IPFW_PF_RUNLOCK(p) IPFW_RUNLOCK(p) #endif #define IPFW_UH_RLOCK_ASSERT(_chain) rw_assert(&(_chain)->uh_lock, RA_RLOCKED) Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Jan 31 21:04:50 2019 (r343619) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw_table.c Thu Jan 31 21:04:50 2019 (r343619) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include /* ip_fw.h requires IFNAMSIZ */ -#include #include #include /* struct ipfw_rule_ref */ Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Jan 31 20:04:18 2019 (r343618) +++ head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Jan 31 21:04:50 2019 (r343619) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include /* ip_fw.h requires IFNAMSIZ */ -#include #include #include /* struct ipfw_rule_ref */ From owner-svn-src-head@freebsd.org Thu Jan 31 21:35:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B7E514B85B1; Thu, 31 Jan 2019 21:35:38 +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 B269872A4A; Thu, 31 Jan 2019 21:35:37 +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 A86A3D69E; Thu, 31 Jan 2019 21:35:37 +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 x0VLZb5O050423; Thu, 31 Jan 2019 21:35:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VLZb7J050422; Thu, 31 Jan 2019 21:35:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901312135.x0VLZb7J050422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 31 Jan 2019 21:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343620 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B269872A4A 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 21:35:38 -0000 Author: jhb Date: Thu Jan 31 21:35:37 2019 New Revision: 343620 URL: https://svnweb.freebsd.org/changeset/base/343620 Log: Don't set IFCAP_TXRTLMT during lagg_clone_create(). lagg_capabilities() will set the capability once interfaces supporting the feature are added to the lagg. Setting it on a lagg without any interfaces is pointless as the if_snd_tag_alloc call will always fail in that case. Reviewed by: hselasky, gallatin MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19040 Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Jan 31 21:04:50 2019 (r343619) +++ head/sys/net/if_lagg.c Thu Jan 31 21:35:37 2019 (r343620) @@ -514,10 +514,8 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; #ifdef RATELIMIT ifp->if_snd_tag_alloc = lagg_snd_tag_alloc; - ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS | IFCAP_TXRTLMT; -#else - ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; #endif + ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; /* * Attach as an ordinary ethernet device, children will be attached From owner-svn-src-head@freebsd.org Thu Jan 31 21:44:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 031B014B889E; Thu, 31 Jan 2019 21:44:35 +0000 (UTC) (envelope-from erj@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 9A0D072F7F; Thu, 31 Jan 2019 21:44:34 +0000 (UTC) (envelope-from erj@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 70154D84D; Thu, 31 Jan 2019 21:44:34 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VLiYRQ055334; Thu, 31 Jan 2019 21:44:34 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VLiXc7055332; Thu, 31 Jan 2019 21:44:33 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201901312144.x0VLiXc7055332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 31 Jan 2019 21:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343621 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 343621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A0D072F7F 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_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 21:44:35 -0000 Author: erj Date: Thu Jan 31 21:44:33 2019 New Revision: 343621 URL: https://svnweb.freebsd.org/changeset/base/343621 Log: ix(4): Run {mod,msf,mbx,fdir,phy}_task in if_update_admin_status From Piotr: This patch introduces adapter->task_requests register responsible for recording requests for mod_task, msf_task, mbx_task, fdir_task and phy_task calls. Instead of enqueueing these tasks with GROUPTASK_ENQUEUE, handlers will be called directly from ixgbe_if_update_admin_status() while holding ctx lock. SIOCGIFXMEDIA ioctl() call reads adapter->media list. The list is deleted and rewritten in ixgbe_handle_msf() task without holding ctx lock. This change is needed to maintain data coherency when sharing adapter info via ioctl() calls. Patch co-authored by Krzysztof Galazka . PR: 221317 Submitted by: Piotr Pietruszewski Reviewed by: sbruno@, IntelNetworking Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18468 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_type.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Thu Jan 31 21:35:37 2019 (r343620) +++ head/sys/dev/ixgbe/if_ix.c Thu Jan 31 21:44:33 2019 (r343621) @@ -120,6 +120,7 @@ static int ixgbe_if_resume(if_ctx_t ctx); static void ixgbe_if_stop(if_ctx_t ctx); void ixgbe_if_enable_intr(if_ctx_t ctx); static void ixgbe_if_disable_intr(if_ctx_t ctx); +static void ixgbe_link_intr_enable(if_ctx_t ctx); static int ixgbe_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t qid); static void ixgbe_if_media_status(if_ctx_t ctx, struct ifmediareq * ifmr); static int ixgbe_if_media_change(if_ctx_t ctx); @@ -173,7 +174,7 @@ static void ixgbe_init_device_features(struct adapter static void ixgbe_check_fan_failure(struct adapter *, u32, bool); static void ixgbe_add_media_types(if_ctx_t ctx); static void ixgbe_update_stats_counters(struct adapter *adapter); -static void ixgbe_config_link(struct adapter *adapter); +static void ixgbe_config_link(if_ctx_t ctx); static void ixgbe_get_slot_info(struct adapter *); static void ixgbe_check_wol_support(struct adapter *adapter); static void ixgbe_enable_rx_drop(struct adapter *); @@ -254,6 +255,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_msix_intr_assign, ixgbe_if_msix_intr_assign), DEVMETHOD(ifdi_intr_enable, ixgbe_if_enable_intr), DEVMETHOD(ifdi_intr_disable, ixgbe_if_disable_intr), + DEVMETHOD(ifdi_link_intr_enable, ixgbe_link_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, ixgbe_if_rx_queue_intr_enable), DEVMETHOD(ifdi_rx_queue_intr_enable, ixgbe_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queues_alloc, ixgbe_if_tx_queues_alloc), @@ -446,19 +448,6 @@ ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs } - iflib_config_gtask_init(ctx, &adapter->mod_task, ixgbe_handle_mod, - "mod_task"); - iflib_config_gtask_init(ctx, &adapter->msf_task, ixgbe_handle_msf, - "msf_task"); - iflib_config_gtask_init(ctx, &adapter->phy_task, ixgbe_handle_phy, - "phy_task"); - if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) - iflib_config_gtask_init(ctx, &adapter->mbx_task, - ixgbe_handle_mbx, "mbx_task"); - if (adapter->feat_en & IXGBE_FEATURE_FDIR) - iflib_config_gtask_init(ctx, &adapter->fdir_task, - ixgbe_reinit_fdir, "fdir_task"); - device_printf(iflib_get_dev(ctx), "allocated for %d queues\n", adapter->num_tx_queues); @@ -1362,8 +1351,9 @@ ixgbe_is_sfp(struct ixgbe_hw *hw) * ixgbe_config_link ************************************************************************/ static void -ixgbe_config_link(struct adapter *adapter) +ixgbe_config_link(if_ctx_t ctx) { + struct adapter *adapter = iflib_get_softc(ctx); struct ixgbe_hw *hw = &adapter->hw; u32 autoneg, err = 0; bool sfp, negotiate; @@ -1371,7 +1361,8 @@ ixgbe_config_link(struct adapter *adapter) sfp = ixgbe_is_sfp(hw); if (sfp) { - GROUPTASK_ENQUEUE(&adapter->mod_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; + iflib_admin_intr_deferred(ctx); } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, @@ -1388,7 +1379,6 @@ ixgbe_config_link(struct adapter *adapter) err = hw->mac.ops.setup_link(hw, autoneg, adapter->link_up); } - } /* ixgbe_config_link */ /************************************************************************ @@ -2096,8 +2086,6 @@ ixgbe_if_media_status(if_ctx_t ctx, struct ifmediareq INIT_DEBUGOUT("ixgbe_if_media_status: begin"); - iflib_admin_intr_deferred(ctx); - ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; @@ -2386,7 +2374,7 @@ ixgbe_msix_link(void *arg) /* Link status change */ if (eicr & IXGBE_EICR_LSC) { IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC); - iflib_admin_intr_deferred(adapter->ctx); + adapter->task_requests |= IXGBE_REQUEST_TASK_LSC; } if (adapter->hw.mac.type != ixgbe_mac_82598EB) { @@ -2397,7 +2385,7 @@ ixgbe_msix_link(void *arg) return (FILTER_HANDLED); /* Disable the interrupt */ IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_FLOW_DIR); - GROUPTASK_ENQUEUE(&adapter->fdir_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_FDIR; } else if (eicr & IXGBE_EICR_ECC) { device_printf(iflib_get_dev(adapter->ctx), @@ -2441,7 +2429,7 @@ ixgbe_msix_link(void *arg) /* Check for VF message */ if ((adapter->feat_en & IXGBE_FEATURE_SRIOV) && (eicr & IXGBE_EICR_MAILBOX)) - GROUPTASK_ENQUEUE(&adapter->mbx_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MBX; } if (ixgbe_is_sfp(hw)) { @@ -2453,16 +2441,14 @@ ixgbe_msix_link(void *arg) if (eicr & eicr_mask) { IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask); - if (atomic_cmpset_acq_int(&adapter->sfp_reinit, 0, 1)) - GROUPTASK_ENQUEUE(&adapter->mod_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; } if ((hw->mac.type == ixgbe_mac_82599EB) && (eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); - if (atomic_cmpset_acq_int(&adapter->sfp_reinit, 0, 1)) - GROUPTASK_ENQUEUE(&adapter->msf_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; } } @@ -2476,13 +2462,10 @@ ixgbe_msix_link(void *arg) if ((hw->phy.type == ixgbe_phy_x550em_ext_t) && (eicr & IXGBE_EICR_GPI_SDP0_X540)) { IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0_X540); - GROUPTASK_ENQUEUE(&adapter->phy_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_PHY; } - /* Re-enable other interrupts */ - IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); - - return (FILTER_HANDLED); + return (adapter->task_requests != 0) ? FILTER_SCHEDULE_THREAD : FILTER_HANDLED; } /* ixgbe_msix_link */ /************************************************************************ @@ -2646,12 +2629,6 @@ ixgbe_if_detach(if_ctx_t ctx) return (EBUSY); } - iflib_config_gtask_deinit(&adapter->mod_task); - iflib_config_gtask_deinit(&adapter->msf_task); - iflib_config_gtask_deinit(&adapter->phy_task); - if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) - iflib_config_gtask_deinit(&adapter->mbx_task); - ixgbe_setup_low_power_mode(ctx); /* let hardware know driver is unloading */ @@ -2910,6 +2887,12 @@ ixgbe_if_init(if_ctx_t ctx) /* Configure RX settings */ ixgbe_initialize_receive_units(ctx); + /* + * Initialize variable holding task enqueue requests + * from MSI-X interrupts + */ + adapter->task_requests = 0; + /* Enable SDP & MSI-X interrupts based on adapter */ ixgbe_config_gpie(adapter); @@ -3011,7 +2994,7 @@ ixgbe_if_init(if_ctx_t ctx) ixgbe_set_phy_power(hw, TRUE); /* Config/Enable Link */ - ixgbe_config_link(adapter); + ixgbe_config_link(ctx); /* Hardware Packet Buffer & Flow Control setup */ ixgbe_config_delay_values(adapter); @@ -3374,7 +3357,6 @@ ixgbe_handle_mod(void *context) device_t dev = iflib_get_dev(ctx); u32 err, cage_full = 0; - adapter->sfp_reinit = 1; if (adapter->hw.need_crosstalk_fix) { switch (hw->mac.type) { case ixgbe_mac_82599EB: @@ -3411,11 +3393,11 @@ ixgbe_handle_mod(void *context) "Setup failure - unsupported SFP+ module type.\n"); goto handle_mod_out; } - GROUPTASK_ENQUEUE(&adapter->msf_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; return; handle_mod_out: - adapter->sfp_reinit = 0; + adapter->task_requests &= ~(IXGBE_REQUEST_TASK_MSF); } /* ixgbe_handle_mod */ @@ -3431,9 +3413,6 @@ ixgbe_handle_msf(void *context) u32 autoneg; bool negotiate; - if (adapter->sfp_reinit != 1) - return; - /* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); @@ -3447,8 +3426,6 @@ ixgbe_handle_msf(void *context) ifmedia_removeall(adapter->media); ixgbe_add_media_types(adapter->ctx); ifmedia_set(adapter->media, IFM_ETHER | IFM_AUTO); - - adapter->sfp_reinit = 0; } /* ixgbe_handle_msf */ /************************************************************************ @@ -3543,10 +3520,20 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) } } - ixgbe_update_stats_counters(adapter); + /* Handle task requests from msix_link() */ + if (adapter->task_requests & IXGBE_REQUEST_TASK_MOD) + ixgbe_handle_mod(ctx); + if (adapter->task_requests & IXGBE_REQUEST_TASK_MSF) + ixgbe_handle_msf(ctx); + if (adapter->task_requests & IXGBE_REQUEST_TASK_MBX) + ixgbe_handle_mbx(ctx); + if (adapter->task_requests & IXGBE_REQUEST_TASK_FDIR) + ixgbe_reinit_fdir(ctx); + if (adapter->task_requests & IXGBE_REQUEST_TASK_PHY) + ixgbe_handle_phy(ctx); + adapter->task_requests = 0; - /* Re-enable link interrupts */ - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_LSC); + ixgbe_update_stats_counters(adapter); } /* ixgbe_if_update_admin_status */ /************************************************************************ @@ -3682,6 +3669,18 @@ ixgbe_if_disable_intr(if_ctx_t ctx) } /* ixgbe_if_disable_intr */ /************************************************************************ + * ixgbe_link_intr_enable + ************************************************************************/ +static void +ixgbe_link_intr_enable(if_ctx_t ctx) +{ + struct ixgbe_hw *hw = &((struct adapter *)iflib_get_softc(ctx))->hw; + + /* Re-enable other interrupts */ + IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER | IXGBE_EIMS_LSC); +} /* ixgbe_link_intr_enable */ + +/************************************************************************ * ixgbe_if_rx_queue_intr_enable ************************************************************************/ static int @@ -3784,22 +3783,21 @@ ixgbe_intr(void *arg) if (eicr & eicr_mask) { IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask); - GROUPTASK_ENQUEUE(&adapter->mod_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; } if ((hw->mac.type == ixgbe_mac_82599EB) && (eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); - if (atomic_cmpset_acq_int(&adapter->sfp_reinit, 0, 1)) - GROUPTASK_ENQUEUE(&adapter->msf_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; } } /* External PHY interrupt */ if ((hw->phy.type == ixgbe_phy_x550em_ext_t) && (eicr & IXGBE_EICR_GPI_SDP0_X540)) - GROUPTASK_ENQUEUE(&adapter->phy_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_PHY; return (FILTER_SCHEDULE_THREAD); } /* ixgbe_intr */ Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Thu Jan 31 21:35:37 2019 (r343620) +++ head/sys/dev/ixgbe/ixgbe.h Thu Jan 31 21:44:33 2019 (r343621) @@ -428,16 +428,11 @@ struct adapter { /* Support for pluggable optics */ bool sfp_probe; - struct grouptask mod_task; /* SFP tasklet */ - struct grouptask msf_task; /* Multispeed Fiber */ - struct grouptask mbx_task; /* VF -> PF mailbox interrupt */ - int sfp_reinit; /* Flow Director */ int fdir_reinit; - struct grouptask fdir_task; - struct grouptask phy_task; /* PHY intr tasklet */ + u32 task_requests; /* * Queues: Modified: head/sys/dev/ixgbe/ixgbe_type.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_type.h Thu Jan 31 21:35:37 2019 (r343620) +++ head/sys/dev/ixgbe/ixgbe_type.h Thu Jan 31 21:44:33 2019 (r343621) @@ -4427,4 +4427,11 @@ struct ixgbe_bypass_eeprom { #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD \ (0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT) +#define IXGBE_REQUEST_TASK_MOD 0x01 +#define IXGBE_REQUEST_TASK_MSF 0x02 +#define IXGBE_REQUEST_TASK_MBX 0x04 +#define IXGBE_REQUEST_TASK_FDIR 0x08 +#define IXGBE_REQUEST_TASK_PHY 0x10 +#define IXGBE_REQUEST_TASK_LSC 0x20 + #endif /* _IXGBE_TYPE_H_ */ From owner-svn-src-head@freebsd.org Thu Jan 31 21:53:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 066CD14B8F20; Thu, 31 Jan 2019 21:53:05 +0000 (UTC) (envelope-from erj@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 988F07365D; Thu, 31 Jan 2019 21:53:04 +0000 (UTC) (envelope-from erj@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 8BD13DA07; Thu, 31 Jan 2019 21:53:04 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VLr4f3060459; Thu, 31 Jan 2019 21:53:04 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VLr446060456; Thu, 31 Jan 2019 21:53:04 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201901312153.x0VLr446060456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 31 Jan 2019 21:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343622 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 343622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 988F07365D 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 21:53:05 -0000 Author: erj Date: Thu Jan 31 21:53:03 2019 New Revision: 343622 URL: https://svnweb.freebsd.org/changeset/base/343622 Log: ix(4),ixv(4): Fix TSO offloads when TXCSUM is disabled This patch and commit message are based on r340256 created by Jacob Keller: The iflib stack does not disable TSO automatically when TXCSUM is disabled, instead assuming that the driver will correctly handle TSOs even when CSUM_IP is not set. This results in iflib calling ixgbe_isc_txd_encap with packets which have CSUM_IP_TSO, but do not have CSUM_IP or CSUM_IP_TCP set. Because of this, ixgbe_tx_ctx_setup will not setup the IPv4 checksum offloading. This results in bad TSO packets being sent if a user disables TXCSUM without disabling TSO. Fix this by updating the ixgbe_tx_ctx_setup function to check both CSUM_IP and CSUM_IP_TSO when deciding whether to enable checksums. Once this is corrected, another issue for TSO packets is revealed. The driver sets IFLIB_NEED_ZERO_CSUM in order to enable a work around that causes the ip->sum field to be zero'd. This is necessary for ix hardware to correctly perform TSOs. However, if TXCSUM is disabled, then the work around is not enabled, as CSUM_IP will not be set when the iflib stack checks to see if it should clear the sum field. Fix this by adding IFLIB_TSO_INIT_IP to the iflib flags for the ix and ixv interface files. Once both of these changes are made, the ix and ixv drivers should correctly offload TSO packets when TSO offload is enabled, regardless of whether TXCSUM is enabled or disabled. Submitted by: Piotr Pietruszewski Reviewed by: IntelNetworking Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18470 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Thu Jan 31 21:44:33 2019 (r343621) +++ head/sys/dev/ixgbe/if_ix.c Thu Jan 31 21:53:03 2019 (r343622) @@ -379,6 +379,7 @@ static struct if_shared_ctx ixgbe_sctx_init = { .isc_vendor_info = ixgbe_vendor_info_array, .isc_driver_version = ixgbe_driver_version, .isc_driver = &ixgbe_if_driver, + .isc_flags = IFLIB_TSO_INIT_IP, .isc_nrxd_min = {MIN_RXD}, .isc_ntxd_min = {MIN_TXD}, Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Thu Jan 31 21:44:33 2019 (r343621) +++ head/sys/dev/ixgbe/if_ixv.c Thu Jan 31 21:53:03 2019 (r343622) @@ -220,6 +220,7 @@ static struct if_shared_ctx ixv_sctx_init = { .isc_vendor_info = ixv_vendor_info_array, .isc_driver_version = ixv_driver_version, .isc_driver = &ixv_if_driver, + .isc_flags = IFLIB_TSO_INIT_IP, .isc_nrxd_min = {MIN_RXD}, .isc_ntxd_min = {MIN_TXD}, Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Thu Jan 31 21:44:33 2019 (r343621) +++ head/sys/dev/ixgbe/ix_txrx.c Thu Jan 31 21:53:03 2019 (r343622) @@ -131,7 +131,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *T switch (pi->ipi_ipproto) { case IPPROTO_TCP: - if (pi->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) + if (pi->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP | CSUM_TSO)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; else offload = FALSE; From owner-svn-src-head@freebsd.org Thu Jan 31 22:27:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93FF514BA1BB; Thu, 31 Jan 2019 22:27:40 +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 3A7DE760ED; Thu, 31 Jan 2019 22:27:40 +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 2FE73DF38; Thu, 31 Jan 2019 22:27:40 +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 x0VMReAD078947; Thu, 31 Jan 2019 22:27:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VMReRT078946; Thu, 31 Jan 2019 22:27:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901312227.x0VMReRT078946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 31 Jan 2019 22:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343626 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A7DE760ED 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.998,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.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 22:27:40 -0000 Author: markj Date: Thu Jan 31 22:27:39 2019 New Revision: 343626 URL: https://svnweb.freebsd.org/changeset/base/343626 Log: Prevent some kobj memory allocation failures from panicking the system. Parts of the kobj(9) KPI assume a non-sleepable context for the purpose of internal memory allocations, but currently have no way to signal an allocation failure to the caller, so they just panic in this case. This can occur even when kobj_create() is called with M_WAITOK. Fix some instances of the problem by plumbing wait flags from kobj_create() through internal subroutines. Change kobj_class_compile() to assume a sleepable context when called externally, since all existing callers use it in a sleepable context. To fix the problem fully the kobj_init() KPI must be changed. Reported and tested by: pho Reviewed by: kib (previous version) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19023 Modified: head/sys/kern/subr_kobj.c Modified: head/sys/kern/subr_kobj.c ============================================================================== --- head/sys/kern/subr_kobj.c Thu Jan 31 22:20:20 2019 (r343625) +++ head/sys/kern/subr_kobj.c Thu Jan 31 22:27:39 2019 (r343626) @@ -125,38 +125,43 @@ kobj_class_compile_common(kobj_class_t cls, kobj_ops_t cls->ops = ops; } -void -kobj_class_compile(kobj_class_t cls) +static int +kobj_class_compile1(kobj_class_t cls, int mflags) { kobj_ops_t ops; KOBJ_ASSERT(MA_NOTOWNED); - /* - * Allocate space for the compiled ops table. - */ - ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT); - if (!ops) - panic("%s: out of memory", __func__); + ops = malloc(sizeof(struct kobj_ops), M_KOBJ, mflags); + if (ops == NULL) + return (ENOMEM); - KOBJ_LOCK(); - /* * We may have lost a race for kobj_class_compile here - check * to make sure someone else hasn't already compiled this * class. */ + KOBJ_LOCK(); if (cls->ops) { KOBJ_UNLOCK(); free(ops, M_KOBJ); - return; + return (0); } - kobj_class_compile_common(cls, ops); KOBJ_UNLOCK(); + return (0); } void +kobj_class_compile(kobj_class_t cls) +{ + int error; + + error = kobj_class_compile1(cls, M_WAITOK); + KASSERT(error == 0, ("kobj_class_compile1 returned %d", error)); +} + +void kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops) { @@ -254,24 +259,6 @@ kobj_class_free(kobj_class_t cls) free(ops, M_KOBJ); } -kobj_t -kobj_create(kobj_class_t cls, - struct malloc_type *mtype, - int mflags) -{ - kobj_t obj; - - /* - * Allocate and initialise the new object. - */ - obj = malloc(cls->size, mtype, mflags | M_ZERO); - if (!obj) - return NULL; - kobj_init(obj, cls); - - return obj; -} - static void kobj_init_common(kobj_t obj, kobj_class_t cls) { @@ -280,30 +267,52 @@ kobj_init_common(kobj_t obj, kobj_class_t cls) cls->refs++; } -void -kobj_init(kobj_t obj, kobj_class_t cls) +static int +kobj_init1(kobj_t obj, kobj_class_t cls, int mflags) { - KOBJ_ASSERT(MA_NOTOWNED); - retry: - KOBJ_LOCK(); + int error; - /* - * Consider compiling the class' method table. - */ - if (!cls->ops) { + KOBJ_LOCK(); + while (cls->ops == NULL) { /* * kobj_class_compile doesn't want the lock held * because of the call to malloc - we drop the lock * and re-try. */ KOBJ_UNLOCK(); - kobj_class_compile(cls); - goto retry; + error = kobj_class_compile1(cls, mflags); + if (error != 0) + return (error); + KOBJ_LOCK(); } - kobj_init_common(obj, cls); - KOBJ_UNLOCK(); + return (0); +} + +kobj_t +kobj_create(kobj_class_t cls, struct malloc_type *mtype, int mflags) +{ + kobj_t obj; + + obj = malloc(cls->size, mtype, mflags | M_ZERO); + if (obj == NULL) + return (NULL); + if (kobj_init1(obj, cls, mflags) != 0) { + free(obj, mtype); + return (NULL); + } + return (obj); +} + +void +kobj_init(kobj_t obj, kobj_class_t cls) +{ + int error; + + error = kobj_init1(obj, cls, M_NOWAIT); + if (error != 0) + panic("kobj_init1 failed: error %d", error); } void From owner-svn-src-head@freebsd.org Thu Jan 31 22:37:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C31F14BA635; Thu, 31 Jan 2019 22:37:29 +0000 (UTC) (envelope-from glebius@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 2585976BFB; Thu, 31 Jan 2019 22:37:29 +0000 (UTC) (envelope-from glebius@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 0A042E116; Thu, 31 Jan 2019 22:37:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VMbSeV085024; Thu, 31 Jan 2019 22:37:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VMbS8u085022; Thu, 31 Jan 2019 22:37:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901312237.x0VMbS8u085022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 31 Jan 2019 22:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343627 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 343627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2585976BFB 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_LONG(-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] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 22:37:29 -0000 Author: glebius Date: Thu Jan 31 22:37:28 2019 New Revision: 343627 URL: https://svnweb.freebsd.org/changeset/base/343627 Log: Add new m_ext type for data for M_NOFREE mbufs, which doesn't actually do anything except several assertions. This type is going to be used for temporary on stack mbufs, that point into data in receive ring of a NIC, that shall not be freed. Such mbuf can not be stored or reallocated, its life time is current context. Modified: head/sys/kern/kern_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Jan 31 22:27:39 2019 (r343626) +++ head/sys/kern/kern_mbuf.c Thu Jan 31 22:37:28 2019 (r343627) @@ -847,7 +847,8 @@ mb_free_ext(struct mbuf *m) */ if (m->m_flags & M_NOFREE) { freembuf = 0; - KASSERT(m->m_ext.ext_type == EXT_EXTREF, + KASSERT(m->m_ext.ext_type == EXT_EXTREF || + m->m_ext.ext_type == EXT_RXRING, ("%s: no-free mbuf %p has wrong type", __func__, m)); } else freembuf = 1; @@ -890,6 +891,10 @@ mb_free_ext(struct mbuf *m) KASSERT(m->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); m->m_ext.ext_free(m); + break; + case EXT_RXRING: + KASSERT(m->m_ext.ext_free == NULL, + ("%s: ext_free is set", __func__)); break; default: KASSERT(m->m_ext.ext_type == 0, Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Jan 31 22:27:39 2019 (r343626) +++ head/sys/sys/mbuf.h Thu Jan 31 22:37:28 2019 (r343627) @@ -443,6 +443,7 @@ struct mbuf { #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference */ +#define EXT_RXRING 8 /* data in NIC receive ring */ #define EXT_VENDOR1 224 /* for vendor-internal use */ #define EXT_VENDOR2 225 /* for vendor-internal use */ From owner-svn-src-head@freebsd.org Thu Jan 31 22:43:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC0E714BA83D; Thu, 31 Jan 2019 22:43:21 +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 537327705A; Thu, 31 Jan 2019 22:43:21 +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 419F9E2D3; Thu, 31 Jan 2019 22:43:21 +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 x0VMhLpj089929; Thu, 31 Jan 2019 22:43:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VMhK9v089926; Thu, 31 Jan 2019 22:43:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901312243.x0VMhK9v089926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 31 Jan 2019 22:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343628 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 343628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 537327705A 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 22:43:22 -0000 Author: kib Date: Thu Jan 31 22:43:20 2019 New Revision: 343628 URL: https://svnweb.freebsd.org/changeset/base/343628 Log: nvdimm: enumerate NVDIMM SPA ranges from the root device Move the enumeration of NVDIMM SPA ranges from the spa GEOM class initializer into the NVDIMM root device. This will be necessary for a later change where NVDIMM namespaces require NVDIMM device enumeration to be reliably ordered before SPA enumeration. Submitted by: D Scott Phillips Sponsored by: Intel Corporation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18734 Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_spa.c head/sys/dev/nvdimm/nvdimm_var.h Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Thu Jan 31 22:37:28 2019 (r343627) +++ head/sys/dev/nvdimm/nvdimm.c Thu Jan 31 22:43:20 2019 (r343628) @@ -227,6 +227,31 @@ nvdimm_resume(device_t dev) return (0); } +static int +nvdimm_root_create_spa(void *nfitsubtbl, void *arg) +{ + enum SPA_mapping_type spa_type; + ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; + struct SPA_mapping *spa; + struct nvdimm_root_dev *dev; + int error; + + nfitaddr = nfitsubtbl; + dev = arg; + spa_type = nvdimm_spa_type_from_uuid( + (struct uuid *)nfitaddr->RangeGuid); + if (spa_type == SPA_TYPE_UNKNOWN) + return (0); + spa = malloc(sizeof(struct SPA_mapping), M_NVDIMM, M_WAITOK | M_ZERO); + error = nvdimm_spa_init(spa, nfitaddr, spa_type); + if (error != 0) { + nvdimm_spa_fini(spa); + free(spa, M_NVDIMM); + } + SLIST_INSERT_HEAD(&dev->spas, spa, link); + return (0); +} + static ACPI_STATUS nvdimm_root_create_dev(ACPI_HANDLE handle, UINT32 nesting_level, void *context, void **return_value) @@ -276,6 +301,7 @@ nvdimm_root_attach(device_t dev) { ACPI_HANDLE handle; ACPI_STATUS status; + ACPI_TABLE_NFIT *nfitbl; int error; handle = acpi_get_handle(dev); @@ -284,15 +310,33 @@ nvdimm_root_attach(device_t dev) if (ACPI_FAILURE(status)) device_printf(dev, "failed adding children\n"); error = bus_generic_attach(dev); + if (error != 0) + return (error); + status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); + if (ACPI_FAILURE(status)) { + device_printf(dev, "cannot get NFIT\n"); + return (ENXIO); + } + error = nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, + nvdimm_root_create_spa, device_get_softc(dev)); + AcpiPutTable(&nfitbl->Header); return (error); } static int nvdimm_root_detach(device_t dev) { + struct nvdimm_root_dev *root; + struct SPA_mapping *spa, *next; device_t *children; int i, error, num_children; + root = device_get_softc(dev); + SLIST_FOREACH_SAFE(spa, &root->spas, link, next) { + nvdimm_spa_fini(spa); + SLIST_REMOVE_HEAD(&root->spas, link); + free(spa, M_NVDIMM); + } error = bus_generic_detach(dev); if (error != 0) return (error); @@ -356,6 +400,7 @@ static device_method_t nvdimm_root_methods[] = { static driver_t nvdimm_root_driver = { "nvdimm_root", nvdimm_root_methods, + sizeof(struct nvdimm_root_dev), }; DRIVER_MODULE(nvdimm_root, acpi, nvdimm_root_driver, nvdimm_root_devclass, NULL, Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Thu Jan 31 22:37:28 2019 (r343627) +++ head/sys/dev/nvdimm/nvdimm_spa.c Thu Jan 31 22:43:20 2019 (r343628) @@ -82,19 +82,6 @@ __FBSDID("$FreeBSD$"); #define UUID_INITIALIZER_PERSISTENT_VIRTUAL_CD \ {0x08018188,0x42cd,0xbb48,0x10,0x0f,{0x53,0x87,0xd5,0x3d,0xed,0x3d}} -struct SPA_mapping *spa_mappings; -int spa_mappings_cnt; - -static int -nvdimm_spa_count(void *nfitsubtbl __unused, void *arg) -{ - int *cnt; - - cnt = arg; - (*cnt)++; - return (0); -} - static struct nvdimm_SPA_uuid_list_elm { const char *u_name; struct uuid u_id; @@ -419,22 +406,17 @@ nvdimm_spa_g_access(struct g_provider *pp, int r, int return (0); } -static g_init_t nvdimm_spa_g_init; -static g_fini_t nvdimm_spa_g_fini; - struct g_class nvdimm_spa_g_class = { .name = "SPA", .version = G_VERSION, .start = nvdimm_spa_g_start, .access = nvdimm_spa_g_access, - .init = nvdimm_spa_g_init, - .fini = nvdimm_spa_g_fini, }; DECLARE_GEOM_CLASS(nvdimm_spa_g_class, g_spa); -static int -nvdimm_spa_init_one(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, - int spa_type) +int +nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, + enum SPA_mapping_type spa_type) { struct make_dev_args mda; struct sglist *spa_sg; @@ -512,7 +494,7 @@ nvdimm_spa_init_one(struct SPA_mapping *spa, ACPI_NFIT if (error1 == 0) error1 = error; } else { - g_topology_assert(); + g_topology_lock(); spa->spa_g = g_new_geomf(&nvdimm_spa_g_class, "spa%d", spa->spa_nfit_idx); spa->spa_g->softc = spa; @@ -526,12 +508,13 @@ nvdimm_spa_init_one(struct SPA_mapping *spa, ACPI_NFIT spa->spa_g_devstat = devstat_new_entry("spa", spa->spa_nfit_idx, DEV_BSIZE, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); + g_topology_unlock(); } return (error1); } -static void -nvdimm_spa_fini_one(struct SPA_mapping *spa) +void +nvdimm_spa_fini(struct SPA_mapping *spa) { mtx_lock(&spa->spa_g_mtx); @@ -562,88 +545,4 @@ nvdimm_spa_fini_one(struct SPA_mapping *spa) } mtx_destroy(&spa->spa_g_mtx); mtx_destroy(&spa->spa_g_stat_mtx); -} - -static int -nvdimm_spa_parse(void *nfitsubtbl, void *arg) -{ - ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; - struct SPA_mapping *spa; - enum SPA_mapping_type spa_type; - int error, *i; - - i = arg; - spa = &spa_mappings[(*i)++]; - nfitaddr = nfitsubtbl; - spa_type = nvdimm_spa_type_from_uuid( - (struct uuid *)&nfitaddr->RangeGuid); - if (spa_type == SPA_TYPE_UNKNOWN) { - printf("Unknown SPA UUID %d ", nfitaddr->RangeIndex); - printf_uuid((struct uuid *)&nfitaddr->RangeGuid); - printf("\n"); - return (0); - } - error = nvdimm_spa_init_one(spa, nfitaddr, spa_type); - if (error != 0) - nvdimm_spa_fini_one(spa); - return (0); -} - -static int -nvdimm_spa_init1(ACPI_TABLE_NFIT *nfitbl) -{ - int error, i; - - error = nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, - nvdimm_spa_count, &spa_mappings_cnt); - if (error != 0) - return (error); - spa_mappings = malloc(sizeof(struct SPA_mapping) * spa_mappings_cnt, - M_NVDIMM, M_WAITOK | M_ZERO); - i = 0; - error = nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, - nvdimm_spa_parse, &i); - if (error != 0) { - free(spa_mappings, M_NVDIMM); - spa_mappings = NULL; - return (error); - } - return (0); -} - -static void -nvdimm_spa_g_init(struct g_class *mp __unused) -{ - ACPI_TABLE_NFIT *nfitbl; - ACPI_STATUS status; - int error; - - spa_mappings_cnt = 0; - spa_mappings = NULL; - if (acpi_disabled("nvdimm")) - return; - status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); - if (ACPI_FAILURE(status)) { - if (bootverbose) - printf("nvdimm_spa_g_init: cannot find NFIT\n"); - return; - } - error = nvdimm_spa_init1(nfitbl); - if (error != 0) - printf("nvdimm_spa_g_init: error %d\n", error); - AcpiPutTable(&nfitbl->Header); -} - -static void -nvdimm_spa_g_fini(struct g_class *mp __unused) -{ - int i; - - if (spa_mappings == NULL) - return; - for (i = 0; i < spa_mappings_cnt; i++) - nvdimm_spa_fini_one(&spa_mappings[i]); - free(spa_mappings, M_NVDIMM); - spa_mappings = NULL; - spa_mappings_cnt = 0; } Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Thu Jan 31 22:37:28 2019 (r343627) +++ head/sys/dev/nvdimm/nvdimm_var.h Thu Jan 31 22:43:20 2019 (r343628) @@ -44,6 +44,10 @@ __BUS_ACCESSOR(nvdimm_root, acpi_handle, NVDIMM_ROOT, __BUS_ACCESSOR(nvdimm_root, device_handle, NVDIMM_ROOT, DEVICE_HANDLE, nfit_handle_t) +struct nvdimm_root_dev { + SLIST_HEAD(, SPA_mapping) spas; +}; + struct nvdimm_dev { device_t nv_dev; nfit_handle_t nv_handle; @@ -64,6 +68,7 @@ enum SPA_mapping_type { }; struct SPA_mapping { + SLIST_ENTRY(SPA_mapping) link; enum SPA_mapping_type spa_type; int spa_domain; int spa_nfit_idx; @@ -84,14 +89,14 @@ struct SPA_mapping { bool spa_g_proc_exiting; }; -extern struct SPA_mapping *spa_mappings; -extern int spa_mappings_cnt; - MALLOC_DECLARE(M_NVDIMM); enum SPA_mapping_type nvdimm_spa_type_from_uuid(struct uuid *); struct nvdimm_dev *nvdimm_find_by_handle(nfit_handle_t nv_handle); int nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum AcpiNfitType type, int (*cb)(void *, void *), void *arg); +int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, + enum SPA_mapping_type spa_type); +void nvdimm_spa_fini(struct SPA_mapping *spa); #endif /* __DEV_NVDIMM_VAR_H__ */ From owner-svn-src-head@freebsd.org Thu Jan 31 22:47:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE6FC14BA8D6; Thu, 31 Jan 2019 22:47:05 +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 6EA5A771F0; Thu, 31 Jan 2019 22:47:05 +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 42508E2D9; Thu, 31 Jan 2019 22:47:05 +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 x0VMl51b090144; Thu, 31 Jan 2019 22:47:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VMl4lS090138; Thu, 31 Jan 2019 22:47:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901312247.x0VMl4lS090138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 31 Jan 2019 22:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343629 - in head/sys: dev/nvdimm modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: dev/nvdimm modules/nvdimm X-SVN-Commit-Revision: 343629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EA5A771F0 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 22:47:06 -0000 Author: kib Date: Thu Jan 31 22:47:04 2019 New Revision: 343629 URL: https://svnweb.freebsd.org/changeset/base/343629 Log: nvdimm: only enumerate present nvdimm devices Not all child devices of the NVDIMM root device represent DIMM devices which are present in the system. The spec says (ACPI 6.2, sec 9.20.2): For each NVDIMM present or intended to be supported by platform, platform firmware also exposes an NVDIMM device ... under the NVDIMM root device. Present NVDIMM devices are found by walking all of the NFIT table's SPA ranges, then walking the NVDIMM regions mentioned by those SPA ranges. A set of NFIT walking helper functions are introduced to avoid the need to splat the enumeration logic across several disparate callbacks. Submitted by: D Scott Phillips Sponsored by: Intel Corporation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18439 Added: head/sys/dev/nvdimm/nvdimm_nfit.c (contents, props changed) Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_var.h head/sys/modules/nvdimm/Makefile Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Thu Jan 31 22:43:20 2019 (r343628) +++ head/sys/dev/nvdimm/nvdimm.c Thu Jan 31 22:47:04 2019 (r343629) @@ -77,99 +77,6 @@ nvdimm_find_by_handle(nfit_handle_t nv_handle) } static int -nvdimm_parse_flush_addr(void *nfitsubtbl, void *arg) -{ - ACPI_NFIT_FLUSH_ADDRESS *nfitflshaddr; - struct nvdimm_dev *nv; - int i; - - nfitflshaddr = nfitsubtbl; - nv = arg; - if (nfitflshaddr->DeviceHandle != nv->nv_handle) - return (0); - - MPASS(nv->nv_flush_addr == NULL && nv->nv_flush_addr_cnt == 0); - nv->nv_flush_addr = mallocarray(nfitflshaddr->HintCount, - sizeof(uint64_t *), M_NVDIMM, M_WAITOK); - for (i = 0; i < nfitflshaddr->HintCount; i++) - nv->nv_flush_addr[i] = (uint64_t *)nfitflshaddr->HintAddress[i]; - nv->nv_flush_addr_cnt = nfitflshaddr->HintCount; - return (0); -} - -int -nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum AcpiNfitType type, - int (*cb)(void *, void *), void *arg) -{ - ACPI_NFIT_HEADER *nfithdr; - ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; - ACPI_NFIT_MEMORY_MAP *nfitmap; - ACPI_NFIT_INTERLEAVE *nfitintrl; - ACPI_NFIT_SMBIOS *nfitsmbios; - ACPI_NFIT_CONTROL_REGION *nfitctlreg; - ACPI_NFIT_DATA_REGION *nfitdtreg; - ACPI_NFIT_FLUSH_ADDRESS *nfitflshaddr; - char *ptr; - int error; - - error = 0; - for (ptr = (char *)(nfitbl + 1); - ptr < (char *)nfitbl + nfitbl->Header.Length; - ptr += nfithdr->Length) { - nfithdr = (ACPI_NFIT_HEADER *)ptr; - if (nfithdr->Type != type) - continue; - switch (nfithdr->Type) { - case ACPI_NFIT_TYPE_SYSTEM_ADDRESS: - nfitaddr = __containerof(nfithdr, - ACPI_NFIT_SYSTEM_ADDRESS, Header); - error = cb(nfitaddr, arg); - break; - case ACPI_NFIT_TYPE_MEMORY_MAP: - nfitmap = __containerof(nfithdr, - ACPI_NFIT_MEMORY_MAP, Header); - error = cb(nfitmap, arg); - break; - case ACPI_NFIT_TYPE_INTERLEAVE: - nfitintrl = __containerof(nfithdr, - ACPI_NFIT_INTERLEAVE, Header); - error = cb(nfitintrl, arg); - break; - case ACPI_NFIT_TYPE_SMBIOS: - nfitsmbios = __containerof(nfithdr, - ACPI_NFIT_SMBIOS, Header); - error = cb(nfitsmbios, arg); - break; - case ACPI_NFIT_TYPE_CONTROL_REGION: - nfitctlreg = __containerof(nfithdr, - ACPI_NFIT_CONTROL_REGION, Header); - error = cb(nfitctlreg, arg); - break; - case ACPI_NFIT_TYPE_DATA_REGION: - nfitdtreg = __containerof(nfithdr, - ACPI_NFIT_DATA_REGION, Header); - error = cb(nfitdtreg, arg); - break; - case ACPI_NFIT_TYPE_FLUSH_ADDRESS: - nfitflshaddr = __containerof(nfithdr, - ACPI_NFIT_FLUSH_ADDRESS, Header); - error = cb(nfitflshaddr, arg); - break; - case ACPI_NFIT_TYPE_RESERVED: - default: - if (bootverbose) - printf("NFIT subtype %d unknown\n", - nfithdr->Type); - error = 0; - break; - } - if (error != 0) - break; - } - return (error); -} - -static int nvdimm_probe(device_t dev) { @@ -197,8 +104,8 @@ nvdimm_attach(device_t dev) device_printf(dev, "cannot get NFIT\n"); return (ENXIO); } - nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS, - nvdimm_parse_flush_addr, nv); + acpi_nfit_get_flush_addrs(nfitbl, nv->nv_handle, &nv->nv_flush_addr, + &nv->nv_flush_addr_cnt); AcpiPutTable(&nfitbl->Header); return (0); } @@ -227,57 +134,92 @@ nvdimm_resume(device_t dev) return (0); } -static int -nvdimm_root_create_spa(void *nfitsubtbl, void *arg) +static ACPI_STATUS +find_dimm(ACPI_HANDLE handle, UINT32 nesting_level, void *context, + void **return_value) { - enum SPA_mapping_type spa_type; - ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; - struct SPA_mapping *spa; - struct nvdimm_root_dev *dev; - int error; + ACPI_DEVICE_INFO *device_info; + ACPI_STATUS status; - nfitaddr = nfitsubtbl; - dev = arg; - spa_type = nvdimm_spa_type_from_uuid( - (struct uuid *)nfitaddr->RangeGuid); - if (spa_type == SPA_TYPE_UNKNOWN) - return (0); - spa = malloc(sizeof(struct SPA_mapping), M_NVDIMM, M_WAITOK | M_ZERO); - error = nvdimm_spa_init(spa, nfitaddr, spa_type); - if (error != 0) { - nvdimm_spa_fini(spa); - free(spa, M_NVDIMM); + status = AcpiGetObjectInfo(handle, &device_info); + if (ACPI_FAILURE(status)) + return_ACPI_STATUS(AE_ERROR); + if (device_info->Address == (uintptr_t)context) { + *(ACPI_HANDLE *)return_value = handle; + return_ACPI_STATUS(AE_CTRL_TERMINATE); } - SLIST_INSERT_HEAD(&dev->spas, spa, link); - return (0); + return_ACPI_STATUS(AE_OK); } -static ACPI_STATUS -nvdimm_root_create_dev(ACPI_HANDLE handle, UINT32 nesting_level, void *context, - void **return_value) +static ACPI_HANDLE +get_dimm_acpi_handle(ACPI_HANDLE root_handle, nfit_handle_t adr) { + ACPI_HANDLE res; ACPI_STATUS status; - ACPI_DEVICE_INFO *device_info; - device_t parent, child; + + res = NULL; + status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, root_handle, 1, find_dimm, + NULL, (void *)(uintptr_t)adr, &res); + if (ACPI_FAILURE(status)) + res = NULL; + return (res); +} + +static int +nvdimm_root_create_devs(device_t dev, ACPI_TABLE_NFIT *nfitbl) +{ + ACPI_HANDLE root_handle, dimm_handle; + device_t child; + nfit_handle_t *dimm_ids, *dimm; uintptr_t *ivars; + int num_dimm_ids; - parent = context; - child = BUS_ADD_CHILD(parent, 100, "nvdimm", -1); - if (child == NULL) { - device_printf(parent, "failed to create nvdimm\n"); - return_ACPI_STATUS(AE_ERROR); + root_handle = acpi_get_handle(dev); + acpi_nfit_get_dimm_ids(nfitbl, &dimm_ids, &num_dimm_ids); + for (dimm = dimm_ids; dimm < dimm_ids + num_dimm_ids; dimm++) { + dimm_handle = get_dimm_acpi_handle(root_handle, *dimm); + child = BUS_ADD_CHILD(dev, 100, "nvdimm", -1); + if (child == NULL) { + device_printf(dev, "failed to create nvdimm\n"); + return (ENXIO); + } + ivars = mallocarray(NVDIMM_ROOT_IVAR_MAX, sizeof(uintptr_t), + M_NVDIMM, M_ZERO | M_WAITOK); + device_set_ivars(child, ivars); + nvdimm_root_set_acpi_handle(child, dimm_handle); + nvdimm_root_set_device_handle(child, *dimm); } - status = AcpiGetObjectInfo(handle, &device_info); - if (ACPI_FAILURE(status)) { - device_printf(parent, "failed to get nvdimm device info\n"); - return_ACPI_STATUS(AE_ERROR); + free(dimm_ids, M_NVDIMM); + return (0); +} + +static int +nvdimm_root_create_spas(struct nvdimm_root_dev *dev, ACPI_TABLE_NFIT *nfitbl) +{ + ACPI_NFIT_SYSTEM_ADDRESS **spas, **spa; + struct SPA_mapping *spa_mapping; + enum SPA_mapping_type spa_type; + int error, num_spas; + + error = 0; + acpi_nfit_get_spa_ranges(nfitbl, &spas, &num_spas); + for (spa = spas; spa < spas + num_spas; spa++) { + spa_type = nvdimm_spa_type_from_uuid( + (struct uuid *)(*spa)->RangeGuid); + if (spa_type == SPA_TYPE_UNKNOWN) + continue; + spa_mapping = malloc(sizeof(struct SPA_mapping), M_NVDIMM, + M_WAITOK | M_ZERO); + error = nvdimm_spa_init(spa_mapping, *spa, spa_type); + if (error != 0) { + nvdimm_spa_fini(spa_mapping); + free(spa, M_NVDIMM); + break; + } + SLIST_INSERT_HEAD(&dev->spas, spa_mapping, link); } - ivars = mallocarray(NVDIMM_ROOT_IVAR_MAX - 1, sizeof(uintptr_t), - M_NVDIMM, M_ZERO | M_WAITOK); - device_set_ivars(child, ivars); - nvdimm_root_set_acpi_handle(child, handle); - nvdimm_root_set_device_handle(child, device_info->Address); - return_ACPI_STATUS(AE_OK); + free(spas, M_NVDIMM); + return (error); } static char *nvdimm_root_id[] = {"ACPI0012", NULL}; @@ -299,26 +241,24 @@ nvdimm_root_probe(device_t dev) static int nvdimm_root_attach(device_t dev) { - ACPI_HANDLE handle; - ACPI_STATUS status; + struct nvdimm_root_dev *root; ACPI_TABLE_NFIT *nfitbl; + ACPI_STATUS status; int error; - handle = acpi_get_handle(dev); - status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 1, - nvdimm_root_create_dev, NULL, dev, NULL); - if (ACPI_FAILURE(status)) - device_printf(dev, "failed adding children\n"); - error = bus_generic_attach(dev); - if (error != 0) - return (error); status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); if (ACPI_FAILURE(status)) { device_printf(dev, "cannot get NFIT\n"); return (ENXIO); } - error = nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, - nvdimm_root_create_spa, device_get_softc(dev)); + error = nvdimm_root_create_devs(dev, nfitbl); + if (error != 0) + return (error); + error = bus_generic_attach(dev); + if (error != 0) + return (error); + root = device_get_softc(dev); + error = nvdimm_root_create_spas(root, nfitbl); AcpiPutTable(&nfitbl->Header); return (error); } Added: head/sys/dev/nvdimm/nvdimm_nfit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvdimm/nvdimm_nfit.c Thu Jan 31 22:47:04 2019 (r343629) @@ -0,0 +1,203 @@ +/*- + * Copyright (c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +static int +uint32_t_compare(const void *a, const void *b) +{ + + return (*(const uint32_t *)a - *(const uint32_t *)b); +} + +static int +find_matches(ACPI_TABLE_NFIT *nfitbl, uint16_t type, uint16_t offset, + uint64_t mask, uint64_t value, void **ptrs, int ptrs_len) +{ + ACPI_NFIT_HEADER *h, *end; + uint64_t val; + size_t load_size; + int count; + + h = (ACPI_NFIT_HEADER *)(nfitbl + 1); + end = (ACPI_NFIT_HEADER *)((char *)nfitbl + + nfitbl->Header.Length); + load_size = roundup2(flsl(mask), 8) / 8; + count = 0; + + while (h < end) { + if (h->Type == type) { + bcopy((char *)h + offset, &val, load_size); + val &= mask; + if (val == value) { + if (ptrs_len > 0) { + ptrs[count] = h; + ptrs_len--; + } + count++; + } + } + if (h->Length == 0) + break; + h = (ACPI_NFIT_HEADER *)((char *)h + h->Length); + } + return (count); +} + +static void +malloc_find_matches(ACPI_TABLE_NFIT *nfitbl, uint16_t type, uint16_t offset, + uint64_t mask, uint64_t value, void ***ptrs, int *ptrs_len) +{ + int count; + + count = find_matches(nfitbl, type, offset, mask, value, NULL, 0); + *ptrs_len = count; + if (count == 0) { + *ptrs = NULL; + return; + } + *ptrs = mallocarray(count, sizeof(void *), M_NVDIMM, M_WAITOK); + find_matches(nfitbl, type, offset, mask, value, *ptrs, *ptrs_len); +} + +void +acpi_nfit_get_dimm_ids(ACPI_TABLE_NFIT *nfitbl, nfit_handle_t **listp, + int *countp) +{ + ACPI_NFIT_SYSTEM_ADDRESS **spas; + ACPI_NFIT_MEMORY_MAP ***regions; + int i, j, k, maxids, num_spas, *region_counts; + + acpi_nfit_get_spa_ranges(nfitbl, &spas, &num_spas); + if (num_spas == 0) { + *listp = NULL; + *countp = 0; + return; + } + regions = mallocarray(num_spas, sizeof(uint16_t *), M_NVDIMM, + M_WAITOK); + region_counts = mallocarray(num_spas, sizeof(int), M_NVDIMM, M_WAITOK); + for (i = 0; i < num_spas; i++) { + acpi_nfit_get_region_mappings_by_spa_range(nfitbl, + spas[i]->RangeIndex, ®ions[i], ®ion_counts[i]); + } + maxids = 0; + for (i = 0; i < num_spas; i++) { + maxids += region_counts[i]; + } + *listp = mallocarray(maxids, sizeof(nfit_handle_t), M_NVDIMM, M_WAITOK); + k = 0; + for (i = 0; i < num_spas; i++) { + for (j = 0; j < region_counts[i]; j++) + (*listp)[k++] = regions[i][j]->DeviceHandle; + } + qsort((*listp), maxids, sizeof(uint32_t), uint32_t_compare); + i = 0; + for (j = 1; j < maxids; j++) { + if ((*listp)[i] != (*listp)[j]) + (*listp)[++i] = (*listp)[j]; + } + *countp = i + 1; + free(region_counts, M_NVDIMM); + for (i = 0; i < num_spas; i++) + free(regions[i], M_NVDIMM); + free(regions, M_NVDIMM); + free(spas, M_NVDIMM); +} + +void +acpi_nfit_get_spa_range(ACPI_TABLE_NFIT *nfitbl, uint16_t range_index, + ACPI_NFIT_SYSTEM_ADDRESS **spa) +{ + + *spa = NULL; + find_matches(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, + offsetof(ACPI_NFIT_SYSTEM_ADDRESS, RangeIndex), UINT16_MAX, + range_index, (void **)spa, 1); +} + +void +acpi_nfit_get_spa_ranges(ACPI_TABLE_NFIT *nfitbl, + ACPI_NFIT_SYSTEM_ADDRESS ***listp, int *countp) +{ + + malloc_find_matches(nfitbl, ACPI_NFIT_TYPE_SYSTEM_ADDRESS, 0, 0, 0, + (void ***)listp, countp); +} + +void +acpi_nfit_get_region_mappings_by_spa_range(ACPI_TABLE_NFIT *nfitbl, + uint16_t spa_range_index, ACPI_NFIT_MEMORY_MAP ***listp, int *countp) +{ + + malloc_find_matches(nfitbl, ACPI_NFIT_TYPE_MEMORY_MAP, + offsetof(ACPI_NFIT_MEMORY_MAP, RangeIndex), UINT16_MAX, + spa_range_index, (void ***)listp, countp); +} + +void acpi_nfit_get_control_region(ACPI_TABLE_NFIT *nfitbl, + uint16_t control_region_index, ACPI_NFIT_CONTROL_REGION **out) +{ + + *out = NULL; + find_matches(nfitbl, ACPI_NFIT_TYPE_CONTROL_REGION, + offsetof(ACPI_NFIT_CONTROL_REGION, RegionIndex), UINT16_MAX, + control_region_index, (void **)out, 1); +} + +void +acpi_nfit_get_flush_addrs(ACPI_TABLE_NFIT *nfitbl, nfit_handle_t dimm, + uint64_t ***listp, int *countp) +{ + ACPI_NFIT_FLUSH_ADDRESS *subtable; + int i; + + subtable = NULL; + find_matches(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS, + offsetof(ACPI_NFIT_FLUSH_ADDRESS, DeviceHandle), UINT32_MAX, + dimm, (void **)&subtable, 1); + if (subtable == NULL || subtable->HintCount == 0) { + *listp = NULL; + *countp = 0; + return; + } + *countp = subtable->HintCount; + *listp = mallocarray(subtable->HintCount, sizeof(uint64_t *), M_NVDIMM, + M_WAITOK); + for (i = 0; i < subtable->HintCount; i++) + (*listp)[i] = (uint64_t *)(intptr_t)subtable->HintAddress[i]; +} Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Thu Jan 31 22:43:20 2019 (r343628) +++ head/sys/dev/nvdimm/nvdimm_var.h Thu Jan 31 22:47:04 2019 (r343629) @@ -91,10 +91,20 @@ struct SPA_mapping { MALLOC_DECLARE(M_NVDIMM); +void acpi_nfit_get_dimm_ids(ACPI_TABLE_NFIT *nfitbl, nfit_handle_t **listp, + int *countp); +void acpi_nfit_get_spa_range(ACPI_TABLE_NFIT *nfitbl, uint16_t range_index, + ACPI_NFIT_SYSTEM_ADDRESS **spa); +void acpi_nfit_get_spa_ranges(ACPI_TABLE_NFIT *nfitbl, + ACPI_NFIT_SYSTEM_ADDRESS ***listp, int *countp); +void acpi_nfit_get_region_mappings_by_spa_range(ACPI_TABLE_NFIT *nfitbl, + uint16_t spa_range_index, ACPI_NFIT_MEMORY_MAP ***listp, int *countp); +void acpi_nfit_get_control_region(ACPI_TABLE_NFIT *nfitbl, + uint16_t control_region_index, ACPI_NFIT_CONTROL_REGION **out); +void acpi_nfit_get_flush_addrs(ACPI_TABLE_NFIT *nfitbl, nfit_handle_t dimm, + uint64_t ***listp, int *countp); enum SPA_mapping_type nvdimm_spa_type_from_uuid(struct uuid *); struct nvdimm_dev *nvdimm_find_by_handle(nfit_handle_t nv_handle); -int nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum AcpiNfitType type, - int (*cb)(void *, void *), void *arg); int nvdimm_spa_init(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, enum SPA_mapping_type spa_type); void nvdimm_spa_fini(struct SPA_mapping *spa); Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Thu Jan 31 22:43:20 2019 (r343628) +++ head/sys/modules/nvdimm/Makefile Thu Jan 31 22:47:04 2019 (r343629) @@ -4,6 +4,7 @@ KMOD= nvdimm SRCS= nvdimm.c \ + nvdimm_nfit.c \ nvdimm_spa.c SRCS+= acpi_if.h bus_if.h device_if.h From owner-svn-src-head@freebsd.org Thu Jan 31 22:58:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64FCD14BAF2D; Thu, 31 Jan 2019 22:58:18 +0000 (UTC) (envelope-from brooks@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 0836877847; Thu, 31 Jan 2019 22:58:18 +0000 (UTC) (envelope-from brooks@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 ECF4CE484; Thu, 31 Jan 2019 22:58:17 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VMwHJe095570; Thu, 31 Jan 2019 22:58:17 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VMwH0W095567; Thu, 31 Jan 2019 22:58:17 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901312258.x0VMwH0W095567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 31 Jan 2019 22:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343630 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 343630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0836877847 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_LONG(-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] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 22:58:18 -0000 Author: brooks Date: Thu Jan 31 22:58:17 2019 New Revision: 343630 URL: https://svnweb.freebsd.org/changeset/base/343630 Log: Regen after r342190. Differential Revision: https://reviews.freebsd.org/D18444 Modified: head/sys/kern/systrace_args.c head/sys/sys/sysproto.h Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Jan 31 22:47:04 2019 (r343629) +++ head/sys/kern/systrace_args.c Thu Jan 31 22:58:17 2019 (r343630) @@ -972,7 +972,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg uarg[1] = p->namelen; /* u_int */ uarg[2] = (intptr_t) p->old; /* void * */ uarg[3] = (intptr_t) p->oldlenp; /* size_t * */ - uarg[4] = (intptr_t) p->new; /* void * */ + uarg[4] = (intptr_t) p->new; /* const void * */ uarg[5] = p->newlen; /* size_t */ *n_args = 6; break; @@ -4867,7 +4867,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland size_t *"; break; case 4: - p = "userland void *"; + p = "userland const void *"; break; case 5: p = "size_t"; Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Jan 31 22:47:04 2019 (r343629) +++ head/sys/sys/sysproto.h Thu Jan 31 22:58:17 2019 (r343630) @@ -560,7 +560,7 @@ struct sysctl_args { char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; char oldlenp_l_[PADL_(size_t *)]; size_t * oldlenp; char oldlenp_r_[PADR_(size_t *)]; - char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; + char new_l_[PADL_(const void *)]; const void * new; char new_r_[PADR_(const void *)]; char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; }; struct mlock_args { From owner-svn-src-head@freebsd.org Thu Jan 31 23:01:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E355814BB005; Thu, 31 Jan 2019 23:01:05 +0000 (UTC) (envelope-from glebius@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 930BA77A38; Thu, 31 Jan 2019 23:01:05 +0000 (UTC) (envelope-from glebius@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 864CEE5BE; Thu, 31 Jan 2019 23:01:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VN15if097223; Thu, 31 Jan 2019 23:01:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VN13lM097213; Thu, 31 Jan 2019 23:01:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201901312301.x0VN13lM097213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 31 Jan 2019 23:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf X-SVN-Commit-Revision: 343631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 930BA77A38 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.998,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.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:01:06 -0000 Author: glebius Date: Thu Jan 31 23:01:03 2019 New Revision: 343631 URL: https://svnweb.freebsd.org/changeset/base/343631 Log: New pfil(9) KPI together with newborn pfil API and control utility. The KPI have been reviewed and cleansed of features that were planned back 20 years ago and never implemented. The pfil(9) internals have been made opaque to protocols with only returned types and function declarations exposed. The KPI is made more strict, but at the same time more extensible, as kernel uses same command structures that userland ioctl uses. In nutshell [KA]PI is about declaring filtering points, declaring filters and linking and unlinking them together. New [KA]PI makes it possible to reconfigure pfil(9) configuration: change order of hooks, rehook filter from one filtering point to a different one, disconnect a hook on output leaving it on input only, prepend/append a filter to existing list of filters. Now it possible for a single packet filter to provide multiple rulesets that may be linked to different points. Think of per-interface ACLs in Cisco or Juniper. None of existing packet filters yet support that, however limited usage is already possible, e.g. default ruleset can be moved to single interface, as soon as interface would pride their filtering points. Another future feature is possiblity to create pfil heads, that provide not an mbuf pointer but just a memory pointer with length. That would allow filtering at very early stages of a packet lifecycle, e.g. when packet has just been received by a NIC and no mbuf was yet allocated. Differential Revision: https://reviews.freebsd.org/D18951 Added: head/sbin/pfilctl/ head/sbin/pfilctl/Makefile (contents, props changed) head/sbin/pfilctl/pfilctl.8 (contents, props changed) head/sbin/pfilctl/pfilctl.c (contents, props changed) Modified: head/ObsoleteFiles.inc head/sbin/Makefile head/share/man/man9/Makefile head/share/man/man9/pfil.9 head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/net/if_bridge.c head/sys/net/if_enc.c head/sys/net/if_ethersubr.c head/sys/net/if_var.h head/sys/net/pfil.c head/sys/net/pfil.h head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/ip_var.h head/sys/netinet/siftr.c head/sys/netinet6/ip6_fastfwd.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h head/sys/netpfil/ipfw/ip_fw_eaction.c head/sys/netpfil/ipfw/ip_fw_pfil.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jan 31 22:58:17 2019 (r343630) +++ head/ObsoleteFiles.inc Thu Jan 31 23:01:03 2019 (r343631) @@ -38,6 +38,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20190131: pfil(9) changed +OLD_FILES+=usr/share/man/man9/pfil_hook_get.9 +OLD_FILES+=usr/share/man/man9/pfil_rlock.9 +OLD_FILES+=usr/share/man/man9/pfil_runlock.9 +OLD_FILES+=usr/share/man/man9/pfil_wlock.9 +OLD_FILES+=usr/share/man/man9/pfil_wunlock.9 # 20190126: adv(4) / adw(4) removal OLD_FILES+=usr/share/man/man4/adv.4.gz OLD_FILES+=usr/share/man/man4/adw.4.gz Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Thu Jan 31 22:58:17 2019 (r343630) +++ head/sbin/Makefile Thu Jan 31 23:01:03 2019 (r343631) @@ -52,6 +52,7 @@ SUBDIR=adjkerntz \ newfs_msdos \ nfsiod \ nos-tun \ + pfilctl \ ping \ rcorder \ reboot \ Added: head/sbin/pfilctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfilctl/Makefile Thu Jan 31 23:01:03 2019 (r343631) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= pfilctl +SRCS= pfilctl.c +WARNS?= 6 + +MAN= pfilctl.8 + +.include Added: head/sbin/pfilctl/pfilctl.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfilctl/pfilctl.8 Thu Jan 31 23:01:03 2019 (r343631) @@ -0,0 +1,117 @@ +.\" Copyright (c) 2019 Gleb Smirnoff +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 28, 2019 +.Dt PFILCTL 8 +.Os +.Sh NAME +.Nm pfilctl +.Nd pfil(9) control utility +.Sh SYNOPSIS +.Nm +.Cm heads +.Nm +.Cm hooks +.Nm +.Cm link +.Aq Fl i | Fl o +.Op Fl a +.Ar hook Ar head +.Nm +.Cm unlink +.Aq Fl i | Fl o +.Ar hook Ar head +.Sh DESCRIPTION +The +.Nm +utility is intended to view and change configuration of the +.Xr pfil 9 +packet filtering hooks and filters on them. +.Sh COMMANDS +.Bl -tag -width "unlink" +.It Cm heads +List available packet filtering points. +.It Cm hooks +List available packet filters. +.It Xo +.Cm link +.Aq Fl i | Fl o +.Op Fl a +.Ar hook Ar head +.Xc +Link +.Ar hook +to +.Ar head . +With the +.Fl i +flag the hook will be connected as input and with +.Fl o +as output hook. +At least one of +.Fl i +or +.Fl o +is required. +By default +.Nm +will prepend the hook in front of other hooks if any present: +new hook will be as close to the wire as possible, so that on input +it will be the first filter and on output it will be the last. +Adding the +.Fl a +flag switches to appending new hook instead of prepending. +.It Xo +.Cm unlink +.Aq Fl i | Fl o +.Ar hook Ar head +.Xc +Unlink +.Ar hook +on +.Ar head . +At least one of +.Fl i +or +.Fl o +is required. +With the +.Fl i +flag the hook will be removed from the input list of hooks +and with +.Fl o +on output list. +.El +.Sh SEE ALSO +.Xr ipfilter 4 , +.Xr ipfw 4 , +.Xr pf 4 , +.Xr pfil 9 +.Sh AUTHORS +.An -nosplit +The +.Nm +utility was written by +.An Gleb Smirnoff Aq Mt glebius@FreeBSD.org . Added: head/sbin/pfilctl/pfilctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfilctl/pfilctl.c Thu Jan 31 23:01:03 2019 (r343631) @@ -0,0 +1,230 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Gleb Smirnoff + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static int dev; + +static const char * const typenames[] = { + [PFIL_TYPE_IP4] = "IPv4", + [PFIL_TYPE_IP6] = "IPv6", + [PFIL_TYPE_ETHERNET] = "Ethernet", +}; + +static void listheads(int argc, char *argv[]); +static void listhooks(int argc, char *argv[]); +static void hook(int argc, char *argv[]); +static void help(void); + +static const struct cmd { + const char *cmd_name; + void (*cmd_func)(int argc, char *argv[]); +} cmds[] = { + { "heads", listheads }, + { "hooks", listhooks }, + { "link", hook }, + { "unlink", hook }, + { NULL, NULL }, +}; + +int +main(int argc __unused, char *argv[] __unused) +{ + int cmd = -1; + + if (--argc == 0) + help(); + argv++; + + for (int i = 0; cmds[i].cmd_name != NULL; i++) + if (!strncmp(argv[0], cmds[i].cmd_name, strlen(argv[0]))) { + if (cmd != -1) + errx(1, "ambiguous command: %s", argv[0]); + cmd = i; + } + if (cmd == -1) + errx(1, "unknown command: %s", argv[0]); + + dev = open("/dev/" PFILDEV, O_RDWR); + if (dev == -1) + err(1, "open(%s)", "/dev/" PFILDEV); + + (*cmds[cmd].cmd_func)(argc, argv); + + return (0); +} + +static void +help(void) +{ + extern char *__progname; + + fprintf(stderr, "usage: %s (heads|hooks|link|unlink)\n", __progname); + exit(0); +} + +static void +listheads(int argc __unused, char *argv[] __unused) +{ + struct pfilioc_list plh; + u_int nheads, nhooks, i; + int j, h; + + plh.pio_nheads = 0; + plh.pio_nhooks = 0; + if (ioctl(dev, PFILIOC_LISTHEADS, &plh) != 0) + err(1, "ioctl(PFILIOC_LISTHEADS)"); + +retry: + plh.pio_heads = calloc(plh.pio_nheads, sizeof(struct pfilioc_head)); + if (plh.pio_heads == NULL) + err(1, "malloc"); + plh.pio_hooks = calloc(plh.pio_nhooks, sizeof(struct pfilioc_hook)); + if (plh.pio_hooks == NULL) + err(1, "malloc"); + + nheads = plh.pio_nheads; + nhooks = plh.pio_nhooks; + + if (ioctl(dev, PFILIOC_LISTHEADS, &plh) != 0) + err(1, "ioctl(PFILIOC_LISTHEADS)"); + + if (plh.pio_nheads > nheads || plh.pio_nhooks > nhooks) { + free(plh.pio_heads); + free(plh.pio_hooks); + goto retry; + } + +#define FMTHD "%16s %8s\n" +#define FMTHK "%29s %16s %16s\n" + printf(FMTHD, "Intercept point", "Type"); + for (i = 0, h = 0; i < plh.pio_nheads; i++) { + printf(FMTHD, plh.pio_heads[i].pio_name, + typenames[plh.pio_heads[i].pio_type]); + for (j = 0; j < plh.pio_heads[i].pio_nhooksin; j++, h++) + printf(FMTHK, "In", plh.pio_hooks[h].pio_module, + plh.pio_hooks[h].pio_ruleset); + for (j = 0; j < plh.pio_heads[i].pio_nhooksout; j++, h++) + printf(FMTHK, "Out", plh.pio_hooks[h].pio_module, + plh.pio_hooks[h].pio_ruleset); + } +} + +static void +listhooks(int argc __unused, char *argv[] __unused) +{ + struct pfilioc_list plh; + u_int nhooks, i; + + plh.pio_nhooks = 0; + if (ioctl(dev, PFILIOC_LISTHEADS, &plh) != 0) + err(1, "ioctl(PFILIOC_LISTHEADS)"); +retry: + plh.pio_hooks = calloc(plh.pio_nhooks, sizeof(struct pfilioc_hook)); + if (plh.pio_hooks == NULL) + err(1, "malloc"); + + nhooks = plh.pio_nhooks; + + if (ioctl(dev, PFILIOC_LISTHOOKS, &plh) != 0) + err(1, "ioctl(PFILIOC_LISTHOOKS)"); + + if (plh.pio_nhooks > nhooks) { + free(plh.pio_hooks); + goto retry; + } + + printf("Available hooks:\n"); + for (i = 0; i < plh.pio_nhooks; i++) { + printf("\t%s:%s %s\n", plh.pio_hooks[i].pio_module, + plh.pio_hooks[i].pio_ruleset, + typenames[plh.pio_hooks[i].pio_type]); + } +} + +static void +hook(int argc, char *argv[]) +{ + struct pfilioc_link req; + int c; + char *ruleset; + + if (argv[0][0] == 'u') + req.pio_flags = PFIL_UNLINK; + else + req.pio_flags = 0; + + while ((c = getopt(argc, argv, "ioa")) != -1) + switch (c) { + case 'i': + req.pio_flags |= PFIL_IN; + break; + case 'o': + req.pio_flags |= PFIL_OUT; + break; + case 'a': + req.pio_flags |= PFIL_APPEND; + break; + default: + help(); + } + + if (!PFIL_DIR(req.pio_flags)) + help(); + + argc -= optind; + argv += optind; + + if (argc != 2) + help(); + + /* link mod:ruleset head */ + if ((ruleset = strchr(argv[0], ':')) == NULL) + help(); + *ruleset = '\0'; + ruleset++; + + strlcpy(req.pio_name, argv[1], sizeof(req.pio_name)); + strlcpy(req.pio_module, argv[0], sizeof(req.pio_module)); + strlcpy(req.pio_ruleset, ruleset, sizeof(req.pio_ruleset)); + + if (ioctl(dev, PFILIOC_LINK, &req) != 0) + err(1, "ioctl(PFILIOC_LINK)"); +} Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jan 31 22:58:17 2019 (r343630) +++ head/share/man/man9/Makefile Thu Jan 31 23:01:03 2019 (r343631) @@ -1635,13 +1635,9 @@ MLINKS+=pci_iov_schema.9 pci_iov_schema_alloc_node.9 \ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_head_register.9 \ pfil.9 pfil_head_unregister.9 \ - pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 \ - pfil.9 pfil_rlock.9 \ pfil.9 pfil_run_hooks.9 \ - pfil.9 pfil_runlock.9 \ - pfil.9 pfil_wlock.9 \ - pfil.9 pfil_wunlock.9 + pfil.9 pfil_link.9 MLINKS+=pfind.9 zpfind.9 MLINKS+=PHOLD.9 PRELE.9 \ PHOLD.9 _PHOLD.9 \ Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Thu Jan 31 22:58:17 2019 (r343630) +++ head/share/man/man9/pfil.9 Thu Jan 31 23:01:03 2019 (r343631) @@ -1,5 +1,6 @@ .\" $NetBSD: pfil.9,v 1.22 2003/07/01 13:04:06 wiz Exp $ .\" +.\" Copyright (c) 2019 Gleb Smirnoff .\" Copyright (c) 1996 Matthew R. Green .\" All rights reserved. .\" @@ -28,194 +29,127 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2018 +.Dd January 28, 2019 .Dt PFIL 9 .Os .Sh NAME .Nm pfil , .Nm pfil_head_register , .Nm pfil_head_unregister , -.Nm pfil_head_get , -.Nm pfil_add_hook , -.Nm pfil_add_hook_flags , -.Nm pfil_remove_hook , -.Nm pfil_remove_hook_flags , -.Nm pfil_run_hooks , -.Nm pfil_rlock , -.Nm pfil_runlock , -.Nm pfil_wlock , -.Nm pfil_wunlock +.Nm pfil_link , +.Nm pfil_run_hooks .Nd packet filter interface .Sh SYNOPSIS .In sys/param.h .In sys/mbuf.h -.In net/if.h .In net/pfil.h -.Bd -literal -typedef int (*pfil_func_t)(void *arg, struct mbuf **mp, struct ifnet *, int dir, struct inpcb); -.Bd -literal -typedef int (*pfil_func_flags_t)(void *arg, struct mbuf **mp, struct ifnet *, int dir, int flags, struct inpcb); -.Ft int -.Fn pfil_head_register "struct pfil_head *head" -.Ft int -.Fn pfil_head_unregister "struct pfil_head *head" -.Ft "struct pfil_head *" -.Fn pfil_head_get "int af" "u_long dlt" -.Ft int -.Fn pfil_add_hook "pfil_func_t" "void *arg" "struct pfil_head *" -.Ft int -.Fn pfil_add_hook_flags "pfil_func_flags_t" "void *arg" "int flags" "struct pfil_head *" -.Ft int -.Fn pfil_remove_hook "pfil_func_t" "void *arg" "struct pfil_head *" -.Ft int -.Fn pfil_remove_hook_flags "pfil_func_flags_t" "void *arg" "int flags" "struct pfil_head *" -.Ft int -.Fn pfil_run_hooks "struct pfil_head *head" "struct mbuf **mp" "struct ifnet *" "int dir" "int flags" "struct inpcb *" +.Ft pfil_head_t +.Fn pfil_head_register "struct pfil_head_args *args" .Ft void -.Fn pfil_rlock "struct pfil_head *" "struct rm_priotracker *" +.Fn pfil_head_unregister "struct pfil_head_t *head" +.Ft pfil_hook_t +.Fn pfil_add_hook "struct pfil_hook_args *" .Ft void -.Fn pfil_runlock "struct pfil_head *" "struct rm_priotracker *" -.Ft void -.Fn pfil_wlock "struct pfil_head *" -.Ft void -.Fn pfil_wunlock "struct pfil_head *" -.Ed +.Fn pfil_remove_hook "pfil_hook_t" +.Ft int +.Fn pfil_link "struct pfil_link_args *args" +.Ft int +.Fn pfil_run_hooks "phil_head_t *" "pfil_packet_t" "struct ifnet *" "int" "struct inpcb *" .Sh DESCRIPTION The .Nm -framework allows for a specified function to be invoked for every -incoming or outgoing packet for a particular network I/O stream. +framework allows for a specified function or a list of functions +to be invoked for every incoming or outgoing packet for a particular +network I/O stream. These hooks may be used to implement a firewall or perform packet transformations. .Pp -Packet filtering points are registered with +Packet filtering points, for historical reasons named +.Em heads , +are registered with .Fn pfil_head_register . -Filtering points are identified by a key -.Pq Vt "void *" -and a data link type -.Pq Vt int -in the -.Vt pfil_head -structure. -Packet filters use the key and data link type to look up the filtering -point with which they register themselves. -The key is unique to the filtering point. -The data link type is a -.Xr bpf 4 -DLT constant indicating what kind of header is present on the packet -at the filtering point. -Each filtering point uses common per-VNET rmlock by default. -This can be changed by specifying -.Vt PFIL_FLAG_PRIVATE_LOCK -as -.Vt "flags" -field in the -.Vt pfil_head -structure. -Note that specifying private lock can break filters sharing the same -ruleset and/or state between different data link types. -Filtering points may be unregistered with the -.Fn pfil_head_unregister -function. +The function is supplied with special versioned +.Vt struct pfil_head_args +structure that specifies type and features of the head as well as +human readable name. +If the filtering point to be ever destroyed, the subsystem that +created it must unregister it with call to +.Fn pfil_head_unregister . .Pp -Packet filters register/unregister themselves with a filtering point -with the +Packet filtering systems may register arbitrary number of filters, +for historical reasons named +.Em hooks . +To register a new hook .Fn pfil_add_hook -and +with special versioned +.Vt struct pfil_hook_args +structure is called. +The structure specifies type and features of the hook, pointer to +the actual filtering function and user readable name of the filtering +module and ruleset name. +Later hooks can be removed with .Fn pfil_remove_hook -functions, respectively. -.I -The head is looked up using the -.Fn pfil_head_get -function, which takes the key and data link type that the packet filter -expects. -Filters may provide an argument to be passed to the filter when -invoked on a packet. +functions. .Pp -When a filter is invoked, the packet appears just as if it -.Dq came off the wire . -That is, all protocol fields are in network byte order. -The filter is called with its specified argument, the pointer to the -pointer to the -.Vt mbuf -containing the packet, the pointer to the network -interface that the packet is traversing, and the direction -.Dv ( PFIL_IN -or -.Dv PFIL_OUT ) -that the packet is traveling. -The -.Vt flags -argument will indicate if an outgoing packet is simply being forwarded with the -value PFIL_FWD. -The filter may change which mbuf the -.Vt "mbuf\ **" -argument references. -The filter returns an error (errno) if the packet processing is to stop, or 0 -if the processing is to continue. -If the packet processing is to stop, it is the responsibility of the -filter to free the packet. -.Pp -Every filter hook is called with +To connect existing +.Em hook +to an existing +.Em head +function +.Fn pfil_link +shall be used. +The function is supplied with versioned +.Vt struct pfil_link_args +structure that specifies either literal names of hook and head or +pointers to them. +Typically +.Fn pfil_link +is called by filtering modules to autoregister their default ruleset +and default filtering points. +It also serves on the kernel side of +.Xr ioctl 2 +when user changes .Nm -read lock held. -All heads uses the same lock within the same VNET instance. -Packet filter can use this lock instead of own locking model to -improve performance. -Since -.Nm -uses -.Xr rmlock 9 -.Fn pfil_rlock -and -.Fn pfil_runlock -require -.Va struct rm_priotracker -to be passed as argument. -Filter can acquire and release writer lock via -.Fn pfil_wlock -and -.Fn pfil_wunlock -functions. -See -.Xr rmlock 9 -for more details. -.Sh FILTERING POINTS -Currently, filtering points are implemented for the following link types: +configuration with help of +.Xr pfilctl 8 +utility. .Pp -.Bl -tag -width "AF_INET6" -offset XXX -compact -.It AF_INET +For every packet traveling through a +.Em head +the latter shall invoke +.Fn pfil_run_hooks . +The function can accept either +.Vt struct mbuf * +pointer or a +.Vt void * +pointer and length. +In case if a hooked filtering module cannot understand +.Vt void * +pointer +.Nm +will provide it with a fake one. +All calls to +.Fn pfil_run_hooks +are performed in network +.Xr epoch 9 . +.Sh HEADS (filtering points) +By default kernel creates the following heads: +.Bl -tag -width "ethernet" +.It inet IPv4 packets. -.It AF_INET6 +.It inet6 IPv6 packets. -.It AF_LINK +.It ethernet Link-layer packets. .El -.Sh RETURN VALUES -If successful, -.Fn pfil_head_get -returns the -.Vt pfil_head -structure for the given key/dlt. -The -.Fn pfil_add_hook -and -.Fn pfil_remove_hook -functions -return 0 if successful. -If called with flag -.Dv PFIL_WAITOK , -.Fn pfil_remove_hook -is expected to always succeed. .Pp -The -.Fn pfil_head_unregister -function -might sleep! +Default rulesets are automatically linked to these heads to preserve +historical behavavior. .Sh SEE ALSO -.Xr bpf 4 , -.Xr if_bridge 4 , -.Xr rmlock 9 +.Xr ipfilter 4 , +.Xr ipfw 4 , +.Xr pf 4 , +.Xr pfilctl 8 .Sh HISTORY The .Nm @@ -223,45 +157,8 @@ interface first appeared in .Nx 1.3 . The .Nm -input and output lists were originally implemented as -.In sys/queue.h -.Dv LIST -structures; -however this was changed in -.Nx 1.4 -to -.Dv TAILQ -structures. -This change was to allow the input and output filters to be processed in -reverse order, to allow the same path to be taken, in or out of the kernel. -.Pp -The -.Nm -interface was changed in 1.4T to accept a 3rd parameter to both -.Fn pfil_add_hook -and -.Fn pfil_remove_hook , -introducing the capability of per-protocol filtering. -This was done primarily in order to support filtering of IPv6. -.Pp -In 1.5K, the -.Nm -framework was changed to work with an arbitrary number of filtering points, -as well as be less IP-centric. -.Pp -Fine-grained locking was added in +interface was imported into .Fx 5.2 . -.Nm -lock export was added in -.Fx 10.0 . -.Sh BUGS -When a -.Vt pfil_head -is being modified, no traffic is diverted -(to avoid deadlock). -This means that traffic may be dropped unconditionally for a short period -of time. -.Fn pfil_run_hooks -will return -.Er ENOBUFS -to indicate this. +In +.Fx 13.0 +the interface was significantly rewritten. Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Jan 31 22:58:17 2019 (r343630) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Jan 31 23:01:03 2019 (r343631) @@ -25,6 +25,7 @@ static const char rcsid[] = "@(#)$Id$"; # include "opt_random_ip_id.h" #endif #include +#include #include #include #include @@ -126,32 +127,33 @@ static void ipf_ifevent(arg, ifp) -static int -ipf_check_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir) +static pfil_return_t +ipf_check_wrapper(struct mbuf **mp, struct ifnet *ifp, int flags, + void *ruleset __unused, struct inpcb *inp) { struct ip *ip = mtod(*mp, struct ip *); - int rv; + pfil_return_t rv; CURVNET_SET(ifp->if_vnet); - rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp, (dir == PFIL_OUT), - mp); + rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp, (flags & PFIL_OUT), + mp); CURVNET_RESTORE(); - return rv; + return (rv == 0 ? PFIL_PASS : PFIL_DROPPED); } -# ifdef USE_INET6 -# include - -static int -ipf_check_wrapper6(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir) +#ifdef USE_INET6 +static pfil_return_t +ipf_check_wrapper6(struct mbuf **mp, struct ifnet *ifp, int flags, + void *ruleset __unused, struct inpcb *inp) { - int error; + pfil_return_t rv; CURVNET_SET(ifp->if_vnet); - error = ipf_check(&V_ipfmain, mtod(*mp, struct ip *), - sizeof(struct ip6_hdr), ifp, (dir == PFIL_OUT), mp); + rv = ipf_check(&V_ipfmain, mtod(*mp, struct ip *), + sizeof(struct ip6_hdr), ifp, (flags & PFIL_OUT), mp); CURVNET_RESTORE(); - return (error); + + return (rv == 0 ? PFIL_PASS : PFIL_DROPPED); } # endif #if defined(IPFILTER_LKM) @@ -1318,53 +1320,62 @@ ipf_inject(fin, m) return error; } +VNET_DEFINE_STATIC(pfil_hook_t, ipf_inet_hook); +VNET_DEFINE_STATIC(pfil_hook_t, ipf_inet6_hook); +#define V_ipf_inet_hook VNET(ipf_inet_hook) +#define V_ipf_inet6_hook VNET(ipf_inet6_hook) + int ipf_pfil_unhook(void) { - struct pfil_head *ph_inet; + + pfil_remove_hook(V_ipf_inet_hook); + #ifdef USE_INET6 - struct pfil_head *ph_inet6; + pfil_remove_hook(V_ipf_inet6_hook); #endif - ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); - if (ph_inet != NULL) - pfil_remove_hook((void *)ipf_check_wrapper, NULL, - PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet); -# ifdef USE_INET6 - ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); - if (ph_inet6 != NULL) - pfil_remove_hook((void *)ipf_check_wrapper6, NULL, - PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); -# endif - return (0); } int ipf_pfil_hook(void) { - struct pfil_head *ph_inet; + struct pfil_hook_args pha; + struct pfil_link_args pla; + int error, error6; + + pha.pa_version = PFIL_VERSION; + pha.pa_flags = PFIL_IN | PFIL_OUT; + pha.pa_modname = "ipfilter"; + pha.pa_rulname = "default"; + pha.pa_func = ipf_check_wrapper; + pha.pa_ruleset = NULL; + pha.pa_type = PFIL_TYPE_IP4; + V_ipf_inet_hook = pfil_add_hook(&pha); + #ifdef USE_INET6 - struct pfil_head *ph_inet6; + pha.pa_func = ipf_check_wrapper6; + pha.pa_type = PFIL_TYPE_IP6; + V_ipf_inet6_hook = pfil_add_hook(&pha); #endif - ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); -# ifdef USE_INET6 - ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); -# endif - if (ph_inet == NULL -# ifdef USE_INET6 - && ph_inet6 == NULL -# endif - ) { - return ENODEV; - } + pla.pa_version = PFIL_VERSION; + pla.pa_flags = PFIL_IN | PFIL_OUT | + PFIL_HEADPTR | PFIL_HOOKPTR; + pla.pa_head = V_inet_pfil_head; + pla.pa_hook = V_ipf_inet_hook; + error = pfil_link(&pla); - if (ph_inet != NULL) - pfil_add_hook((void *)ipf_check_wrapper, NULL, - PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet); -# ifdef USE_INET6 - if (ph_inet6 != NULL) - pfil_add_hook((void *)ipf_check_wrapper6, NULL, - PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); -# endif - return (0); + error6 = 0; +#ifdef USE_INET6 + pla.pa_head = V_inet6_pfil_head; + pla.pa_hook = V_ipf_inet6_hook; + error6 = pfil_link(&pla); +#endif + + if (error || error6) + error = ENODEV; + else + error = 0; + + return (error); } void Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Jan 31 22:58:17 2019 (r343630) +++ head/sys/net/if_bridge.c Thu Jan 31 23:01:03 2019 (r343631) @@ -1970,9 +1970,9 @@ bridge_dummynet(struct mbuf *m, struct ifnet *ifp) return; } - if (PFIL_HOOKED(&V_inet_pfil_hook) + if (PFIL_HOOKED_OUT(V_inet_pfil_head) #ifdef INET6 - || PFIL_HOOKED(&V_inet6_pfil_hook) + || PFIL_HOOKED_OUT(V_inet6_pfil_head) #endif ) { if (bridge_pfil(&m, sc->sc_ifp, ifp, PFIL_OUT) != 0) @@ -2230,9 +2230,9 @@ bridge_forward(struct bridge_softc *sc, struct bridge_ ETHER_BPF_MTAP(ifp, m); /* run the packet filter */ - if (PFIL_HOOKED(&V_inet_pfil_hook) + if (PFIL_HOOKED_IN(V_inet_pfil_head) #ifdef INET6 - || PFIL_HOOKED(&V_inet6_pfil_hook) + || PFIL_HOOKED_IN(V_inet6_pfil_head) #endif ) { BRIDGE_UNLOCK(sc); @@ -2270,9 +2270,9 @@ bridge_forward(struct bridge_softc *sc, struct bridge_ BRIDGE_UNLOCK(sc); - if (PFIL_HOOKED(&V_inet_pfil_hook) + if (PFIL_HOOKED_OUT(V_inet_pfil_head) #ifdef INET6 - || PFIL_HOOKED(&V_inet6_pfil_hook) + || PFIL_HOOKED_OUT(V_inet6_pfil_head) #endif ) { if (bridge_pfil(&m, ifp, dst_if, PFIL_OUT) != 0) @@ -2409,7 +2409,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) #ifdef INET6 # define OR_PFIL_HOOKED_INET6 \ - || PFIL_HOOKED(&V_inet6_pfil_hook) + || PFIL_HOOKED_IN(V_inet6_pfil_head) #else # define OR_PFIL_HOOKED_INET6 #endif @@ -2427,7 +2427,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) if_inc_counter(iface, IFCOUNTER_IBYTES, m->m_pkthdr.len); \ /* Filter on the physical interface. */ \ if (V_pfil_local_phys && \ - (PFIL_HOOKED(&V_inet_pfil_hook) \ + (PFIL_HOOKED_IN(V_inet_pfil_head) \ OR_PFIL_HOOKED_INET6)) { \ if (bridge_pfil(&m, NULL, ifp, \ PFIL_IN) != 0 || m == NULL) { \ @@ -2517,9 +2517,9 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet } /* Filter on the bridge interface before broadcasting */ - if (runfilt && (PFIL_HOOKED(&V_inet_pfil_hook) + if (runfilt && (PFIL_HOOKED_OUT(V_inet_pfil_head) #ifdef INET6 - || PFIL_HOOKED(&V_inet6_pfil_hook) + || PFIL_HOOKED_OUT(V_inet6_pfil_head) #endif )) { if (bridge_pfil(&m, sc->sc_ifp, NULL, PFIL_OUT) != 0) @@ -2564,9 +2564,9 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet * pointer so we do not redundantly filter on the bridge for * each interface we broadcast on. */ - if (runfilt && (PFIL_HOOKED(&V_inet_pfil_hook) + if (runfilt && (PFIL_HOOKED_OUT(V_inet_pfil_head) #ifdef INET6 - || PFIL_HOOKED(&V_inet6_pfil_hook) + || PFIL_HOOKED_OUT(V_inet6_pfil_head) #endif )) { if (used == 0) { @@ -3101,6 +3101,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, stru struct ip *ip; struct llc llc1; u_int16_t ether_type; + pfil_return_t rv; snap = 0; error = -1; /* Default error if not error == 0 */ @@ -3172,14 +3173,14 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, stru } /* Run the packet through pfil before stripping link headers */ - if (PFIL_HOOKED(&V_link_pfil_hook) && V_pfil_ipfw != 0 && *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jan 31 23:01:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C50314BB042; Thu, 31 Jan 2019 23:01:13 +0000 (UTC) (envelope-from brooks@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 CCDC477A79; Thu, 31 Jan 2019 23:01:12 +0000 (UTC) (envelope-from brooks@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 A7C1BE5C9; Thu, 31 Jan 2019 23:01:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VN1CXw097273; Thu, 31 Jan 2019 23:01:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VN1Cle097272; Thu, 31 Jan 2019 23:01:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901312301.x0VN1Cle097272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 31 Jan 2019 23:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343632 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 343632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCDC477A79 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.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:01:13 -0000 Author: brooks Date: Thu Jan 31 23:01:12 2019 New Revision: 343632 URL: https://svnweb.freebsd.org/changeset/base/343632 Log: Remove iBCS2: also remove xenix syscall function support. Missed in r342243. Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Thu Jan 31 23:01:03 2019 (r343631) +++ head/sys/kern/makesyscalls.sh Thu Jan 31 23:01:12 2019 (r343632) @@ -526,8 +526,7 @@ sed -e ' if (!flag("NOPROTO") && !flag("NODEF")) { if (funcname == "nosys" || funcname == "lkmnosys" || funcname == "sysarch" || funcname ~ /^freebsd/ || - funcname ~ /^linux/ || funcname ~ /^xenix/ || - funcname ~ /^cloudabi/) { + funcname ~ /^linux/ || funcname ~ /^cloudabi/) { printf("%s\t%s(struct thread *, struct %s *)", rettype, funcname, argalias) > sysdcl } else { @@ -546,8 +545,7 @@ sed -e ' } else { if (funcname == "nosys" || funcname == "sysarch" || funcname == "lkmnosys" || funcname ~ /^freebsd/ || - funcname ~ /^linux/ || funcname ~ /^xenix/ || - funcname ~ /^cloudabi/) { + funcname ~ /^linux/ || funcname ~ /^cloudabi/) { printf("%s, %s, NULL, 0, 0, %s, %s },", funcname, auditev, flags, thr_flag) > sysent column = column + length(funcname) + length(auditev) + length(flags) + 3 } else { From owner-svn-src-head@freebsd.org Thu Jan 31 23:04:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7079C14BB2E0; Thu, 31 Jan 2019 23:04:48 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C07E77F53; Thu, 31 Jan 2019 23:04:47 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id B67F33C475F; Thu, 31 Jan 2019 23:04:46 +0000 (UTC) Date: Thu, 31 Jan 2019 23:04:46 +0000 From: Brooks Davis To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343630 - in head/sys: kern sys Message-ID: <20190131230446.GB3654@spindle.one-eyed-alien.net> References: <201901312258.x0VMwH0W095567@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DBIVS5p969aUjpLe" Content-Disposition: inline In-Reply-To: <201901312258.x0VMwH0W095567@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 0C07E77F53 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:04:48 -0000 --DBIVS5p969aUjpLe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 31, 2019 at 10:58:17PM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Jan 31 22:58:17 2019 > New Revision: 343630 > URL: https://svnweb.freebsd.org/changeset/base/343630 >=20 > Log: > Regen after r342190. Yes, that was a while ago... I can only assume I was interrupted and forgot to get back to it. Fortunately, no functional change and testing was against a tree with the files regenerated. -- Brooks --DBIVS5p969aUjpLe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcU38NAAoJEKzQXbSebgfAwWIH/0dQzHa5gNMJ02Apca+qOf01 4RMWOVtx5XRdOoTTtdzb7wq8nuYKBdQjQEZ1TiAG0bQM4593LgdwHJxmy6Bm4ub5 OOnkeBlJnwlCcJsEtiGQ4GJl50xPf0HSupcPDrXUQ2gK2Xkdj+XKcaTUdJ5emrUP TBA+WiW9zlBPntue0xMKa5b1uwxPs/Fmos/bIWg1fyng8NJB9R04Z9pCu6TjkQjC MTqgvNy92CrOc3gEFPUsBharUwCfme4To93+9D908fm7yQ5nSHr58z1vNHEFEKyQ fB9OsjWZPB+cSMA45CNC5cd/CWb7A8uWkS329nDYj1J6xeMlb2x7mdqVqk9yYUw= =WG31 -----END PGP SIGNATURE----- --DBIVS5p969aUjpLe-- From owner-svn-src-head@freebsd.org Thu Jan 31 23:21:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B2014BB9F3; Thu, 31 Jan 2019 23:21:19 +0000 (UTC) (envelope-from bdrewery@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 18EA680854; Thu, 31 Jan 2019 23:21:19 +0000 (UTC) (envelope-from bdrewery@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 0D637E824; Thu, 31 Jan 2019 23:21:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VNLIGT009824; Thu, 31 Jan 2019 23:21:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VNLI2N009823; Thu, 31 Jan 2019 23:21:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201901312321.x0VNLI2N009823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 31 Jan 2019 23:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343633 - head/usr.bin/shar X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/usr.bin/shar X-SVN-Commit-Revision: 343633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18EA680854 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:21:19 -0000 Author: bdrewery Date: Thu Jan 31 23:21:18 2019 New Revision: 343633 URL: https://svnweb.freebsd.org/changeset/base/343633 Log: Shar files may be seen as binary by grep. Suggest using -a to egrep to properly see executed commands. This is a minor improvement to the manpage. A better improvement would be removal or gigantic warnings. Sponsored by: Dell EMC MFC after: 1 week Modified: head/usr.bin/shar/shar.1 Modified: head/usr.bin/shar/shar.1 ============================================================================== --- head/usr.bin/shar/shar.1 Thu Jan 31 23:01:12 2019 (r343632) +++ head/usr.bin/shar/shar.1 Thu Jan 31 23:21:18 2019 (r343633) @@ -28,7 +28,7 @@ .\" @(#)shar.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd January 31, 2019 .Dt SHAR 1 .Os .Sh NAME @@ -103,5 +103,5 @@ Archives produced using this implementation of .Nm may be easily examined with the command: .Bd -literal -offset indent -egrep -v '^[X#]' shar.file +egrep -av '^[X#]' shar.file .Ed From owner-svn-src-head@freebsd.org Thu Jan 31 23:23:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 586FC14BBAD7; Thu, 31 Jan 2019 23:23:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB43980C55; Thu, 31 Jan 2019 23:23:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id A44B1A3A3; Thu, 31 Jan 2019 23:23:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6FD021440; Thu, 31 Jan 2019 23:23:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 6sP3TzEtzD8p; Thu, 31 Jan 2019 23:23:29 +0000 (UTC) Subject: Re: svn commit: r343630 - in head/sys: kern sys DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com E47C41431 To: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901312258.x0VMwH0W095567@repo.freebsd.org> <20190131230446.GB3654@spindle.one-eyed-alien.net> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAG0JEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hLu BQkNPvODAAoJEDXXcbtuRpfP9rMH/3f7cfX5rzyEV5QNfV/wS4jFukLoPZ4+nCM/TKxH3pEX 2bLbeQbkk6La8cueQ5Lpoht5XFZ18Y5TbMittngltrlNzoDD0h9are24OkDFGim3afJU7tkj IGQa1if+re+vI5BhzYwRhj0oKXzBi39M5oePd3L1dXfx83rg2FPyZBdIejsz6fR74T3JVkbd 6k2l5/3Zk2uiNMy+eBfDRgYE1E6CP28kV0nCeGKZgSVso0kGUUHud7voKqGVpMvbd0mE4pp4 PE5YJaFPjrll9miaDAvdU8LGIq5n6+aXPLKoQ/QNl6mg6ifgI6FfKILOkTizLW8E5PBSNnCm NapQ55yjm125AQ0EUmmGawEIAKJUU9+Q19oW1RK5jTf3m56j+szIc8Y9DaLC8REUKl4UZJBK BqCl6c0cukVApOD92XoU6hJPm2rLEyp/IcYcPPNTnVu8D8h9oag2L8EiFN7+2hk0xG+lwjc8 uOIZycme7AIJsBU4AZ1v63lxm2k104hwpiatgbe71GIGl7p1MX6ousP/wGzXCOF25Dx9w02C eRe7zEMfhnFjSUhzdCC9han2+KaVB7qIqNR3b8NfbwRNlwPmHqlhXffUow9OsQjSnTK8WKNR lx7xzVccXIvWP2wECFrmqmzMmXpSrmIuiWEpFwZ9x2a0Pva8dCNRiCVTK51IlRXKjaAxiN1u IUrMm6UAEQEAAYkBJQQYAQoADwUCUmmGawIbDAUJCWYBgAAKCRA113G7bkaXz1Q+CADaYZCn bzIJQqwnoocVXL+Wkd+hCsoX6zsd8pNTY5tV5U1fgjxl1bVQ7jyZGrEQ7BjyvlhIfpfTo6aK oJfZpIxeDc3Tr+X7O2UHT5QYaWRcGO+X3+eKL5sLpvxda67RftClv2hgEr1i2hqjK5WmUCaN 2P9w+i7rmZ4ohpLXINOMeHjnQOtbxCCF7qXRsVfgEcpNKb31T3QwvsRjX0HqIjYFlKpa61Wz IPvWgBERjo0aAOkI4g7oVLjX5Z5gINGPy+xr8GJqhfZ3ZIEOwLCwTB71+Dk9gyLa5UiG8vo6 vGfA50H5OSC87LnNlI07b1Qb8mKVkqg13PbCkRpTMKEYaou9iQElBBgBCgAPAhsMBQJa6M4o BQkKYHs9AAoJEDXXcbtuRpfPpuQH/0d1RHcTTAHAyHrPQA4UMqH49tEj1d3gidx2ETnm00rj XTrnRreAAMgPCrPeLvYYiKeSBrHOkQ7E/Vuztr4F4Xenld3omOTon+cSyGKyA1btWNRskcUa zxJ/0DqgzerhWQj8CtWjmqRnGAqzvZQdIDLk1X4B2p1Ota4AvbTF9DqADskXfld/zPJQzYYy XRfyKTt0nWMyn5MHbsuKmpsOBqYXMf0X2EL2C6v3g5D/HedD6YVnW6KlgcDUR2sq6Fv9Ozhs 38TOXyeZgbFz0HDtkHEY5Mh3+sQjOh4takC+Dp1zDRP2U19JZzo9f6R/d05c0h2TD02oogPz AQ97xrFwZgaJATwEGAEKACYCGwwWIQT5Fzyyw6rqelyKHwk113G7bkaXzwUCW+YS+AUJDT7z jQAKCRA113G7bkaXzwo3B/4rwbDqXaXm6YC4s0jVOf1+MljeQIsbHPVQZ0IRigCpzCDSUFTK QOebA9iUj8JaF2DPwd6sjyUUv/XMCLl+SwzSijmVN0Kfk85XspzNef8XmteKK1mERkYnLWBw TNwp6qezg/CukNbobNH08ciT+z2fxtPuwqK5X9Q5R4Q7egth5XUTxbwLwIJerEfVs4HG+687 m9h1bWyYJemB24MgBu8fTaVxas8dSSwDHabdgyGMKIvqDHUUJQSMDbio0Iwhs7lx2p3Xd5Br wQLMiaUPnKBHqfVM8ADWldvHF6xa9keBUjnEedKwQNjYf76lGH6bLwbyZcLigKFdXY1R2ooT Xi+R Organization: FreeBSD Message-ID: Date: Thu, 31 Jan 2019 15:23:26 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190131230446.GB3654@spindle.one-eyed-alien.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aIMOvFwgr4Nj1aFnlmk9CSnLz5MU0dEQX" X-Rspamd-Queue-Id: DB43980C55 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.981,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:23:34 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aIMOvFwgr4Nj1aFnlmk9CSnLz5MU0dEQX Content-Type: multipart/mixed; boundary="wt4G329r7iebeaBssD3aAJM9KPFmxRT6Q"; protected-headers="v1" From: Bryan Drewery To: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r343630 - in head/sys: kern sys References: <201901312258.x0VMwH0W095567@repo.freebsd.org> <20190131230446.GB3654@spindle.one-eyed-alien.net> In-Reply-To: <20190131230446.GB3654@spindle.one-eyed-alien.net> --wt4G329r7iebeaBssD3aAJM9KPFmxRT6Q Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 1/31/19 3:04 PM, Brooks Davis wrote: > On Thu, Jan 31, 2019 at 10:58:17PM +0000, Brooks Davis wrote: >> Author: brooks >> Date: Thu Jan 31 22:58:17 2019 >> New Revision: 343630 >> URL: https://svnweb.freebsd.org/changeset/base/343630 >> >> Log: >> Regen after r342190. >=20 > Yes, that was a while ago... I can only assume I was interrupted and > forgot to get back to it. Fortunately, no functional change and testin= g > was against a tree with the files regenerated. >=20 > -- Brooks >=20 I've been needing to get involved again. I'll start thinking about and tackling generating these during the build soon. --=20 Regards, Bryan Drewery --wt4G329r7iebeaBssD3aAJM9KPFmxRT6Q-- --aIMOvFwgr4Nj1aFnlmk9CSnLz5MU0dEQX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlxTg28ACgkQNddxu25G l8+7LAf/d6MWXZKyGMTUBmG5yn3fnOhtkiaFAOtrKb0z22K/JcIC7IxDCTXvALTN ad/P+WKZGRxnTYs+57LnO9eQgeV6vhfRqzdx+MjUdsqJqeH/IIGZSz8dLwOq/Cwg LEfwvdcijPqdlvS1LC9oM1EEaRoASICLNPj4IFPcZwiiY9hcUHk999hBGFI3wV9x ntVv8mVXZxmMsuSialV8Us8kDEViGXJm81EFGXg73fhCPz++oF2uGFTcQcSj/YgS BpDM2fEWh3KemvfrRGbJIB9S9LJjlcf/4LuLnQo2pWLn34D5HGIKd/Dzg5T0hlcb LxGX6v0d6k8Kn2vZcAsunKX0C2R9Vw== =YV20 -----END PGP SIGNATURE----- --aIMOvFwgr4Nj1aFnlmk9CSnLz5MU0dEQX-- From owner-svn-src-head@freebsd.org Thu Jan 31 23:30:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A8314BBC3F; Thu, 31 Jan 2019 23:30:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62D3B80EE0; Thu, 31 Jan 2019 23:30:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 2B9E9A599; Thu, 31 Jan 2019 23:30:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 65D2714D0; Thu, 31 Jan 2019 23:30:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id MKTZ7-Q7Ggti; Thu, 31 Jan 2019 23:29:04 +0000 (UTC) Subject: Re: svn commit: r343633 - head/usr.bin/shar DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 4600F14AA From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901312321.x0VNLI2N009823@repo.freebsd.org> Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAG0JEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hLu BQkNPvODAAoJEDXXcbtuRpfP9rMH/3f7cfX5rzyEV5QNfV/wS4jFukLoPZ4+nCM/TKxH3pEX 2bLbeQbkk6La8cueQ5Lpoht5XFZ18Y5TbMittngltrlNzoDD0h9are24OkDFGim3afJU7tkj IGQa1if+re+vI5BhzYwRhj0oKXzBi39M5oePd3L1dXfx83rg2FPyZBdIejsz6fR74T3JVkbd 6k2l5/3Zk2uiNMy+eBfDRgYE1E6CP28kV0nCeGKZgSVso0kGUUHud7voKqGVpMvbd0mE4pp4 PE5YJaFPjrll9miaDAvdU8LGIq5n6+aXPLKoQ/QNl6mg6ifgI6FfKILOkTizLW8E5PBSNnCm NapQ55yjm125AQ0EUmmGawEIAKJUU9+Q19oW1RK5jTf3m56j+szIc8Y9DaLC8REUKl4UZJBK BqCl6c0cukVApOD92XoU6hJPm2rLEyp/IcYcPPNTnVu8D8h9oag2L8EiFN7+2hk0xG+lwjc8 uOIZycme7AIJsBU4AZ1v63lxm2k104hwpiatgbe71GIGl7p1MX6ousP/wGzXCOF25Dx9w02C eRe7zEMfhnFjSUhzdCC9han2+KaVB7qIqNR3b8NfbwRNlwPmHqlhXffUow9OsQjSnTK8WKNR lx7xzVccXIvWP2wECFrmqmzMmXpSrmIuiWEpFwZ9x2a0Pva8dCNRiCVTK51IlRXKjaAxiN1u IUrMm6UAEQEAAYkBJQQYAQoADwUCUmmGawIbDAUJCWYBgAAKCRA113G7bkaXz1Q+CADaYZCn bzIJQqwnoocVXL+Wkd+hCsoX6zsd8pNTY5tV5U1fgjxl1bVQ7jyZGrEQ7BjyvlhIfpfTo6aK oJfZpIxeDc3Tr+X7O2UHT5QYaWRcGO+X3+eKL5sLpvxda67RftClv2hgEr1i2hqjK5WmUCaN 2P9w+i7rmZ4ohpLXINOMeHjnQOtbxCCF7qXRsVfgEcpNKb31T3QwvsRjX0HqIjYFlKpa61Wz IPvWgBERjo0aAOkI4g7oVLjX5Z5gINGPy+xr8GJqhfZ3ZIEOwLCwTB71+Dk9gyLa5UiG8vo6 vGfA50H5OSC87LnNlI07b1Qb8mKVkqg13PbCkRpTMKEYaou9iQElBBgBCgAPAhsMBQJa6M4o BQkKYHs9AAoJEDXXcbtuRpfPpuQH/0d1RHcTTAHAyHrPQA4UMqH49tEj1d3gidx2ETnm00rj XTrnRreAAMgPCrPeLvYYiKeSBrHOkQ7E/Vuztr4F4Xenld3omOTon+cSyGKyA1btWNRskcUa zxJ/0DqgzerhWQj8CtWjmqRnGAqzvZQdIDLk1X4B2p1Ota4AvbTF9DqADskXfld/zPJQzYYy XRfyKTt0nWMyn5MHbsuKmpsOBqYXMf0X2EL2C6v3g5D/HedD6YVnW6KlgcDUR2sq6Fv9Ozhs 38TOXyeZgbFz0HDtkHEY5Mh3+sQjOh4takC+Dp1zDRP2U19JZzo9f6R/d05c0h2TD02oogPz AQ97xrFwZgaJATwEGAEKACYCGwwWIQT5Fzyyw6rqelyKHwk113G7bkaXzwUCW+YS+AUJDT7z jQAKCRA113G7bkaXzwo3B/4rwbDqXaXm6YC4s0jVOf1+MljeQIsbHPVQZ0IRigCpzCDSUFTK QOebA9iUj8JaF2DPwd6sjyUUv/XMCLl+SwzSijmVN0Kfk85XspzNef8XmteKK1mERkYnLWBw TNwp6qezg/CukNbobNH08ciT+z2fxtPuwqK5X9Q5R4Q7egth5XUTxbwLwIJerEfVs4HG+687 m9h1bWyYJemB24MgBu8fTaVxas8dSSwDHabdgyGMKIvqDHUUJQSMDbio0Iwhs7lx2p3Xd5Br wQLMiaUPnKBHqfVM8ADWldvHF6xa9keBUjnEedKwQNjYf76lGH6bLwbyZcLigKFdXY1R2ooT Xi+R Organization: FreeBSD Message-ID: Date: Thu, 31 Jan 2019 15:29:03 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201901312321.x0VNLI2N009823@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3jpmfglGM5JoSzSwlbM3Nt8t7y68bQWDP" X-Rspamd-Queue-Id: 62D3B80EE0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:30:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3jpmfglGM5JoSzSwlbM3Nt8t7y68bQWDP Content-Type: multipart/mixed; boundary="DrjvG4n1XHNBOZiOBoCVXnN4zEjQGOoEs"; protected-headers="v1" From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r343633 - head/usr.bin/shar References: <201901312321.x0VNLI2N009823@repo.freebsd.org> In-Reply-To: <201901312321.x0VNLI2N009823@repo.freebsd.org> --DrjvG4n1XHNBOZiOBoCVXnN4zEjQGOoEs Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 1/31/19 3:21 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Thu Jan 31 23:21:18 2019 > New Revision: 343633 > URL: https://svnweb.freebsd.org/changeset/base/343633 >=20 > Log: > Shar files may be seen as binary by grep. > =20 > Suggest using -a to egrep to properly see executed commands. > =20 > This is a minor improvement to the manpage. A better improvement > would be removal or gigantic warnings. I dare someone to remove this utility. There may still be documentation suggesting its use somewhere due to pre-bugzilla days but now we can do proper binary attachments I believe. --=20 Regards, Bryan Drewery --DrjvG4n1XHNBOZiOBoCVXnN4zEjQGOoEs-- --3jpmfglGM5JoSzSwlbM3Nt8t7y68bQWDP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlxThL8ACgkQNddxu25G l89tewf+OXCh+fKR00Lu4dshCuVjFW+JrO/zQjuRn2c9VEsObQuUzOwHdfS9hvm5 uWYDy8jZeATGMvlk3B9InZLmoswdy/qvXzbVcFPpZ7uTbeE3bjCdP1jTGhwvbClq 6UGHdq4xAOwGtbabuGapfMJCh61w4xq6OBraeHDcAwkWbZAqg030+crLACIn2U5Z qLg4Awlqexwg7HZNI3Z71mfFxTIpeM98xUboOqkQiiA+U5ZhZqZ6dt2lwwd0pbrw eMUaRHnxskM534yZGTEXu4vvoK5QV0DobfLDDLlUHTS5WSIr/9Jgk2XJBnvDm/RB mB5IUx1qTPuxvOz/VFKuUe+3wflD0A== =SNnb -----END PGP SIGNATURE----- --3jpmfglGM5JoSzSwlbM3Nt8t7y68bQWDP-- From owner-svn-src-head@freebsd.org Thu Jan 31 23:32:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADF8114BBE59; Thu, 31 Jan 2019 23:32:20 +0000 (UTC) (envelope-from araujo@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 4D0F681294; Thu, 31 Jan 2019 23:32:20 +0000 (UTC) (envelope-from araujo@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 41048EB34; Thu, 31 Jan 2019 23:32:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0VNWKjY016059; Thu, 31 Jan 2019 23:32:20 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0VNWJ6o016057; Thu, 31 Jan 2019 23:32:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201901312332.x0VNWJ6o016057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 31 Jan 2019 23:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343634 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 343634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D0F681294 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.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:32:20 -0000 Author: araujo Date: Thu Jan 31 23:32:19 2019 New Revision: 343634 URL: https://svnweb.freebsd.org/changeset/base/343634 Log: Mostly a cosmetic change to replace strlen with strnlen. Obtained from: Project ACRN MFC after: 2 weeks Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/smbiostbl.c head/usr.sbin/bhyve/usb_mouse.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:21:18 2019 (r343633) +++ head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:32:19 2019 (r343634) @@ -233,8 +233,8 @@ usage(int code) " -W: force virtio to use single-vector MSI\n" " -x: local apic is in x2APIC mode\n" " -Y: disable MPtable generation\n", - progname, (int)strlen(progname), "", (int)strlen(progname), "", - (int)strlen(progname), ""); + progname, (int)strnlen(progname, PATH_MAX), "", (int)strnlen(progname, PATH_MAX), "", + (int)strnlen(progname, PATH_MAX), ""); exit(code); } Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:21:18 2019 (r343633) +++ head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:32:19 2019 (r343634) @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure *te int len; string = template_strings[i]; - len = strlen(string) + 1; + len = strnlen(string, SMBIOS_MAX_LENGTH) + 1; memcpy(curaddr, string, len); curaddr += len; } @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure *temp return (-1); MD5Init(&mdctx); - MD5Update(&mdctx, vmname, strlen(vmname)); + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX)); MD5Update(&mdctx, hostname, sizeof(hostname)); MD5Final(digest, &mdctx); Modified: head/usr.sbin/bhyve/usb_mouse.c ============================================================================== --- head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:21:18 2019 (r343633) +++ head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:32:19 2019 (r343634) @@ -70,6 +70,7 @@ enum { UMSTR_MAX }; +#define UMOUSE_DESC_MAX_LEN 32 static const char *umouse_desc_strings[] = { "\x04\x09", "BHYVE", @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer goto done; } - slen = 2 + strlen(str) * 2; + slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2; udata[0] = slen; udata[1] = UDESC_STRING; From owner-svn-src-head@freebsd.org Thu Jan 31 23:44:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8073114BC259; Thu, 31 Jan 2019 23:44:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1B981975; Thu, 31 Jan 2019 23:44:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id DA990AA57; Thu, 31 Jan 2019 23:44:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 215D6158F; Thu, 31 Jan 2019 23:44:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id kKoDavYNz8wS; Thu, 31 Jan 2019 23:44:31 +0000 (UTC) Subject: Re: svn commit: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 5C326157C To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901312301.x0VN13lM097213@repo.freebsd.org> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAG0JEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hLu BQkNPvODAAoJEDXXcbtuRpfP9rMH/3f7cfX5rzyEV5QNfV/wS4jFukLoPZ4+nCM/TKxH3pEX 2bLbeQbkk6La8cueQ5Lpoht5XFZ18Y5TbMittngltrlNzoDD0h9are24OkDFGim3afJU7tkj IGQa1if+re+vI5BhzYwRhj0oKXzBi39M5oePd3L1dXfx83rg2FPyZBdIejsz6fR74T3JVkbd 6k2l5/3Zk2uiNMy+eBfDRgYE1E6CP28kV0nCeGKZgSVso0kGUUHud7voKqGVpMvbd0mE4pp4 PE5YJaFPjrll9miaDAvdU8LGIq5n6+aXPLKoQ/QNl6mg6ifgI6FfKILOkTizLW8E5PBSNnCm NapQ55yjm125AQ0EUmmGawEIAKJUU9+Q19oW1RK5jTf3m56j+szIc8Y9DaLC8REUKl4UZJBK BqCl6c0cukVApOD92XoU6hJPm2rLEyp/IcYcPPNTnVu8D8h9oag2L8EiFN7+2hk0xG+lwjc8 uOIZycme7AIJsBU4AZ1v63lxm2k104hwpiatgbe71GIGl7p1MX6ousP/wGzXCOF25Dx9w02C eRe7zEMfhnFjSUhzdCC9han2+KaVB7qIqNR3b8NfbwRNlwPmHqlhXffUow9OsQjSnTK8WKNR lx7xzVccXIvWP2wECFrmqmzMmXpSrmIuiWEpFwZ9x2a0Pva8dCNRiCVTK51IlRXKjaAxiN1u IUrMm6UAEQEAAYkBJQQYAQoADwUCUmmGawIbDAUJCWYBgAAKCRA113G7bkaXz1Q+CADaYZCn bzIJQqwnoocVXL+Wkd+hCsoX6zsd8pNTY5tV5U1fgjxl1bVQ7jyZGrEQ7BjyvlhIfpfTo6aK oJfZpIxeDc3Tr+X7O2UHT5QYaWRcGO+X3+eKL5sLpvxda67RftClv2hgEr1i2hqjK5WmUCaN 2P9w+i7rmZ4ohpLXINOMeHjnQOtbxCCF7qXRsVfgEcpNKb31T3QwvsRjX0HqIjYFlKpa61Wz IPvWgBERjo0aAOkI4g7oVLjX5Z5gINGPy+xr8GJqhfZ3ZIEOwLCwTB71+Dk9gyLa5UiG8vo6 vGfA50H5OSC87LnNlI07b1Qb8mKVkqg13PbCkRpTMKEYaou9iQElBBgBCgAPAhsMBQJa6M4o BQkKYHs9AAoJEDXXcbtuRpfPpuQH/0d1RHcTTAHAyHrPQA4UMqH49tEj1d3gidx2ETnm00rj XTrnRreAAMgPCrPeLvYYiKeSBrHOkQ7E/Vuztr4F4Xenld3omOTon+cSyGKyA1btWNRskcUa zxJ/0DqgzerhWQj8CtWjmqRnGAqzvZQdIDLk1X4B2p1Ota4AvbTF9DqADskXfld/zPJQzYYy XRfyKTt0nWMyn5MHbsuKmpsOBqYXMf0X2EL2C6v3g5D/HedD6YVnW6KlgcDUR2sq6Fv9Ozhs 38TOXyeZgbFz0HDtkHEY5Mh3+sQjOh4takC+Dp1zDRP2U19JZzo9f6R/d05c0h2TD02oogPz AQ97xrFwZgaJATwEGAEKACYCGwwWIQT5Fzyyw6rqelyKHwk113G7bkaXzwUCW+YS+AUJDT7z jQAKCRA113G7bkaXzwo3B/4rwbDqXaXm6YC4s0jVOf1+MljeQIsbHPVQZ0IRigCpzCDSUFTK QOebA9iUj8JaF2DPwd6sjyUUv/XMCLl+SwzSijmVN0Kfk85XspzNef8XmteKK1mERkYnLWBw TNwp6qezg/CukNbobNH08ciT+z2fxtPuwqK5X9Q5R4Q7egth5XUTxbwLwIJerEfVs4HG+687 m9h1bWyYJemB24MgBu8fTaVxas8dSSwDHabdgyGMKIvqDHUUJQSMDbio0Iwhs7lx2p3Xd5Br wQLMiaUPnKBHqfVM8ADWldvHF6xa9keBUjnEedKwQNjYf76lGH6bLwbyZcLigKFdXY1R2ooT Xi+R Organization: FreeBSD Message-ID: Date: Thu, 31 Jan 2019 15:44:30 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201901312301.x0VN13lM097213@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Zm88ZyQXxqt1zgYRUw62e58AzfSFBjD8L" X-Rspamd-Queue-Id: 1C1B981975 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:44:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Zm88ZyQXxqt1zgYRUw62e58AzfSFBjD8L Content-Type: multipart/mixed; boundary="MG8yPnvrACnE4sLycPNLhSh1pxKK947TS"; protected-headers="v1" From: Bryan Drewery To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf References: <201901312301.x0VN13lM097213@repo.freebsd.org> In-Reply-To: <201901312301.x0VN13lM097213@repo.freebsd.org> --MG8yPnvrACnE4sLycPNLhSh1pxKK947TS Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 1/31/19 3:01 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Jan 31 23:01:03 2019 > New Revision: 343631 > URL: https://svnweb.freebsd.org/changeset/base/343631 >=20 > Log: > New pfil(9) KPI together with newborn pfil API and control utility. > =20 > The KPI have been reviewed and cleansed of features that were planned= > back 20 years ago and never implemented. The pfil(9) internals have > been made opaque to protocols with only returned types and function > declarations exposed. The KPI is made more strict, but at the same ti= me > more extensible, as kernel uses same command structures that userland= > ioctl uses. > =20 > In nutshell [KA]PI is about declaring filtering points, declaring > filters and linking and unlinking them together. > =20 > New [KA]PI makes it possible to reconfigure pfil(9) configuration: > change order of hooks, rehook filter from one filtering point to a > different one, disconnect a hook on output leaving it on input only, > prepend/append a filter to existing list of filters. > =20 > Now it possible for a single packet filter to provide multiple rulese= ts > that may be linked to different points. Think of per-interface ACLs i= n > Cisco or Juniper. None of existing packet filters yet support that, > however limited usage is already possible, e.g. default ruleset can > be moved to single interface, as soon as interface would pride their > filtering points. > =20 > Another future feature is possiblity to create pfil heads, that provi= de > not an mbuf pointer but just a memory pointer with length. That would= > allow filtering at very early stages of a packet lifecycle, e.g. when= > packet has just been received by a NIC and no mbuf was yet allocated.= > =20 > Differential Revision: https://reviews.freebsd.org/D18951 >=20 > Added: > head/sbin/pfilctl/ > head/sbin/pfilctl/Makefile (contents, props changed) > head/sbin/pfilctl/pfilctl.8 (contents, props changed) > head/sbin/pfilctl/pfilctl.c (contents, props changed) > Modified: > head/ObsoleteFiles.inc > head/sbin/Makefile > head/share/man/man9/Makefile > head/share/man/man9/pfil.9 > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > head/sys/net/if_bridge.c > head/sys/net/if_enc.c > head/sys/net/if_ethersubr.c > head/sys/net/if_var.h > head/sys/net/pfil.c > head/sys/net/pfil.h > head/sys/netinet/ip_fastfwd.c > head/sys/netinet/ip_input.c > head/sys/netinet/ip_output.c > head/sys/netinet/ip_var.h > head/sys/netinet/siftr.c > head/sys/netinet6/ip6_fastfwd.c > head/sys/netinet6/ip6_forward.c > head/sys/netinet6/ip6_input.c > head/sys/netinet6/ip6_output.c > head/sys/netinet6/ip6_var.h > head/sys/netpfil/ipfw/ip_fw_eaction.c > head/sys/netpfil/ipfw/ip_fw_pfil.c > head/sys/netpfil/pf/pf_ioctl.c This breaks the build. https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/9220/console > 23:28:54 cc1: warnings being treated as errors > 23:28:54 /usr/src/sbin/pfilctl/pfilctl.c: In function 'help': > 23:28:54 /usr/src/sbin/pfilctl/pfilctl.c:97: warning: nested extern dec= laration of '__progname' > 23:28:54 --- all_subdir_lib --- > 23:28:54 --- clog.3.gz --- > 23:28:54 gzip -cn /usr/src/lib/msun/man/clog.3 > clog.3.gz > 23:28:54 --- all_subdir_sbin --- > 23:28:54 *** [pfilctl.o] Error code 1 > 23:28:54=20 > 23:28:54 make[4]: stopped in /usr/src/sbin/pfilctl --=20 Regards, Bryan Drewery --MG8yPnvrACnE4sLycPNLhSh1pxKK947TS-- --Zm88ZyQXxqt1zgYRUw62e58AzfSFBjD8L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlxTiF4ACgkQNddxu25G l88sSQf9GMr7ZZ8Rq86aVpbS9zr4yKznwrmWGJ0OxKybl3J2L1HzUOZuJn5hUyKS 8PUjz3PoXab0jkNyECkNMsRhz4v3BDe59QMOBvtpr4j1tPGaY+QnM5qhGGkbz3Sb 4oaGz1I3Un9qZwqa9G95zcf0zgzy2cwVJv7mU3KwF/vyNmUjt9NOTCOpIs1qqNmH l6SeNqKIj+M1MSNz+aCoCTHkgiCAz6q6JDpwwGPxIFprU2t8Q1nnmccDun17Ldbs VTw0FjkjdHx/tvz008Sa9tMDz7ttSNbeGjNM+afJt8muMpE40yuNhjj6EoOMKasW S+8W5jYmILBCUBTCf8G2YE95j1ckCQ== =H82w -----END PGP SIGNATURE----- --Zm88ZyQXxqt1zgYRUw62e58AzfSFBjD8L-- From owner-svn-src-head@freebsd.org Thu Jan 31 23:46:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BDA614BC3B8; Thu, 31 Jan 2019 23:46:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10F7B81BFA; Thu, 31 Jan 2019 23:46:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x0VNk9ZD082817 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 1 Feb 2019 01:46:12 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x0VNk9ZD082817 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x0VNk93h082816; Fri, 1 Feb 2019 01:46:09 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 1 Feb 2019 01:46:09 +0200 From: Konstantin Belousov To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve Message-ID: <20190131234609.GZ24863@kib.kiev.ua> References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901312332.x0VNWJ6o016057@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:46:21 -0000 On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: > Author: araujo > Date: Thu Jan 31 23:32:19 2019 > New Revision: 343634 > URL: https://svnweb.freebsd.org/changeset/base/343634 > > Log: > Mostly a cosmetic change to replace strlen with strnlen. This is not cosmetic, and more, for instance the usage() part of the change does not make any sense to me. > > Obtained from: Project ACRN > MFC after: 2 weeks > > Modified: > head/usr.sbin/bhyve/bhyverun.c > head/usr.sbin/bhyve/smbiostbl.c > head/usr.sbin/bhyve/usb_mouse.c > > Modified: head/usr.sbin/bhyve/bhyverun.c > ============================================================================== > --- head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:21:18 2019 (r343633) > +++ head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:32:19 2019 (r343634) > @@ -233,8 +233,8 @@ usage(int code) > " -W: force virtio to use single-vector MSI\n" > " -x: local apic is in x2APIC mode\n" > " -Y: disable MPtable generation\n", > - progname, (int)strlen(progname), "", (int)strlen(progname), "", > - (int)strlen(progname), ""); > + progname, (int)strnlen(progname, PATH_MAX), "", (int)strnlen(progname, PATH_MAX), "", > + (int)strnlen(progname, PATH_MAX), ""); > > exit(code); > } > > Modified: head/usr.sbin/bhyve/smbiostbl.c > ============================================================================== > --- head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:21:18 2019 (r343633) > +++ head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:32:19 2019 (r343634) > @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure *te > int len; > > string = template_strings[i]; > - len = strlen(string) + 1; > + len = strnlen(string, SMBIOS_MAX_LENGTH) + 1; > memcpy(curaddr, string, len); > curaddr += len; > } > @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure *temp > return (-1); > > MD5Init(&mdctx); > - MD5Update(&mdctx, vmname, strlen(vmname)); > + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX)); > MD5Update(&mdctx, hostname, sizeof(hostname)); > MD5Final(digest, &mdctx); > > > Modified: head/usr.sbin/bhyve/usb_mouse.c > ============================================================================== > --- head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:21:18 2019 (r343633) > +++ head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:32:19 2019 (r343634) > @@ -70,6 +70,7 @@ enum { > UMSTR_MAX > }; > > +#define UMOUSE_DESC_MAX_LEN 32 > static const char *umouse_desc_strings[] = { > "\x04\x09", > "BHYVE", > @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer > goto done; > } > > - slen = 2 + strlen(str) * 2; > + slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2; > udata[0] = slen; > udata[1] = UDESC_STRING; > From owner-svn-src-head@freebsd.org Thu Jan 31 23:49:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B77B914BC5F4 for ; Thu, 31 Jan 2019 23:49:19 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35F8A821AB for ; Thu, 31 Jan 2019 23:49:19 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-lj1-x242.google.com with SMTP id v15-v6so4188558ljh.13 for ; Thu, 31 Jan 2019 15:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XkBwzOKYKq5yJER2FZOf2E4gMZnMLnutfymZitlIhLo=; b=R3eJ+vHd91ZUNvDtFAODaA/+bTdx/jJ2QSqe3XveSiN7ToNDTWR6sgd7MgCHHrSZ/x lQQtBfg1RZI4DN1p436HE5W3B+FyETLnNXaMxo6Kn7/9ZsToUORIbWaow7Cdo1Y+rbu+ ajamRm/pdgXakH14g6LG2B/NokTMRjz+aThAoudfM1hJeVnXekKlM/+I5xLuBRU/NOLC JbZnDtzqJIqiS5WBLiQONm/RJ9sGfqLCLCUiDueZMG4GRsUCje73M8koSYE2Fp0gaSrG 4eQVswQTgiMSD7VhUBKI1SWBIdCJeB6kpxzZ1t4ZarrEVT2ksE+A+IOsWOPdgdiAiEi/ /YZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XkBwzOKYKq5yJER2FZOf2E4gMZnMLnutfymZitlIhLo=; b=LpMdPdNJVsgC3qaqYZ1CU376AvCrmmZsqnnv0cMEY2NnKsS8PWwwcO2NDfus1ebEgJ 15bcwBQLA6YlXPkOqBThgLdzODHqk9mYdue/B5GiVlLWq5IlD6EPJjOYyNeECKNTzIxe q4WTsWnQayFn6asPCF9xaO+mG6IJvLaHyan1gNGTQh8yhvjIORqES1hS++u7VUV3heGx mE6PSjnavHLW9h+4YzMmUNwQFWkVbNtFFrpYiJKI4D5gKqOGhC1fpPXT3gs4NjBtpDfL JtVxrPr9Oteojl8NKMQeobmrjjYtr/jsGepPfyfnf68BFtDXdYX+7MlenkOcdFy11zsN xvBQ== X-Gm-Message-State: AHQUAuYnfg7PBpDYOwvRb3QHo7VPovSwoK8hoUSUenZBHB1oLgJ7PIe0 YFa845ldBRjmZB/61MsYPy0LqA== X-Google-Smtp-Source: AHgI3IY2hX7xuqZiesrqa+c1V6aCFsMtfHpgOW1tYtaDPjzOqYpL+LQH3EPlJXXDhJoN5gl7VcTUFA== X-Received: by 2002:a2e:8786:: with SMTP id n6-v6mr18968265lji.100.1548978557394; Thu, 31 Jan 2019 15:49:17 -0800 (PST) Received: from mutt-hbsd ([81.17.27.133]) by smtp.gmail.com with ESMTPSA id w4sm1060867lfk.83.2019.01.31.15.49.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 15:49:16 -0800 (PST) Date: Thu, 31 Jan 2019 18:48:40 -0500 From: Shawn Webb To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343633 - head/usr.bin/shar Message-ID: <20190131234840.wvatima5ynkxc5fo@mutt-hbsd> References: <201901312321.x0VNLI2N009823@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iwu4gmyz7zsio5pv" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD 1b35a2c4553(hardened/current/cross-dso-cfi) HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 35F8A821AB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:49:20 -0000 --iwu4gmyz7zsio5pv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 31, 2019 at 03:29:03PM -0800, Bryan Drewery wrote: > On 1/31/19 3:21 PM, Bryan Drewery wrote: > > Author: bdrewery > > Date: Thu Jan 31 23:21:18 2019 > > New Revision: 343633 > > URL: https://svnweb.freebsd.org/changeset/base/343633 > >=20 > > Log: > > Shar files may be seen as binary by grep. > > =20 > > Suggest using -a to egrep to properly see executed commands. > > =20 > > This is a minor improvement to the manpage. A better improvement > > would be removal or gigantic warnings. >=20 > I dare someone to remove this utility. > There may still be documentation suggesting its use somewhere due to > pre-bugzilla days but now we can do proper binary attachments I believe. The recommended way to submit a new port is with a shar: https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-= submitting.html :D --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --iwu4gmyz7zsio5pv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlxTiVMACgkQaoRlj1JF bu6EDRAAyqL8DYiOJ71O2h3qR/l/xJW0RAnMogLn0ukySqaCMg8tJvigB8lvzQ95 4up1lg3+LKJFzmuZZgWo8C9oOgTIGiypI50M427E3irHNTiAVPACA0G8BQo5vn9Q suR8kHFbOA79Z2RWupVtizBHbcMi3zfAaBRVS/xnMS8JkrTtL117z956CNoDFPuo lLD9Nng2pbNEhYNftxDZF0gGEZpKRrnjaoMNDIJ/+Pn3mW5r5XFI2347vYfACdzD eBG4HVcalUd+hYhMHPUHgBvY0/yU0luzPagdUBnC3iodfr2nwhtXWBctsyPVTfgc M+aS6VOdV+aosWRnFyQ4ugjNhrk0LTIta5u9y27+rcricRD97j3bQlKgC3iv8pA6 1a10ngROwIA8Hs+ImEtzIdCYhza4J2m8oTlSVLojEVl5T/2IIMTqVWGDpKdRrApW /Vg7/xdal3o9VBVVwctw8d/rDswpwV73Sp5RHs9XPK+hsig1MgZC3JNTT/2Bh0S9 DVe5xqoCSkxtscSuQ7a1UpWJp8neTbaI4/Uzq4HCtTy0Nevv7F1IPMdRRfd+dlOr +ncsPEl/Bd8fOJMgOhMsOT8Ddb+y9/OYUVo7AI6Ak/HR1S6xZvmrXEo6biHng6uV OtRxFqpy5ahziIHI6xTlQefC4adxJQ0IhjYXy8d3V8DkOuSZS84= =LAoo -----END PGP SIGNATURE----- --iwu4gmyz7zsio5pv-- From owner-svn-src-head@freebsd.org Fri Feb 1 00:33:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49BC014BDA25; Fri, 1 Feb 2019 00:33:18 +0000 (UTC) (envelope-from glebius@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 DFC338383D; Fri, 1 Feb 2019 00:33:17 +0000 (UTC) (envelope-from glebius@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 CF77AF5C1; Fri, 1 Feb 2019 00:33:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x110XHWt046988; Fri, 1 Feb 2019 00:33:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x110XHXF046987; Fri, 1 Feb 2019 00:33:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902010033.x110XHXF046987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 1 Feb 2019 00:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343635 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 343635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFC338383D 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 00:33:18 -0000 Author: glebius Date: Fri Feb 1 00:33:17 2019 New Revision: 343635 URL: https://svnweb.freebsd.org/changeset/base/343635 Log: Fix build without INET6. Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_pfil.c Thu Jan 31 23:32:19 2019 (r343634) +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Feb 1 00:33:17 2019 (r343635) @@ -533,10 +533,12 @@ ipfw_divert(struct mbuf **m0, int incoming, struct ipf * attach or detach hooks for a given protocol family */ VNET_DEFINE_STATIC(pfil_hook_t, ipfw_inet_hook); -VNET_DEFINE_STATIC(pfil_hook_t, ipfw_inet6_hook); -VNET_DEFINE_STATIC(pfil_hook_t, ipfw_link_hook); #define V_ipfw_inet_hook VNET(ipfw_inet_hook) +#ifdef INET6 +VNET_DEFINE_STATIC(pfil_hook_t, ipfw_inet6_hook); #define V_ipfw_inet6_hook VNET(ipfw_inet6_hook) +#endif +VNET_DEFINE_STATIC(pfil_hook_t, ipfw_link_hook); #define V_ipfw_link_hook VNET(ipfw_link_hook) static int From owner-svn-src-head@freebsd.org Fri Feb 1 00:34:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E041C14BDABE; Fri, 1 Feb 2019 00:34:18 +0000 (UTC) (envelope-from glebius@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 86F9A839A2; Fri, 1 Feb 2019 00:34:18 +0000 (UTC) (envelope-from glebius@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 7B130F5C2; Fri, 1 Feb 2019 00:34:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x110YIcm047082; Fri, 1 Feb 2019 00:34:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x110YIqU047081; Fri, 1 Feb 2019 00:34:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902010034.x110YIqU047081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 1 Feb 2019 00:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343636 - head/sbin/pfilctl X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sbin/pfilctl X-SVN-Commit-Revision: 343636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86F9A839A2 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 00:34:19 -0000 Author: glebius Date: Fri Feb 1 00:34:18 2019 New Revision: 343636 URL: https://svnweb.freebsd.org/changeset/base/343636 Log: Hopefully fix compilation by other compilers. Modified: head/sbin/pfilctl/pfilctl.c Modified: head/sbin/pfilctl/pfilctl.c ============================================================================== --- head/sbin/pfilctl/pfilctl.c Fri Feb 1 00:33:17 2019 (r343635) +++ head/sbin/pfilctl/pfilctl.c Fri Feb 1 00:34:18 2019 (r343636) @@ -94,9 +94,8 @@ main(int argc __unused, char *argv[] __unused) static void help(void) { - extern char *__progname; - fprintf(stderr, "usage: %s (heads|hooks|link|unlink)\n", __progname); + fprintf(stderr, "usage: %s (heads|hooks|link|unlink)\n", getprogname()); exit(0); } From owner-svn-src-head@freebsd.org Fri Feb 1 00:36:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4B1114BDBE9 for ; Fri, 1 Feb 2019 00:36:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59F7583C22 for ; Fri, 1 Feb 2019 00:36:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id 189so3058120qkj.8 for ; Thu, 31 Jan 2019 16:36:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uAdbXTvvoWr+JJKVQUM7EI3Jr9E2QMY7EiAhfHGrV5s=; b=k2Uh/cXAruGINC3BB+WYLtLaHxdJl6GoDRcrxE6f2X587x8jjg/s1mSwgJZUM9WJdY jdTY1U+iVn+MYQ4LTDU0BbOyPx3Xe7QbVE1RHOgxxNWK2L67+Li+qafnnm4GsGi7Dzbm 1w2PZ0HhYagmhMosLD89UuZzoH0vQd0WumGViAnVar4ckiMCzGBS7ueT6udKOSVXS1+1 0F6PBjqqsTB9LFricXQTNqOc2HzwcrfoFGsAi3NkAQOSSln54eYSF2nemLhBYM1hnUxM dakoDfjkJzgk3iWhO8/1c6jgaJAKBJrd9qorZg1Raezj2S4CHFH8ajYQQ+9/pVhx6Ex6 QKSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uAdbXTvvoWr+JJKVQUM7EI3Jr9E2QMY7EiAhfHGrV5s=; b=j5NO53wijtNs7T/E8iUV3ttN6YSUY4ECw/vhQnKgz6YECYW0p/5lB/qLm+ef9Wpk9J Ym1iNZQT/qVlcQxhAw5FEIkLgEe4d4Icyz6kBFGhOSXdjBws3BhlxFv0oANKY/DQi9ap L4xETOxARGFKQqJbsbyNXQVhOphmYnULttvDru/j4tDVlpvn2U7VQWoGzUpSGCvo9MY5 GszCaN39RUT3q3M8cdq5v0+Y3xbCPVZ5uTeN6lQtFA4XuVluOSI/cAoygNQs/GoKRarw xuRzYQIrz6RPiO+HTq52kTuoHzVuNamG/hLWFs8GB/FwT5iJtwgs2cVIGqDXoMD3rxUd pynw== X-Gm-Message-State: AJcUukd0FaoAvVAfkG/UqWrq9/xp//C23qyvtNPZOXqtYevQ4gSFFI8N kTPuGFej0JzjEa0d9QT3mlbgOo755Dw6ojvo8IsPUw== X-Google-Smtp-Source: ALg8bN4LJgrR2HLBuVdsSrXQvfX+LBBbrBN1P39sFvvKy14+jeVRRgbZ2PZ7bVn0M0o6Sr1hB/OBZ1O6N7BMKzSmh+k= X-Received: by 2002:a37:6c05:: with SMTP id h5mr33970519qkc.175.1548981383584; Thu, 31 Jan 2019 16:36:23 -0800 (PST) MIME-Version: 1.0 References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> In-Reply-To: <20190131234609.GZ24863@kib.kiev.ua> From: Warner Losh Date: Thu, 31 Jan 2019 17:36:04 -0700 Message-ID: Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve To: Konstantin Belousov Cc: Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 59F7583C22 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 00:36:26 -0000 On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: > > Author: araujo > > Date: Thu Jan 31 23:32:19 2019 > > New Revision: 343634 > > URL: https://svnweb.freebsd.org/changeset/base/343634 > > > > Log: > > Mostly a cosmetic change to replace strlen with strnlen. > This is not cosmetic, and more, for instance the usage() part of the change > does not make any sense to me. > I specifically objected as well and was blown off. What gives? Warner > > > Obtained from: Project ACRN > > MFC after: 2 weeks > > > > Modified: > > head/usr.sbin/bhyve/bhyverun.c > > head/usr.sbin/bhyve/smbiostbl.c > > head/usr.sbin/bhyve/usb_mouse.c > > > > Modified: head/usr.sbin/bhyve/bhyverun.c > > > ============================================================================== > > --- head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:21:18 2019 > (r343633) > > +++ head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:32:19 2019 > (r343634) > > @@ -233,8 +233,8 @@ usage(int code) > > " -W: force virtio to use single-vector MSI\n" > > " -x: local apic is in x2APIC mode\n" > > " -Y: disable MPtable generation\n", > > - progname, (int)strlen(progname), "", > (int)strlen(progname), "", > > - (int)strlen(progname), ""); > > + progname, (int)strnlen(progname, PATH_MAX), "", > (int)strnlen(progname, PATH_MAX), "", > > + (int)strnlen(progname, PATH_MAX), ""); > > > > exit(code); > > } > > > > Modified: head/usr.sbin/bhyve/smbiostbl.c > > > ============================================================================== > > --- head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:21:18 2019 > (r343633) > > +++ head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:32:19 2019 > (r343634) > > @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure > *te > > int len; > > > > string = template_strings[i]; > > - len = strlen(string) + 1; > > + len = strnlen(string, SMBIOS_MAX_LENGTH) + 1; > > memcpy(curaddr, string, len); > > curaddr += len; > > } > > @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure > *temp > > return (-1); > > > > MD5Init(&mdctx); > > - MD5Update(&mdctx, vmname, strlen(vmname)); > > + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX)); > > MD5Update(&mdctx, hostname, sizeof(hostname)); > > MD5Final(digest, &mdctx); > > > > > > Modified: head/usr.sbin/bhyve/usb_mouse.c > > > ============================================================================== > > --- head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:21:18 2019 > (r343633) > > +++ head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:32:19 2019 > (r343634) > > @@ -70,6 +70,7 @@ enum { > > UMSTR_MAX > > }; > > > > +#define UMOUSE_DESC_MAX_LEN 32 > > static const char *umouse_desc_strings[] = { > > "\x04\x09", > > "BHYVE", > > @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer > *xfer > > goto done; > > } > > > > - slen = 2 + strlen(str) * 2; > > + slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2; > > udata[0] = slen; > > udata[1] = UDESC_STRING; > > > > From owner-svn-src-head@freebsd.org Fri Feb 1 00:40:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A85F14BDD88; Fri, 1 Feb 2019 00:40:26 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8980283F63; Fri, 1 Feb 2019 00:40:25 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x131.google.com with SMTP id v5so3766340lfe.7; Thu, 31 Jan 2019 16:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=fNF+DrL6yGsX3CO+9pcKrSCdgo3SRvSSt70DXn49aa4=; b=Nii+0MzHge4DkdofNQJF3CwKAt/aMxlenXoU5FU9udHni2MEfZsGUPUF1beuFiLRl4 8Ce59B2yoGzY0jx8UCqQ14LCzV4w0JnUs6DrVpI6W0l+O/iiGqjq2ABk7iNAlPshu1iy XwpalUID65r2B4MijxUyQOQae5lu0qsxVqbx//SveqRgIzK/MubLCcabvTZopBKXafYC Sh21StF+/YEpQvb4AoLYqnbU+OURIBrWnDotiWV8k8W9QZKNKOYCyv8AGHKHQql6ZZIG uUlr6fH5hKSVbn4KkRZ3sDvbS93PyBywf7f6Ou2CJFuoBG1iUGfHFCYqmz1ZY8ix34LP 9RUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=fNF+DrL6yGsX3CO+9pcKrSCdgo3SRvSSt70DXn49aa4=; b=S7bx/j9hZgyvmr05Y3e7hSafcaaaui7EotadrX5IIUOSWflBG0Fuo8wmJATgrHrud0 ZSUnQqW4w0bJce+t6Np3ESFNgwMEEzACbJrJ+GRaSDHcASuCgNNpAbeiSzzXNoT7p8f9 a4JlFzE53ryNx95KS5XlB9juREyWVLtJTaBZKX3QqmsS6xfYIH4WES8Huz92tEJ3tZIs tnRgC/K9JrdVDpOjJZQDfCB69bVJMR5MIYJ/9/T5KvvL3qxj6qDsMvL4pejKwR786U9i f/159bbEjE/W1z7lMsO9mqBs086vXt98mACjj4Mea3pc6dkOOBAXf/WaV9UGRosPfwKf 4XhA== X-Gm-Message-State: AHQUAuawxy0ewDM3pCczoAQIbGL6QQMS5Cd3o93zhxx7qRUj9+puYRds dbAHbxBz2QcSGIehiYErAoP7QOXbvtWrSbWfeJE= X-Google-Smtp-Source: AHgI3IavqAnZ51UaYZRhmYzR5Vb+MAbAuOEsfpWpXXZQoQJLelcK/uXd9cKKsXbsL8DPzXp0A2XEfWYaiXGcW2Qc0O0= X-Received: by 2002:ac2:53b7:: with SMTP id j23mr2344420lfh.109.1548981623894; Thu, 31 Jan 2019 16:40:23 -0800 (PST) MIME-Version: 1.0 References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> In-Reply-To: Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Fri, 1 Feb 2019 08:40:11 +0800 Message-ID: Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve To: Warner Losh Cc: Konstantin Belousov , Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 8980283F63 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 00:40:26 -0000 Em sex, 1 de fev de 2019 =C3=A0s 08:36, Warner Losh escrev= eu: > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov wrote: > >> On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: >> > Author: araujo >> > Date: Thu Jan 31 23:32:19 2019 >> > New Revision: 343634 >> > URL: https://svnweb.freebsd.org/changeset/base/343634 >> > >> > Log: >> > Mostly a cosmetic change to replace strlen with strnlen. >> This is not cosmetic, and more, for instance the usage() part of the >> change >> does not make any sense to me. >> > > I specifically objected as well and was blown off. What gives? > I have asked you feedback and got none! I will revert the usage() changes later then. Best, > > Warner > > > >> > Obtained from: Project ACRN >> > MFC after: 2 weeks >> > >> > Modified: >> > head/usr.sbin/bhyve/bhyverun.c >> > head/usr.sbin/bhyve/smbiostbl.c >> > head/usr.sbin/bhyve/usb_mouse.c >> > >> > Modified: head/usr.sbin/bhyve/bhyverun.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:21:18 2019 >> (r343633) >> > +++ head/usr.sbin/bhyve/bhyverun.c Thu Jan 31 23:32:19 2019 >> (r343634) >> > @@ -233,8 +233,8 @@ usage(int code) >> > " -W: force virtio to use single-vector MSI\n" >> > " -x: local apic is in x2APIC mode\n" >> > " -Y: disable MPtable generation\n", >> > - progname, (int)strlen(progname), "", >> (int)strlen(progname), "", >> > - (int)strlen(progname), ""); >> > + progname, (int)strnlen(progname, PATH_MAX), "", >> (int)strnlen(progname, PATH_MAX), "", >> > + (int)strnlen(progname, PATH_MAX), ""); >> > >> > exit(code); >> > } >> > >> > Modified: head/usr.sbin/bhyve/smbiostbl.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:21:18 2019 >> (r343633) >> > +++ head/usr.sbin/bhyve/smbiostbl.c Thu Jan 31 23:32:19 2019 >> (r343634) >> > @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure >> *te >> > int len; >> > >> > string =3D template_strings[i]; >> > - len =3D strlen(string) + 1; >> > + len =3D strnlen(string, SMBIOS_MAX_LENGTH) + 1; >> > memcpy(curaddr, string, len); >> > curaddr +=3D len; >> > } >> > @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure >> *temp >> > return (-1); >> > >> > MD5Init(&mdctx); >> > - MD5Update(&mdctx, vmname, strlen(vmname)); >> > + MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX)); >> > MD5Update(&mdctx, hostname, sizeof(hostname)); >> > MD5Final(digest, &mdctx); >> > >> > >> > Modified: head/usr.sbin/bhyve/usb_mouse.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:21:18 2019 >> (r343633) >> > +++ head/usr.sbin/bhyve/usb_mouse.c Thu Jan 31 23:32:19 2019 >> (r343634) >> > @@ -70,6 +70,7 @@ enum { >> > UMSTR_MAX >> > }; >> > >> > +#define UMOUSE_DESC_MAX_LEN 32 >> > static const char *umouse_desc_strings[] =3D { >> > "\x04\x09", >> > "BHYVE", >> > @@ -441,7 +442,7 @@ umouse_request(void *scarg, struct usb_data_xfer >> *xfer >> > goto done; >> > } >> > >> > - slen =3D 2 + strlen(str) * 2; >> > + slen =3D 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) *= 2; >> > udata[0] =3D slen; >> > udata[1] =3D UDESC_STRING; >> > >> >> --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Feb 1 01:01:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D865114BE210; Fri, 1 Feb 2019 01:01:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2289A8484B; Fri, 1 Feb 2019 01:01:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x1111HmX001123 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 1 Feb 2019 03:01:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x1111HmX001123 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x1111HtB001122; Fri, 1 Feb 2019 03:01:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 1 Feb 2019 03:01:17 +0200 From: Konstantin Belousov To: araujo@freebsd.org Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve Message-ID: <20190201010117.GA24863@kib.kiev.ua> References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 01:01:28 -0000 On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote: > Em sex, 1 de fev de 2019 às 08:36, Warner Losh escreveu: > > > > > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov > wrote: > > > >> On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: > >> > Author: araujo > >> > Date: Thu Jan 31 23:32:19 2019 > >> > New Revision: 343634 > >> > URL: https://svnweb.freebsd.org/changeset/base/343634 > >> > > >> > Log: > >> > Mostly a cosmetic change to replace strlen with strnlen. > >> This is not cosmetic, and more, for instance the usage() part of the > >> change > >> does not make any sense to me. > >> > > > > I specifically objected as well and was blown off. What gives? > > > > I have asked you feedback and got none! I will revert the usage() changes > later then. I noted the usage() chunk because it is the first one in the commit and I stopped after I see the obvious issues with it, not because it is the only wrong part. From owner-svn-src-head@freebsd.org Fri Feb 1 01:05:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 279AA14BE426; Fri, 1 Feb 2019 01:05:52 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65B5284BE0; Fri, 1 Feb 2019 01:05:51 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lj1-x233.google.com with SMTP id u89-v6so4397030lje.1; Thu, 31 Jan 2019 17:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=albf8FPXM+MAOueeawzz/byxL3GtaH+ISDDtSEju0fo=; b=AFz5p1FihVr0q/efoaWVwCidKjYjEHJvWvvQY3CxGekugK2HvyQKH2mtz4tO0odYZS 15zxVFBD5O9gWGfVoJF9cT40osVHsQWyi688m5+BMB/4sJav5ef35JRPG0n6LZkoVkGQ axFm+xsI1GQDb4nK+15UmQzv3wPk53MY1px1XShgw/gIsBYD+90wOkn708ef28Hl46nh ss5uaWLnvwmEeeGJp8ylKp9lnDvx7MtTB6kG7UVmf2+87CKcPoJtDMRZk1peVikpRHpr Ro+0vIWN1GSAI4VFMw3+nNuuPzc1Ip/849RdJIbrGfN4EvUDPfgqI5w7JRY1FVkEKOuI C3eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=albf8FPXM+MAOueeawzz/byxL3GtaH+ISDDtSEju0fo=; b=MTzk1NW2v1gc7Kx89dI3E8EXflHV6SijyX2+xLTV4AZ5bE1qk2y8Lrnk06HRxL7Ea6 XBukF0fCKkEJ2mIrRctoHWCxMHLQyWFfXRZLDgHyadcxQjVcW6WT/NXZJn29TuObk5/W dHCGpKqzcK1yCgb5Ha6BMhX3CrkvG47HeKXoG6oTGItZf3GBPKZtKFuWbqVsI0J+It7D jdav1pJlRERZqY/jPd++JxhFRVCRGyxFEviFMyBkKt4ngToPCeWM8TWOd3wv91YXseMl BgYUFyE0RKoIbKg9ENu3e7QHCMT68EAm7ft2ajJdHFQ8v3I+hunaPOOC+PSzXxv83j1U HcuQ== X-Gm-Message-State: AJcUuke0qmuMdzcKnp/saJPaihMdz+xPWxmufJxyFAl/iqeNbwnhLZ6B D3U2ZXoGeg34bswj9gnyQyhi3mkiOde1jATjaag= X-Google-Smtp-Source: ALg8bN7RKKQstrXoo80jAPHcejDfa5Txd+JqUWiQrsiw8KOZ1Xj9AmLlV+E4ekgs3cr8tccDRlqycyJmcjHeI88ce4M= X-Received: by 2002:a2e:12d0:: with SMTP id 77-v6mr29213292ljs.132.1548983149696; Thu, 31 Jan 2019 17:05:49 -0800 (PST) MIME-Version: 1.0 References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> <20190201010117.GA24863@kib.kiev.ua> In-Reply-To: <20190201010117.GA24863@kib.kiev.ua> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Fri, 1 Feb 2019 09:05:37 +0800 Message-ID: Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve To: Konstantin Belousov Cc: Marcelo Araujo , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 65B5284BE0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 01:05:52 -0000 Em sex, 1 de fev de 2019 =C3=A0s 09:01, Konstantin Belousov escreveu: > On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote: > > Em sex, 1 de fev de 2019 =C3=A0s 08:36, Warner Losh > escreveu: > > > > > > > > > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov > > wrote: > > > > > >> On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: > > >> > Author: araujo > > >> > Date: Thu Jan 31 23:32:19 2019 > > >> > New Revision: 343634 > > >> > URL: https://svnweb.freebsd.org/changeset/base/343634 > > >> > > > >> > Log: > > >> > Mostly a cosmetic change to replace strlen with strnlen. > > >> This is not cosmetic, and more, for instance the usage() part of the > > >> change > > >> does not make any sense to me. > > >> > > > > > > I specifically objected as well and was blown off. What gives? > > > > > > > I have asked you feedback and got none! I will revert the usage() chang= es > > later then. > > I noted the usage() chunk because it is the first one in the commit and > I stopped after I see the obvious issues with it, not because it is the > only wrong part. > Are you implying that all the patch is wrong? I have no problem to revert it at all if you give me the right reason, it was basically a port from another project that also uses bhyve. Best, --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Feb 1 01:21:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39BE14BED3D; Fri, 1 Feb 2019 01:21:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52C5885549; Fri, 1 Feb 2019 01:21:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x111LBah006107 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 1 Feb 2019 03:21:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x111LBah006107 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x111LBWp006106; Fri, 1 Feb 2019 03:21:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 1 Feb 2019 03:21:11 +0200 From: Konstantin Belousov To: araujo@freebsd.org Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve Message-ID: <20190201012111.GB24863@kib.kiev.ua> References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> <20190201010117.GA24863@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 01:21:21 -0000 On Fri, Feb 01, 2019 at 09:05:37AM +0800, Marcelo Araujo wrote: > Em sex, 1 de fev de 2019 às 09:01, Konstantin Belousov > escreveu: > > > On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote: > > > Em sex, 1 de fev de 2019 às 08:36, Warner Losh > > escreveu: > > > > > > > > > > > > > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov > > > wrote: > > > > > > > >> On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: > > > >> > Author: araujo > > > >> > Date: Thu Jan 31 23:32:19 2019 > > > >> > New Revision: 343634 > > > >> > URL: https://svnweb.freebsd.org/changeset/base/343634 > > > >> > > > > >> > Log: > > > >> > Mostly a cosmetic change to replace strlen with strnlen. > > > >> This is not cosmetic, and more, for instance the usage() part of the > > > >> change > > > >> does not make any sense to me. > > > >> > > > > > > > > I specifically objected as well and was blown off. What gives? > > > > > > > > > > I have asked you feedback and got none! I will revert the usage() changes > > > later then. > > > > I noted the usage() chunk because it is the first one in the commit and > > I stopped after I see the obvious issues with it, not because it is the > > only wrong part. > > > > Are you implying that all the patch is wrong? > I have no problem to revert it at all if you give me the right reason, it > was basically a port from another project that also uses bhyve. By default, all uses of strncmp() and strncpy() are bugs. Your commit message have no explanation what the change fixes/improves. So I looked at the second chunk, for smbios_generic_initializer(). It also seems to be wrong. If template_string[i] length is greater than SMBIOS_MAX_LENGTH, then the copied string is not nul-terminated. If its length is less than the constant, then what is the point ? I also looked at the third chunk, smbios_type1_initializer(). I cannot understand the reasoning behind it, at all. Only usb_mouse.c is left, I do not expect anything good from it. From owner-svn-src-head@freebsd.org Fri Feb 1 01:42:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09EEB14BF3CA; Fri, 1 Feb 2019 01:42:27 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D44885DD5; Fri, 1 Feb 2019 01:42:26 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lj1-x241.google.com with SMTP id l15-v6so4378084lja.9; Thu, 31 Jan 2019 17:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=swUZh/+GwuaB7zn1NohVLeml4QcsZXCf/WhxD/+pV6s=; b=uryxjevDrwiVr4TtUbNqAokk1K4aT+MpvzkjHJtsnewjFADJLdI+A6c48Sc1tHpd3N Y3PTAyGr3yJViRlTe5UrjfnFMFA3hXZ2+MDitrUu8osDAgIKeyd9uDlY9p6s4EwS05f9 +0Uc6V5mYNyjaotz0OHHiHKbwYAw8Fl6sFnEHwcffBt8Y4DBcsbWGcLfPmJpfJWguCts sf88t0sKOmgejFtypYd4M7uwrdjY0A+5bpkSK8G2Oe+Bf3SV4KnQoT3YvpO/1Wa2WrgL QLaqXNVLzdgkYxckgY79gHCd0Tz0aSLxrMxuoPZqVZlB9OFjeVZfCNSJ2/ZRfEfFG5oR +k1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=swUZh/+GwuaB7zn1NohVLeml4QcsZXCf/WhxD/+pV6s=; b=UjJxaSawcyLLGsco/89KcEdArd1AQhP6ccHv1uQz/2Vnh1pEd+7JzB+eOMxXqNMapf 2xYchFdrPDRh2tYmL3iwKcbs/ZQ8Rpo2JDLSvzEsSWcktfd4xOAMYuWkT4Wh0RTLTQ/1 uyrYmoIDyvWK/+a3r7v72GF01xwgA25eV0Rv+y4XggI/nxs4UhChmYphi71QI8nRcmtq jfqrnr5V1vIAdUj1kFdh9XzpnKCxDrROSc9DospUwcnSWUwW5eUQliOPeLnVn86muCVy j05Xaj2TFUC8qNwRKkUj3LFWFUXapOUfceoJc4AzdZZ5agX1Fesgh0XWGXlf7mbFjn3z GAgQ== X-Gm-Message-State: AHQUAubDaHnWgHh0240WRbViJMK/XMmDLMMt5LRI+Hnsu21mADmyDU97 xvRWrNEDNjAyGnM1xMAQmMnT894mKpmFPwV0tv0= X-Google-Smtp-Source: AHgI3IbtDCfZpLRBXasj5658B/jFw/h3loO9OJDvVPLqZxbwgf3bKZUphAOE4xtzRfQRCPU57a67OTY8WbztLQFycl4= X-Received: by 2002:a2e:3a10:: with SMTP id h16-v6mr25404977lja.184.1548985344985; Thu, 31 Jan 2019 17:42:24 -0800 (PST) MIME-Version: 1.0 References: <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> <20190201010117.GA24863@kib.kiev.ua> <20190201012111.GB24863@kib.kiev.ua> In-Reply-To: <20190201012111.GB24863@kib.kiev.ua> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Fri, 1 Feb 2019 09:42:13 +0800 Message-ID: Subject: Re: svn commit: r343634 - head/usr.sbin/bhyve To: Konstantin Belousov Cc: Marcelo Araujo , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 6D44885DD5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 01:42:27 -0000 Em sex, 1 de fev de 2019 =C3=A0s 09:21, Konstantin Belousov escreveu: > On Fri, Feb 01, 2019 at 09:05:37AM +0800, Marcelo Araujo wrote: > > Em sex, 1 de fev de 2019 =C3=A0s 09:01, Konstantin Belousov < > kostikbel@gmail.com> > > escreveu: > > > > > On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote: > > > > Em sex, 1 de fev de 2019 =C3=A0s 08:36, Warner Losh > > > escreveu: > > > > > > > > > > > > > > > > > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov < > kostikbel@gmail.com > > > > > wrote: > > > > > > > > > >> On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote: > > > > >> > Author: araujo > > > > >> > Date: Thu Jan 31 23:32:19 2019 > > > > >> > New Revision: 343634 > > > > >> > URL: https://svnweb.freebsd.org/changeset/base/343634 > > > > >> > > > > > >> > Log: > > > > >> > Mostly a cosmetic change to replace strlen with strnlen. > > > > >> This is not cosmetic, and more, for instance the usage() part of > the > > > > >> change > > > > >> does not make any sense to me. > > > > >> > > > > > > > > > > I specifically objected as well and was blown off. What gives? > > > > > > > > > > > > > I have asked you feedback and got none! I will revert the usage() > changes > > > > later then. > > > > > > I noted the usage() chunk because it is the first one in the commit a= nd > > > I stopped after I see the obvious issues with it, not because it is t= he > > > only wrong part. > > > > > > > Are you implying that all the patch is wrong? > > I have no problem to revert it at all if you give me the right reason, = it > > was basically a port from another project that also uses bhyve. > > By default, all uses of strncmp() and strncpy() are bugs. > Your commit message have no explanation what the change fixes/improves. > > So I looked at the second chunk, for smbios_generic_initializer(). It > also seems to be wrong. If template_string[i] length is greater than > SMBIOS_MAX_LENGTH, then the copied string is not nul-terminated. If its > length is less than the constant, then what is the point ? > > I also looked at the third chunk, smbios_type1_initializer(). I cannot > understand the reasoning behind it, at all. > > Only usb_mouse.c is left, I do not expect anything good from it. > Thanks kib, I will recheck the patch and open another review! I will revert this commit in a few. Best, --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Feb 1 03:09:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E6DB14C152A; Fri, 1 Feb 2019 03:09:13 +0000 (UTC) (envelope-from araujo@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 BD33E88E96; Fri, 1 Feb 2019 03:09:12 +0000 (UTC) (envelope-from araujo@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 B33F718F72; Fri, 1 Feb 2019 03:09:12 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1139Cxl025485; Fri, 1 Feb 2019 03:09:12 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1139CUe025482; Fri, 1 Feb 2019 03:09:12 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201902010309.x1139CUe025482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 1 Feb 2019 03:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343642 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 343642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD33E88E96 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 03:09:13 -0000 Author: araujo Date: Fri Feb 1 03:09:11 2019 New Revision: 343642 URL: https://svnweb.freebsd.org/changeset/base/343642 Log: Revert r343634: Mostly a cosmetic change to replace strlen with strnlen. Requested by: kib and imp Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/smbiostbl.c head/usr.sbin/bhyve/usb_mouse.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Feb 1 03:02:52 2019 (r343641) +++ head/usr.sbin/bhyve/bhyverun.c Fri Feb 1 03:09:11 2019 (r343642) @@ -233,8 +233,8 @@ usage(int code) " -W: force virtio to use single-vector MSI\n" " -x: local apic is in x2APIC mode\n" " -Y: disable MPtable generation\n", - progname, (int)strnlen(progname, PATH_MAX), "", (int)strnlen(progname, PATH_MAX), "", - (int)strnlen(progname, PATH_MAX), ""); + progname, (int)strlen(progname), "", (int)strlen(progname), "", + (int)strlen(progname), ""); exit(code); } Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Fri Feb 1 03:02:52 2019 (r343641) +++ head/usr.sbin/bhyve/smbiostbl.c Fri Feb 1 03:09:11 2019 (r343642) @@ -558,7 +558,7 @@ smbios_generic_initializer(struct smbios_structure *te int len; string = template_strings[i]; - len = strnlen(string, SMBIOS_MAX_LENGTH) + 1; + len = strlen(string) + 1; memcpy(curaddr, string, len); curaddr += len; } @@ -611,7 +611,7 @@ smbios_type1_initializer(struct smbios_structure *temp return (-1); MD5Init(&mdctx); - MD5Update(&mdctx, vmname, strnlen(vmname, PATH_MAX)); + MD5Update(&mdctx, vmname, strlen(vmname)); MD5Update(&mdctx, hostname, sizeof(hostname)); MD5Final(digest, &mdctx); Modified: head/usr.sbin/bhyve/usb_mouse.c ============================================================================== --- head/usr.sbin/bhyve/usb_mouse.c Fri Feb 1 03:02:52 2019 (r343641) +++ head/usr.sbin/bhyve/usb_mouse.c Fri Feb 1 03:09:11 2019 (r343642) @@ -70,7 +70,6 @@ enum { UMSTR_MAX }; -#define UMOUSE_DESC_MAX_LEN 32 static const char *umouse_desc_strings[] = { "\x04\x09", "BHYVE", @@ -442,7 +441,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer goto done; } - slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2; + slen = 2 + strlen(str) * 2; udata[0] = slen; udata[1] = UDESC_STRING; From owner-svn-src-head@freebsd.org Fri Feb 1 06:59:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A18B014C8C5B; Fri, 1 Feb 2019 06:59:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id EAA2F735EA; Fri, 1 Feb 2019 06:59:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 9365D4327D6; Fri, 1 Feb 2019 17:59:37 +1100 (AEDT) Date: Fri, 1 Feb 2019 17:59:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343636 - head/sbin/pfilctl In-Reply-To: <201902010034.x110YIqU047081@repo.freebsd.org> Message-ID: <20190201160141.U1348@besplex.bde.org> References: <201902010034.x110YIqU047081@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=_D4y2HQ-7yQqC668tgQA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: EAA2F735EA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.86 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.86)[-0.857,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 06:59:51 -0000 On Fri, 1 Feb 2019, Gleb Smirnoff wrote: > Log: > Hopefully fix compilation by other compilers. You mean "Hopefully fix compilation by compilers whose -Wnested-externs support is not broken". bsd.sys.mk sets -Wnested-externs at WARNS >= 6 and also -Wredundant-decls to inhibit the engineering and style bug of declaring extern variables outside of header files. Certain compilers whose -Wnested-includes is broken also have a broken -Wredundant-decls. The brokenness is typically to silently ignore these flags. Even adding -pedantic doesn't fix this in certain compilers. > Modified: head/sbin/pfilctl/pfilctl.c > ============================================================================== > --- head/sbin/pfilctl/pfilctl.c Fri Feb 1 00:33:17 2019 (r343635) > +++ head/sbin/pfilctl/pfilctl.c Fri Feb 1 00:34:18 2019 (r343636) > @@ -94,9 +94,8 @@ main(int argc __unused, char *argv[] __unused) > static void > help(void) > { > - extern char *__progname; > > - fprintf(stderr, "usage: %s (heads|hooks|link|unlink)\n", __progname); > + fprintf(stderr, "usage: %s (heads|hooks|link|unlink)\n", getprogname()); > exit(0); > } Here __progname is an implementation detail, and it is intentionally not declared in a header file. Bad code like the above was chummy with the implementation and declared it as part of the chumminess. Compilers with non-broken -Wnested-includes used to be more common and detected this bug. If __progname were declared in an included header files, then compilers with a non-broken -Wredundant-decls would detect another bug. The change is to use the correct API. This function has many other style bugs. Normal programs spell help() as usage(). Even this program still prints "usage: " and not "help: ". There are a lot of style rules for usage(), and one is to normally use a hard-coded name for the program and not use getprogname() or argv[0], or even warnx(). warnx() would do the same thing as a normal usage(), except it would print "%s: usage:" instead of "usage: %s", where %s is getprogname() for warnx() and a hard-coded name for normal usage(). The warnx() order is better but is not traditional. However, some programs like this one get different features according to the program name given by argv[0]. rm is a good example of how to do this, and this program is a bad example of how to do this. rm has 2 name, rm and unlink. It starts by taking the basename of argv[0] (hackishly using strrchr(3) instead of basename(3)). Then it prints separate usage messages for rm and unlink using hard coded names for both. It could be improved by only printing the usage message for the current name. This program starts by not taking the basename of argv[0], so it fails to find the correct program if argv[0] has a path prefix. It has 4 alternative names where rm has only 2, and it uses the style bug of !strcmp() to search its table where rm uses strcmp() == 0. Later it prints a wrong usage message. The usage message should have 4 alternative hard-coded program names following by options relevant to each name (as in rm), or only the usage relative to the current name. Instead it has the current name followed by the syntax error of repeating one of of the possible names, and no options. The man page gives normally formatted syntax, as for rm. Usage messages should be checked to be lexically identical to man page synopses after removing "usage: " and leading whitespace. man(1) limits line lengths, and it is important for usage() to limit line lengths identically exept for the "usage: " prefix, for readability and for easy comparison. man(1) wraps long lines and comparison is too difficult if usage() wraps differently. man(1) leaves a large left margin and a small right margin, and that is enough for the margin given by "usage: ". One reason to hard-code names in usage() is that they have to be hard- coded in the man page. The action has to be the same as in the man page, _especially_ for programs like rm and unlink where the name affects the action. Otherwise, the only thing that using the dynamic name does is to slightly de-obfuscate obfuscations and security attacks like "ln /bin/rm $HOME/bin/ls". getprogname(3) is documented to "manipulate" the name of the program, but no details of the manipulation are documented. It actually returns __progname. __progname is set in too many different ways: - csu uses a manually inlined version of strrchr() to find the base name - rtld uses __progname = obj_rtld.path in 2 places and basename(argv[0]) in 1 places. The 2 places seem to be missing taking the base name. - setprogname() uses strrchr() to find the base name - using basename() is usually worse than the home made methods for most uses. basename() has extras like converting NULL and "" to "." and removing trailing slashes. The extras make it non-reentrant. basename() was fixed in 4.4BSD or earlier to allocate memory and take a const char * arg, but was later broken to POSIX spec. setprogname() is documented to return a pointer into its string arg, so that the string should not be modified. The documentation of basename() is not so good. It doesn't emphasize that the string should not be modified. It gives 2 implementation methods, with the first one the current method and the second one the old BSD method, then says that the "former" method is thread-safe. It is actually the latter method that is thread-safe. It was only former in time. Except it was also latter in time (between 2 thread-unsafe implementations). Stripping trailing slashes is usually wrong. However, for program names it is harmless, because program names can't name directories. If they did have trailing slashes, then the strrchr() method would be harmful -- it would give "" for "ls/", while basename() gives "ls". But the program name can't be "ls/", since "ls/" is a directory if it exists. Bruce From owner-svn-src-head@freebsd.org Fri Feb 1 07:48:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C46914B7771; Fri, 1 Feb 2019 07:48:38 +0000 (UTC) (envelope-from glebius@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 0D29275D52; Fri, 1 Feb 2019 07:48:38 +0000 (UTC) (envelope-from glebius@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 EE8D71BEDD; Fri, 1 Feb 2019 07:48:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x117mb0K069710; Fri, 1 Feb 2019 07:48:37 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x117mbQT069709; Fri, 1 Feb 2019 07:48:37 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902010748.x117mbQT069709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 1 Feb 2019 07:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343645 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 343645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D29275D52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.87)[-0.868,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 07:48:38 -0000 Author: glebius Date: Fri Feb 1 07:48:37 2019 New Revision: 343645 URL: https://svnweb.freebsd.org/changeset/base/343645 Log: Unbreak call to ipf_check(): it expects the out parameter to be 0 or 1. Pointy hat to: glebius Reported by: cy Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Fri Feb 1 06:19:12 2019 (r343644) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Fri Feb 1 07:48:37 2019 (r343645) @@ -135,8 +135,8 @@ ipf_check_wrapper(struct mbuf **mp, struct ifnet *ifp, pfil_return_t rv; CURVNET_SET(ifp->if_vnet); - rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp, (flags & PFIL_OUT), - mp); + rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp, + !!(flags & PFIL_OUT), mp); CURVNET_RESTORE(); return (rv == 0 ? PFIL_PASS : PFIL_DROPPED); } @@ -150,7 +150,7 @@ ipf_check_wrapper6(struct mbuf **mp, struct ifnet *ifp CURVNET_SET(ifp->if_vnet); rv = ipf_check(&V_ipfmain, mtod(*mp, struct ip *), - sizeof(struct ip6_hdr), ifp, (flags & PFIL_OUT), mp); + sizeof(struct ip6_hdr), ifp, !!(flags & PFIL_OUT), mp); CURVNET_RESTORE(); return (rv == 0 ? PFIL_PASS : PFIL_DROPPED); From owner-svn-src-head@freebsd.org Fri Feb 1 08:10:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EFFC14BAB59; Fri, 1 Feb 2019 08:10:27 +0000 (UTC) (envelope-from glebius@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 681AF76D46; Fri, 1 Feb 2019 08:10:27 +0000 (UTC) (envelope-from glebius@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 5EDB01C249; Fri, 1 Feb 2019 08:10:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x118AR7v080438; Fri, 1 Feb 2019 08:10:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x118AR38080437; Fri, 1 Feb 2019 08:10:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902010810.x118AR38080437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 1 Feb 2019 08:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343646 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 681AF76D46 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.87)[-0.868,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 08:10:27 -0000 Author: glebius Date: Fri Feb 1 08:10:26 2019 New Revision: 343646 URL: https://svnweb.freebsd.org/changeset/base/343646 Log: Repair siftr(4): PFIL_IN and PFIL_OUT are defines of some value, relying on them having particular values can break things. Modified: head/sys/netinet/siftr.c Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Fri Feb 1 07:48:37 2019 (r343645) +++ head/sys/netinet/siftr.c Fri Feb 1 08:10:26 2019 (r343646) @@ -172,8 +172,11 @@ static MALLOC_DEFINE(M_SIFTR_HASHNODE, "siftr_hashnode struct pkt_node { /* Timestamp of pkt as noted in the pfil hook. */ struct timeval tval; - /* Direction pkt is travelling; either PFIL_IN or PFIL_OUT. */ - uint8_t direction; + /* Direction pkt is travelling. */ + enum { + DIR_IN = 0, + DIR_OUT = 1, + } direction; /* IP version pkt_node relates to; either INP_IPV4 or INP_IPV6. */ uint8_t ipver; /* Hash of the pkt which triggered the log message. */ @@ -286,11 +289,7 @@ static struct alq *siftr_alq = NULL; static struct mtx siftr_pkt_queue_mtx; static struct mtx siftr_pkt_mgr_mtx; static struct thread *siftr_pkt_manager_thr = NULL; -/* - * pfil.h defines PFIL_IN as 1 and PFIL_OUT as 2, - * which we use as an index into this array. - */ -static char direction[3] = {'\0', 'i','o'}; +static char direction[2] = {'i','o'}; /* Required function prototypes. */ static int siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS); @@ -409,7 +408,7 @@ siftr_process_pkt(struct pkt_node * pkt_node) LIST_INSERT_HEAD(counter_list, hash_node, nodes); } else { /* Malloc failed. */ - if (pkt_node->direction == PFIL_IN) + if (pkt_node->direction == DIR_IN) ss->nskip_in_malloc++; else ss->nskip_out_malloc++; @@ -812,7 +811,7 @@ siftr_siftdata(struct pkt_node *pn, struct inpcb *inp, INP_RUNLOCK(inp); pn->ipver = ipver; - pn->direction = dir; + pn->direction = (dir == PFIL_IN ? DIR_IN : DIR_OUT); /* * Significantly more accurate than using getmicrotime(), but slower! From owner-svn-src-head@freebsd.org Fri Feb 1 12:33:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8852214AFCFC; Fri, 1 Feb 2019 12:33:01 +0000 (UTC) (envelope-from tuexen@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 2C35C8BE00; Fri, 1 Feb 2019 12:33:01 +0000 (UTC) (envelope-from tuexen@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 1DFBE1EFC4; Fri, 1 Feb 2019 12:33:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11CX087020287; Fri, 1 Feb 2019 12:33:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11CX0J0020283; Fri, 1 Feb 2019 12:33:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201902011233.x11CX0J0020283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 1 Feb 2019 12:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343661 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 343661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C35C8BE00 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 12:33:01 -0000 Author: tuexen Date: Fri Feb 1 12:33:00 2019 New Revision: 343661 URL: https://svnweb.freebsd.org/changeset/base/343661 Log: When handling SYN-ACK segments in the SYN-RCVD state, set tp->snd_wnd consistently. This inconsistency was observed when working on the bug reported in PR 235256, although it does not fix the reported issue. The fix for the PR will be a separate commit. PR: 235256 Reviewed by: rrs@, Richard Scheffenegger MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19033 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Feb 1 12:24:56 2019 (r343660) +++ head/sys/netinet/tcp_input.c Fri Feb 1 12:33:00 2019 (r343661) @@ -2385,8 +2385,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == (TF_RCVD_SCALE|TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; - tp->snd_wnd = tiwin; } + tp->snd_wnd = tiwin; /* * Make transitions: * SYN-RECEIVED -> ESTABLISHED Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Fri Feb 1 12:24:56 2019 (r343660) +++ head/sys/netinet/tcp_stacks/rack.c Fri Feb 1 12:33:00 2019 (r343661) @@ -5433,6 +5433,7 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st tp->ts_recent_age = tcp_ts_getticks(); tp->ts_recent = to->to_tsval; } + tp->snd_wnd = tiwin; /* * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN flag * is on (half-synchronized state), then queue data for later @@ -5440,7 +5441,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st */ if ((thflags & TH_ACK) == 0) { if (IS_FASTOPEN(tp->t_flags)) { - tp->snd_wnd = tiwin; cc_conn_init(tp); } return (rack_process_data(m, th, so, tp, drop_hdrlen, tlen, @@ -5452,7 +5452,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st if ((tp->t_flags & (TF_RCVD_SCALE | TF_REQ_SCALE)) == (TF_RCVD_SCALE | TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; - tp->snd_wnd = tiwin; } /* * Make transitions: SYN-RECEIVED -> ESTABLISHED SYN-RECEIVED* -> From owner-svn-src-head@freebsd.org Fri Feb 1 16:07:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCB114B8D92; Fri, 1 Feb 2019 16:07:50 +0000 (UTC) (envelope-from bde@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 051C16F1CE; Fri, 1 Feb 2019 16:07:50 +0000 (UTC) (envelope-from bde@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 DB9DF21381; Fri, 1 Feb 2019 16:07:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11G7nPx032616; Fri, 1 Feb 2019 16:07:49 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11G7n4j032615; Fri, 1 Feb 2019 16:07:49 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902011607.x11G7n4j032615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 1 Feb 2019 16:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343663 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 343663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 051C16F1CE 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 16:07:50 -0000 Author: bde Date: Fri Feb 1 16:07:49 2019 New Revision: 343663 URL: https://svnweb.freebsd.org/changeset/base/343663 Log: Fix function keys for syscons in cons25 mode (vidcontrol -T cons25). kbd(4) (but only documented in atkbd(4)) maintains a table of strings for 96 function keys. Using teken broke this 9+ years ago for the most usable first 12 function keys and for 10 cursor keys, by supplying its own non-programmable strings so that the keyboard driver's strings are not used. Fix this by supplying NULL in the teken layer for syscons in cons25 mode so that the the strings are found in the kbd(4) layer. vt needs more changes to use kbd(4)'s tables. Teken's cons25 table is still needed to supply nonempty strings for vt in cons25 mode. Keep using teken's xterm tables for both syscons and vt in xterm mode. Function keys should at least default to xterm values in xterm mode, and kbd(4) doesn't support this. teken_set_cons25() sets a sticky flag to ask for the fix, and space is reserved for another new flag. vt should set this flag when it uses kbd(4)'s tables. PR: 226553 (for vt) Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Fri Feb 1 15:38:20 2019 (r343662) +++ head/sys/teken/teken.c Fri Feb 1 16:07:49 2019 (r343663) @@ -58,6 +58,7 @@ #define TS_CONS25 0x0040 /* cons25 emulation. */ #define TS_INSTRING 0x0080 /* Inside string. */ #define TS_CURSORKEYS 0x0100 /* Cursor keys mode. */ +#define TS_CONS25KEYS 0x0400 /* Fuller cons25 emul (fix function keys). */ /* Character that blanks a cell. */ #define BLANK ' ' @@ -411,7 +412,7 @@ void teken_set_cons25(teken_t *t) { - t->t_stateflags |= TS_CONS25; + t->t_stateflags |= TS_CONS25 | TS_CONS25KEYS; } /* @@ -722,6 +723,9 @@ teken_get_sequence(const teken_t *t, unsigned int k) { /* Cons25 mode. */ + if ((t->t_stateflags & (TS_CONS25 | TS_CONS25KEYS)) == + (TS_CONS25 | TS_CONS25KEYS)) + return (NULL); /* Don't override good kbd(4) strings. */ if (t->t_stateflags & TS_CONS25 && k < sizeof special_strings_cons25 / sizeof(char *)) return (special_strings_cons25[k]); From owner-svn-src-head@freebsd.org Fri Feb 1 20:28:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D186914BFBBB; Fri, 1 Feb 2019 20:28:16 +0000 (UTC) (envelope-from emaste@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 756528025E; Fri, 1 Feb 2019 20:28:16 +0000 (UTC) (envelope-from emaste@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 3ABD223F98; Fri, 1 Feb 2019 20:28:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11KSGBH071400; Fri, 1 Feb 2019 20:28:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11KSGKo071399; Fri, 1 Feb 2019 20:28:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902012028.x11KSGKo071399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 1 Feb 2019 20:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343665 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 343665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 756528025E 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.95)[-0.950,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 20:28:17 -0000 Author: emaste Date: Fri Feb 1 20:28:15 2019 New Revision: 343665 URL: https://svnweb.freebsd.org/changeset/base/343665 Log: readelf: use table-based DT_FLAGS and DT_FLAGS_1 decoding Fewer lines of code and more maintainable. Reviewed by: brooks, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19053 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Feb 1 18:19:33 2019 (r343664) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Feb 1 20:28:15 2019 (r343665) @@ -220,6 +220,11 @@ struct mips_option { const char *desc; }; +struct flag_desc { + uint64_t flag; + const char *desc; +}; + static void add_dumpop(struct readelf *re, size_t si, const char *sn, int op, int t); static const char *aeabi_adv_simd_arch(uint64_t simd); @@ -293,8 +298,7 @@ static void dump_dwarf_ranges_foreach(struct readelf * static void dump_dwarf_str(struct readelf *re); static void dump_eflags(struct readelf *re, uint64_t e_flags); static void dump_elf(struct readelf *re); -static void dump_dt_flags_val(uint64_t d_val); -static void dump_dt_flags_1_val(uint64_t d_val); +static void dump_flags(struct flag_desc *fd, uint64_t flags); static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab); static void dump_dynamic(struct readelf *re); static void dump_liblist(struct readelf *re); @@ -2723,6 +2727,58 @@ dump_arch_dyn_val(struct readelf *re, GElf_Dyn *dyn) } static void +dump_flags(struct flag_desc *desc, uint64_t val) +{ + struct flag_desc *fd; + + for (fd = desc; fd->flag != 0; fd++) { + if (val & fd->flag) { + val &= ~fd->flag; + printf(" %s", fd->desc); + } + } + if (val != 0) + printf(" unknown (0x%jx)", (uintmax_t)val); +} + +static struct flag_desc dt_flags[] = { + { DF_ORIGIN, "ORIGIN" }, + { DF_SYMBOLIC, "SYMBOLIC" }, + { DF_TEXTREL, "TEXTREL" }, + { DF_BIND_NOW, "BIND_NOW" }, + { DF_STATIC_TLS, "STATIC_TLS" }, + { 0, NULL } +}; + +static struct flag_desc dt_flags_1[] = { + { DF_1_BIND_NOW, "NOW" }, + { DF_1_GLOBAL, "GLOBAL" }, + { 0x4, "GROUP" }, + { DF_1_NODELETE, "NODELETE" }, + { DF_1_LOADFLTR, "LOADFLTR" }, + { 0x20, "INITFIRST" }, + { DF_1_NOOPEN, "NOOPEN" }, + { DF_1_ORIGIN, "ORIGIN" }, + { 0x100, "DIRECT" }, + { DF_1_INTERPOSE, "INTERPOSE" }, + { DF_1_NODEFLIB, "NODEFLIB" }, + { 0x1000, "NODUMP" }, + { 0x2000, "CONFALT" }, + { 0x4000, "ENDFILTEE" }, + { 0x8000, "DISPRELDNE" }, + { 0x10000, "DISPRELPND" }, + { 0x20000, "NODIRECT" }, + { 0x40000, "IGNMULDEF" }, + { 0x80000, "NOKSYMS" }, + { 0x100000, "NOHDR" }, + { 0x200000, "EDITED" }, + { 0x400000, "NORELOC" }, + { 0x800000, "SYMINTPOSE" }, + { 0x1000000, "GLOBAUDIT" }, + { 0, NULL } +}; + +static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab) { const char *name; @@ -2807,146 +2863,14 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32 printf(" %s\n", timestamp(dyn->d_un.d_val)); break; case DT_FLAGS: - dump_dt_flags_val(dyn->d_un.d_val); + dump_flags(dt_flags, dyn->d_un.d_val); break; case DT_FLAGS_1: - dump_dt_flags_1_val(dyn->d_un.d_val); + dump_flags(dt_flags_1, dyn->d_un.d_val); break; default: printf("\n"); } -} - -static void -dump_dt_flags_val(uint64_t d_val) -{ - if (d_val & 0x1) { - d_val ^= 0x1; - printf(" ORIGIN"); - } - if (d_val & 0x2) { - d_val ^= 0x2; - printf(" SYMBOLIC"); - } - if (d_val & 0x4) { - d_val ^= 0x4; - printf(" TEXTREL"); - } - if (d_val & 0x8) { - d_val ^= 0x8; - printf(" BIND_NOW"); - } - if (d_val & 0x10) { - d_val ^= 0x10; - printf(" STATIC_TLS"); - } - if (d_val) - printf(" %jx", (uintmax_t)d_val); - printf("\n"); -} - -static void -dump_dt_flags_1_val(uint64_t d_val) -{ - if (d_val & 0x1) { - d_val ^= 0x1; - printf(" NOW"); - } - if (d_val & 0x2) { - d_val ^= 0x2; - printf(" GLOBAL"); - } - if (d_val & 0x4) { - d_val ^= 0x4; - printf(" GROUP"); - } - if (d_val & 0x8) { - d_val ^= 0x8; - printf(" NODELETE"); - } - if (d_val & 0x10) { - d_val ^= 0x10; - printf(" LOADFLTR"); - } - if (d_val & 0x20) { - d_val ^= 0x20; - printf(" INITFIRST"); - } - if (d_val & 0x40) { - d_val ^= 0x40; - printf(" NOOPEN"); - } - if (d_val & 0x80) { - d_val ^= 0x80; - printf(" ORIGIN"); - } - if (d_val & 0x100) { - d_val ^= 0x100; - printf(" DIRECT"); - } - if (d_val & 0x400) { - d_val ^= 0x400; - printf(" INTERPOSE"); - } - if (d_val & 0x800) { - d_val ^= 0x800; - printf(" NODEFLIB"); - } - if (d_val & 0x1000) { - d_val ^= 0x1000; - printf(" NODUMP"); - } - if (d_val & 0x2000) { - d_val ^= 0x2000; - printf(" CONFALT"); - } - if (d_val & 0x4000) { - d_val ^= 0x4000; - printf(" ENDFILTEE"); - } - if (d_val & 0x8000) { - d_val ^= 0x8000; - printf(" DISPRELDNE"); - } - if (d_val & 0x10000) { - d_val ^= 0x10000; - printf(" DISPRELPND"); - } - if (d_val & 0x20000) { - d_val ^= 0x20000; - printf(" NODIRECT"); - } - if (d_val & 0x40000) { - d_val ^= 0x40000; - printf(" IGNMULDEF"); - } - if (d_val & 0x80000) { - d_val ^= 0x80000; - printf(" NOKSYMS"); - } - if (d_val & 0x100000) { - d_val ^= 0x100000; - printf(" NOHDR"); - } - if (d_val & 0x200000) { - d_val ^= 0x200000; - printf(" EDITED"); - } - if (d_val & 0x400000) { - d_val ^= 0x400000; - printf(" NORELOC"); - } - if (d_val & 0x800000) { - d_val ^= 0x800000; - printf(" SYMINTPOSE"); - } - if (d_val & 0x1000000) { - d_val ^= 0x1000000; - printf(" GLOBAUDIT"); - } - if (d_val) - printf(" %jx", (uintmax_t)d_val); - printf("\n"); } static void From owner-svn-src-head@freebsd.org Fri Feb 1 20:42:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C67914C048A; Fri, 1 Feb 2019 20:42:50 +0000 (UTC) (envelope-from np@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 F131580C2F; Fri, 1 Feb 2019 20:42:49 +0000 (UTC) (envelope-from np@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 E2FBD242EE; Fri, 1 Feb 2019 20:42:49 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11KgnB2081448; Fri, 1 Feb 2019 20:42:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11Kgner081445; Fri, 1 Feb 2019 20:42:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201902012042.x11Kgner081445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 1 Feb 2019 20:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343666 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 343666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F131580C2F 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_LONG(-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] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 20:42:50 -0000 Author: np Date: Fri Feb 1 20:42:49 2019 New Revision: 343666 URL: https://svnweb.freebsd.org/changeset/base/343666 Log: cxgbe(4): Improved error reporting and diagnostics. "slow" interrupt handler: - Expand the list of INT_CAUSE registers known to the driver. - Add decode information for many more bits but decouple it from the rest of intr_info so that it is entirely optional. - Call t4_fatal_err exactly once, and from the top level PL intr handler. t4_fatal_err: - Use t4_shutdown_adapter from the common code to stop the adapter. - Stop servicing slow interrupts after the first fatal one. Driver/firmware interaction: - CH_DUMP_MBOX: note whether the mailbox being dumped is a command or a reply or something else. - Log the raw value of pcie_fw for some errors. - Use correct log levels (debug vs. error). Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Feb 1 20:28:15 2019 (r343665) +++ head/sys/dev/cxgbe/adapter.h Fri Feb 1 20:42:49 2019 (r343666) @@ -155,7 +155,7 @@ enum { CHK_MBOX_ACCESS = (1 << 2), MASTER_PF = (1 << 3), ADAP_SYSCTL_CTX = (1 << 4), - /* TOM_INIT_DONE= (1 << 5), No longer used */ + ADAP_ERR = (1 << 5), BUF_PACKING_OK = (1 << 6), IS_VF = (1 << 7), @@ -175,6 +175,7 @@ enum { DF_LOAD_FW_ANYTIME = (1 << 1), /* Allow LOAD_FW after init */ DF_DISABLE_TCB_CACHE = (1 << 2), /* Disable TCB cache (T6+) */ DF_DISABLE_CFG_RETRY = (1 << 3), /* Disable fallback config */ + DF_VERBOSE_SLOWINTR = (1 << 4), /* Chatty slow intr handler */ }; #define IS_DOOMED(vi) ((vi)->flags & DOOMED) @@ -932,24 +933,6 @@ struct adapter { #define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq) #define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq) -#define CH_DUMP_MBOX(sc, mbox, data_reg) \ - do { \ - if (sc->debug_flags & DF_DUMP_MBOX) { \ - log(LOG_NOTICE, \ - "%s mbox %u: %016llx %016llx %016llx %016llx " \ - "%016llx %016llx %016llx %016llx\n", \ - device_get_nameunit(sc->dev), mbox, \ - (unsigned long long)t4_read_reg64(sc, data_reg), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 8), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 16), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 24), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 32), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 40), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 48), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 56)); \ - } \ - } while (0) - #define for_each_txq(vi, iter, q) \ for (q = &vi->pi->adapter->sge.txq[vi->first_txq], iter = 0; \ iter < vi->ntxq; ++iter, ++q) @@ -1103,6 +1086,38 @@ t4_use_ldst(struct adapter *sc) #else return (0); #endif +} + +static inline void +CH_DUMP_MBOX(struct adapter *sc, int mbox, const int reg, + const char *msg, const __be64 *const p, const bool err) +{ + + if (!(sc->debug_flags & DF_DUMP_MBOX) && !err) + return; + if (p != NULL) { + log(err ? LOG_ERR : LOG_DEBUG, + "%s: mbox %u %s %016llx %016llx %016llx %016llx " + "%016llx %016llx %016llx %016llx\n", + device_get_nameunit(sc->dev), mbox, msg, + (long long)be64_to_cpu(p[0]), (long long)be64_to_cpu(p[1]), + (long long)be64_to_cpu(p[2]), (long long)be64_to_cpu(p[3]), + (long long)be64_to_cpu(p[4]), (long long)be64_to_cpu(p[5]), + (long long)be64_to_cpu(p[6]), (long long)be64_to_cpu(p[7])); + } else { + log(err ? LOG_ERR : LOG_DEBUG, + "%s: mbox %u %s %016llx %016llx %016llx %016llx " + "%016llx %016llx %016llx %016llx\n", + device_get_nameunit(sc->dev), mbox, msg, + (long long)t4_read_reg64(sc, reg), + (long long)t4_read_reg64(sc, reg + 8), + (long long)t4_read_reg64(sc, reg + 16), + (long long)t4_read_reg64(sc, reg + 24), + (long long)t4_read_reg64(sc, reg + 32), + (long long)t4_read_reg64(sc, reg + 40), + (long long)t4_read_reg64(sc, reg + 48), + (long long)t4_read_reg64(sc, reg + 56)); + } } /* t4_main.c */ Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Feb 1 20:28:15 2019 (r343665) +++ head/sys/dev/cxgbe/common/common.h Fri Feb 1 20:42:49 2019 (r343666) @@ -34,10 +34,6 @@ #include "t4_hw.h" -#define GLBL_INTR_MASK (F_CIM | F_MPS | F_PL | F_PCIE | F_MC0 | F_EDC0 | \ - F_EDC1 | F_LE | F_TP | F_MA | F_PM_TX | F_PM_RX | F_ULP_RX | \ - F_CPL_SWITCH | F_SGE | F_ULP_TX) - enum { MAX_NPORTS = 4, /* max # of ports */ SERNUM_LEN = 24, /* Serial # length */ @@ -581,7 +577,7 @@ struct fw_filter_wr; void t4_intr_enable(struct adapter *adapter); void t4_intr_disable(struct adapter *adapter); void t4_intr_clear(struct adapter *adapter); -int t4_slow_intr_handler(struct adapter *adapter); +int t4_slow_intr_handler(struct adapter *adapter, bool verbose); int t4_hash_mac_addr(const u8 *addr); int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, @@ -621,9 +617,7 @@ int t4_init_sge_params(struct adapter *adapter); int t4_init_tp_params(struct adapter *adap, bool sleep_ok); int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id); -void t4_fatal_err(struct adapter *adapter); -void t4_db_full(struct adapter *adapter); -void t4_db_dropped(struct adapter *adapter); +void t4_fatal_err(struct adapter *adapter, bool fw_error); int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp, int filter_index, int enable); void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Feb 1 20:28:15 2019 (r343665) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Feb 1 20:42:49 2019 (r343666) @@ -212,8 +212,8 @@ static void t4_report_fw_error(struct adapter *adap) pcie_fw = t4_read_reg(adap, A_PCIE_FW); if (pcie_fw & F_PCIE_FW_ERR) { - CH_ERR(adap, "Firmware reports adapter error: %s\n", - reason[G_PCIE_FW_EVAL(pcie_fw)]); + CH_ERR(adap, "firmware reports adapter error: %s (0x%08x)\n", + reason[G_PCIE_FW_EVAL(pcie_fw)], pcie_fw); adap->flags &= ~FW_OK; } } @@ -340,7 +340,6 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int u32 v; u64 res; int i, ms, delay_idx, ret, next_tx_check; - const __be64 *p = cmd; u32 data_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_DATA); u32 ctl_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_CTRL); u32 ctl; @@ -351,7 +350,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int if (adap->flags & CHK_MBOX_ACCESS) ASSERT_SYNCHRONIZED_OP(adap); - if ((size & 15) || size > MBOX_LEN) + if (size <= 0 || (size & 15) || size > MBOX_LEN) return -EINVAL; if (adap->flags & IS_VF) { @@ -381,8 +380,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int } /* - * If we were unable to gain access, dequeue ourselves from the - * mailbox atomic access list and report the error to our caller. + * If we were unable to gain access, report the error to our caller. */ if (v != X_MBOWNER_PL) { t4_report_fw_error(adap); @@ -398,23 +396,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * presaged the firmware crashing ... */ if (ctl & F_MBMSGVALID) { - CH_ERR(adap, "found VALID command in mbox %u: %016llx %016llx " - "%016llx %016llx %016llx %016llx %016llx %016llx\n", - mbox, (unsigned long long)t4_read_reg64(adap, data_reg), - (unsigned long long)t4_read_reg64(adap, data_reg + 8), - (unsigned long long)t4_read_reg64(adap, data_reg + 16), - (unsigned long long)t4_read_reg64(adap, data_reg + 24), - (unsigned long long)t4_read_reg64(adap, data_reg + 32), - (unsigned long long)t4_read_reg64(adap, data_reg + 40), - (unsigned long long)t4_read_reg64(adap, data_reg + 48), - (unsigned long long)t4_read_reg64(adap, data_reg + 56)); + CH_DUMP_MBOX(adap, mbox, data_reg, "VLD", NULL, true); } /* * Copy in the new mailbox command and send it on its way ... */ - for (i = 0; i < size; i += 8, p++) - t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p)); + memset(cmd_rpl, 0, sizeof(cmd_rpl)); + memcpy(cmd_rpl, cmd, size); + CH_DUMP_MBOX(adap, mbox, 0, "cmd", cmd_rpl, false); + for (i = 0; i < ARRAY_SIZE(cmd_rpl); i++) + t4_write_reg64(adap, data_reg + i * 8, be64_to_cpu(cmd_rpl[i])); if (adap->flags & IS_VF) { /* @@ -432,8 +424,6 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int t4_read_reg(adap, data_reg); } - CH_DUMP_MBOX(adap, mbox, data_reg); - t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); read_tx_state(adap, &tx_state[0]); /* also flushes the write_reg */ next_tx_check = 1000; @@ -480,10 +470,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * Retrieve the command reply and release the mailbox. */ get_mbox_rpl(adap, cmd_rpl, MBOX_LEN/8, data_reg); + CH_DUMP_MBOX(adap, mbox, 0, "rpl", cmd_rpl, false); t4_write_reg(adap, ctl_reg, V_MBOWNER(X_MBOWNER_NONE)); - CH_DUMP_MBOX(adap, mbox, data_reg); - res = be64_to_cpu(cmd_rpl[0]); if (G_FW_CMD_OP(res >> 32) == FW_DEBUG_CMD) { fw_asrt(adap, (struct fw_debug_cmd *)cmd_rpl); @@ -500,26 +489,13 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * errors ... */ ret = (pcie_fw & F_PCIE_FW_ERR) ? -ENXIO : -ETIMEDOUT; - CH_ERR(adap, "command %#x in mailbox %d timed out\n", - *(const u8 *)cmd, mbox); + CH_ERR(adap, "command %#x in mbox %d timed out (0x%08x).\n", + *(const u8 *)cmd, mbox, pcie_fw); + CH_DUMP_MBOX(adap, mbox, 0, "cmdsent", cmd_rpl, true); + CH_DUMP_MBOX(adap, mbox, data_reg, "current", NULL, true); - /* If DUMP_MBOX is set the mbox has already been dumped */ - if ((adap->debug_flags & DF_DUMP_MBOX) == 0) { - p = cmd; - CH_ERR(adap, "mbox: %016llx %016llx %016llx %016llx " - "%016llx %016llx %016llx %016llx\n", - (unsigned long long)be64_to_cpu(p[0]), - (unsigned long long)be64_to_cpu(p[1]), - (unsigned long long)be64_to_cpu(p[2]), - (unsigned long long)be64_to_cpu(p[3]), - (unsigned long long)be64_to_cpu(p[4]), - (unsigned long long)be64_to_cpu(p[5]), - (unsigned long long)be64_to_cpu(p[6]), - (unsigned long long)be64_to_cpu(p[7])); - } - t4_report_fw_error(adap); - t4_fatal_err(adap); + t4_fatal_err(adap, true); return ret; } @@ -3965,785 +3941,1330 @@ int t4_restart_aneg(struct adapter *adap, unsigned int return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); } -typedef void (*int_handler_t)(struct adapter *adap); +struct intr_details { + u32 mask; + const char *msg; +}; +struct intr_action { + u32 mask; + int arg; + bool (*action)(struct adapter *, int, bool); +}; + struct intr_info { - unsigned int mask; /* bits to check in interrupt status */ - const char *msg; /* message to print or NULL */ - short stat_idx; /* stat counter to increment or -1 */ - unsigned short fatal; /* whether the condition reported is fatal */ - int_handler_t int_handler; /* platform-specific int handler */ + const char *name; /* name of the INT_CAUSE register */ + int cause_reg; /* INT_CAUSE register */ + int enable_reg; /* INT_ENABLE register */ + u32 fatal; /* bits that are fatal */ + const struct intr_details *details; + const struct intr_action *actions; }; -/** - * t4_handle_intr_status - table driven interrupt handler - * @adapter: the adapter that generated the interrupt - * @reg: the interrupt status register to process - * @acts: table of interrupt actions - * - * A table driven interrupt handler that applies a set of masks to an - * interrupt status word and performs the corresponding actions if the - * interrupts described by the mask have occurred. The actions include - * optionally emitting a warning or alert message. The table is terminated - * by an entry specifying mask 0. Returns the number of fatal interrupt - * conditions. +static inline char +intr_alert_char(u32 cause, u32 enable, u32 fatal) +{ + + if (cause & fatal) + return ('!'); + if (cause & enable) + return ('*'); + return ('-'); +} + +static void +t4_show_intr_info(struct adapter *adap, const struct intr_info *ii, u32 cause) +{ + u32 enable, leftover; + const struct intr_details *details; + char alert; + + enable = t4_read_reg(adap, ii->enable_reg); + alert = intr_alert_char(cause, enable, ii->fatal); + CH_ALERT(adap, "%c %s 0x%x = 0x%08x, E 0x%08x, F 0x%08x\n", + alert, ii->name, ii->cause_reg, cause, enable, ii->fatal); + + leftover = cause; + for (details = ii->details; details && details->mask != 0; details++) { + u32 msgbits = details->mask & cause; + if (msgbits == 0) + continue; + alert = intr_alert_char(msgbits, enable, ii->fatal); + CH_ALERT(adap, " %c [0x%08x] %s\n", alert, msgbits, + details->msg); + leftover &= ~msgbits; + } + if (leftover != 0 && leftover != cause) + CH_ALERT(adap, " ? [0x%08x]\n", leftover); +} + +/* + * Returns true for fatal error. */ -static int t4_handle_intr_status(struct adapter *adapter, unsigned int reg, - const struct intr_info *acts) +static bool +t4_handle_intr(struct adapter *adap, const struct intr_info *ii, + u32 additional_cause, bool verbose) { - int fatal = 0; - unsigned int mask = 0; - unsigned int status = t4_read_reg(adapter, reg); + u32 cause; + bool fatal; + const struct intr_action *action; - for ( ; acts->mask; ++acts) { - if (!(status & acts->mask)) + /* read and display cause. */ + cause = t4_read_reg(adap, ii->cause_reg); + if (verbose || cause != 0) + t4_show_intr_info(adap, ii, cause); + fatal = (cause & ii->fatal) != 0; + cause |= additional_cause; + if (cause == 0) + return (false); + + for (action = ii->actions; action && action->mask != 0; action++) { + if (!(action->mask & cause)) continue; - if (acts->fatal) { - fatal++; - CH_ALERT(adapter, "%s (0x%x)\n", acts->msg, - status & acts->mask); - } else if (acts->msg) - CH_WARN_RATELIMIT(adapter, "%s (0x%x)\n", acts->msg, - status & acts->mask); - if (acts->int_handler) - acts->int_handler(adapter); - mask |= acts->mask; + fatal |= (action->action)(adap, action->arg, verbose); } - status &= mask; - if (status) /* clear processed interrupts */ - t4_write_reg(adapter, reg, status); - return fatal; + + /* clear */ + t4_write_reg(adap, ii->cause_reg, cause); + (void)t4_read_reg(adap, ii->cause_reg); + + return (fatal); } /* * Interrupt handler for the PCIE module. */ -static void pcie_intr_handler(struct adapter *adapter) +static bool pcie_intr_handler(struct adapter *adap, int arg, bool verbose) { - static const struct intr_info sysbus_intr_info[] = { - { F_RNPP, "RXNP array parity error", -1, 1 }, - { F_RPCP, "RXPC array parity error", -1, 1 }, - { F_RCIP, "RXCIF array parity error", -1, 1 }, - { F_RCCP, "Rx completions control array parity error", -1, 1 }, - { F_RFTP, "RXFT array parity error", -1, 1 }, + static const struct intr_details sysbus_intr_details[] = { + { F_RNPP, "RXNP array parity error" }, + { F_RPCP, "RXPC array parity error" }, + { F_RCIP, "RXCIF array parity error" }, + { F_RCCP, "Rx completions control array parity error" }, + { F_RFTP, "RXFT array parity error" }, { 0 } }; - static const struct intr_info pcie_port_intr_info[] = { - { F_TPCP, "TXPC array parity error", -1, 1 }, - { F_TNPP, "TXNP array parity error", -1, 1 }, - { F_TFTP, "TXFT array parity error", -1, 1 }, - { F_TCAP, "TXCA array parity error", -1, 1 }, - { F_TCIP, "TXCIF array parity error", -1, 1 }, - { F_RCAP, "RXCA array parity error", -1, 1 }, - { F_OTDD, "outbound request TLP discarded", -1, 1 }, - { F_RDPE, "Rx data parity error", -1, 1 }, - { F_TDUE, "Tx uncorrectable data error", -1, 1 }, + static const struct intr_info sysbus_intr_info = { + .name = "PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS", + .cause_reg = A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, + .enable_reg = A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_INTERRUPT_ENABLE, + .fatal = F_RFTP | F_RCCP | F_RCIP | F_RPCP | F_RNPP, + .details = sysbus_intr_details, + .actions = NULL, + }; + static const struct intr_details pcie_port_intr_details[] = { + { F_TPCP, "TXPC array parity error" }, + { F_TNPP, "TXNP array parity error" }, + { F_TFTP, "TXFT array parity error" }, + { F_TCAP, "TXCA array parity error" }, + { F_TCIP, "TXCIF array parity error" }, + { F_RCAP, "RXCA array parity error" }, + { F_OTDD, "outbound request TLP discarded" }, + { F_RDPE, "Rx data parity error" }, + { F_TDUE, "Tx uncorrectable data error" }, { 0 } }; - static const struct intr_info pcie_intr_info[] = { - { F_MSIADDRLPERR, "MSI AddrL parity error", -1, 1 }, - { F_MSIADDRHPERR, "MSI AddrH parity error", -1, 1 }, - { F_MSIDATAPERR, "MSI data parity error", -1, 1 }, - { F_MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 }, - { F_MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 }, - { F_MSIXDATAPERR, "MSI-X data parity error", -1, 1 }, - { F_MSIXDIPERR, "MSI-X DI parity error", -1, 1 }, - { F_PIOCPLPERR, "PCI PIO completion FIFO parity error", -1, 1 }, - { F_PIOREQPERR, "PCI PIO request FIFO parity error", -1, 1 }, - { F_TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 }, - { F_CCNTPERR, "PCI CMD channel count parity error", -1, 1 }, - { F_CREQPERR, "PCI CMD channel request parity error", -1, 1 }, - { F_CRSPPERR, "PCI CMD channel response parity error", -1, 1 }, - { F_DCNTPERR, "PCI DMA channel count parity error", -1, 1 }, - { F_DREQPERR, "PCI DMA channel request parity error", -1, 1 }, - { F_DRSPPERR, "PCI DMA channel response parity error", -1, 1 }, - { F_HCNTPERR, "PCI HMA channel count parity error", -1, 1 }, - { F_HREQPERR, "PCI HMA channel request parity error", -1, 1 }, - { F_HRSPPERR, "PCI HMA channel response parity error", -1, 1 }, - { F_CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 }, - { F_FIDPERR, "PCI FID parity error", -1, 1 }, - { F_INTXCLRPERR, "PCI INTx clear parity error", -1, 1 }, - { F_MATAGPERR, "PCI MA tag parity error", -1, 1 }, - { F_PIOTAGPERR, "PCI PIO tag parity error", -1, 1 }, - { F_RXCPLPERR, "PCI Rx completion parity error", -1, 1 }, - { F_RXWRPERR, "PCI Rx write parity error", -1, 1 }, - { F_RPLPERR, "PCI replay buffer parity error", -1, 1 }, - { F_PCIESINT, "PCI core secondary fault", -1, 1 }, - { F_PCIEPINT, "PCI core primary fault", -1, 1 }, - { F_UNXSPLCPLERR, "PCI unexpected split completion error", -1, - 0 }, + static const struct intr_info pcie_port_intr_info = { + .name = "PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS", + .cause_reg = A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, + .enable_reg = A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_INTERRUPT_ENABLE, + .fatal = F_TPCP | F_TNPP | F_TFTP | F_TCAP | F_TCIP | F_RCAP | + F_OTDD | F_RDPE | F_TDUE, + .details = pcie_port_intr_details, + .actions = NULL, + }; + static const struct intr_details pcie_intr_details[] = { + { F_MSIADDRLPERR, "MSI AddrL parity error" }, + { F_MSIADDRHPERR, "MSI AddrH parity error" }, + { F_MSIDATAPERR, "MSI data parity error" }, + { F_MSIXADDRLPERR, "MSI-X AddrL parity error" }, + { F_MSIXADDRHPERR, "MSI-X AddrH parity error" }, + { F_MSIXDATAPERR, "MSI-X data parity error" }, + { F_MSIXDIPERR, "MSI-X DI parity error" }, + { F_PIOCPLPERR, "PCIe PIO completion FIFO parity error" }, + { F_PIOREQPERR, "PCIe PIO request FIFO parity error" }, + { F_TARTAGPERR, "PCIe target tag FIFO parity error" }, + { F_CCNTPERR, "PCIe CMD channel count parity error" }, + { F_CREQPERR, "PCIe CMD channel request parity error" }, + { F_CRSPPERR, "PCIe CMD channel response parity error" }, + { F_DCNTPERR, "PCIe DMA channel count parity error" }, + { F_DREQPERR, "PCIe DMA channel request parity error" }, + { F_DRSPPERR, "PCIe DMA channel response parity error" }, + { F_HCNTPERR, "PCIe HMA channel count parity error" }, + { F_HREQPERR, "PCIe HMA channel request parity error" }, + { F_HRSPPERR, "PCIe HMA channel response parity error" }, + { F_CFGSNPPERR, "PCIe config snoop FIFO parity error" }, + { F_FIDPERR, "PCIe FID parity error" }, + { F_INTXCLRPERR, "PCIe INTx clear parity error" }, + { F_MATAGPERR, "PCIe MA tag parity error" }, + { F_PIOTAGPERR, "PCIe PIO tag parity error" }, + { F_RXCPLPERR, "PCIe Rx completion parity error" }, + { F_RXWRPERR, "PCIe Rx write parity error" }, + { F_RPLPERR, "PCIe replay buffer parity error" }, + { F_PCIESINT, "PCIe core secondary fault" }, + { F_PCIEPINT, "PCIe core primary fault" }, + { F_UNXSPLCPLERR, "PCIe unexpected split completion error" }, { 0 } }; - - static const struct intr_info t5_pcie_intr_info[] = { - { F_MSTGRPPERR, "Master Response Read Queue parity error", - -1, 1 }, - { F_MSTTIMEOUTPERR, "Master Timeout FIFO parity error", -1, 1 }, - { F_MSIXSTIPERR, "MSI-X STI SRAM parity error", -1, 1 }, - { F_MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 }, - { F_MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 }, - { F_MSIXDATAPERR, "MSI-X data parity error", -1, 1 }, - { F_MSIXDIPERR, "MSI-X DI parity error", -1, 1 }, - { F_PIOCPLGRPPERR, "PCI PIO completion Group FIFO parity error", - -1, 1 }, - { F_PIOREQGRPPERR, "PCI PIO request Group FIFO parity error", - -1, 1 }, - { F_TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 }, - { F_MSTTAGQPERR, "PCI master tag queue parity error", -1, 1 }, - { F_CREQPERR, "PCI CMD channel request parity error", -1, 1 }, - { F_CRSPPERR, "PCI CMD channel response parity error", -1, 1 }, - { F_DREQWRPERR, "PCI DMA channel write request parity error", - -1, 1 }, - { F_DREQPERR, "PCI DMA channel request parity error", -1, 1 }, - { F_DRSPPERR, "PCI DMA channel response parity error", -1, 1 }, - { F_HREQWRPERR, "PCI HMA channel count parity error", -1, 1 }, - { F_HREQPERR, "PCI HMA channel request parity error", -1, 1 }, - { F_HRSPPERR, "PCI HMA channel response parity error", -1, 1 }, - { F_CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 }, - { F_FIDPERR, "PCI FID parity error", -1, 1 }, - { F_VFIDPERR, "PCI INTx clear parity error", -1, 1 }, - { F_MAGRPPERR, "PCI MA group FIFO parity error", -1, 1 }, - { F_PIOTAGPERR, "PCI PIO tag parity error", -1, 1 }, - { F_IPRXHDRGRPPERR, "PCI IP Rx header group parity error", - -1, 1 }, - { F_IPRXDATAGRPPERR, "PCI IP Rx data group parity error", - -1, 1 }, - { F_RPLPERR, "PCI IP replay buffer parity error", -1, 1 }, - { F_IPSOTPERR, "PCI IP SOT buffer parity error", -1, 1 }, - { F_TRGT1GRPPERR, "PCI TRGT1 group FIFOs parity error", -1, 1 }, - { F_READRSPERR, "Outbound read error", -1, - 0 }, + static const struct intr_details t5_pcie_intr_details[] = { + { F_IPGRPPERR, "Parity errors observed by IP" }, + { F_NONFATALERR, "PCIe non-fatal error" }, + { F_READRSPERR, "Outbound read error" }, + { F_TRGT1GRPPERR, "PCIe TRGT1 group FIFOs parity error" }, + { F_IPSOTPERR, "PCIe IP SOT buffer SRAM parity error" }, + { F_IPRETRYPERR, "PCIe IP replay buffer parity error" }, + { F_IPRXDATAGRPPERR, "PCIe IP Rx data group SRAMs parity error" }, + { F_IPRXHDRGRPPERR, "PCIe IP Rx header group SRAMs parity error" }, + { F_PIOTAGQPERR, "PIO tag queue FIFO parity error" }, + { F_MAGRPPERR, "MA group FIFO parity error" }, + { F_VFIDPERR, "VFID SRAM parity error" }, + { F_FIDPERR, "FID SRAM parity error" }, + { F_CFGSNPPERR, "config snoop FIFO parity error" }, + { F_HRSPPERR, "HMA channel response data SRAM parity error" }, + { F_HREQRDPERR, "HMA channel read request SRAM parity error" }, + { F_HREQWRPERR, "HMA channel write request SRAM parity error" }, + { F_DRSPPERR, "DMA channel response data SRAM parity error" }, + { F_DREQRDPERR, "DMA channel write request SRAM parity error" }, + { F_CRSPPERR, "CMD channel response data SRAM parity error" }, + { F_CREQRDPERR, "CMD channel read request SRAM parity error" }, + { F_MSTTAGQPERR, "PCIe master tag queue SRAM parity error" }, + { F_TGTTAGQPERR, "PCIe target tag queue FIFO parity error" }, + { F_PIOREQGRPPERR, "PIO request group FIFOs parity error" }, + { F_PIOCPLGRPPERR, "PIO completion group FIFOs parity error" }, + { F_MSIXDIPERR, "MSI-X DI SRAM parity error" }, + { F_MSIXDATAPERR, "MSI-X data SRAM parity error" }, + { F_MSIXADDRHPERR, "MSI-X AddrH SRAM parity error" }, + { F_MSIXADDRLPERR, "MSI-X AddrL SRAM parity error" }, + { F_MSIXSTIPERR, "MSI-X STI SRAM parity error" }, + { F_MSTTIMEOUTPERR, "Master timeout FIFO parity error" }, + { F_MSTGRPPERR, "Master response read queue SRAM parity error" }, { 0 } }; + struct intr_info pcie_intr_info = { + .name = "PCIE_INT_CAUSE", + .cause_reg = A_PCIE_INT_CAUSE, + .enable_reg = A_PCIE_INT_ENABLE, + .fatal = 0, + .details = NULL, + .actions = NULL, + }; + bool fatal = false; - int fat; + if (is_t4(adap)) { + fatal |= t4_handle_intr(adap, &sysbus_intr_info, 0, verbose); + fatal |= t4_handle_intr(adap, &pcie_port_intr_info, 0, verbose); - if (is_t4(adapter)) - fat = t4_handle_intr_status(adapter, - A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, - sysbus_intr_info) + - t4_handle_intr_status(adapter, - A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, - pcie_port_intr_info) + - t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, - pcie_intr_info); - else - fat = t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, - t5_pcie_intr_info); - if (fat) - t4_fatal_err(adapter); + pcie_intr_info.fatal = 0x3fffffc0; + pcie_intr_info.details = pcie_intr_details; + } else { + pcie_intr_info.fatal = is_t5(adap) ? 0xbfffff40 : 0x9fffff40; + pcie_intr_info.details = t5_pcie_intr_details; + } + fatal |= t4_handle_intr(adap, &pcie_intr_info, 0, verbose); + + return (fatal); } /* * TP interrupt handler. */ -static void tp_intr_handler(struct adapter *adapter) +static bool tp_intr_handler(struct adapter *adap, int arg, bool verbose) { - static const struct intr_info tp_intr_info[] = { - { 0x3fffffff, "TP parity error", -1, 1 }, - { F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1 }, + static const struct intr_details tp_intr_details[] = { + { 0x3fffffff, "TP parity error" }, + { F_FLMTXFLSTEMPTY, "TP out of Tx pages" }, { 0 } }; + static const struct intr_info tp_intr_info = { + .name = "TP_INT_CAUSE", + .cause_reg = A_TP_INT_CAUSE, + .enable_reg = A_TP_INT_ENABLE, + .fatal = 0x7fffffff, + .details = tp_intr_details, + .actions = NULL, + }; - if (t4_handle_intr_status(adapter, A_TP_INT_CAUSE, tp_intr_info)) - t4_fatal_err(adapter); + return (t4_handle_intr(adap, &tp_intr_info, 0, verbose)); } /* * SGE interrupt handler. */ -static void sge_intr_handler(struct adapter *adapter) +static bool sge_intr_handler(struct adapter *adap, int arg, bool verbose) { - u64 v; - u32 err; - - static const struct intr_info sge_intr_info[] = { + static const struct intr_info sge_int1_info = { + .name = "SGE_INT_CAUSE1", + .cause_reg = A_SGE_INT_CAUSE1, + .enable_reg = A_SGE_INT_ENABLE1, + .fatal = 0xffffffff, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int2_info = { + .name = "SGE_INT_CAUSE2", + .cause_reg = A_SGE_INT_CAUSE2, + .enable_reg = A_SGE_INT_ENABLE2, + .fatal = 0xffffffff, + .details = NULL, + .actions = NULL, + }; + static const struct intr_details sge_int3_details[] = { + { F_ERR_FLM_DBP, + "DBP pointer delivery for invalid context or QID" }, + { F_ERR_FLM_IDMA1 | F_ERR_FLM_IDMA0, + "Invalid QID or header request by IDMA" }, + { F_ERR_FLM_HINT, "FLM hint is for invalid context or QID" }, + { F_ERR_PCIE_ERROR3, "SGE PCIe error for DBP thread 3" }, + { F_ERR_PCIE_ERROR2, "SGE PCIe error for DBP thread 2" }, + { F_ERR_PCIE_ERROR1, "SGE PCIe error for DBP thread 1" }, + { F_ERR_PCIE_ERROR0, "SGE PCIe error for DBP thread 0" }, + { F_ERR_TIMER_ABOVE_MAX_QID, + "SGE GTS with timer 0-5 for IQID > 1023" }, { F_ERR_CPL_EXCEED_IQE_SIZE, - "SGE received CPL exceeding IQE size", -1, 1 }, - { F_ERR_INVALID_CIDX_INC, - "SGE GTS CIDX increment too large", -1, 0 }, - { F_ERR_CPL_OPCODE_0, "SGE received 0-length CPL", -1, 0 }, - { F_DBFIFO_LP_INT, NULL, -1, 0, t4_db_full }, + "SGE received CPL exceeding IQE size" }, + { F_ERR_INVALID_CIDX_INC, "SGE GTS CIDX increment too large" }, + { F_ERR_ITP_TIME_PAUSED, "SGE ITP error" }, + { F_ERR_CPL_OPCODE_0, "SGE received 0-length CPL" }, + { F_ERR_DROPPED_DB, "SGE DB dropped" }, { F_ERR_DATA_CPL_ON_HIGH_QID1 | F_ERR_DATA_CPL_ON_HIGH_QID0, - "SGE IQID > 1023 received CPL for FL", -1, 0 }, - { F_ERR_BAD_DB_PIDX3, "SGE DBP 3 pidx increment too large", -1, - 0 }, - { F_ERR_BAD_DB_PIDX2, "SGE DBP 2 pidx increment too large", -1, - 0 }, - { F_ERR_BAD_DB_PIDX1, "SGE DBP 1 pidx increment too large", -1, - 0 }, - { F_ERR_BAD_DB_PIDX0, "SGE DBP 0 pidx increment too large", -1, - 0 }, + "SGE IQID > 1023 received CPL for FL" }, + { F_ERR_BAD_DB_PIDX3 | F_ERR_BAD_DB_PIDX2 | F_ERR_BAD_DB_PIDX1 | + F_ERR_BAD_DB_PIDX0, "SGE DBP pidx increment too large" }, + { F_ERR_ING_PCIE_CHAN, "SGE Ingress PCIe channel mismatch" }, { F_ERR_ING_CTXT_PRIO, - "SGE too many priority ingress contexts", -1, 0 }, - { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID", -1, 0 }, - { F_EGRESS_SIZE_ERR, "SGE illegal egress QID", -1, 0 }, - { F_ERR_PCIE_ERROR0 | F_ERR_PCIE_ERROR1 | - F_ERR_PCIE_ERROR2 | F_ERR_PCIE_ERROR3, - "SGE PCIe error for a DBP thread", -1, 0 }, - { 0 } - }; - - static const struct intr_info t4t5_sge_intr_info[] = { - { F_ERR_DROPPED_DB, NULL, -1, 0, t4_db_dropped }, - { F_DBFIFO_HP_INT, NULL, -1, 0, t4_db_full }, + "Ingress context manager priority user error" }, { F_ERR_EGR_CTXT_PRIO, - "SGE too many priority egress contexts", -1, 0 }, + "Egress context manager priority user error" }, + { F_DBFIFO_HP_INT, "High priority DB FIFO threshold reached" }, + { F_DBFIFO_LP_INT, "Low priority DB FIFO threshold reached" }, + { F_REG_ADDRESS_ERR, "Undefined SGE register accessed" }, + { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID" }, + { F_EGRESS_SIZE_ERR, "SGE illegal egress QID" }, + { 0x0000000f, "SGE context access for invalid queue" }, { 0 } }; - - /* - * For now, treat below interrupts as fatal so that we disable SGE and - * get better debug */ - static const struct intr_info t6_sge_intr_info[] = { + static const struct intr_details t6_sge_int3_details[] = { + { F_ERR_FLM_DBP, + "DBP pointer delivery for invalid context or QID" }, + { F_ERR_FLM_IDMA1 | F_ERR_FLM_IDMA0, + "Invalid QID or header request by IDMA" }, + { F_ERR_FLM_HINT, "FLM hint is for invalid context or QID" }, + { F_ERR_PCIE_ERROR3, "SGE PCIe error for DBP thread 3" }, + { F_ERR_PCIE_ERROR2, "SGE PCIe error for DBP thread 2" }, + { F_ERR_PCIE_ERROR1, "SGE PCIe error for DBP thread 1" }, + { F_ERR_PCIE_ERROR0, "SGE PCIe error for DBP thread 0" }, + { F_ERR_TIMER_ABOVE_MAX_QID, + "SGE GTS with timer 0-5 for IQID > 1023" }, + { F_ERR_CPL_EXCEED_IQE_SIZE, + "SGE received CPL exceeding IQE size" }, + { F_ERR_INVALID_CIDX_INC, "SGE GTS CIDX increment too large" }, + { F_ERR_ITP_TIME_PAUSED, "SGE ITP error" }, + { F_ERR_CPL_OPCODE_0, "SGE received 0-length CPL" }, + { F_ERR_DROPPED_DB, "SGE DB dropped" }, + { F_ERR_DATA_CPL_ON_HIGH_QID1 | F_ERR_DATA_CPL_ON_HIGH_QID0, + "SGE IQID > 1023 received CPL for FL" }, + { F_ERR_BAD_DB_PIDX3 | F_ERR_BAD_DB_PIDX2 | F_ERR_BAD_DB_PIDX1 | + F_ERR_BAD_DB_PIDX0, "SGE DBP pidx increment too large" }, + { F_ERR_ING_PCIE_CHAN, "SGE Ingress PCIe channel mismatch" }, + { F_ERR_ING_CTXT_PRIO, + "Ingress context manager priority user error" }, + { F_ERR_EGR_CTXT_PRIO, + "Egress context manager priority user error" }, + { F_DBP_TBUF_FULL, "SGE DBP tbuf full" }, { F_FATAL_WRE_LEN, - "SGE Actual WRE packet is less than advertized length", - -1, 1 }, + "SGE WRE packet less than advertized length" }, + { F_REG_ADDRESS_ERR, "Undefined SGE register accessed" }, + { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID" }, + { F_EGRESS_SIZE_ERR, "SGE illegal egress QID" }, + { 0x0000000f, "SGE context access for invalid queue" }, { 0 } }; + struct intr_info sge_int3_info = { + .name = "SGE_INT_CAUSE3", + .cause_reg = A_SGE_INT_CAUSE3, + .enable_reg = A_SGE_INT_ENABLE3, + .fatal = F_ERR_CPL_EXCEED_IQE_SIZE, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int4_info = { + .name = "SGE_INT_CAUSE4", + .cause_reg = A_SGE_INT_CAUSE4, + .enable_reg = A_SGE_INT_ENABLE4, + .fatal = 0, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int5_info = { + .name = "SGE_INT_CAUSE5", + .cause_reg = A_SGE_INT_CAUSE5, + .enable_reg = A_SGE_INT_ENABLE5, + .fatal = 0xffffffff, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int6_info = { + .name = "SGE_INT_CAUSE6", + .cause_reg = A_SGE_INT_CAUSE6, + .enable_reg = A_SGE_INT_ENABLE6, + .fatal = 0, + .details = NULL, + .actions = NULL, + }; - v = (u64)t4_read_reg(adapter, A_SGE_INT_CAUSE1) | - ((u64)t4_read_reg(adapter, A_SGE_INT_CAUSE2) << 32); - if (v) { - CH_ALERT(adapter, "SGE parity error (%#llx)\n", - (unsigned long long)v); - t4_write_reg(adapter, A_SGE_INT_CAUSE1, v); - t4_write_reg(adapter, A_SGE_INT_CAUSE2, v >> 32); + bool fatal; + u32 v; + + if (chip_id(adap) <= CHELSIO_T5) { + sge_int3_info.details = sge_int3_details; + } else { + sge_int3_info.details = t6_sge_int3_details; } - v |= t4_handle_intr_status(adapter, A_SGE_INT_CAUSE3, sge_intr_info); - if (chip_id(adapter) <= CHELSIO_T5) - v |= t4_handle_intr_status(adapter, A_SGE_INT_CAUSE3, - t4t5_sge_intr_info); - else - v |= t4_handle_intr_status(adapter, A_SGE_INT_CAUSE3, - t6_sge_intr_info); + fatal = false; + fatal |= t4_handle_intr(adap, &sge_int1_info, 0, verbose); + fatal |= t4_handle_intr(adap, &sge_int2_info, 0, verbose); + fatal |= t4_handle_intr(adap, &sge_int3_info, 0, verbose); + fatal |= t4_handle_intr(adap, &sge_int4_info, 0, verbose); + if (chip_id(adap) >= CHELSIO_T5) + fatal |= t4_handle_intr(adap, &sge_int5_info, 0, verbose); + if (chip_id(adap) >= CHELSIO_T6) + fatal |= t4_handle_intr(adap, &sge_int6_info, 0, verbose); - err = t4_read_reg(adapter, A_SGE_ERROR_STATS); - if (err & F_ERROR_QID_VALID) { - CH_ERR(adapter, "SGE error for queue %u\n", G_ERROR_QID(err)); - if (err & F_UNCAPTURED_ERROR) - CH_ERR(adapter, "SGE UNCAPTURED_ERROR set (clearing)\n"); - t4_write_reg(adapter, A_SGE_ERROR_STATS, F_ERROR_QID_VALID | - F_UNCAPTURED_ERROR); + v = t4_read_reg(adap, A_SGE_ERROR_STATS); + if (v & F_ERROR_QID_VALID) { + CH_ERR(adap, "SGE error for QID %u\n", G_ERROR_QID(v)); + if (v & F_UNCAPTURED_ERROR) + CH_ERR(adap, "SGE UNCAPTURED_ERROR set (clearing)\n"); + t4_write_reg(adap, A_SGE_ERROR_STATS, + F_ERROR_QID_VALID | F_UNCAPTURED_ERROR); } - if (v != 0) - t4_fatal_err(adapter); + return (fatal); } -#define CIM_OBQ_INTR (F_OBQULP0PARERR | F_OBQULP1PARERR | F_OBQULP2PARERR |\ - F_OBQULP3PARERR | F_OBQSGEPARERR | F_OBQNCSIPARERR) -#define CIM_IBQ_INTR (F_IBQTP0PARERR | F_IBQTP1PARERR | F_IBQULPPARERR |\ - F_IBQSGEHIPARERR | F_IBQSGELOPARERR | F_IBQNCSIPARERR) - /* * CIM interrupt handler. */ -static void cim_intr_handler(struct adapter *adapter) +static bool cim_intr_handler(struct adapter *adap, int arg, bool verbose) { - static const struct intr_info cim_intr_info[] = { - { F_PREFDROPINT, "CIM control register prefetch drop", -1, 1 }, - { CIM_OBQ_INTR, "CIM OBQ parity error", -1, 1 }, - { CIM_IBQ_INTR, "CIM IBQ parity error", -1, 1 }, - { F_MBUPPARERR, "CIM mailbox uP parity error", -1, 1 }, - { F_MBHOSTPARERR, "CIM mailbox host parity error", -1, 1 }, - { F_TIEQINPARERRINT, "CIM TIEQ outgoing parity error", -1, 1 }, - { F_TIEQOUTPARERRINT, "CIM TIEQ incoming parity error", -1, 1 }, - { F_TIMER0INT, "CIM TIMER0 interrupt", -1, 1 }, - { 0 } + static const struct intr_details cim_host_intr_details[] = { + /* T6+ */ + { F_PCIE2CIMINTFPARERR, "CIM IBQ PCIe interface parity error" }, + + /* T5+ */ + { F_MA_CIM_INTFPERR, "MA2CIM interface parity error" }, + { F_PLCIM_MSTRSPDATAPARERR, + "PL2CIM master response data parity error" }, + { F_NCSI2CIMINTFPARERR, "CIM IBQ NC-SI interface parity error" }, + { F_SGE2CIMINTFPARERR, "CIM IBQ SGE interface parity error" }, + { F_ULP2CIMINTFPARERR, "CIM IBQ ULP_TX interface parity error" }, + { F_TP2CIMINTFPARERR, "CIM IBQ TP interface parity error" }, + { F_OBQSGERX1PARERR, "CIM OBQ SGE1_RX parity error" }, + { F_OBQSGERX0PARERR, "CIM OBQ SGE0_RX parity error" }, + + /* T4+ */ + { F_TIEQOUTPARERRINT, "CIM TIEQ outgoing FIFO parity error" }, + { F_TIEQINPARERRINT, "CIM TIEQ incoming FIFO parity error" }, + { F_MBHOSTPARERR, "CIM mailbox host read parity error" }, + { F_MBUPPARERR, "CIM mailbox uP parity error" }, + { F_IBQTP0PARERR, "CIM IBQ TP0 parity error" }, + { F_IBQTP1PARERR, "CIM IBQ TP1 parity error" }, + { F_IBQULPPARERR, "CIM IBQ ULP parity error" }, + { F_IBQSGELOPARERR, "CIM IBQ SGE_LO parity error" }, + { F_IBQSGEHIPARERR | F_IBQPCIEPARERR, /* same bit */ + "CIM IBQ PCIe/SGE_HI parity error" }, + { F_IBQNCSIPARERR, "CIM IBQ NC-SI parity error" }, + { F_OBQULP0PARERR, "CIM OBQ ULP0 parity error" }, + { F_OBQULP1PARERR, "CIM OBQ ULP1 parity error" }, + { F_OBQULP2PARERR, "CIM OBQ ULP2 parity error" }, + { F_OBQULP3PARERR, "CIM OBQ ULP3 parity error" }, + { F_OBQSGEPARERR, "CIM OBQ SGE parity error" }, + { F_OBQNCSIPARERR, "CIM OBQ NC-SI parity error" }, + { F_TIMER1INT, "CIM TIMER0 interrupt" }, + { F_TIMER0INT, "CIM TIMER0 interrupt" }, + { F_PREFDROPINT, "CIM control register prefetch drop" }, + { 0} }; - static const struct intr_info cim_upintr_info[] = { - { F_RSVDSPACEINT, "CIM reserved space access", -1, 1 }, - { F_ILLTRANSINT, "CIM illegal transaction", -1, 1 }, - { F_ILLWRINT, "CIM illegal write", -1, 1 }, - { F_ILLRDINT, "CIM illegal read", -1, 1 }, - { F_ILLRDBEINT, "CIM illegal read BE", -1, 1 }, - { F_ILLWRBEINT, "CIM illegal write BE", -1, 1 }, - { F_SGLRDBOOTINT, "CIM single read from boot space", -1, 1 }, - { F_SGLWRBOOTINT, "CIM single write to boot space", -1, 1 }, - { F_BLKWRBOOTINT, "CIM block write to boot space", -1, 1 }, - { F_SGLRDFLASHINT, "CIM single read from flash space", -1, 1 }, - { F_SGLWRFLASHINT, "CIM single write to flash space", -1, 1 }, - { F_BLKWRFLASHINT, "CIM block write to flash space", -1, 1 }, - { F_SGLRDEEPROMINT, "CIM single EEPROM read", -1, 1 }, - { F_SGLWREEPROMINT, "CIM single EEPROM write", -1, 1 }, - { F_BLKRDEEPROMINT, "CIM block EEPROM read", -1, 1 }, - { F_BLKWREEPROMINT, "CIM block EEPROM write", -1, 1 }, - { F_SGLRDCTLINT , "CIM single read from CTL space", -1, 1 }, - { F_SGLWRCTLINT , "CIM single write to CTL space", -1, 1 }, - { F_BLKRDCTLINT , "CIM block read from CTL space", -1, 1 }, - { F_BLKWRCTLINT , "CIM block write to CTL space", -1, 1 }, - { F_SGLRDPLINT , "CIM single read from PL space", -1, 1 }, - { F_SGLWRPLINT , "CIM single write to PL space", -1, 1 }, - { F_BLKRDPLINT , "CIM block read from PL space", -1, 1 }, - { F_BLKWRPLINT , "CIM block write to PL space", -1, 1 }, - { F_REQOVRLOOKUPINT , "CIM request FIFO overwrite", -1, 1 }, - { F_RSPOVRLOOKUPINT , "CIM response FIFO overwrite", -1, 1 }, - { F_TIMEOUTINT , "CIM PIF timeout", -1, 1 }, - { F_TIMEOUTMAINT , "CIM PIF MA timeout", -1, 1 }, - { 0 } + struct intr_info cim_host_intr_info = { + .name = "CIM_HOST_INT_CAUSE", + .cause_reg = A_CIM_HOST_INT_CAUSE, + .enable_reg = A_CIM_HOST_INT_ENABLE, + .fatal = 0, + .details = cim_host_intr_details, + .actions = NULL, }; + static const struct intr_details cim_host_upacc_intr_details[] = { + { F_EEPROMWRINT, "CIM EEPROM came out of busy state" }, + { F_TIMEOUTMAINT, "CIM PIF MA timeout" }, + { F_TIMEOUTINT, "CIM PIF timeout" }, + { F_RSPOVRLOOKUPINT, "CIM response FIFO overwrite" }, + { F_REQOVRLOOKUPINT, "CIM request FIFO overwrite" }, + { F_BLKWRPLINT, "CIM block write to PL space" }, + { F_BLKRDPLINT, "CIM block read from PL space" }, + { F_SGLWRPLINT, + "CIM single write to PL space with illegal BEs" }, + { F_SGLRDPLINT, + "CIM single read from PL space with illegal BEs" }, + { F_BLKWRCTLINT, "CIM block write to CTL space" }, + { F_BLKRDCTLINT, "CIM block read from CTL space" }, + { F_SGLWRCTLINT, + "CIM single write to CTL space with illegal BEs" }, + { F_SGLRDCTLINT, + "CIM single read from CTL space with illegal BEs" }, + { F_BLKWREEPROMINT, "CIM block write to EEPROM space" }, + { F_BLKRDEEPROMINT, "CIM block read from EEPROM space" }, + { F_SGLWREEPROMINT, + "CIM single write to EEPROM space with illegal BEs" }, + { F_SGLRDEEPROMINT, + "CIM single read from EEPROM space with illegal BEs" }, + { F_BLKWRFLASHINT, "CIM block write to flash space" }, + { F_BLKRDFLASHINT, "CIM block read from flash space" }, + { F_SGLWRFLASHINT, "CIM single write to flash space" }, + { F_SGLRDFLASHINT, + "CIM single read from flash space with illegal BEs" }, + { F_BLKWRBOOTINT, "CIM block write to boot space" }, + { F_BLKRDBOOTINT, "CIM block read from boot space" }, + { F_SGLWRBOOTINT, "CIM single write to boot space" }, + { F_SGLRDBOOTINT, + "CIM single read from boot space with illegal BEs" }, + { F_ILLWRBEINT, "CIM illegal write BEs" }, + { F_ILLRDBEINT, "CIM illegal read BEs" }, + { F_ILLRDINT, "CIM illegal read" }, + { F_ILLWRINT, "CIM illegal write" }, + { F_ILLTRANSINT, "CIM illegal transaction" }, + { F_RSVDSPACEINT, "CIM reserved space access" }, + {0} + }; + static const struct intr_info cim_host_upacc_intr_info = { + .name = "CIM_HOST_UPACC_INT_CAUSE", + .cause_reg = A_CIM_HOST_UPACC_INT_CAUSE, + .enable_reg = A_CIM_HOST_UPACC_INT_ENABLE, + .fatal = 0x3fffeeff, + .details = cim_host_upacc_intr_details, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 1 20:46:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A6614C0526; Fri, 1 Feb 2019 20:46:48 +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 25D4E80DE9; Fri, 1 Feb 2019 20:46:48 +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 EDC30242F4; Fri, 1 Feb 2019 20:46:47 +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 x11KklWm081667; Fri, 1 Feb 2019 20:46:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11KklBT081666; Fri, 1 Feb 2019 20:46:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902012046.x11KklBT081666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 1 Feb 2019 20:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343667 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 343667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25D4E80DE9 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 20:46:48 -0000 Author: kib Date: Fri Feb 1 20:46:47 2019 New Revision: 343667 URL: https://svnweb.freebsd.org/changeset/base/343667 Log: x86: correctly limit max memory resource address.. CPU and buses can manage up to the limit reported by cpu_maxphyaddr, so set mem_rman to the value returned by cpu_getmaxphyaddr(). For the PAE mode, it was missed both when rman_res_t was increased to uintmax_t, and from the PAE merge commit. When importing smaps or dump_avail chunks into memory rman, do not blindly ignore resources which ends above the limit, chomp them instead if start is below the limit. The same change was already done to i386 add_physmap_entry(). Based on the submission by: bde MFC after: 2 months Modified: head/sys/x86/x86/nexus.c Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Fri Feb 1 20:42:49 2019 (r343666) +++ head/sys/x86/x86/nexus.c Fri Feb 1 20:46:47 2019 (r343667) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -269,11 +270,7 @@ nexus_init_resources(void) panic("nexus_init_resources port_rman"); mem_rman.rm_start = 0; -#ifndef PAE - mem_rman.rm_end = BUS_SPACE_MAXADDR; -#else - mem_rman.rm_end = ((1ULL << cpu_maxphyaddr) - 1); -#endif + mem_rman.rm_end = cpu_getmaxphyaddr(); mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "I/O memory addresses"; if (rman_init(&mem_rman) @@ -787,6 +784,7 @@ ram_attach(device_t dev) { struct bios_smap *smapbase, *smap, *smapend; struct resource *res; + rman_res_t length; vm_paddr_t *p; caddr_t kmdp; uint32_t smapsize; @@ -807,16 +805,12 @@ ram_attach(device_t dev) if (smap->type != SMAP_TYPE_MEMORY || smap->length == 0) continue; -#ifdef __i386__ - /* - * Resources use long's to track resources, so - * we can't include memory regions above 4GB. - */ - if (smap->base > ~0ul) + if (smap->base > mem_rman.rm_end) continue; -#endif + length = smap->base + smap->length > mem_rman.rm_end ? + mem_rman.rm_end - smap->base : smap->length; error = bus_set_resource(dev, SYS_RES_MEMORY, rid, - smap->base, smap->length); + smap->base, length); if (error) panic( "ram_attach: resource %d failed set with %d", @@ -841,16 +835,12 @@ ram_attach(device_t dev) * segment is 0. */ for (rid = 0, p = dump_avail; p[1] != 0; rid++, p += 2) { -#ifdef PAE - /* - * Resources use long's to track resources, so we can't - * include memory regions above 4GB. - */ - if (p[0] > ~0ul) + if (p[0] > mem_rman.rm_end) break; -#endif + length = (p[1] > mem_rman.rm_end ? mem_rman.rm_end : p[1]) - + p[0]; error = bus_set_resource(dev, SYS_RES_MEMORY, rid, p[0], - p[1] - p[0]); + length); if (error) panic("ram_attach: resource %d failed set with %d", rid, error); From owner-svn-src-head@freebsd.org Fri Feb 1 21:09:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8504914C0B97; Fri, 1 Feb 2019 21:09:37 +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 28E4E817B5; Fri, 1 Feb 2019 21:09:37 +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 1C10C246AE; Fri, 1 Feb 2019 21:09:37 +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 x11L9aGJ091983; Fri, 1 Feb 2019 21:09:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11L9aNh091982; Fri, 1 Feb 2019 21:09:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902012109.x11L9aNh091982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 1 Feb 2019 21:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343668 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 343668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28E4E817B5 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 21:09:37 -0000 Author: kib Date: Fri Feb 1 21:09:36 2019 New Revision: 343668 URL: https://svnweb.freebsd.org/changeset/base/343668 Log: Disable boot-time memory test on i386 be default. With the current 24G memory limit for GENERIC, the boot time test causes quite visible delay, amplified by the default debug.late_console = 0. The comment text is copied from the same setting explanation for amd64. Suggested by: bde Discussed with: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 months Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Feb 1 20:46:47 2019 (r343667) +++ head/sys/i386/i386/machdep.c Fri Feb 1 21:09:36 2019 (r343668) @@ -2005,13 +2005,15 @@ physmap_done: Maxmem = atop(physmap[physmap_idx + 1]); /* - * By default enable the memory test on real hardware, and disable - * it if we appear to be running in a VM. This avoids touching all - * pages unnecessarily, which doesn't matter on real hardware but is - * bad for shared VM hosts. Use a general name so that - * one could eventually do more with the code than just disable it. + * The boot memory test is disabled by default, as it takes a + * significant amount of time on large-memory systems, and is + * unfriendly to virtual machines as it unnecessarily touches all + * pages. + * + * A general name is used as the code may be extended to support + * additional tests beyond the current "page present" test. */ - memtest = (vm_guest > VM_GUEST_NO) ? 0 : 1; + memtest = 0; TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); if (atop(physmap[physmap_idx + 1]) != Maxmem && From owner-svn-src-head@freebsd.org Fri Feb 1 22:24:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D19F14C305B; Fri, 1 Feb 2019 22:24:15 +0000 (UTC) (envelope-from emaste@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 A420485CA0; Fri, 1 Feb 2019 22:24:14 +0000 (UTC) (envelope-from emaste@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 93CCC25459; Fri, 1 Feb 2019 22:24:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11MOEIH037665; Fri, 1 Feb 2019 22:24:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11MOEYn037664; Fri, 1 Feb 2019 22:24:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902012224.x11MOEYn037664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 1 Feb 2019 22:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343669 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 343669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A420485CA0 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 22:24:15 -0000 Author: emaste Date: Fri Feb 1 22:24:14 2019 New Revision: 343669 URL: https://svnweb.freebsd.org/changeset/base/343669 Log: readelf: decode FreeBSD note types Decode NT_FREEBSD_ABI_TAG, NT_FREEBSD_ARCH_TAG, and NT_FREEBSD_FEATURE_CTL. Reviewed by: brooks, kib (earlier) MFC after: 2 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19054 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Feb 1 21:09:36 2019 (r343668) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Feb 1 22:24:14 2019 (r343669) @@ -313,6 +313,8 @@ static void dump_mips_specific_info(struct readelf *re static void dump_notes(struct readelf *re); static void dump_notes_content(struct readelf *re, const char *buf, size_t sz, off_t off); +static void dump_notes_data(const char *name, uint32_t type, const char *buf, + size_t sz); static void dump_svr4_hash(struct section *s); static void dump_svr4_hash64(struct readelf *re, struct section *s); static void dump_gnu_hash(struct readelf *re, struct section *s); @@ -3486,12 +3488,58 @@ dump_notes(struct readelf *re) } } +static struct flag_desc note_feature_ctl_flags[] = { + { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" }, + { 0, NULL } +}; + static void +dump_notes_data(const char *name, uint32_t type, const char *buf, size_t sz) +{ + size_t i; + const uint32_t *ubuf; + + /* Note data is at least 4-byte aligned. */ + if (((uintptr_t)buf & 3) != 0) { + warnx("bad note data alignment"); + goto unknown; + } + ubuf = (const uint32_t *)(const void *)buf; + + if (strcmp(name, "FreeBSD") == 0) { + switch (type) { + case NT_FREEBSD_ABI_TAG: + if (sz != 4) + goto unknown; + printf(" ABI tag: %u\n", ubuf[0]); + return; + /* NT_FREEBSD_NOINIT_TAG carries no data, treat as unknown. */ + case NT_FREEBSD_ARCH_TAG: + if (sz != 4) + goto unknown; + printf(" Arch tag: %x\n", ubuf[0]); + return; + case NT_FREEBSD_FEATURE_CTL: + if (sz != 4) + goto unknown; + printf(" Features:"); + dump_flags(note_feature_ctl_flags, ubuf[0]); + printf("\n"); + return; + } + } +unknown: + printf(" description data:"); + for (i = 0; i < sz; i++) + printf(" %02x", (unsigned char)buf[i]); + printf("\n"); +} + +static void dump_notes_content(struct readelf *re, const char *buf, size_t sz, off_t off) { Elf_Note *note; const char *end, *name; - uint32_t i; printf("\nNotes at offset %#010jx with length %#010jx:\n", (uintmax_t) off, (uintmax_t) sz); @@ -3523,10 +3571,7 @@ dump_notes_content(struct readelf *re, const char *buf printf(" %-13s %#010jx", name, (uintmax_t) note->n_descsz); printf(" %s\n", note_type(name, re->ehdr.e_type, note->n_type)); - printf(" description data:"); - for (i = 0; i < note->n_descsz; i++) - printf(" %02x", (unsigned char)buf[i]); - printf("\n"); + dump_notes_data(name, note->n_type, buf, note->n_descsz); buf += roundup2(note->n_descsz, 4); } } From owner-svn-src-head@freebsd.org Fri Feb 1 23:04:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F336114C402F; Fri, 1 Feb 2019 23:04:46 +0000 (UTC) (envelope-from cem@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 96E9787412; Fri, 1 Feb 2019 23:04:46 +0000 (UTC) (envelope-from cem@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 5677725B44; Fri, 1 Feb 2019 23:04:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11N4kop058093; Fri, 1 Feb 2019 23:04:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11N4jAE058089; Fri, 1 Feb 2019 23:04:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201902012304.x11N4jAE058089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 1 Feb 2019 23:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343670 - in head/sys: dev/qlnx/qlnxe dev/qlnx/qlnxr modules/qlnx/qlnxr X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/qlnx/qlnxe dev/qlnx/qlnxr modules/qlnx/qlnxr X-SVN-Commit-Revision: 343670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96E9787412 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 23:04:47 -0000 Author: cem Date: Fri Feb 1 23:04:45 2019 New Revision: 343670 URL: https://svnweb.freebsd.org/changeset/base/343670 Log: qlnxr(4), qlnxe(4): Unbreak gcc build Remove redundant definitions and conditionalize Clang-specific CFLAGS. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/qlnx/qlnxe/qlnx_rdma.h head/sys/dev/qlnx/qlnxr/qlnxr_verbs.c head/sys/modules/qlnx/qlnxr/Makefile Modified: head/sys/dev/qlnx/qlnxe/qlnx_rdma.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_rdma.h Fri Feb 1 22:24:14 2019 (r343669) +++ head/sys/dev/qlnx/qlnxe/qlnx_rdma.h Fri Feb 1 23:04:45 2019 (r343670) @@ -51,8 +51,6 @@ typedef struct qlnx_rdma_if qlnx_rdma_if_t; extern int qlnx_rdma_register_if(qlnx_rdma_if_t *rdma_if); extern int qlnx_rdma_deregister_if(qlnx_rdma_if_t *rdma_if); -extern int qlnx_rdma_ll2_set_mac_filter(void *rdma_ctx, uint8_t *old_mac_address, - uint8_t *new_mac_address); #define QLNX_NUM_CNQ 1 Modified: head/sys/dev/qlnx/qlnxr/qlnxr_verbs.c ============================================================================== --- head/sys/dev/qlnx/qlnxr/qlnxr_verbs.c Fri Feb 1 22:24:14 2019 (r343669) +++ head/sys/dev/qlnx/qlnxr/qlnxr_verbs.c Fri Feb 1 23:04:45 2019 (r343670) @@ -74,16 +74,6 @@ __FBSDID("$FreeBSD$"); ((unsigned char *)&addr)[2], \ ((unsigned char *)&addr)[3] -struct ib_srq *qlnxr_create_srq(struct ib_pd *, - struct ib_srq_init_attr *, - struct ib_udata *); - -int qlnxr_destroy_srq(struct ib_srq *); - -int qlnxr_modify_srq(struct ib_srq *, - struct ib_srq_attr *, - enum ib_srq_attr_mask, - struct ib_udata *); static int qlnxr_check_srq_params(struct ib_pd *ibpd, struct qlnxr_dev *dev, @@ -99,19 +89,6 @@ static int qlnxr_alloc_srq_kernel_params(struct qlnxr_srq *srq, struct qlnxr_dev *dev, struct ib_srq_init_attr *init_attr); - -extern enum _ecore_status_t -ecore_rdma_modify_srq(void *rdma_cxt, - struct ecore_rdma_modify_srq_in_params *in_params); - -extern enum _ecore_status_t -ecore_rdma_destroy_srq(void *rdma_cxt, - struct ecore_rdma_destroy_srq_in_params *in_params); - -extern enum _ecore_status_t -ecore_rdma_create_srq(void *rdma_cxt, - struct ecore_rdma_create_srq_in_params *in_params, - struct ecore_rdma_create_srq_out_params *out_params); static int Modified: head/sys/modules/qlnx/qlnxr/Makefile ============================================================================== --- head/sys/modules/qlnx/qlnxr/Makefile Fri Feb 1 22:24:14 2019 (r343669) +++ head/sys/modules/qlnx/qlnxr/Makefile Fri Feb 1 23:04:45 2019 (r343670) @@ -62,12 +62,14 @@ CFLAGS+= -DINET6 -DINET CWARNEXTRA += -Wno-cast-qual CWARNEXTRA += -Wno-unused-function +.if ${COMPILER_TYPE} == "clang" CWARNEXTRA += -Wno-gnu-variable-sized-type-not-at-end +.endif CWARNEXTRA += -Wno-missing-prototypes -CWARNEXTRA += -Wno-constant-conversion +CWARNEXTRA += ${NO_WCONSTANT_CONVERSION} CWARNEXTRA += -Wno-format -CWARNEXTRA += -Wno-shift-sign-overflow +CWARNEXTRA += ${NO_WSHIFT_COUNT_OVERFLOW} CWARNEXTRA += -Wno-empty-body CFLAGS += -DQLNX_DEBUG From owner-svn-src-head@freebsd.org Fri Feb 1 23:15:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B80E14C44F5; Fri, 1 Feb 2019 23:15:55 +0000 (UTC) (envelope-from vangyzen@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 A653C87B30; Fri, 1 Feb 2019 23:15:54 +0000 (UTC) (envelope-from vangyzen@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 93FC625CEB; Fri, 1 Feb 2019 23:15:54 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11NFs0Q063091; Fri, 1 Feb 2019 23:15:54 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11NFsHf063090; Fri, 1 Feb 2019 23:15:54 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201902012315.x11NFsHf063090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 1 Feb 2019 23:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343671 - head/lib/msun X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/msun X-SVN-Commit-Revision: 343671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A653C87B30 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.957,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 23:15:55 -0000 Author: vangyzen Date: Fri Feb 1 23:15:54 2019 New Revision: 343671 URL: https://svnweb.freebsd.org/changeset/base/343671 Log: libm: squelch -Woverflow from gcc6 Sponsored by: Dell EMC Isilon Modified: head/lib/msun/Makefile Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Fri Feb 1 23:04:45 2019 (r343670) +++ head/lib/msun/Makefile Fri Feb 1 23:15:54 2019 (r343671) @@ -108,6 +108,15 @@ COMMON_SRCS+= catrigl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ s_scalbnl.c s_sinl.c s_sincosl.c \ s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c +# Work around this warning from gcc 6: +# lib/msun/ld80/e_powl.c:275:1: error: floating constant exceeds range of +# 'long double' [-Werror=overflow] +# if( y >= LDBL_MAX ) +# See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=130067 +.include +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000 +CFLAGS.e_powl.c+= -Wno-error=overflow +.endif .endif # C99 complex functions From owner-svn-src-head@freebsd.org Fri Feb 1 23:17:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC48014C4546; Fri, 1 Feb 2019 23:17:00 +0000 (UTC) (envelope-from vangyzen@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 63BA487C91; Fri, 1 Feb 2019 23:17:00 +0000 (UTC) (envelope-from vangyzen@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 5526D25CEC; Fri, 1 Feb 2019 23:17:00 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x11NH063063180; Fri, 1 Feb 2019 23:17:00 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x11NH0vS063179; Fri, 1 Feb 2019 23:17:00 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201902012317.x11NH0vS063179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 1 Feb 2019 23:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343672 - head/libexec/rtld-elf/i386 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/libexec/rtld-elf/i386 X-SVN-Commit-Revision: 343672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63BA487C91 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.957,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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 23:17:01 -0000 Author: vangyzen Date: Fri Feb 1 23:16:59 2019 New Revision: 343672 URL: https://svnweb.freebsd.org/changeset/base/343672 Log: rtld: pacify -Wmaybe-uninitialized from gcc6 Sponsored by: Dell EMC Isilon Modified: head/libexec/rtld-elf/i386/reloc.c Modified: head/libexec/rtld-elf/i386/reloc.c ============================================================================== --- head/libexec/rtld-elf/i386/reloc.c Fri Feb 1 23:15:54 2019 (r343671) +++ head/libexec/rtld-elf/i386/reloc.c Fri Feb 1 23:16:59 2019 (r343672) @@ -146,6 +146,10 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int } else cache = NULL; + /* Appease some compilers. */ + symval = 0; + def = NULL; + rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize); for (rel = obj->rel; rel < rellim; rel++) { switch (ELF_R_TYPE(rel->r_info)) { From owner-svn-src-head@freebsd.org Sat Feb 2 05:49:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57FB014AAAB8; Sat, 2 Feb 2019 05:49:06 +0000 (UTC) (envelope-from glebius@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 F3C436FFE9; Sat, 2 Feb 2019 05:49:05 +0000 (UTC) (envelope-from glebius@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 E21682499; Sat, 2 Feb 2019 05:49:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x125n5ql068851; Sat, 2 Feb 2019 05:49:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x125n57G068850; Sat, 2 Feb 2019 05:49:05 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201902020549.x125n57G068850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 2 Feb 2019 05:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343678 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 343678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3C436FFE9 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.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 05:49:06 -0000 Author: glebius Date: Sat Feb 2 05:49:05 2019 New Revision: 343678 URL: https://svnweb.freebsd.org/changeset/base/343678 Log: Return PFIL_CONSUMED if packet was consumed. While here gather all the identical endings of pf_check_*() into single function. PR: 235411 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sat Feb 2 04:27:47 2019 (r343677) +++ head/sys/netpfil/pf/pf_ioctl.c Sat Feb 2 05:49:05 2019 (r343678) @@ -4002,6 +4002,26 @@ shutdown_pf(void) return (error); } +static pfil_return_t +pf_check_return(int chk, struct mbuf **m) +{ + + switch (chk) { + case PF_PASS: + if (*m == NULL) + return (PFIL_CONSUMED); + else + return (PFIL_PASS); + break; + default: + if (*m != NULL) { + m_freem(*m); + *m = NULL; + } + return (PFIL_DROPPED); + } +} + #ifdef INET static pfil_return_t pf_check_in(struct mbuf **m, struct ifnet *ifp, int flags, @@ -4010,12 +4030,8 @@ pf_check_in(struct mbuf **m, struct ifnet *ifp, int fl int chk; chk = pf_test(PF_IN, flags, ifp, m, inp); - if (chk && *m) { - m_freem(*m); - *m = NULL; - } - return (chk == PF_PASS ? PFIL_PASS : PFIL_DROPPED); + return (pf_check_return(chk, m)); } static pfil_return_t @@ -4025,12 +4041,8 @@ pf_check_out(struct mbuf **m, struct ifnet *ifp, int f int chk; chk = pf_test(PF_OUT, flags, ifp, m, inp); - if (chk && *m) { - m_freem(*m); - *m = NULL; - } - return (chk == PF_PASS ? PFIL_PASS : PFIL_DROPPED); + return (pf_check_return(chk, m)); } #endif @@ -4049,12 +4061,8 @@ pf_check6_in(struct mbuf **m, struct ifnet *ifp, int f CURVNET_SET(ifp->if_vnet); chk = pf_test6(PF_IN, flags, (*m)->m_flags & M_LOOP ? V_loif : ifp, m, inp); CURVNET_RESTORE(); - if (chk && *m) { - m_freem(*m); - *m = NULL; - } - return (chk == PF_PASS ? PFIL_PASS : PFIL_DROPPED); + return (pf_check_return(chk, m)); } static pfil_return_t @@ -4066,12 +4074,8 @@ pf_check6_out(struct mbuf **m, struct ifnet *ifp, int CURVNET_SET(ifp->if_vnet); chk = pf_test6(PF_OUT, flags, ifp, m, inp); CURVNET_RESTORE(); - if (chk && *m) { - m_freem(*m); - *m = NULL; - } - return (chk == PF_PASS ? PFIL_PASS : PFIL_DROPPED); + return (pf_check_return(chk, m)); } #endif /* INET6 */ From owner-svn-src-head@freebsd.org Sat Feb 2 04:15:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3102414D2AEF; Sat, 2 Feb 2019 04:15:18 +0000 (UTC) (envelope-from jhibbits@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 D3AC46CD69; Sat, 2 Feb 2019 04:15:17 +0000 (UTC) (envelope-from jhibbits@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 C64B014F7; Sat, 2 Feb 2019 04:15:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x124FHNY022325; Sat, 2 Feb 2019 04:15:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x124FGgG022249; Sat, 2 Feb 2019 04:15:16 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201902020415.x124FGgG022249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 2 Feb 2019 04:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343674 - in head/sys: conf powerpc/powernv powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/powernv powerpc/pseries X-SVN-Commit-Revision: 343674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3AC46CD69 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 04:15:18 -0000 Author: jhibbits Date: Sat Feb 2 04:15:16 2019 New Revision: 343674 URL: https://svnweb.freebsd.org/changeset/base/343674 Log: powerpc/powernv: Add a driver for the POWER9 XIVE interrupt controller The XIVE (External Interrupt Virtualization Engine) is a new interrupt controller present in IBM's POWER9 processor. It's a very powerful, very complex device using queues and shared memory to improve interrupt dispatch performance in a virtualized environment. This yields a ~10% performance improvment over the XICS emulation mode, measured in both buildworld, and 'dd' from nvme to /dev/null. Currently, this only supports native access. MFC after: 1 month Added: head/sys/powerpc/powernv/xive.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/platform_powernv.c head/sys/powerpc/pseries/xics.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Feb 2 04:11:59 2019 (r343673) +++ head/sys/conf/files.powerpc Sat Feb 2 04:15:16 2019 (r343674) @@ -201,6 +201,7 @@ powerpc/powernv/opalcall.S optional powernv powerpc/powernv/platform_powernv.c optional powernv powerpc/powernv/powernv_centaur.c optional powernv powerpc/powernv/powernv_xscom.c optional powernv +powerpc/powernv/xive.c optional powernv powerpc/powerpc/altivec.c optional powerpc | powerpc64 powerpc/powerpc/autoconf.c standard powerpc/powerpc/bus_machdep.c standard Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Sat Feb 2 04:11:59 2019 (r343673) +++ head/sys/powerpc/powernv/opal.h Sat Feb 2 04:15:16 2019 (r343674) @@ -82,6 +82,20 @@ int opal_call(uint64_t token, ...); #define OPAL_INT_SET_MFRR 125 #define OPAL_PCI_TCE_KILL 126 #define OPAL_XIVE_RESET 128 +#define OPAL_XIVE_GET_IRQ_INFO 129 +#define OPAL_XIVE_GET_IRQ_CONFIG 130 +#define OPAL_XIVE_SET_IRQ_CONFIG 131 +#define OPAL_XIVE_GET_QUEUE_INFO 132 +#define OPAL_XIVE_SET_QUEUE_INFO 133 +#define OPAL_XIVE_DONATE_PAGE 134 +#define OPAL_XIVE_ALLOCATE_VP_BLOCK 135 +#define OPAL_XIVE_FREE_VP_BLOCK 136 +#define OPAL_XIVE_GET_VP_INFO 137 +#define OPAL_XIVE_SET_VP_INFO 138 +#define OPAL_XIVE_ALLOCATE_IRQ 139 +#define OPAL_XIVE_FREE_IRQ 140 +#define OPAL_XIVE_SYNC 141 +#define OPAL_XIVE_DUMP 142 #define OPAL_SENSOR_GROUP_CLEAR 156 #define OPAL_SENSOR_READ_U64 162 #define OPAL_SENSOR_GROUP_ENABLE 163 @@ -114,6 +128,18 @@ int opal_call(uint64_t token, ...); #define OPAL_BUSY_EVENT -12 #define OPAL_ASYNC_COMPLETION -15 #define OPAL_EMPTY -16 +#define OPAL_XIVE_PROVISIONING -31 +#define OPAL_XIVE_FREE_ACTIVE -32 + +#define OPAL_XIVE_XICS_MODE_EMU 0 +#define OPAL_XIVE_XICS_MODE_EXP 1 + +#define OPAL_XIVE_VP_ENABLED 0x00000001 +#define OPAL_XIVE_VP_SINGLE_ESCALATION 0x00000002 + +#define OPAL_XIVE_EQ_ENABLED 0x00000001 +#define OPAL_XIVE_EQ_ALWAYS_NOTIFY 0x00000002 +#define OPAL_XIVE_EQ_ESCALATE 0x00000004 struct opal_msg { uint32_t msg_type; Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Sat Feb 2 04:11:59 2019 (r343673) +++ head/sys/powerpc/powernv/platform_powernv.c Sat Feb 2 04:15:16 2019 (r343674) @@ -59,7 +59,8 @@ __FBSDID("$FreeBSD$"); extern void *ap_pcpu; #endif -extern void xicp_smp_cpu_startup(void); +void (*powernv_smp_ap_extra_init)(void); + static int powernv_probe(platform_t); static int powernv_attach(platform_t); void powernv_mem_regions(platform_t, struct mem_region *phys, int *physsz, @@ -473,7 +474,8 @@ static void powernv_smp_ap_init(platform_t platform) { - xicp_smp_cpu_startup(); + if (powernv_smp_ap_extra_init != NULL) + powernv_smp_ap_extra_init(); } static void Added: head/sys/powerpc/powernv/xive.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/xive.c Sat Feb 2 04:15:16 2019 (r343674) @@ -0,0 +1,764 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2019 Justin Hibbits + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef POWERNV +#include +#endif + +#include "pic_if.h" + +#define XIVE_PRIORITY 7 /* Random non-zero number */ +#define MAX_XIVE_IRQS (1<<24) /* 24-bit XIRR field */ + +/* Registers */ +#define XIVE_TM_QW1_OS 0x010 /* Guest OS registers */ +#define XIVE_TM_QW2_HV_POOL 0x020 /* Hypervisor pool registers */ +#define XIVE_TM_QW3_HV 0x030 /* Hypervisor registers */ + +#define XIVE_TM_NSR 0x00 +#define XIVE_TM_CPPR 0x01 +#define XIVE_TM_IPB 0x02 +#define XIVE_TM_LSMFB 0x03 +#define XIVE_TM_ACK_CNT 0x04 +#define XIVE_TM_INC 0x05 +#define XIVE_TM_AGE 0x06 +#define XIVE_TM_PIPR 0x07 + +#define TM_WORD0 0x0 +#define TM_WORD2 0x8 +#define TM_QW2W2_VP 0x80000000 + +#define XIVE_TM_SPC_ACK 0x800 +#define TM_QW3NSR_HE_SHIFT 14 +#define TM_QW3_NSR_HE_NONE 0 +#define TM_QW3_NSR_HE_POOL 1 +#define TM_QW3_NSR_HE_PHYS 2 +#define TM_QW3_NSR_HE_LSI 3 +#define XIVE_TM_SPC_PULL_POOL_CTX 0x828 + +#define XIVE_IRQ_LOAD_EOI 0x000 +#define XIVE_IRQ_STORE_EOI 0x400 +#define XIVE_IRQ_PQ_00 0xc00 +#define XIVE_IRQ_PQ_01 0xd00 + +#define XIVE_IRQ_VAL_P 0x02 +#define XIVE_IRQ_VAL_Q 0x01 + +struct xive_softc; +struct xive_irq; + +extern void (*powernv_smp_ap_extra_init)(void); + +/* Private support */ +static void xive_setup_cpu(void); +static void xive_smp_cpu_startup(void); +static void xive_init_irq(struct xive_irq *irqd, u_int irq); +static struct xive_irq *xive_configure_irq(u_int irq); +static int xive_provision_page(struct xive_softc *sc); + + +/* Interfaces */ +static int xive_probe(device_t); +static int xive_attach(device_t); +static int xics_probe(device_t); +static int xics_attach(device_t); + +static void xive_bind(device_t, u_int, cpuset_t, void **); +static void xive_dispatch(device_t, struct trapframe *); +static void xive_enable(device_t, u_int, u_int, void **); +static void xive_eoi(device_t, u_int, void *); +static void xive_ipi(device_t, u_int); +static void xive_mask(device_t, u_int, void *); +static void xive_unmask(device_t, u_int, void *); +static void xive_translate_code(device_t dev, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol); + +static device_method_t xive_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, xive_probe), + DEVMETHOD(device_attach, xive_attach), + + /* PIC interface */ + DEVMETHOD(pic_bind, xive_bind), + DEVMETHOD(pic_dispatch, xive_dispatch), + DEVMETHOD(pic_enable, xive_enable), + DEVMETHOD(pic_eoi, xive_eoi), + DEVMETHOD(pic_ipi, xive_ipi), + DEVMETHOD(pic_mask, xive_mask), + DEVMETHOD(pic_unmask, xive_unmask), + DEVMETHOD(pic_translate_code, xive_translate_code), + + DEVMETHOD_END +}; + +static device_method_t xics_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, xics_probe), + DEVMETHOD(device_attach, xics_attach), + + DEVMETHOD_END +}; + +struct xive_softc { + struct mtx sc_mtx; + struct resource *sc_mem; + vm_size_t sc_prov_page_size; + uint32_t sc_offset; +}; + +struct xive_queue { + uint32_t *q_page; + uint32_t *q_eoi_page; + uint32_t q_toggle; + uint32_t q_size; + uint32_t q_index; + uint32_t q_mask; +}; + +struct xive_irq { + uint32_t girq; + uint32_t lirq; + uint64_t vp; + uint64_t flags; +#define OPAL_XIVE_IRQ_EOI_VIA_FW 0x00000020 +#define OPAL_XIVE_IRQ_MASK_VIA_FW 0x00000010 +#define OPAL_XIVE_IRQ_SHIFT_BUG 0x00000008 +#define OPAL_XIVE_IRQ_LSI 0x00000004 +#define OPAL_XIVE_IRQ_STORE_EOI 0x00000002 +#define OPAL_XIVE_IRQ_TRIGGER_PAGE 0x00000001 + uint8_t prio; + vm_offset_t eoi_page; + vm_offset_t trig_page; + vm_size_t esb_size; + int chip; +}; + +struct xive_cpu { + uint64_t vp; + uint64_t flags; + struct xive_irq ipi_data; + struct xive_queue queue; /* We only use a single queue for now. */ + uint64_t cam; + uint32_t chip; +}; + +static driver_t xive_driver = { + "xive", + xive_methods, + sizeof(struct xive_softc) +}; + +static driver_t xics_driver = { + "xivevc", + xics_methods, + 0 +}; + +static devclass_t xive_devclass; +static devclass_t xics_devclass; + +EARLY_DRIVER_MODULE(xive, ofwbus, xive_driver, xive_devclass, 0, 0, + BUS_PASS_INTERRUPT-1); +EARLY_DRIVER_MODULE(xivevc, ofwbus, xics_driver, xics_devclass, 0, 0, + BUS_PASS_INTERRUPT); + +MALLOC_DEFINE(M_XIVE, "xive", "XIVE Memory"); + +DPCPU_DEFINE_STATIC(struct xive_cpu, xive_cpu_data); + +static int xive_ipi_vector = -1; + +/* + * XIVE Exploitation mode driver. + * + * The XIVE, present in the POWER9 CPU, can run in two modes: XICS emulation + * mode, and "Exploitation mode". XICS emulation mode is compatible with the + * POWER8 and earlier XICS interrupt controller, using OPAL calls to emulate + * hypervisor calls and memory accesses. Exploitation mode gives us raw access + * to the XIVE MMIO, improving performance significantly. + * + * The XIVE controller is a very bizarre interrupt controller. It uses queues + * in memory to pass interrupts around, and maps itself into 512GB of physical + * device address space, giving each interrupt in the system one or more pages + * of address space. An IRQ is tied to a virtual processor, which could be a + * physical CPU thread, or a guest CPU thread (LPAR running on a physical + * thread). Thus, the controller can route interrupts directly to guest OSes + * bypassing processing by the hypervisor, thereby improving performance of the + * guest OS. + * + * An IRQ, in addition to being tied to a virtual processor, has one or two + * page mappings: an EOI page, and an optional trigger page. The trigger page + * could be the same as the EOI page. Level-sensitive interrupts (LSIs) don't + * have a trigger page, as they're external interrupts controlled by physical + * lines. MSIs and IPIs have trigger pages. An IPI is really just another IRQ + * in the XIVE, which is triggered by software. + * + * An interesting behavior of the XIVE controller is that oftentimes the + * contents of an address location don't actually matter, but the direction of + * the action is the signifier (read vs write), and the address is significant. + * Hence, masking and unmasking an interrupt is done by reading different + * addresses in the EOI page, and triggering an interrupt consists of writing to + * the trigger page. + * + * Additionally, the MMIO region mapped is CPU-sensitive, just like the + * per-processor register space (private access) in OpenPIC. In order for a CPU + * to receive interrupts it must itself configure its CPPR (Current Processor + * Priority Register), it cannot be set by any other processor. This + * necessitates the xive_smp_cpu_startup() function. + * + * Queues are pages of memory, sized powers-of-two, that are shared with the + * XIVE. The XIVE writes into the queue with an alternating polarity bit, which + * flips when the queue wraps. + */ + +/* + * Offset-based read/write interfaces. + */ +static uint16_t +xive_read_2(struct xive_softc *sc, bus_size_t offset) +{ + + return (bus_read_2(sc->sc_mem, sc->sc_offset + offset)); +} + +static void +xive_write_1(struct xive_softc *sc, bus_size_t offset, uint8_t val) +{ + + bus_write_1(sc->sc_mem, sc->sc_offset + offset, val); +} + +/* EOI and Trigger page access interfaces. */ +static uint64_t +xive_read_mmap8(vm_offset_t addr) +{ + return (*(volatile uint64_t *)addr); +} + +static void +xive_write_mmap8(vm_offset_t addr, uint64_t val) +{ + *(uint64_t *)(addr) = val; +} + + +/* Device interfaces. */ +static int +xive_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "ibm,opal-xive-pe")) + return (ENXIO); + + device_set_desc(dev, "External Interrupt Virtualization Engine"); + + /* Make sure we always win against the xicp driver. */ + return (BUS_PROBE_DEFAULT); +} + +static int +xics_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "ibm,opal-xive-vc")) + return (ENXIO); + + device_set_desc(dev, "External Interrupt Virtualization Engine Root"); + return (BUS_PROBE_DEFAULT); +} + +static int +xive_attach(device_t dev) +{ + struct xive_softc *sc = device_get_softc(dev); + struct xive_cpu *xive_cpud; + phandle_t phandle = ofw_bus_get_node(dev); + int64_t vp_block; + int error; + int rid; + int i, order; + uint64_t vp_id; + int64_t ipi_irq; + + opal_call(OPAL_XIVE_RESET, OPAL_XIVE_XICS_MODE_EXP); + + error = OF_getencprop(phandle, "ibm,xive-provision-page-size", + (pcell_t *)&sc->sc_prov_page_size, sizeof(sc->sc_prov_page_size)); + + rid = 1; /* Get the Hypervisor-level register set. */ + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + sc->sc_offset = XIVE_TM_QW3_HV; + + mtx_init(&sc->sc_mtx, "XIVE", NULL, MTX_DEF); + + order = fls(mp_maxid + (mp_maxid - 1)) - 1; + + do { + vp_block = opal_call(OPAL_XIVE_ALLOCATE_VP_BLOCK, order); + if (vp_block == OPAL_BUSY) + DELAY(10); + else if (vp_block == OPAL_XIVE_PROVISIONING) + xive_provision_page(sc); + else + break; + } while (1); + + if (vp_block < 0) { + device_printf(dev, + "Unable to allocate VP block. Opal error %d\n", + (int)vp_block); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->sc_mem); + return (ENXIO); + } + + /* + * Set up the VPs. Try to do as much as we can in attach, to lessen + * what's needed at AP spawn time. + */ + CPU_FOREACH(i) { + vp_id = pcpu_find(i)->pc_hwref; + + xive_cpud = DPCPU_ID_PTR(i, xive_cpu_data); + xive_cpud->vp = vp_id + vp_block; + opal_call(OPAL_XIVE_GET_VP_INFO, xive_cpud->vp, NULL, + vtophys(&xive_cpud->cam), NULL, vtophys(&xive_cpud->chip)); + + /* Allocate the queue page and populate the queue state data. */ + xive_cpud->queue.q_page = contigmalloc(PAGE_SIZE, M_XIVE, + M_ZERO | M_WAITOK, 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); + xive_cpud->queue.q_size = 1 << PAGE_SHIFT; + xive_cpud->queue.q_mask = + ((xive_cpud->queue.q_size / sizeof(int)) - 1); + xive_cpud->queue.q_toggle = 0; + xive_cpud->queue.q_index = 0; + do { + error = opal_call(OPAL_XIVE_SET_VP_INFO, xive_cpud->vp, + OPAL_XIVE_VP_ENABLED, 0); + } while (error == OPAL_BUSY); + error = opal_call(OPAL_XIVE_SET_QUEUE_INFO, vp_id, + XIVE_PRIORITY, vtophys(xive_cpud->queue.q_page), PAGE_SHIFT, + OPAL_XIVE_EQ_ALWAYS_NOTIFY | OPAL_XIVE_EQ_ENABLED); + + do { + ipi_irq = opal_call(OPAL_XIVE_ALLOCATE_IRQ, + xive_cpud->chip); + } while (ipi_irq == OPAL_BUSY); + + if (ipi_irq < 0) + device_printf(root_pic, + "Failed allocating IPI. OPAL error %d\n", + (int)ipi_irq); + else { + xive_init_irq(&xive_cpud->ipi_data, ipi_irq); + xive_cpud->ipi_data.vp = vp_id; + xive_cpud->ipi_data.lirq = MAX_XIVE_IRQS; + opal_call(OPAL_XIVE_SET_IRQ_CONFIG, ipi_irq, + xive_cpud->ipi_data.vp, XIVE_PRIORITY, + MAX_XIVE_IRQS); + } + } + + powerpc_register_pic(dev, OF_xref_from_node(phandle), MAX_XIVE_IRQS, + 1 /* Number of IPIs */, FALSE); + root_pic = dev; + + xive_setup_cpu(); + powernv_smp_ap_extra_init = xive_smp_cpu_startup; + + return (0); +} + +static int +xics_attach(device_t dev) +{ + phandle_t phandle = ofw_bus_get_node(dev); + + /* The XIVE (root PIC) will handle all our interrupts */ + powerpc_register_pic(root_pic, OF_xref_from_node(phandle), + MAX_XIVE_IRQS, 1 /* Number of IPIs */, FALSE); + + return (0); +} + +/* + * PIC I/F methods. + */ + +static void +xive_bind(device_t dev, u_int irq, cpuset_t cpumask, void **priv) +{ + struct xive_irq *irqd; + int cpu; + int ncpus, i, error; + + if (*priv == NULL) + *priv = xive_configure_irq(irq); + + irqd = *priv; + + /* + * This doesn't appear to actually support affinity groups, so pick a + * random CPU. + */ + ncpus = 0; + CPU_FOREACH(cpu) + if (CPU_ISSET(cpu, &cpumask)) ncpus++; + + i = mftb() % ncpus; + ncpus = 0; + CPU_FOREACH(cpu) { + if (!CPU_ISSET(cpu, &cpumask)) + continue; + if (ncpus == i) + break; + ncpus++; + } + + opal_call(OPAL_XIVE_SYNC); + + irqd->vp = pcpu_find(cpu)->pc_hwref; + error = opal_call(OPAL_XIVE_SET_IRQ_CONFIG, irq, irqd->vp, + XIVE_PRIORITY, irqd->lirq); + + if (error < 0) + panic("Cannot bind interrupt %d to CPU %d", irq, cpu); + + xive_eoi(dev, irq, irqd); +} + +/* Read the next entry in the queue page and update the index. */ +static int +xive_read_eq(struct xive_queue *q) +{ + uint32_t i = be32toh(q->q_page[q->q_index]); + + /* Check validity, using current queue polarity. */ + if ((i >> 31) == q->q_toggle) + return (0); + + q->q_index = (q->q_index + 1) & q->q_mask; + + if (q->q_index == 0) + q->q_toggle ^= 1; + + return (i & 0x7fffffff); +} + +static void +xive_dispatch(device_t dev, struct trapframe *tf) +{ + struct xive_softc *sc; + struct xive_cpu *xive_cpud; + uint32_t vector; + uint16_t ack; + uint8_t cppr, he; + + sc = device_get_softc(dev); + + for (;;) { + ack = xive_read_2(sc, XIVE_TM_SPC_ACK); + cppr = (ack & 0xff); + + he = ack >> TM_QW3NSR_HE_SHIFT; + + if (he == TM_QW3_NSR_HE_NONE) + break; + switch (he) { + case TM_QW3_NSR_HE_NONE: + goto end; + case TM_QW3_NSR_HE_POOL: + case TM_QW3_NSR_HE_LSI: + device_printf(dev, + "Unexpected interrupt he type: %d\n", he); + goto end; + case TM_QW3_NSR_HE_PHYS: + break; + } + + xive_cpud = DPCPU_PTR(xive_cpu_data); + xive_write_1(sc, XIVE_TM_CPPR, cppr); + + for (;;) { + vector = xive_read_eq(&xive_cpud->queue); + + if (vector == 0) + break; + + if (vector == MAX_XIVE_IRQS) + vector = xive_ipi_vector; + + powerpc_dispatch_intr(vector, tf); + } + } +end: + xive_write_1(sc, XIVE_TM_CPPR, 0xff); +} + +static void +xive_enable(device_t dev, u_int irq, u_int vector, void **priv) +{ + struct xive_irq *irqd; + cell_t status, cpu; + + if (irq == MAX_XIVE_IRQS) { + if (xive_ipi_vector == -1) + xive_ipi_vector = vector; + return; + } + if (*priv == NULL) + *priv = xive_configure_irq(irq); + + irqd = *priv; + + /* Bind to this CPU to start */ + cpu = PCPU_GET(hwref); + irqd->lirq = vector; + + for (;;) { + status = opal_call(OPAL_XIVE_SET_IRQ_CONFIG, irq, cpu, + XIVE_PRIORITY, vector); + if (status != OPAL_BUSY) + break; + DELAY(10); + } + + if (status != 0) + panic("OPAL_SET_XIVE IRQ %d -> cpu %d failed: %d", irq, + cpu, status); + + xive_unmask(dev, irq, *priv); +} + +static void +xive_eoi(device_t dev, u_int irq, void *priv) +{ + struct xive_irq *rirq; + struct xive_cpu *cpud; + uint8_t eoi_val; + + if (irq == MAX_XIVE_IRQS) { + cpud = DPCPU_PTR(xive_cpu_data); + rirq = &cpud->ipi_data; + } else + rirq = priv; + + if (rirq->flags & OPAL_XIVE_IRQ_EOI_VIA_FW) + opal_call(OPAL_INT_EOI, irq); + else if (rirq->flags & OPAL_XIVE_IRQ_STORE_EOI) + xive_write_mmap8(rirq->eoi_page + XIVE_IRQ_STORE_EOI, 0); + else if (rirq->flags & OPAL_XIVE_IRQ_LSI) + xive_read_mmap8(rirq->eoi_page + XIVE_IRQ_LOAD_EOI); + else { + eoi_val = xive_read_mmap8(rirq->eoi_page + XIVE_IRQ_PQ_00); + if ((eoi_val & XIVE_IRQ_VAL_Q) && rirq->trig_page != 0) + xive_write_mmap8(rirq->trig_page, 0); + } +} + +static void +xive_ipi(device_t dev, u_int cpu) +{ + struct xive_cpu *xive_cpud; + + xive_cpud = DPCPU_ID_PTR(cpu, xive_cpu_data); + + if (xive_cpud->ipi_data.trig_page == 0) + return; + xive_write_mmap8(xive_cpud->ipi_data.trig_page, 0); +} + +static void +xive_mask(device_t dev, u_int irq, void *priv) +{ + struct xive_irq *rirq; + + /* Never mask IPIs */ + if (irq == MAX_XIVE_IRQS) + return; + + rirq = priv; + + if (!(rirq->flags & OPAL_XIVE_IRQ_LSI)) + return; + xive_read_mmap8(rirq->eoi_page + XIVE_IRQ_PQ_01); +} + +static void +xive_unmask(device_t dev, u_int irq, void *priv) +{ + struct xive_irq *rirq; + + rirq = priv; + + xive_read_mmap8(rirq->eoi_page + XIVE_IRQ_PQ_00); +} + +static void +xive_translate_code(device_t dev, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol) +{ + switch (code) { + case 0: + /* L to H edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_HIGH; + break; + case 1: + /* Active L level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_LOW; + break; + default: + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } +} + +/* Private functions. */ +/* + * Setup the current CPU. Called by the BSP at driver attachment, and by each + * AP at wakeup (via xive_smp_cpu_startup()). + */ +static void +xive_setup_cpu(void) +{ + struct xive_softc *sc; + struct xive_cpu *cpup; + uint32_t val; + + cpup = DPCPU_PTR(xive_cpu_data); + + sc = device_get_softc(root_pic); + + val = bus_read_4(sc->sc_mem, XIVE_TM_QW2_HV_POOL + TM_WORD2); + if (val & TM_QW2W2_VP) + bus_read_8(sc->sc_mem, XIVE_TM_SPC_PULL_POOL_CTX); + + bus_write_4(sc->sc_mem, XIVE_TM_QW2_HV_POOL + TM_WORD0, 0xff); + bus_write_4(sc->sc_mem, XIVE_TM_QW2_HV_POOL + TM_WORD2, + TM_QW2W2_VP | cpup->cam); + + xive_unmask(root_pic, cpup->ipi_data.girq, &cpup->ipi_data); + xive_write_1(sc, XIVE_TM_CPPR, 0xff); +} + +/* Populate an IRQ structure, mapping the EOI and trigger pages. */ +static void +xive_init_irq(struct xive_irq *irqd, u_int irq) +{ + uint64_t eoi_phys, trig_phys; + uint32_t esb_shift; + + opal_call(OPAL_XIVE_GET_IRQ_INFO, irq, + vtophys(&irqd->flags), vtophys(&eoi_phys), + vtophys(&trig_phys), vtophys(&esb_shift), + vtophys(&irqd->chip)); + + irqd->girq = irq; + irqd->esb_size = 1 << esb_shift; + irqd->eoi_page = (vm_offset_t)pmap_mapdev(eoi_phys, irqd->esb_size); + + if (eoi_phys == trig_phys) + irqd->trig_page = irqd->eoi_page; + else if (trig_phys != 0) + irqd->trig_page = (vm_offset_t)pmap_mapdev(trig_phys, + irqd->esb_size); + else + irqd->trig_page = 0; + + opal_call(OPAL_XIVE_GET_IRQ_CONFIG, irq, vtophys(&irqd->vp), + vtophys(&irqd->prio), vtophys(&irqd->lirq)); +} + +/* Allocate an IRQ struct before populating it. */ +static struct xive_irq * +xive_configure_irq(u_int irq) +{ + struct xive_irq *irqd; + + irqd = malloc(sizeof(struct xive_irq), M_XIVE, M_WAITOK); + + xive_init_irq(irqd, irq); + + return (irqd); +} + +/* + * Part of the OPAL API. OPAL_XIVE_ALLOCATE_VP_BLOCK might require more pages, + * provisioned through this call. + */ +static int +xive_provision_page(struct xive_softc *sc) +{ + void *prov_page; + int error; + + do { + prov_page = contigmalloc(sc->sc_prov_page_size, M_XIVE, 0, + 0, BUS_SPACE_MAXADDR, + sc->sc_prov_page_size, sc->sc_prov_page_size); + + error = opal_call(OPAL_XIVE_DONATE_PAGE, -1, + vtophys(prov_page)); + } while (error == OPAL_XIVE_PROVISIONING); + + return (0); +} + +/* The XIVE_TM_CPPR register must be set by each thread */ +static void +xive_smp_cpu_startup(void) +{ + + xive_setup_cpu(); +} Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Sat Feb 2 04:11:59 2019 (r343673) +++ head/sys/powerpc/pseries/xics.c Sat Feb 2 04:15:16 2019 (r343674) @@ -61,9 +61,6 @@ __FBSDID("$FreeBSD$"); #define XICP_IPI 2 #define MAX_XICP_IRQS (1<<24) /* 24-bit XIRR field */ -#define XIVE_XICS_MODE_EMU 0 -#define XIVE_XICS_MODE_EXP 1 - static int xicp_probe(device_t); static int xicp_attach(device_t); static int xics_probe(device_t); @@ -78,7 +75,8 @@ static void xicp_mask(device_t, u_int, void *priv); static void xicp_unmask(device_t, u_int, void *priv); #ifdef POWERNV -void xicp_smp_cpu_startup(void); +extern void (*powernv_smp_ap_extra_init)(void); +static void xicp_smp_cpu_startup(void); #endif static device_method_t xicp_methods[] = { @@ -238,7 +236,7 @@ xicp_attach(device_t dev) * compatibility mode. */ sc->xics_emu = true; - opal_call(OPAL_XIVE_RESET, XIVE_XICS_MODE_EMU); + opal_call(OPAL_XIVE_RESET, OPAL_XIVE_XICS_MODE_EMU); #endif } else { sc->cpu_range[0] = 0; @@ -280,6 +278,11 @@ xicp_attach(device_t dev) 1 /* Number of IPIs */, FALSE); root_pic = dev; +#ifdef POWERNV + if (sc->xics_emu) + powernv_smp_ap_extra_init = xicp_smp_cpu_startup; +#endif + return (0); } @@ -556,7 +559,7 @@ xicp_unmask(device_t dev, u_int irq, void *priv) #ifdef POWERNV /* This is only used on POWER9 systems with the XIVE's XICS emulation. */ -void +static void xicp_smp_cpu_startup(void) { struct xicp_softc *sc; From owner-svn-src-head@freebsd.org Sat Feb 2 04:12:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0A3314D2A42; Sat, 2 Feb 2019 04:12:00 +0000 (UTC) (envelope-from mav@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 5F9E76C9F7; Sat, 2 Feb 2019 04:12:00 +0000 (UTC) (envelope-from mav@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 4E0981377; Sat, 2 Feb 2019 04:12:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x124C0O5020885; Sat, 2 Feb 2019 04:12:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x124C0su020884; Sat, 2 Feb 2019 04:12:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902020412.x124C0su020884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 2 Feb 2019 04:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343673 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F9E76C9F7 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 04:12:00 -0000 Author: mav Date: Sat Feb 2 04:11:59 2019 New Revision: 343673 URL: https://svnweb.freebsd.org/changeset/base/343673 Log: Fix integer math overflow in UMA hash_alloc(). 512GB of ZFS ABD ARC means abd_chunk zone of 128M 4KB items. To manage them UMA tries to allocate 2GB hash table, which size does not fit into the int variable, causing later allocation failure, which makes ARC shrink back below the 512GB, not letting it to use more RAM. With this change I easily reached >700GB ARC size on 768GB RAM machine. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Feb 1 23:16:59 2019 (r343672) +++ head/sys/vm/uma_core.c Sat Feb 2 04:11:59 2019 (r343673) @@ -623,7 +623,7 @@ static int hash_alloc(struct uma_hash *hash) { int oldsize; - int alloc; + size_t alloc; oldsize = hash->uh_hashsize; From owner-svn-src-head@freebsd.org Sat Feb 2 12:52:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B49C614BCEB1; Sat, 2 Feb 2019 12:52:36 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 617958707D; Sat, 2 Feb 2019 12:52:34 +0000 (UTC) (envelope-from joerg@bec.de) X-Originating-IP: 164.15.244.34 Received: from britannica.bec.de (unknown [164.15.244.34]) (Authenticated sender: joerg@bec.de) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 5A0B920008; Sat, 2 Feb 2019 12:52:32 +0000 (UTC) Date: Sat, 2 Feb 2019 13:52:30 +0100 From: Joerg Sonnenberger To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343633 - head/usr.bin/shar Message-ID: <20190202125230.GA29541@britannica.bec.de> References: <201901312321.x0VNLI2N009823@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) X-Rspamd-Queue-Id: 617958707D X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [0.57 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_XOIP(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bec.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.41)[0.412,0]; NEURAL_SPAM_SHORT(0.40)[0.399,0]; NEURAL_HAM_LONG(-0.70)[-0.699,0]; IP_SCORE(-0.33)[ip: (-0.13), ipnet: 217.70.176.0/20(-0.81), asn: 29169(-0.71), country: FR(-0.02)]; MX_GOOD(-0.01)[spool.mail.gandi.net]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[200.183.70.217.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29169, ipnet:217.70.176.0/20, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 12:52:36 -0000 On Thu, Jan 31, 2019 at 03:29:03PM -0800, Bryan Drewery wrote: > On 1/31/19 3:21 PM, Bryan Drewery wrote: > > Author: bdrewery > > Date: Thu Jan 31 23:21:18 2019 > > New Revision: 343633 > > URL: https://svnweb.freebsd.org/changeset/base/343633 > > > > Log: > > Shar files may be seen as binary by grep. > > > > Suggest using -a to egrep to properly see executed commands. > > > > This is a minor improvement to the manpage. A better improvement > > would be removal or gigantic warnings. > > I dare someone to remove this utility. > There may still be documentation suggesting its use somewhere due to > pre-bugzilla days but now we can do proper binary attachments I believe. bsdtar --format shar? Joerg From owner-svn-src-head@freebsd.org Sat Feb 2 14:28:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4D9614BF2F6; Sat, 2 Feb 2019 14:28:42 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6810F89B03; Sat, 2 Feb 2019 14:28:40 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id BB640211A9; Sat, 2 Feb 2019 09:28:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 02 Feb 2019 09:28:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.net; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=fm1; bh=GXn0gC1iPPCnlDlISItT6RRNXXn rDk/OgtOGlwS1H20=; b=OvspbB51z4aLQwqAVU1Xa+d5Bx6eO/pj16smGslg2OQ hfjXJ+pTa4XAMRG6hrLPeaiNzMLNGP9RJPIAmpMbJnJoELnT5iCRueOM5Rg4lUbP bCsWYS/5aeP7cGcURNy33Rvc9E4S1YAEZGzic5qFERnw/MKelyNr61TTnF8W6mXi B7FO/4tAOY3UZ4BEbxe7Wd4itCv/Skdq8CZuddwJEybbRq016JLdg9E18JSfsqa0 GqiSx5sA47wpuB99XCJOvwpZNq83whCVIwIq1ezlcpdD9RiEJ9XGOgsvYHSQVqqq NkWHvMMuZma18KKRUNtfS1uZGTQg4mMAmWEN7f4Kd7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=GXn0gC 1iPPCnlDlISItT6RRNXXnrDk/OgtOGlwS1H20=; b=RyVnQn0z2S7CTIqFuBvJmy 0iju98AuZTyENB4KbrhX88yFtNMHMOi9IjJYLcLeMInhNGU0cz6Aq5TZbOTwpMaS 5V4sG7ddSk/h0QQpESZzeieUJYzKm1T3jDoT1FSpcNQGWVYanJpir4vUPbxlRtzs jc23nuokfPHWx4LMS0lO0P3yKyTbq3C8uCFB9Otpc3yl606egdoLj7fjmdqV8KK6 tqwMU/q0dR6/NP8WrMjpE1l6qc0dKpsOnwZDXa+6LN8zU5eu8c/6KvUPr8WyRqLv nEg+EGea7lYMAyLypNT4pREyQhcbJx491qDuA3Poa3ilirAk78NnuK1tAO6VTeeQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrkedtgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkffffg ggjggtsehgtderofdtfeejnecuhfhrohhmpegjuhhrihcurfgrnhhkohhvuceohihurhhi phhvseihuhhrihhpvhdrnhgvtheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgne cukfhppeehrddufeekrdduieehrdejtdenucfrrghrrghmpehmrghilhhfrhhomhephihu rhhiphhvseihuhhrihhpvhdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from odin.yuripv.net (unknown [5.138.165.70]) by mail.messagingengine.com (Postfix) with ESMTPA id 529A6100E5; Sat, 2 Feb 2019 09:28:32 -0500 (EST) Subject: Re: svn commit: r343291 - in head/sys: dev/vmware/vmxnet3 net To: Patrick Kelsey , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901220111.x0M1BHS1025063@repo.freebsd.org> From: Yuri Pankov Openpgp: preference=signencrypt Autocrypt: addr=yuripv@yuripv.net; keydata= mQENBFu8u6IBCADB11gP0QwnorrHjqAtKLHKHNHskhy0s7jqJKfx0YqXgVBKGLJ9/mjLAz0F CBNvemHSDDTs0mEZ9cBKKi6cmsav6+UQgr//yai6hvXLBJqKchSFO4MhmdvBtsGFq1yKz5Zi uhjmimKyIpgBgvMdbgGbGq6cnSB2uEPmZuJr419SVRODOkXukU+F5WHgaHzDdHAIu1asCt2B +6msxqIqlFWcXyZyTGicTGGvC/PFIsVRUtD1dIJANTC876g7DTb7LZXWiWwJpSJ4GKMXMHVX Ct9BoQ4i3nhKbOxb6Io1wsy+NFyWsTJ9KYrxKKPJP3oG8BWb/cqlFqnE4eNSsiq2q7krABEB AAG0H1l1cmkgUGFua292IDx5dXJpcHZAeXVyaXB2Lm5ldD6JAVQEEwEKAD4WIQT4arc+w94t Pi0v/3CTi+B/sSrhbAUCW7y7ogIbAwUJBaOagAULCQgHAwUVCgkICwUWAwIBAAIeAQIXgAAK CRCTi+B/sSrhbJ+ACACqOlkjZ+iP8K8hcwz/G6+c1lVkhuMWL+hxFeE149QuJAXQvkOj/UXO 7jY9HSqFbOYYY44/hujpQCu+/u2dsJ5MAA7TJspWK2zUxtFAzgDp1fRXmCvMlFLdI0yVkKOB JaK+HQP8rBT6yHzGw1KJ6VyOXuuD0Kx02Ou61qjG9/vPRR0jtaxog0rKxpf+yf0UvSM4vb7+ LdY2GQxgfcLcJ8hThR4ElWJAkDsG4CiXixGJuFJ+9dpMK6LHmP6M+NxV4NkzpNddn3Eii8XQ y5spxcLszp8csFBDtAC6BI9sHLhJ9Va1VKpuvSlDsBv4ZtsjnUCIaOiF5MDTYkddSPGGMBck uQENBFu8u6IBCADKih3Q933rDNj4ZA8FhBQ2RlmBgvwOLcDPIL3h0V7h38y3+HisgFScXACD sdrTlYZ1bRXkD9FHENynBcv0l/3uGJDk8jaGIDE0TP8OQBRp+IaU9/BHnAqrKxTJGIolDahy 2m+yx2yhdc6B4ujWMDqCF1rWOD+ymOWw+VLllOkrHcZa5PJtX9UOGbApZl8ZTM8El4CANN8F 1bg9MWzUi+8LYoGWGc+BwsFS1OUB1c4SPgMu5fD4Wfsr9yRl06fdpEA2YT7B/j5/5RSC0sE2 Zs/tmJ/JRflHJ12ycj59ma2xQMfEJF40hZDpMFQmZvbVqgEg3ocQcltjbxlIKZ/mjC4zABEB AAGJATwEGAEKACYWIQT4arc+w94tPi0v/3CTi+B/sSrhbAUCW7y7ogIbDAUJBaOagAAKCRCT i+B/sSrhbIDcCACqAZMcoxUBLZa40a5b24j5i1jplvCYYb3h+Q5lt5+BFJ87kCb4dJuUD3kh 2i29BrxWQWa9WNue9ozxeYkbkfXubQYXexVolRsnh64OdGsE8KvorBFBB3zdK/GRt2Jy+jsn TfUWuQllbzMP0MfhCDMk1Mo8WvDH2/cOEP/yLKf20a+cd6nLs7bidjmGXo9pyuBKAtV6Kv+V Ru54AL+A/UBYu/eB3Dtvzcnut+1Zq6KaP++kUwPwINLIk04OBDwN0zRNTiqMAFYYyz2vZHBB 6E1th/l//ZC5b9Dk0ZpFI1bYdL9ymnrZe1MqbGPnDCToQxu00T/pZCm6Z92YrZQYuNwl Message-ID: <2c0e0179-63e7-1e2f-ba7f-6a373c927d88@yuripv.net> Date: Sat, 2 Feb 2019 17:28:19 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <201901220111.x0M1BHS1025063@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bpQBZQIYS7AWN0y65qoS20LbKYqktKGXw" X-Rspamd-Queue-Id: 6810F89B03 X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yuripv.net header.s=fm1 header.b=OvspbB51; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=RyVnQn0z; spf=pass (mx1.freebsd.org: domain of yuripv@yuripv.net designates 66.111.4.25 as permitted sender) smtp.mailfrom=yuripv@yuripv.net X-Spamd-Result: default: False [-9.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.25]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yuripv.net:+,messagingengine.com:+]; MX_GOOD(-0.01)[in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; SIGNED_PGP(-2.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[70.165.138.5.zen.spamhaus.org : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[25.4.111.66.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[yuripv.net:s=fm1,messagingengine.com:s=fm1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[yuripv.net]; IP_SCORE(-3.53)[ip: (-9.29), ipnet: 66.111.4.0/24(-4.68), asn: 11403(-3.62), country: US(-0.07)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 14:28:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bpQBZQIYS7AWN0y65qoS20LbKYqktKGXw Content-Type: multipart/mixed; boundary="EyxAYSHHKZvMt9FMoxlWYrFwWSc7TjNZB"; protected-headers="v1" From: Yuri Pankov To: Patrick Kelsey , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2c0e0179-63e7-1e2f-ba7f-6a373c927d88@yuripv.net> Subject: Re: svn commit: r343291 - in head/sys: dev/vmware/vmxnet3 net References: <201901220111.x0M1BHS1025063@repo.freebsd.org> In-Reply-To: <201901220111.x0M1BHS1025063@repo.freebsd.org> --EyxAYSHHKZvMt9FMoxlWYrFwWSc7TjNZB Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Patrick Kelsey wrote: > Author: pkelsey > Date: Tue Jan 22 01:11:17 2019 > New Revision: 343291 > URL: https://svnweb.freebsd.org/changeset/base/343291 >=20 > Log: > onvert vmx(4) to being an iflib driver. > =20 > Also, expose IFLIB_MAX_RX_SEGS to iflib drivers and add > iflib_dma_alloc_align() to the iflib API. > =20 > Performance is generally better with the tunable/sysctl > dev.vmx..iflib.tx_abdicate=3D1. > =20 > Reviewed by: shurd > MFC after: 1 week > Relnotes: yes > Sponsored by: RG Nets > Differential Revision: https://reviews.freebsd.org/D18761 This breaks vmx interfaces for me in ESXi 6.7 (output below). The review mentions setting hw.pci.honor_msi_blacklist=3D"0" and it helps indeed -- worth mentioning in UPDATING? vmx0: port 0x3000-0x300f mem 0xfe903000-0xfe903fff,0xfe902000-0xfe902fff,0xfe900000-0xfe901fff at device 0.0 on pci3 vmx0: Using 512 tx descriptors and 256 rx descriptors vmx0: msix_init qsets capped at 8 vmx0: intr CPUs: 20 queue msgs: 24 admincnt: 1 vmx0: Using 8 rx queues 8 tx queues vmx0: attempting to allocate 9 MSI-X vectors (25 supported) vmx0: failed to allocate 9 MSI-X vectors, err: 6 - using MSI vmx0: attempting to allocate 1 MSI vectors (1 supported) msi: routing MSI IRQ 25 to local APIC 6 vector 48 vmx0: using IRQ 25 for MSI vmx0: Using an MSI interrupt msi: Assigning MSI IRQ 25 to local APIC 25 vector 48 msi: Assigning MSI IRQ 25 to local APIC 24 vector 48 vmx0: bpf attached vmx0: Ethernet address: 00:00:00:00:00:33 vmx0: netmap queues/slots: TX 1/512, RX 1/512 vmx0: device enable command failed! vmx0: link state changed to UP vmx0: device enable command failed! --EyxAYSHHKZvMt9FMoxlWYrFwWSc7TjNZB-- --bpQBZQIYS7AWN0y65qoS20LbKYqktKGXw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Gq3PsPeLT4tL/9wk4vgf7Eq4WwFAlxVqQ4ACgkQk4vgf7Eq 4Wx+gwgAhZ8BGqAaxQwCvRjQ8PIxLlaRk3VIVq5GuBUmrm6yp1xSuCbsYsuys/qb v3Ez1COc/iNAeCsQTLESwNfngkTh18U9v1jcM8DWxrRlkzjKfHyEGsuMAB2OhnWY hFelwGXfCfbaA3E0oMgHnbNmT2blRr8Ng+Um3fKZkSPB3vcD6nUFBPgadUArvT+k 2s0SIdrEuy8AV2XIq3W27sEPIiMS5a3y0LHyEjqJ8msehjw9VP/O35hBxiNNvlbG DaJi3IOdvCJwXE3WnGCBMwHclGfZM4WsG/V/TKX7yqNh2QqT9WOLG+w2CgIChO/w c+MRUfrrjHVdp7V/VQfcx0oOcMZgoA== =xDWw -----END PGP SIGNATURE----- --bpQBZQIYS7AWN0y65qoS20LbKYqktKGXw-- From owner-svn-src-head@freebsd.org Sat Feb 2 16:01:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD1B014C1503; Sat, 2 Feb 2019 16:01:17 +0000 (UTC) (envelope-from avos@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 711508C52B; Sat, 2 Feb 2019 16:01:17 +0000 (UTC) (envelope-from avos@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 632CC90EB; Sat, 2 Feb 2019 16:01:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12G1Hgp090058; Sat, 2 Feb 2019 16:01:17 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12G1Hte090057; Sat, 2 Feb 2019 16:01:17 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902021601.x12G1Hte090057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 16:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343679 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 711508C52B 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.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 16:01:18 -0000 Author: avos Date: Sat Feb 2 16:01:16 2019 New Revision: 343679 URL: https://svnweb.freebsd.org/changeset/base/343679 Log: run(4): fix allocated memory type and -Wincompatible-pointer-types compiler warning. PR: 177366 MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Feb 2 05:49:05 2019 (r343678) +++ head/sys/dev/usb/wlan/if_run.c Sat Feb 2 16:01:16 2019 (r343679) @@ -2029,7 +2029,14 @@ run_read_eeprom(struct run_softc *sc) static struct ieee80211_node * run_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { - return malloc(sizeof (struct run_node), M_DEVBUF, M_NOWAIT | M_ZERO); + struct run_node *rn; + + rn = malloc(sizeof (struct run_node), M_80211_NODE, M_NOWAIT | M_ZERO); + + if (rn == NULL) + return (NULL); + + return (&rn->ni); } static int From owner-svn-src-head@freebsd.org Sat Feb 2 16:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCBC414C18F3; Sat, 2 Feb 2019 16:06:07 +0000 (UTC) (envelope-from avos@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 403278C8F0; Sat, 2 Feb 2019 16:06:07 +0000 (UTC) (envelope-from avos@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 2BE829152; Sat, 2 Feb 2019 16:06:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12G67Jv095135; Sat, 2 Feb 2019 16:06:07 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12G67Ld095134; Sat, 2 Feb 2019 16:06:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902021606.x12G67Ld095134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 16:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343680 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 403278C8F0 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.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 16:06:08 -0000 Author: avos Date: Sat Feb 2 16:06:06 2019 New Revision: 343680 URL: https://svnweb.freebsd.org/changeset/base/343680 Log: run(4): revert previous commit; there were no compiler warning (at least, from clang(1)). Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Feb 2 16:01:16 2019 (r343679) +++ head/sys/dev/usb/wlan/if_run.c Sat Feb 2 16:06:06 2019 (r343680) @@ -2029,14 +2029,7 @@ run_read_eeprom(struct run_softc *sc) static struct ieee80211_node * run_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { - struct run_node *rn; - - rn = malloc(sizeof (struct run_node), M_80211_NODE, M_NOWAIT | M_ZERO); - - if (rn == NULL) - return (NULL); - - return (&rn->ni); + return malloc(sizeof (struct run_node), M_DEVBUF, M_NOWAIT | M_ZERO); } static int From owner-svn-src-head@freebsd.org Sat Feb 2 16:07:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 837C514C19FC; Sat, 2 Feb 2019 16:07:57 +0000 (UTC) (envelope-from avos@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 25E128CA9C; Sat, 2 Feb 2019 16:07:57 +0000 (UTC) (envelope-from avos@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 12F3B9153; Sat, 2 Feb 2019 16:07:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12G7uXq095242; Sat, 2 Feb 2019 16:07:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12G7uB9095241; Sat, 2 Feb 2019 16:07:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902021607.x12G7uB9095241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 16:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343681 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25E128CA9C 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.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 16:07:57 -0000 Author: avos Date: Sat Feb 2 16:07:56 2019 New Revision: 343681 URL: https://svnweb.freebsd.org/changeset/base/343681 Log: run(4): fix allocated memory type for ieee80211_node(4). PR: 177366 MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Feb 2 16:06:06 2019 (r343680) +++ head/sys/dev/usb/wlan/if_run.c Sat Feb 2 16:07:56 2019 (r343681) @@ -2029,7 +2029,8 @@ run_read_eeprom(struct run_softc *sc) static struct ieee80211_node * run_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { - return malloc(sizeof (struct run_node), M_DEVBUF, M_NOWAIT | M_ZERO); + return malloc(sizeof (struct run_node), M_80211_NODE, + M_NOWAIT | M_ZERO); } static int From owner-svn-src-head@freebsd.org Sat Feb 2 16:15:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17CCC14C1EB8; Sat, 2 Feb 2019 16:15:47 +0000 (UTC) (envelope-from avos@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 AAC8E8D064; Sat, 2 Feb 2019 16:15:46 +0000 (UTC) (envelope-from avos@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 98BB192F8; Sat, 2 Feb 2019 16:15:46 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12GFkUA000436; Sat, 2 Feb 2019 16:15:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12GFkmQ000435; Sat, 2 Feb 2019 16:15:46 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902021615.x12GFkmQ000435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 16:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343682 - head/sys/dev/wtap X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/wtap X-SVN-Commit-Revision: 343682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AAC8E8D064 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.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 16:15:47 -0000 Author: avos Date: Sat Feb 2 16:15:46 2019 New Revision: 343682 URL: https://svnweb.freebsd.org/changeset/base/343682 Log: sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and drop unneeded cast. MFC after: 3 days Modified: head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681) +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682) @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) destroy_dev(avp->av_dev); callout_stop(&avp->av_swba); ieee80211_vap_detach(vap); - free((struct wtap_vap*) vap, M_80211_VAP); + free(avp, M_80211_VAP); } static void @@ -602,6 +602,8 @@ wtap_node_alloc(struct ieee80211vap *vap, const uint8_ ni = malloc(sizeof(struct ieee80211_node), M_80211_NODE, M_NOWAIT|M_ZERO); + if (ni == NULL) + return (NULL); ni->ni_txrate = 130; return ni; From owner-svn-src-head@freebsd.org Sat Feb 2 16:18:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9ED014C2063; Sat, 2 Feb 2019 16:18:02 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 422D78D255; Sat, 2 Feb 2019 16:18:02 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf1-f53.google.com with SMTP id b20so7265094lfa.12; Sat, 02 Feb 2019 08:18:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=sXPDB4HhryQx/Uz3CC2i+ps3rei7XwooHC2IyZfLSS4=; b=TAnhO1UFAk/qur5Wb3fNDWTMy204oT+IARr0O9vBRz2ZR0h2R7SXVMZ+udmWQ7AdfE n8lYXhwAR/ROLoxnLr5MH5bT/htwVEFo10wrXiyjTXWDt7KyaXQn6oAyfs2hGPR6dZyk UAPFWyd6sQrceHXJddMrNl/486+yZZOrEPqAeUXNFXE7LvMNoyandsMCbFRnRkaFnRs8 LPvszWFKkA1cD5DYI8sR4iKcpY9PC+ojJv1qvjFNQ2IwVXVBuJOfQ5+cXNgAkW6MYSWC o3OkYP3bgk3504go1oNN8ThVURxRO6/z2MW0c5ei6AFyThrbzN8UJvdywCWCIuKxDqYE EEJg== X-Gm-Message-State: AJcUukfvcgVqJLL6el0lsqZQnkGPwknN8bdC86/q5arovzncLBGoTdz+ GwQmCghwfneWrHdXY4aHPhMkcZvg X-Google-Smtp-Source: ALg8bN6YeK4lCW5kgzavGodFTwiK3P8wsWlmDbJ5rdjqvWmyVXOAtW1gXYllmOIy2RSjHpYwN0I1ag== X-Received: by 2002:a19:9b50:: with SMTP id d77mr33379066lfe.137.1549123963197; Sat, 02 Feb 2019 08:12:43 -0800 (PST) Received: from localhost ([37.73.131.213]) by smtp.gmail.com with ESMTPSA id e97-v6sm1879158lji.51.2019.02.02.08.12.42 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 02 Feb 2019 08:12:42 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343681 - head/sys/dev/usb/wlan References: <201902021607.x12G7uB9095241@repo.freebsd.org> Date: Sat, 02 Feb 2019 18:12:02 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201902021607.x12G7uB9095241@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 422D78D255 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 16:18:02 -0000 Sat, 02 Feb 2019 18:07:56 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : > Author: avos > Date: Sat Feb 2 16:07:56 2019 > New Revision: 343681 > URL: https://svnweb.freebsd.org/changeset/base/343681 > > Log: > run(4): fix allocated memory type for ieee80211_node(4). Wrong man page number, it should be ieee80211_node(9) From owner-svn-src-head@freebsd.org Sat Feb 2 16:21:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4078414C23C5; Sat, 2 Feb 2019 16:21:24 +0000 (UTC) (envelope-from avos@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 D86228D5FA; Sat, 2 Feb 2019 16:21:23 +0000 (UTC) (envelope-from avos@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 C9DCF944F; Sat, 2 Feb 2019 16:21:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12GLNnR002506; Sat, 2 Feb 2019 16:21:23 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12GLN6p002505; Sat, 2 Feb 2019 16:21:23 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902021621.x12GLN6p002505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 16:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343683 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 343683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D86228D5FA 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 16:21:24 -0000 Author: avos Date: Sat Feb 2 16:21:23 2019 New Revision: 343683 URL: https://svnweb.freebsd.org/changeset/base/343683 Log: Do not acquire IEEE80211_LOCK twice in cac_timeout(); reuse locked function instead. It is externally visible since r257065. MFC after: 5 days Modified: head/sys/net80211/ieee80211_dfs.c Modified: head/sys/net80211/ieee80211_dfs.c ============================================================================== --- head/sys/net80211/ieee80211_dfs.c Sat Feb 2 16:15:46 2019 (r343682) +++ head/sys/net80211/ieee80211_dfs.c Sat Feb 2 16:21:23 2019 (r343683) @@ -156,8 +156,7 @@ cac_timeout(void *arg) /* XXX clobbers any existing desired channel */ /* NB: dfs->newchan may be NULL, that's ok */ vap->iv_des_chan = dfs->newchan; - /* XXX recursive lock need ieee80211_new_state_locked */ - ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); + ieee80211_new_state_locked(vap, IEEE80211_S_SCAN, 0); } else { if_printf(vap->iv_ifp, "CAC timer on channel %u (%u MHz) expired; " From owner-svn-src-head@freebsd.org Sat Feb 2 16:23:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0910D14C27E1; Sat, 2 Feb 2019 16:23:46 +0000 (UTC) (envelope-from avos@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 9A64C8D9CD; Sat, 2 Feb 2019 16:23:45 +0000 (UTC) (envelope-from avos@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 87A2794A4; Sat, 2 Feb 2019 16:23:45 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12GNjSo005608; Sat, 2 Feb 2019 16:23:45 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12GNjLI005607; Sat, 2 Feb 2019 16:23:45 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201902021623.x12GNjLI005607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 16:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343684 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 343684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A64C8D9CD 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.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 16:23:46 -0000 Author: avos Date: Sat Feb 2 16:23:45 2019 New Revision: 343684 URL: https://svnweb.freebsd.org/changeset/base/343684 Log: Drop unused M_80211_COM malloc(9) type. It is not used since r287197. MFC after: 3 days Modified: head/sys/net80211/ieee80211_freebsd.c Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sat Feb 2 16:21:23 2019 (r343683) +++ head/sys/net80211/ieee80211_freebsd.c Sat Feb 2 16:23:45 2019 (r343684) @@ -68,8 +68,6 @@ SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ie 0, "debugging printfs"); #endif -static MALLOC_DEFINE(M_80211_COM, "80211com", "802.11 com state"); - static const char wlanname[] = "wlan"; static struct if_clone *wlan_cloner; From owner-svn-src-head@freebsd.org Sat Feb 2 17:26:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B6F14C4635; Sat, 2 Feb 2019 17:26:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C25458FCEB; Sat, 2 Feb 2019 17:26:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x12HPu8W028465; Sat, 2 Feb 2019 09:25:56 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x12HPuD2028464; Sat, 2 Feb 2019 09:25:56 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902021725.x12HPuD2028464@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343682 - head/sys/dev/wtap In-Reply-To: <201902021615.x12GFkmQ000435@repo.freebsd.org> To: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 09:25:56 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C25458FCEB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.936,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 17:26:06 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: avos > Date: Sat Feb 2 16:15:46 2019 > New Revision: 343682 > URL: https://svnweb.freebsd.org/changeset/base/343682 > > Log: > sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and > drop unneeded cast. > > MFC after: 3 days > > Modified: > head/sys/dev/wtap/if_wtap.c > > Modified: head/sys/dev/wtap/if_wtap.c > ============================================================================== > --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681) > +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682) > @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) > destroy_dev(avp->av_dev); > callout_stop(&avp->av_swba); > ieee80211_vap_detach(vap); > - free((struct wtap_vap*) vap, M_80211_VAP); > + free(avp, M_80211_VAP); First one crees vap, second one frees avp, is that a typo, or intended change? > } > > static void > @@ -602,6 +602,8 @@ wtap_node_alloc(struct ieee80211vap *vap, const uint8_ > > ni = malloc(sizeof(struct ieee80211_node), M_80211_NODE, > M_NOWAIT|M_ZERO); > + if (ni == NULL) > + return (NULL); > > ni->ni_txrate = 130; > return ni; > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Feb 2 17:30:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4690114C491C; Sat, 2 Feb 2019 17:30:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDD558FFE7; Sat, 2 Feb 2019 17:30:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x12HUrCZ028482; Sat, 2 Feb 2019 09:30:53 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x12HUrcO028481; Sat, 2 Feb 2019 09:30:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902021730.x12HUrcO028481@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343682 - head/sys/dev/wtap In-Reply-To: <201902021615.x12GFkmQ000435@repo.freebsd.org> To: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 09:30:53 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: BDD558FFE7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 17:30:57 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: avos > Date: Sat Feb 2 16:15:46 2019 > New Revision: 343682 > URL: https://svnweb.freebsd.org/changeset/base/343682 > > Log: > sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and > drop unneeded cast. > > MFC after: 3 days > > Modified: > head/sys/dev/wtap/if_wtap.c > > Modified: head/sys/dev/wtap/if_wtap.c > ============================================================================== > --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681) > +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682) > @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) > destroy_dev(avp->av_dev); > callout_stop(&avp->av_swba); > ieee80211_vap_detach(vap); > - free((struct wtap_vap*) vap, M_80211_VAP); > + free(avp, M_80211_VAP); > } > > static void > @@ -602,6 +602,8 @@ wtap_node_alloc(struct ieee80211vap *vap, const uint8_ > > ni = malloc(sizeof(struct ieee80211_node), M_80211_NODE, > M_NOWAIT|M_ZERO); > + if (ni == NULL) > + return (NULL); > > ni->ni_txrate = 130; > return ni; Um, this simplifies to and preserves single return: if (ni != NULL) ni->ni_txrate = 130; return ni; -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Feb 2 17:31:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 080D114C49EC; Sat, 2 Feb 2019 17:31:20 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC2C90141; Sat, 2 Feb 2019 17:31:14 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf1-f54.google.com with SMTP id l10so7362642lfh.9; Sat, 02 Feb 2019 09:31:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=BBYz8NvWrtlkxik9xiUzZEVqsADknzHSy41JZ6nxwmg=; b=oWFqBzwFgUz1hkIUd+QuSPY/ml9/fwTcD3FRYXI7XrGMrqGszbIcUj93jcNmf9NolM DE6I7hAuDj8WlmzWLiiAGAwYvxc3SQwoDdLtBYJkS9ZtCYAqKSqYy8bniBVty6wltvOG ZmIU/n146p+GyDurRvcGtNwIzuiTauX8mqql7de2muCMJL7Y4fcpkvD3rCy2kmM8Zw0J N4QGv5Q6ZLafrqhOAP3FZqTZOk2SoCakNoE6gBNIcqaVzbEmOVtFcuI3mxj/SWoQgUdc 1sEbsuVDSP4rvqo595NE5EI0zIMeHJ7qbHTPiwZ+xHZc+dwpGRtSm/a1j0Rbau8xkjy1 sRLw== X-Gm-Message-State: AJcUukeFgQ8jEXdan2ujIFGZEj4hMdjLZ+cl2lmgS8y81oJY6Xhob28K yQz0jNz+W9iuJjcApK5kTJEEn0R5CWs= X-Google-Smtp-Source: ALg8bN5wemLPqlFJyPpq0CwevpOEJltnFuPv9TZvBECgF0GKfPH11vOfa9vjqEOoAd2u0TldiH9LaQ== X-Received: by 2002:a19:5510:: with SMTP id n16mr27345807lfe.68.1549128669985; Sat, 02 Feb 2019 09:31:09 -0800 (PST) Received: from localhost ([37.73.131.213]) by smtp.gmail.com with ESMTPSA id m63-v6sm2088988lje.81.2019.02.02.09.31.08 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 02 Feb 2019 09:31:09 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Rodney W. Grimes" , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343682 - head/sys/dev/wtap References: <201902021725.x12HPuD2028464@pdx.rh.CN85.dnsmgr.net> Date: Sat, 02 Feb 2019 19:30:23 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201902021725.x12HPuD2028464@pdx.rh.CN85.dnsmgr.net> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 6CC2C90141 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 17:31:20 -0000 Sat, 02 Feb 2019 19:25:56 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Rodney W. Grimes = : > [ Charset UTF-8 unsupported, converting... ] >> Author: avos >> Date: Sat Feb 2 16:15:46 2019 >> New Revision: 343682 >> URL: https://svnweb.freebsd.org/changeset/base/343682 >> >> Log: >> sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and >> drop unneeded cast. >> >> MFC after: 3 days >> >> Modified: >> head/sys/dev/wtap/if_wtap.c >> >> Modified: head/sys/dev/wtap/if_wtap.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681) >> +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682) >> @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) >> destroy_dev(avp->av_dev); >> callout_stop(&avp->av_swba); >> ieee80211_vap_detach(vap); >> - free((struct wtap_vap*) vap, M_80211_VAP); >> + free(avp, M_80211_VAP); > > First one crees vap, second one frees avp, is that a typo, or intended= = > change? ieee80211_vap_detach() will not free the vap, it will free only some (internal) vap structures. From owner-svn-src-head@freebsd.org Sat Feb 2 17:43:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A29E14C59EE; Sat, 2 Feb 2019 17:43:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19EF99138A; Sat, 2 Feb 2019 17:43:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x12HhVWT028586; Sat, 2 Feb 2019 09:43:31 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x12HhVRH028585; Sat, 2 Feb 2019 09:43:31 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902021743.x12HhVRH028585@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343682 - head/sys/dev/wtap In-Reply-To: To: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 09:43:31 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 19EF99138A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 17:43:33 -0000 > Sat, 02 Feb 2019 19:25:56 +0200 ???? ???????? Rodney W. Grimes > : > > >> Author: avos > >> Date: Sat Feb 2 16:15:46 2019 > >> New Revision: 343682 > >> URL: https://svnweb.freebsd.org/changeset/base/343682 > >> > >> Log: > >> sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and > >> drop unneeded cast. > >> > >> MFC after: 3 days > >> > >> Modified: > >> head/sys/dev/wtap/if_wtap.c > >> > >> Modified: head/sys/dev/wtap/if_wtap.c > >> ============================================================================== > >> --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681) > >> +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682) > >> @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) > >> destroy_dev(avp->av_dev); > >> callout_stop(&avp->av_swba); > >> ieee80211_vap_detach(vap); > >> - free((struct wtap_vap*) vap, M_80211_VAP); > >> + free(avp, M_80211_VAP); > > > > First one crees vap, second one frees avp, is that a typo, or intended > > change? > > ieee80211_vap_detach() will not free the vap, it will free only some > (internal) vap structures. Your commit message only states "drop unneeded cast", it does not mention the function change of no longering freeing vap. Also this is in routine wtap_vap_delete, which I would expect to free all things in the vap, and then free the vap. Why is a delete function only freeing "some (internal) vap structures?" -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Feb 2 17:54:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8099D14C5E90; Sat, 2 Feb 2019 17:54:22 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECCD79197D; Sat, 2 Feb 2019 17:54:21 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f175.google.com with SMTP id k15-v6so8473402ljc.8; Sat, 02 Feb 2019 09:54:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=9t1c6HLrKw4KELTd4+bCXhXQSz5uhnuSNYu9U/49x9U=; b=MTkh5W2950RV0G91xkCJGEp2OgHsK0hATwdMblammigu5DVPohI4k+B2cmPD7frwvw Uq8wNJcJ9R8yqrheiycBMaEHNDcYZDNmLllCSGS0Oqen5EQ/PwERwQJ2UDAsC/G+8kH6 Yh8sQXJ6BgVzucUCOsFYxirbK6aLGFm6hZctvX+xh+kltd2urICvxLGN0EQLe3A0z5He Z9ETkKJrOM/95BfA5PK88PA7rbJIPredhDRwWSSrf7uussMyuL0fox/DkP9liU3UKrGv 19NvF5ys7+kf3swjdaGC6Wa0iRQVaqEJ/JhqPhhFHe9gO2Si6G821tf9Ag17SV5P9GpM Do2w== X-Gm-Message-State: AJcUukdO0OCRs2lbDRNVht+JZAmuZkvhkBaPHHnSK3h9gPlAxeeKfB7J BvZ0/fsG3xB7L58zhWtJTbM= X-Google-Smtp-Source: ALg8bN7gUDICzjvJcmd2FPdLPp4km1DbNNVwUT0dpauQ41zEStQ6BcvZ6UB20R/aFonXMIShFs3IDg== X-Received: by 2002:a2e:5054:: with SMTP id v20-v6mr35876521ljd.45.1549129604680; Sat, 02 Feb 2019 09:46:44 -0800 (PST) Received: from localhost ([37.73.131.213]) by smtp.gmail.com with ESMTPSA id p67sm2027204lfe.14.2019.02.02.09.46.43 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 02 Feb 2019 09:46:44 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Rodney W. Grimes" , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343682 - head/sys/dev/wtap References: <201902021743.x12HhVRH028585@pdx.rh.CN85.dnsmgr.net> Date: Sat, 02 Feb 2019 19:45:57 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201902021743.x12HhVRH028585@pdx.rh.CN85.dnsmgr.net> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: ECCD79197D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 17:54:22 -0000 Sat, 02 Feb 2019 19:43:31 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Rodney W. Grimes = : >> Sat, 02 Feb 2019 19:25:56 +0200 ???? ???????? Rodney W. Grimes >> : >> >> >> Author: avos >> >> Date: Sat Feb 2 16:15:46 2019 >> >> New Revision: 343682 >> >> URL: https://svnweb.freebsd.org/changeset/base/343682 >> >> >> >> Log: >> >> sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and >> >> drop unneeded cast. >> >> >> >> MFC after: 3 days >> >> >> >> Modified: >> >> head/sys/dev/wtap/if_wtap.c >> >> >> >> Modified: head/sys/dev/wtap/if_wtap.c >> >> = >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> >> --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681)= >> >> +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682)= >> >> @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) >> >> destroy_dev(avp->av_dev); >> >> callout_stop(&avp->av_swba); >> >> ieee80211_vap_detach(vap); >> >> - free((struct wtap_vap*) vap, M_80211_VAP); >> >> + free(avp, M_80211_VAP); >> > >> > First one crees vap, second one frees avp, is that a typo, or inten= ded >> > change? >> >> ieee80211_vap_detach() will not free the vap, it will free only some >> (internal) vap structures. > > Your commit message only states "drop unneeded cast", > it does not mention the function change of no longering freeing vap. Ah, I see where things are getting confused; actually, avp =3D=3D vap: if_wtapvar.h: #define WTAP_VAP(vap) ((struct wtap_vap *)(vap)) and the start of the function: struct wtap_vap *avp =3D WTAP_VAP(vap); From owner-svn-src-head@freebsd.org Sat Feb 2 17:56:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7186F14C5FF9; Sat, 2 Feb 2019 17:56:06 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0037A91BFA; Sat, 2 Feb 2019 17:56:05 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf1-f54.google.com with SMTP id p6so7442419lfc.1; Sat, 02 Feb 2019 09:56:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=ilk79F/N7koU9N6mi6CTWPZsK21E7IeX3Kk5O+Ksjj0=; b=ZvthyiWd66l/UCbZZ2qtFaQ+WWUqAh6RLYewo57f4PpI5MC18utMLswejXmCnohDbD jWoP/v/8ByqbtDQdgt79KFeSLaGzpjw5eReBPypzm54mWPNsK1Z1sLPPHJbz4j+PlOy5 umdGv8F+ZoyUgzZSJI0Y61KgHIi7QhnvordxMRyP2wFd/gYTbvvkB5XxrKdnmJbgcMMq LKlpeI54A6kjNmVPdlnQ9mqUXzhMSbd8qayMqk5dcWGJlC4UjpvbXaU7xZLsSLiWESP7 JT1vINsDvK4jkPONVTxVI5RORAlZd4s20/SHnT1QY2vNhBfQWHvJL0eb3ZyqfPRkpE1f aAvw== X-Gm-Message-State: AHQUAuZ4m9QGpZTdMy5TYt3H2qXRipXsb5PCagZEURUsGpX8DdZVtFAT /14s+4XaQ9wpOkeFbPkB7ww= X-Google-Smtp-Source: AHgI3IbQ/6ik/NjGE2jF8kiSjkG2X+eyLtoZrJjLlH1Y0Stc4EVA+42WA+Mjefva+4Yn4PndKxBheg== X-Received: by 2002:ac2:550e:: with SMTP id j14mr7738278lfk.110.1549129694796; Sat, 02 Feb 2019 09:48:14 -0800 (PST) Received: from localhost ([37.73.131.213]) by smtp.gmail.com with ESMTPSA id m12sm2028946lfc.30.2019.02.02.09.48.13 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 02 Feb 2019 09:48:14 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Rodney W. Grimes" , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343682 - head/sys/dev/wtap References: <201902021730.x12HUrcO028481@pdx.rh.CN85.dnsmgr.net> Date: Sat, 02 Feb 2019 19:47:33 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201902021730.x12HUrcO028481@pdx.rh.CN85.dnsmgr.net> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 0037A91BFA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 17:56:06 -0000 Sat, 02 Feb 2019 19:30:53 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Rodney W. Grimes = : > [ Charset UTF-8 unsupported, converting... ] >> Author: avos >> Date: Sat Feb 2 16:15:46 2019 >> New Revision: 343682 >> URL: https://svnweb.freebsd.org/changeset/base/343682 >> >> Log: >> sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and >> drop unneeded cast. >> >> MFC after: 3 days >> >> Modified: >> head/sys/dev/wtap/if_wtap.c >> >> Modified: head/sys/dev/wtap/if_wtap.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681) >> +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682) >> @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) >> destroy_dev(avp->av_dev); >> callout_stop(&avp->av_swba); >> ieee80211_vap_detach(vap); >> - free((struct wtap_vap*) vap, M_80211_VAP); >> + free(avp, M_80211_VAP); >> } >> >> static void >> @@ -602,6 +602,8 @@ wtap_node_alloc(struct ieee80211vap *vap, const = >> uint8_ >> >> ni =3D malloc(sizeof(struct ieee80211_node), M_80211_NODE, >> M_NOWAIT|M_ZERO); >> + if (ni =3D=3D NULL) >> + return (NULL); >> >> ni->ni_txrate =3D 130; >> return ni; > > Um, this simplifies to and preserves single return: > > if (ni !=3D NULL) > ni->ni_txrate =3D 130; > return ni; Yes, but code style for this function is just the same across all wireless drivers and ieee80211_node(4) man page; also, it clearly shows the main code path. From owner-svn-src-head@freebsd.org Sat Feb 2 20:29:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F76D14CE663; Sat, 2 Feb 2019 20:29:30 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF01096AAA; Sat, 2 Feb 2019 20:29:29 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-pl1-f179.google.com with SMTP id u6so4954879plm.8; Sat, 02 Feb 2019 12:29:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JTRq8g944PxpiBoPyMUQAuILltD0cX5ZfuI3CyEI7xc=; b=KrPHFHT6AIVMyAZBvAj8BCL/RkGOW5EV+O77A6UDG9GTVERP4sff+k6tgnBTx70uM9 b9HFn+oLpStoipnEBJFVUrBEJQidXhlIwNDicDw4F+9FnHAh15xEGw5UrkPom99mxNn3 2GbRpt9+kiiBMUi072L8UQhgalH47kdW7OJgKXgZwQPIQvrV+sxrsld6eS9zdwxoM+0z vz5IVs2AHrxX2QujfuLo99yK7dhvyVLClJ3p9NstQbJm9p4MVNhCN6ODxxaknmZUFykt xp8TZ9acLeAYvABIf2o5hlTpRfRKenUXnNGP4P2NdQd5YroKNIbKVbjPotQKtPhDMDJU HgSA== X-Gm-Message-State: AJcUukfwX/Km9g93QrpxvAaSS+EAeF8jT/M1oNpLG45Kq5SayG0t1vLk 8humlCEVXtzWA3vWEgoUt3dIVonvf/9hdx4mElmma9ZI X-Google-Smtp-Source: ALg8bN5xo5Pc6VFkhHZNMu1OYcCGsV4kf5vHzoavuXEPsYxaR4Vc/v1wV7q9Oq5n4Zw1NRZBLUMTBxutHsudhBbEHWY= X-Received: by 2002:a17:902:128c:: with SMTP id g12mr43286482pla.146.1549139362797; Sat, 02 Feb 2019 12:29:22 -0800 (PST) MIME-Version: 1.0 References: <201901220111.x0M1BHS1025063@repo.freebsd.org> <2c0e0179-63e7-1e2f-ba7f-6a373c927d88@yuripv.net> In-Reply-To: <2c0e0179-63e7-1e2f-ba7f-6a373c927d88@yuripv.net> From: Patrick Kelsey Date: Sat, 2 Feb 2019 15:29:09 -0500 Message-ID: Subject: Re: svn commit: r343291 - in head/sys: dev/vmware/vmxnet3 net To: Yuri Pankov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: DF01096AAA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.85 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.85)[-0.851,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 20:29:30 -0000 On Sat, Feb 2, 2019 at 9:28 AM Yuri Pankov wrote: > Patrick Kelsey wrote: > > Author: pkelsey > > Date: Tue Jan 22 01:11:17 2019 > > New Revision: 343291 > > URL: https://svnweb.freebsd.org/changeset/base/343291 > > > > Log: > > onvert vmx(4) to being an iflib driver. > > > > Also, expose IFLIB_MAX_RX_SEGS to iflib drivers and add > > iflib_dma_alloc_align() to the iflib API. > > > > Performance is generally better with the tunable/sysctl > > dev.vmx..iflib.tx_abdicate=1. > > > > Reviewed by: shurd > > MFC after: 1 week > > Relnotes: yes > > Sponsored by: RG Nets > > Differential Revision: https://reviews.freebsd.org/D18761 > > This breaks vmx interfaces for me in ESXi 6.7 (output below). The > review mentions setting hw.pci.honor_msi_blacklist="0" and it helps > indeed -- worth mentioning in UPDATING? > > vmx0: port 0x3000-0x300f mem > 0xfe903000-0xfe903fff,0xfe902000-0xfe902fff,0xfe900000-0xfe901fff at > device 0.0 on pci3 > vmx0: Using 512 tx descriptors and 256 rx descriptors > vmx0: msix_init qsets capped at 8 > vmx0: intr CPUs: 20 queue msgs: 24 admincnt: 1 > vmx0: Using 8 rx queues 8 tx queues > vmx0: attempting to allocate 9 MSI-X vectors (25 supported) > vmx0: failed to allocate 9 MSI-X vectors, err: 6 - using MSI > vmx0: attempting to allocate 1 MSI vectors (1 supported) > msi: routing MSI IRQ 25 to local APIC 6 vector 48 > vmx0: using IRQ 25 for MSI > vmx0: Using an MSI interrupt > msi: Assigning MSI IRQ 25 to local APIC 25 vector 48 > msi: Assigning MSI IRQ 25 to local APIC 24 vector 48 > vmx0: bpf attached > vmx0: Ethernet address: 00:00:00:00:00:33 > vmx0: netmap queues/slots: TX 1/512, RX 1/512 > vmx0: device enable command failed! > vmx0: link state changed to UP > vmx0: device enable command failed! > > Setting hw.pci.honor_msi_blacklist="0" should only be necessary if you want to operate with more than one queue. If hw.pci.honor_msi_blacklist="0" is not set, then MSI-X will not be available, and MSI will be used, which reduces the number of queues that can be configured for use to 1. This case should work correctly. I am able to reproduce the behavior you described above on ESXi 6.7 using the latest snapshot release (based on r343598). The error that appears in the ESXi logs will be similar to: 2019-02-02T15:14:02.986Z| vcpu-1| I125: VMXNET3 user: failed to activate 'Ethernet0', status: 0xbad0001 which vaguely means 'the device did not like something about the configuration it was given'. I will see if I can determine the root cause. Given that enabling MSI-X seems to work around the problem, and based on other issues I encountered during development, I currently suspect there is a problem with the interrupt index that is being configured for the transmit queue in the device configuration structure when using MSI. -Patrick From owner-svn-src-head@freebsd.org Sat Feb 2 21:14:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC80114CFD72; Sat, 2 Feb 2019 21:14:54 +0000 (UTC) (envelope-from pkelsey@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 61A4669C38; Sat, 2 Feb 2019 21:14:54 +0000 (UTC) (envelope-from pkelsey@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 50CA4C85C; Sat, 2 Feb 2019 21:14:54 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x12LEsQ2058822; Sat, 2 Feb 2019 21:14:54 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12LEsE8058821; Sat, 2 Feb 2019 21:14:54 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201902022114.x12LEsE8058821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sat, 2 Feb 2019 21:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343688 - head/sys/dev/vmware/vmxnet3 X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/dev/vmware/vmxnet3 X-SVN-Commit-Revision: 343688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61A4669C38 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 21:14:55 -0000 Author: pkelsey Date: Sat Feb 2 21:14:53 2019 New Revision: 343688 URL: https://svnweb.freebsd.org/changeset/base/343688 Log: Fix interrupt index configuratoin when using MSI interrupts. When in MSI mode, the device was only being configured with one interrupt index, but it needs two - one for the actual interrupt and one to park the tx queue at. Also clarified comments relating to interrupt index assignment. Reported by: Yuri Pankov MFC after: 1 day Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Sat Feb 2 17:42:17 2019 (r343687) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Sat Feb 2 21:14:53 2019 (r343688) @@ -676,14 +676,16 @@ vmxnet3_set_interrupt_idx(struct vmxnet3_softc *sc) scctx = sc->vmx_scctx; /* - * There is either one interrupt, or there is one interrupt per - * receive queue. If there is one interrupt, then all interrupt - * indexes are zero. If there is one interrupt per receive queue, - * the transmit queue interrupt indexes are assigned the receive - * queue interrupt indexesin round-robin fashion. - * - * The event interrupt is always the last interrupt index. + * There is always one interrupt per receive queue, assigned + * starting with the first interrupt. When there is only one + * interrupt available, the event interrupt shares the receive queue + * interrupt, otherwise it uses the interrupt following the last + * receive queue interrupt. Transmit queues are not assigned + * interrupts, so they are given indexes beyond the indexes that + * correspond to the real interrupts. */ + + /* The event interrupt is always the last vector. */ sc->vmx_event_intr_idx = scctx->isc_vectors - 1; intr_idx = 0; @@ -1073,14 +1075,14 @@ vmxnet3_init_shared_data(struct vmxnet3_softc *sc) ds->automask = sc->vmx_intr_mask_mode == VMXNET3_IMM_AUTO; /* * Total number of interrupt indexes we are using in the shared - * config data, even though we don't actually allocate MSI-X + * config data, even though we don't actually allocate interrupt * resources for the tx queues. Some versions of the device will * fail to initialize successfully if interrupt indexes are used in * the shared config that exceed the number of interrupts configured * here. */ ds->nintr = (scctx->isc_vectors == 1) ? - 1 : (scctx->isc_nrxqsets + scctx->isc_ntxqsets + 1); + 2 : (scctx->isc_nrxqsets + scctx->isc_ntxqsets + 1); ds->evintr = sc->vmx_event_intr_idx; ds->ictrl = VMXNET3_ICTRL_DISABLE_ALL; From owner-svn-src-head@freebsd.org Sat Feb 2 21:17:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72C3A14CFF14; Sat, 2 Feb 2019 21:17:24 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAAEB6A04F; Sat, 2 Feb 2019 21:17:23 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: by mail-pg1-f179.google.com with SMTP id v28so4578029pgk.10; Sat, 02 Feb 2019 13:17:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l3e8BTip52CWEQ/8GXygkVdw8/Ufvsg1NRNm0nj2SpQ=; b=o+GwH94PdMxAvQT7sDFpPfs7xmaio7ZzEkuiQSjSrghu0Az+YvjCSiOkwwcjTmOyxj VpIjspAeygL6P8F1CcYPSf4IyHruX/hRtvA9W8ZfLFefdZdK73EBIF7UreaYfFlwUVET cUETblYhf2adfzpG6Xs8oAz1Z9cf0NzAeahHjnNwfmMyawcXPCEbtIpWjjb7je3GwCuE V1YxuLLK07iLH9iqTqCWyXa1gx/0osVCJNMfaFxHYklGdRO3Tz0kzhYg49+qvS2fYdod /+LQytG3An+wOvc4hUY03X/K4j3WAexRNKeD3tLg8E+OEQzeANRZVCAYd7r/WzeKGiDu +Sdw== X-Gm-Message-State: AJcUukcQW6tV6hpkQBC2AGrjcif0vghWAXCDWYgWWbSnM25FJTSsD45U zC63sIx0Nxufd81xm49lFHVP+KGEGY0DM4l7sb1P6Y3g X-Google-Smtp-Source: ALg8bN4U0c3gJILpJi11yl/EXLGXS/7Afi2Q6t6u98fLvuG8Kmgk+HTBWuPONj+GEcw+FtQvQfTPmAfElMGetpPPPIs= X-Received: by 2002:a62:28c9:: with SMTP id o192mr45792715pfo.57.1549142236634; Sat, 02 Feb 2019 13:17:16 -0800 (PST) MIME-Version: 1.0 References: <201901220111.x0M1BHS1025063@repo.freebsd.org> <2c0e0179-63e7-1e2f-ba7f-6a373c927d88@yuripv.net> In-Reply-To: From: Patrick Kelsey Date: Sat, 2 Feb 2019 16:17:03 -0500 Message-ID: Subject: Re: svn commit: r343291 - in head/sys: dev/vmware/vmxnet3 net To: Yuri Pankov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: EAAEB6A04F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.86 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.86)[-0.857,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 21:17:24 -0000 On Sat, Feb 2, 2019 at 3:29 PM Patrick Kelsey wrote: > > > On Sat, Feb 2, 2019 at 9:28 AM Yuri Pankov wrote: > >> Patrick Kelsey wrote: >> > Author: pkelsey >> > Date: Tue Jan 22 01:11:17 2019 >> > New Revision: 343291 >> > URL: https://svnweb.freebsd.org/changeset/base/343291 >> > >> > Log: >> > onvert vmx(4) to being an iflib driver. >> > >> > Also, expose IFLIB_MAX_RX_SEGS to iflib drivers and add >> > iflib_dma_alloc_align() to the iflib API. >> > >> > Performance is generally better with the tunable/sysctl >> > dev.vmx..iflib.tx_abdicate=1. >> > >> > Reviewed by: shurd >> > MFC after: 1 week >> > Relnotes: yes >> > Sponsored by: RG Nets >> > Differential Revision: https://reviews.freebsd.org/D18761 >> >> This breaks vmx interfaces for me in ESXi 6.7 (output below). The >> review mentions setting hw.pci.honor_msi_blacklist="0" and it helps >> indeed -- worth mentioning in UPDATING? >> >> vmx0: port 0x3000-0x300f mem >> 0xfe903000-0xfe903fff,0xfe902000-0xfe902fff,0xfe900000-0xfe901fff at >> device 0.0 on pci3 >> vmx0: Using 512 tx descriptors and 256 rx descriptors >> vmx0: msix_init qsets capped at 8 >> vmx0: intr CPUs: 20 queue msgs: 24 admincnt: 1 >> vmx0: Using 8 rx queues 8 tx queues >> vmx0: attempting to allocate 9 MSI-X vectors (25 supported) >> vmx0: failed to allocate 9 MSI-X vectors, err: 6 - using MSI >> vmx0: attempting to allocate 1 MSI vectors (1 supported) >> msi: routing MSI IRQ 25 to local APIC 6 vector 48 >> vmx0: using IRQ 25 for MSI >> vmx0: Using an MSI interrupt >> msi: Assigning MSI IRQ 25 to local APIC 25 vector 48 >> msi: Assigning MSI IRQ 25 to local APIC 24 vector 48 >> vmx0: bpf attached >> vmx0: Ethernet address: 00:00:00:00:00:33 >> vmx0: netmap queues/slots: TX 1/512, RX 1/512 >> vmx0: device enable command failed! >> vmx0: link state changed to UP >> vmx0: device enable command failed! >> >> > Setting hw.pci.honor_msi_blacklist="0" should only be necessary if you > want to operate with more than one queue. If > hw.pci.honor_msi_blacklist="0" is not set, then MSI-X will not be > available, and MSI will be used, which reduces the number of queues that > can be configured for use to 1. This case should work correctly. > > I am able to reproduce the behavior you described above on ESXi 6.7 using > the latest snapshot release (based on r343598). The error that appears in > the ESXi logs will be similar to: > > 2019-02-02T15:14:02.986Z| vcpu-1| I125: VMXNET3 user: failed to activate > 'Ethernet0', status: 0xbad0001 > > which vaguely means 'the device did not like something about the > configuration it was given'. I will see if I can determine the root > cause. Given that enabling MSI-X seems to work around the problem, and > based on other issues I encountered during development, I currently suspect > there is a problem with the interrupt index that is being configured for > the transmit queue in the device configuration structure when using MSI. > > Indeed, the interrupt index for the tx queue in MSI mode was the problem. This is now fixed in r343688 ( https://svnweb.freebsd.org/changeset/base/343688). Thanks for reporting the issue! -Patrick From owner-svn-src-head@freebsd.org Sat Feb 2 22:39:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0DB114D278C; Sat, 2 Feb 2019 22:39:30 +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 684AA6DFDC; Sat, 2 Feb 2019 22:39:30 +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 3A2F6D644; Sat, 2 Feb 2019 22:39:30 +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 x12MdUMR004025; Sat, 2 Feb 2019 22:39:30 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x12MdTtV004020; Sat, 2 Feb 2019 22:39:29 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201902022239.x12MdTtV004020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 2 Feb 2019 22:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343689 - in head/sys: dev/netmap net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: dev/netmap net X-SVN-Commit-Revision: 343689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 684AA6DFDC 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.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 22:39:31 -0000 Author: vmaffione Date: Sat Feb 2 22:39:29 2019 New Revision: 343689 URL: https://svnweb.freebsd.org/changeset/base/343689 Log: netmap: upgrade sync-kloop support Add SYNC_KLOOP_MODE option, and add support for direct mode, where application executes the TXSYNC and RXSYNC in the context of the ioeventfd wake up callback. MFC after: 5 days Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_kloop.c head/sys/net/netmap.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sat Feb 2 21:14:53 2019 (r343688) +++ head/sys/dev/netmap/netmap.c Sat Feb 2 22:39:29 2019 (r343689) @@ -2971,6 +2971,9 @@ nmreq_opt_size_by_type(uint32_t nro_reqtype, uint64_t case NETMAP_REQ_OPT_CSB: rv = sizeof(struct nmreq_opt_csb); break; + case NETMAP_REQ_OPT_SYNC_KLOOP_MODE: + rv = sizeof(struct nmreq_opt_sync_kloop_mode); + break; } /* subtract the common header */ return rv - sizeof(struct nmreq_option); @@ -3287,10 +3290,8 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM * there are pending packets to send. The latter can be disabled * passing NETMAP_NO_TX_POLL in the NIOCREG call. */ - si[NR_RX] = nm_si_user(priv, NR_RX) ? &na->si[NR_RX] : - &na->rx_rings[priv->np_qfirst[NR_RX]]->si; - si[NR_TX] = nm_si_user(priv, NR_TX) ? &na->si[NR_TX] : - &na->tx_rings[priv->np_qfirst[NR_TX]]->si; + si[NR_RX] = priv->np_si[NR_RX]; + si[NR_TX] = priv->np_si[NR_TX]; #ifdef __FreeBSD__ /* Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Sat Feb 2 21:14:53 2019 (r343688) +++ head/sys/dev/netmap/netmap_kern.h Sat Feb 2 22:39:29 2019 (r343689) @@ -1169,6 +1169,15 @@ nm_kr_txempty(struct netmap_kring *kring) * rxsync_prologue */ #define nm_kr_rxempty(_k) nm_kr_txempty(_k) +/* True if the application needs to wait for more space on the ring + * (more received packets or more free tx slots). + * Only valid after *xsync_prologue. */ +static inline int +nm_kr_wouldblock(struct netmap_kring *kring) +{ + return kring->rcur == kring->nr_hwtail; +} + /* * protect against multiple threads using the same ring. * also check that the ring has not been stopped or locked Modified: head/sys/dev/netmap/netmap_kloop.c ============================================================================== --- head/sys/dev/netmap/netmap_kloop.c Sat Feb 2 21:14:53 2019 (r343688) +++ head/sys/dev/netmap/netmap_kloop.c Sat Feb 2 22:39:29 2019 (r343689) @@ -141,6 +141,9 @@ sync_kloop_kring_dump(const char *title, const struct kring->rcur, kring->rtail, kring->nr_hwtail); } +/* Arguments for netmap_sync_kloop_tx_ring() and + * netmap_sync_kloop_rx_ring(). + */ struct sync_kloop_ring_args { struct netmap_kring *kring; struct nm_csb_atok *csb_atok; @@ -148,6 +151,10 @@ struct sync_kloop_ring_args { #ifdef SYNC_KLOOP_POLL struct eventfd_ctx *irq_ctx; #endif /* SYNC_KLOOP_POLL */ + /* Are we busy waiting rather than using a schedule() loop ? */ + bool busy_wait; + /* Are we processing in the context of VM exit ? */ + bool direct; }; static void @@ -161,10 +168,16 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring uint32_t num_slots; int batch; + if (unlikely(nm_kr_tryget(kring, 1, NULL))) { + return; + } + num_slots = kring->nkr_num_slots; /* Disable application --> kernel notifications. */ - csb_ktoa_kick_enable(csb_ktoa, 0); + if (!a->direct) { + csb_ktoa_kick_enable(csb_ktoa, 0); + } /* Copy the application kring pointers from the CSB */ sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); @@ -197,7 +210,9 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring if (unlikely(nm_txsync_prologue(kring, &shadow_ring) >= num_slots)) { /* Reinit ring and enable notifications. */ netmap_ring_reinit(kring); - csb_ktoa_kick_enable(csb_ktoa, 1); + if (!a->busy_wait) { + csb_ktoa_kick_enable(csb_ktoa, 1); + } break; } @@ -206,8 +221,10 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring } if (unlikely(kring->nm_sync(kring, shadow_ring.flags))) { - /* Reenable notifications. */ - csb_ktoa_kick_enable(csb_ktoa, 1); + if (!a->busy_wait) { + /* Reenable notifications. */ + csb_ktoa_kick_enable(csb_ktoa, 1); + } nm_prerr("txsync() failed"); break; } @@ -232,7 +249,8 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring /* Interrupt the application if needed. */ #ifdef SYNC_KLOOP_POLL if (a->irq_ctx && more_txspace && csb_atok_intr_enabled(csb_atok)) { - /* Disable application kick to avoid sending unnecessary kicks */ + /* We could disable kernel --> application kicks here, + * to avoid spurious interrupts. */ eventfd_signal(a->irq_ctx, 1); more_txspace = false; } @@ -241,6 +259,9 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring /* Read CSB to see if there is more work to do. */ sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); if (shadow_ring.head == kring->rhead) { + if (a->busy_wait) { + break; + } /* * No more packets to transmit. We enable notifications and * go to sleep, waiting for a kick from the application when new @@ -268,6 +289,8 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring } } + nm_kr_put(kring); + #ifdef SYNC_KLOOP_POLL if (a->irq_ctx && more_txspace && csb_atok_intr_enabled(csb_atok)) { eventfd_signal(a->irq_ctx, 1); @@ -297,13 +320,19 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring bool some_recvd = false; uint32_t num_slots; + if (unlikely(nm_kr_tryget(kring, 1, NULL))) { + return; + } + num_slots = kring->nkr_num_slots; /* Get RX csb_atok and csb_ktoa pointers from the CSB. */ num_slots = kring->nkr_num_slots; /* Disable notifications. */ - csb_ktoa_kick_enable(csb_ktoa, 0); + if (!a->direct) { + csb_ktoa_kick_enable(csb_ktoa, 0); + } /* Copy the application kring pointers from the CSB */ sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); @@ -315,7 +344,9 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring if (unlikely(nm_rxsync_prologue(kring, &shadow_ring) >= num_slots)) { /* Reinit ring and enable notifications. */ netmap_ring_reinit(kring); - csb_ktoa_kick_enable(csb_ktoa, 1); + if (!a->busy_wait) { + csb_ktoa_kick_enable(csb_ktoa, 1); + } break; } @@ -324,8 +355,10 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring } if (unlikely(kring->nm_sync(kring, shadow_ring.flags))) { - /* Reenable notifications. */ - csb_ktoa_kick_enable(csb_ktoa, 1); + if (!a->busy_wait) { + /* Reenable notifications. */ + csb_ktoa_kick_enable(csb_ktoa, 1); + } nm_prerr("rxsync() failed"); break; } @@ -351,7 +384,8 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring #ifdef SYNC_KLOOP_POLL /* Interrupt the application if needed. */ if (a->irq_ctx && some_recvd && csb_atok_intr_enabled(csb_atok)) { - /* Disable application kick to avoid sending unnecessary kicks */ + /* We could disable kernel --> application kicks here, + * to avoid spurious interrupts. */ eventfd_signal(a->irq_ctx, 1); some_recvd = false; } @@ -360,6 +394,9 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring /* Read CSB to see if there is more work to do. */ sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); if (sync_kloop_norxslots(kring, shadow_ring.head)) { + if (a->busy_wait) { + break; + } /* * No more slots available for reception. We enable notification and * go to sleep, waiting for a kick from the application when new receive @@ -401,6 +438,7 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring } #ifdef SYNC_KLOOP_POLL +struct sync_kloop_poll_ctx; struct sync_kloop_poll_entry { /* Support for receiving notifications from * a netmap ring or from the application. */ @@ -411,12 +449,24 @@ struct sync_kloop_poll_entry { /* Support for sending notifications to the application. */ struct eventfd_ctx *irq_ctx; struct file *irq_filp; + + /* Arguments for the ring processing function. Useful + * in case of custom wake-up function. */ + struct sync_kloop_ring_args *args; + struct sync_kloop_poll_ctx *parent; + }; struct sync_kloop_poll_ctx { poll_table wait_table; unsigned int next_entry; + int (*next_wake_fun)(wait_queue_t *, unsigned, int, void *); unsigned int num_entries; + unsigned int num_tx_rings; + unsigned int num_rings; + /* First num_tx_rings entries are for the TX kicks. + * Then the RX kicks entries follow. The last two + * entries are for TX irq, and RX irq. */ struct sync_kloop_poll_entry entries[0]; }; @@ -433,10 +483,78 @@ sync_kloop_poll_table_queue_proc(struct file *file, wa entry->wqh = wqh; entry->filp = file; /* Use the default wake up function. */ - init_waitqueue_entry(&entry->wait, current); + if (poll_ctx->next_wake_fun == NULL) { + init_waitqueue_entry(&entry->wait, current); + } else { + init_waitqueue_func_entry(&entry->wait, + poll_ctx->next_wake_fun); + } add_wait_queue(wqh, &entry->wait); - poll_ctx->next_entry++; } + +static int +sync_kloop_tx_kick_wake_fun(wait_queue_t *wait, unsigned mode, + int wake_flags, void *key) +{ + struct sync_kloop_poll_entry *entry = + container_of(wait, struct sync_kloop_poll_entry, wait); + + netmap_sync_kloop_tx_ring(entry->args); + + return 0; +} + +static int +sync_kloop_tx_irq_wake_fun(wait_queue_t *wait, unsigned mode, + int wake_flags, void *key) +{ + struct sync_kloop_poll_entry *entry = + container_of(wait, struct sync_kloop_poll_entry, wait); + struct sync_kloop_poll_ctx *poll_ctx = entry->parent; + int i; + + for (i = 0; i < poll_ctx->num_tx_rings; i++) { + struct eventfd_ctx *irq_ctx = poll_ctx->entries[i].irq_ctx; + + if (irq_ctx) { + eventfd_signal(irq_ctx, 1); + } + } + + return 0; +} + +static int +sync_kloop_rx_kick_wake_fun(wait_queue_t *wait, unsigned mode, + int wake_flags, void *key) +{ + struct sync_kloop_poll_entry *entry = + container_of(wait, struct sync_kloop_poll_entry, wait); + + netmap_sync_kloop_rx_ring(entry->args); + + return 0; +} + +static int +sync_kloop_rx_irq_wake_fun(wait_queue_t *wait, unsigned mode, + int wake_flags, void *key) +{ + struct sync_kloop_poll_entry *entry = + container_of(wait, struct sync_kloop_poll_entry, wait); + struct sync_kloop_poll_ctx *poll_ctx = entry->parent; + int i; + + for (i = poll_ctx->num_tx_rings; i < poll_ctx->num_rings; i++) { + struct eventfd_ctx *irq_ctx = poll_ctx->entries[i].irq_ctx; + + if (irq_ctx) { + eventfd_signal(irq_ctx, 1); + } + } + + return 0; +} #endif /* SYNC_KLOOP_POLL */ int @@ -455,6 +573,10 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n struct nm_csb_ktoa* csb_ktoa_base; struct netmap_adapter *na; struct nmreq_option *opt; + bool na_could_sleep = false; + bool busy_wait = true; + bool direct_tx = false; + bool direct_rx = false; int err = 0; int i; @@ -505,8 +627,44 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n goto out; } + /* Prepare the arguments for netmap_sync_kloop_tx_ring() + * and netmap_sync_kloop_rx_ring(). */ + for (i = 0; i < num_tx_rings; i++) { + struct sync_kloop_ring_args *a = args + i; + + a->kring = NMR(na, NR_TX)[i + priv->np_qfirst[NR_TX]]; + a->csb_atok = csb_atok_base + i; + a->csb_ktoa = csb_ktoa_base + i; + a->busy_wait = busy_wait; + a->direct = direct_tx; + } + for (i = 0; i < num_rx_rings; i++) { + struct sync_kloop_ring_args *a = args + num_tx_rings + i; + + a->kring = NMR(na, NR_RX)[i + priv->np_qfirst[NR_RX]]; + a->csb_atok = csb_atok_base + num_tx_rings + i; + a->csb_ktoa = csb_ktoa_base + num_tx_rings + i; + a->busy_wait = busy_wait; + a->direct = direct_rx; + } + /* Validate notification options. */ opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, + NETMAP_REQ_OPT_SYNC_KLOOP_MODE); + if (opt != NULL) { + struct nmreq_opt_sync_kloop_mode *mode_opt = + (struct nmreq_opt_sync_kloop_mode *)opt; + + direct_tx = !!(mode_opt->mode & NM_OPT_SYNC_KLOOP_DIRECT_TX); + direct_rx = !!(mode_opt->mode & NM_OPT_SYNC_KLOOP_DIRECT_RX); + if (mode_opt->mode & ~(NM_OPT_SYNC_KLOOP_DIRECT_TX | + NM_OPT_SYNC_KLOOP_DIRECT_RX)) { + opt->nro_status = err = EINVAL; + goto out; + } + opt->nro_status = 0; + } + opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS); if (opt != NULL) { err = nmreq_checkduplicate(opt); @@ -524,54 +682,132 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n #ifdef SYNC_KLOOP_POLL eventfds_opt = (struct nmreq_opt_sync_kloop_eventfds *)opt; opt->nro_status = 0; + + /* Check if some ioeventfd entry is not defined, and force sleep + * synchronization in that case. */ + busy_wait = false; + for (i = 0; i < num_rings; i++) { + if (eventfds_opt->eventfds[i].ioeventfd < 0) { + busy_wait = true; + break; + } + } + + if (busy_wait && (direct_tx || direct_rx)) { + /* For direct processing we need all the + * ioeventfds to be valid. */ + opt->nro_status = err = EINVAL; + goto out; + } + /* We need 2 poll entries for TX and RX notifications coming * from the netmap adapter, plus one entries per ring for the * notifications coming from the application. */ poll_ctx = nm_os_malloc(sizeof(*poll_ctx) + - (2 + num_rings) * sizeof(poll_ctx->entries[0])); + (num_rings + 2) * sizeof(poll_ctx->entries[0])); init_poll_funcptr(&poll_ctx->wait_table, sync_kloop_poll_table_queue_proc); poll_ctx->num_entries = 2 + num_rings; + poll_ctx->num_tx_rings = num_tx_rings; + poll_ctx->num_rings = num_rings; poll_ctx->next_entry = 0; + poll_ctx->next_wake_fun = NULL; + + if (direct_tx && (na->na_flags & NAF_BDG_MAYSLEEP)) { + /* In direct mode, VALE txsync is called from + * wake-up context, where it is not possible + * to sleep. + */ + na->na_flags &= ~NAF_BDG_MAYSLEEP; + na_could_sleep = true; + } + + for (i = 0; i < num_rings + 2; i++) { + poll_ctx->entries[i].args = args + i; + poll_ctx->entries[i].parent = poll_ctx; + } + /* Poll for notifications coming from the applications through - * eventfds . */ - for (i = 0; i < num_rings; i++) { - struct eventfd_ctx *irq; - struct file *filp; + * eventfds. */ + for (i = 0; i < num_rings; i++, poll_ctx->next_entry++) { + struct eventfd_ctx *irq = NULL; + struct file *filp = NULL; unsigned long mask; + bool tx_ring = (i < num_tx_rings); - filp = eventfd_fget(eventfds_opt->eventfds[i].ioeventfd); - if (IS_ERR(filp)) { - err = PTR_ERR(filp); - goto out; + if (eventfds_opt->eventfds[i].irqfd >= 0) { + filp = eventfd_fget( + eventfds_opt->eventfds[i].irqfd); + if (IS_ERR(filp)) { + err = PTR_ERR(filp); + goto out; + } + irq = eventfd_ctx_fileget(filp); + if (IS_ERR(irq)) { + err = PTR_ERR(irq); + goto out; + } } - mask = filp->f_op->poll(filp, &poll_ctx->wait_table); - if (mask & POLLERR) { - err = EINVAL; - goto out; - } - - filp = eventfd_fget(eventfds_opt->eventfds[i].irqfd); - if (IS_ERR(filp)) { - err = PTR_ERR(filp); - goto out; - } poll_ctx->entries[i].irq_filp = filp; - irq = eventfd_ctx_fileget(filp); - if (IS_ERR(irq)) { - err = PTR_ERR(irq); - goto out; - } poll_ctx->entries[i].irq_ctx = irq; + poll_ctx->entries[i].args->busy_wait = busy_wait; + /* Don't let netmap_sync_kloop_*x_ring() use + * IRQs in direct mode. */ + poll_ctx->entries[i].args->irq_ctx = + ((tx_ring && direct_tx) || + (!tx_ring && direct_rx)) ? NULL : + poll_ctx->entries[i].irq_ctx; + poll_ctx->entries[i].args->direct = + (tx_ring ? direct_tx : direct_rx); + + if (!busy_wait) { + filp = eventfd_fget( + eventfds_opt->eventfds[i].ioeventfd); + if (IS_ERR(filp)) { + err = PTR_ERR(filp); + goto out; + } + if (tx_ring && direct_tx) { + /* Override the wake up function + * so that it can directly call + * netmap_sync_kloop_tx_ring(). + */ + poll_ctx->next_wake_fun = + sync_kloop_tx_kick_wake_fun; + } else if (!tx_ring && direct_rx) { + /* Same for direct RX. */ + poll_ctx->next_wake_fun = + sync_kloop_rx_kick_wake_fun; + } else { + poll_ctx->next_wake_fun = NULL; + } + mask = filp->f_op->poll(filp, + &poll_ctx->wait_table); + if (mask & POLLERR) { + err = EINVAL; + goto out; + } + } } + /* Poll for notifications coming from the netmap rings bound to * this file descriptor. */ - { + if (!busy_wait) { NMG_LOCK(); + /* In direct mode, override the wake up function so + * that it can forward the netmap_tx_irq() to the + * guest. */ + poll_ctx->next_wake_fun = direct_tx ? + sync_kloop_tx_irq_wake_fun : NULL; poll_wait(priv->np_filp, priv->np_si[NR_TX], &poll_ctx->wait_table); + poll_ctx->next_entry++; + + poll_ctx->next_wake_fun = direct_rx ? + sync_kloop_rx_irq_wake_fun : NULL; poll_wait(priv->np_filp, priv->np_si[NR_RX], &poll_ctx->wait_table); + poll_ctx->next_entry++; NMG_UNLOCK(); } #else /* SYNC_KLOOP_POLL */ @@ -580,31 +816,10 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n #endif /* SYNC_KLOOP_POLL */ } - /* Prepare the arguments for netmap_sync_kloop_tx_ring() - * and netmap_sync_kloop_rx_ring(). */ - for (i = 0; i < num_tx_rings; i++) { - struct sync_kloop_ring_args *a = args + i; + nm_prinf("kloop busy_wait %u, direct_tx %u, direct_rx %u, " + "na_could_sleep %u", busy_wait, direct_tx, direct_rx, + na_could_sleep); - a->kring = NMR(na, NR_TX)[i + priv->np_qfirst[NR_TX]]; - a->csb_atok = csb_atok_base + i; - a->csb_ktoa = csb_ktoa_base + i; -#ifdef SYNC_KLOOP_POLL - if (poll_ctx) - a->irq_ctx = poll_ctx->entries[i].irq_ctx; -#endif /* SYNC_KLOOP_POLL */ - } - for (i = 0; i < num_rx_rings; i++) { - struct sync_kloop_ring_args *a = args + num_tx_rings + i; - - a->kring = NMR(na, NR_RX)[i + priv->np_qfirst[NR_RX]]; - a->csb_atok = csb_atok_base + num_tx_rings + i; - a->csb_ktoa = csb_ktoa_base + num_tx_rings + i; -#ifdef SYNC_KLOOP_POLL - if (poll_ctx) - a->irq_ctx = poll_ctx->entries[num_tx_rings + i].irq_ctx; -#endif /* SYNC_KLOOP_POLL */ - } - /* Main loop. */ for (;;) { if (unlikely(NM_ACCESS_ONCE(priv->np_kloop_state) & NM_SYNC_KLOOP_STOPPING)) { @@ -612,7 +827,7 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n } #ifdef SYNC_KLOOP_POLL - if (poll_ctx) { + if (!busy_wait) { /* It is important to set the task state as * interruptible before processing any TX/RX ring, * so that if a notification on ring Y comes after @@ -627,46 +842,37 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n #endif /* SYNC_KLOOP_POLL */ /* Process all the TX rings bound to this file descriptor. */ - for (i = 0; i < num_tx_rings; i++) { + for (i = 0; !direct_tx && i < num_tx_rings; i++) { struct sync_kloop_ring_args *a = args + i; - - if (unlikely(nm_kr_tryget(a->kring, 1, NULL))) { - continue; - } netmap_sync_kloop_tx_ring(a); - nm_kr_put(a->kring); } /* Process all the RX rings bound to this file descriptor. */ - for (i = 0; i < num_rx_rings; i++) { + for (i = 0; !direct_rx && i < num_rx_rings; i++) { struct sync_kloop_ring_args *a = args + num_tx_rings + i; - - if (unlikely(nm_kr_tryget(a->kring, 1, NULL))) { - continue; - } netmap_sync_kloop_rx_ring(a); - nm_kr_put(a->kring); } -#ifdef SYNC_KLOOP_POLL - if (poll_ctx) { - /* If a poll context is present, yield to the scheduler - * waiting for a notification to come either from - * netmap or the application. */ - schedule_timeout(msecs_to_jiffies(3000)); - } else -#endif /* SYNC_KLOOP_POLL */ - { + if (busy_wait) { /* Default synchronization method: sleep for a while. */ usleep_range(sleep_us, sleep_us); } +#ifdef SYNC_KLOOP_POLL + else { + /* Yield to the scheduler waiting for a notification + * to come either from netmap or the application. */ + schedule_timeout(msecs_to_jiffies(3000)); + } +#endif /* SYNC_KLOOP_POLL */ } out: #ifdef SYNC_KLOOP_POLL if (poll_ctx) { /* Stop polling from netmap and the eventfds, and deallocate * the poll context. */ - __set_current_state(TASK_RUNNING); + if (!busy_wait) { + __set_current_state(TASK_RUNNING); + } for (i = 0; i < poll_ctx->next_entry; i++) { struct sync_kloop_poll_entry *entry = poll_ctx->entries + i; @@ -696,6 +902,9 @@ out: /* Reset the kloop state. */ NMG_LOCK(); priv->np_kloop_state = 0; + if (na_could_sleep) { + na->na_flags |= NAF_BDG_MAYSLEEP; + } NMG_UNLOCK(); return err; @@ -770,14 +979,14 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc atok->appl_need_kick = 0; /* - * First part: tell the host (updating the CSB) to process the new - * packets. + * First part: tell the host to process the new packets, + * updating the CSB. */ kring->nr_hwcur = ktoa->hwcur; nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); /* Ask for a kick from a guest to the host if needed. */ - if (((kring->rhead != kring->nr_hwcur || nm_kr_txempty(kring)) + if (((kring->rhead != kring->nr_hwcur || nm_kr_wouldblock(kring)) && NM_ACCESS_ONCE(ktoa->kern_need_kick)) || (flags & NAF_FORCE_RECLAIM)) { atok->sync_flags = flags; @@ -787,7 +996,7 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc /* * Second part: reclaim buffers for completed transmissions. */ - if (nm_kr_txempty(kring) || (flags & NAF_FORCE_RECLAIM)) { + if (nm_kr_wouldblock(kring) || (flags & NAF_FORCE_RECLAIM)) { nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, &kring->nr_hwcur); } @@ -797,7 +1006,7 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc * go to sleep and we need to be notified by the host when more free * space is available. */ - if (nm_kr_txempty(kring) && !(kring->nr_kflags & NKR_NOINTR)) { + if (nm_kr_wouldblock(kring) && !(kring->nr_kflags & NKR_NOINTR)) { /* Reenable notifications. */ atok->appl_need_kick = 1; /* Double check, with store-load memory barrier. */ @@ -805,7 +1014,7 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, &kring->nr_hwcur); /* If there is new free space, disable notifications */ - if (unlikely(!nm_kr_txempty(kring))) { + if (unlikely(!nm_kr_wouldblock(kring))) { atok->appl_need_kick = 0; } } @@ -851,11 +1060,6 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc */ if (kring->rhead != kring->nr_hwcur) { nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); - /* Ask for a kick from the guest to the host if needed. */ - if (NM_ACCESS_ONCE(ktoa->kern_need_kick)) { - atok->sync_flags = flags; - notify = true; - } } /* @@ -863,7 +1067,7 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc * we need to be notified by the host when more RX slots have been * completed. */ - if (nm_kr_rxempty(kring) && !(kring->nr_kflags & NKR_NOINTR)) { + if (nm_kr_wouldblock(kring) && !(kring->nr_kflags & NKR_NOINTR)) { /* Reenable notifications. */ atok->appl_need_kick = 1; /* Double check, with store-load memory barrier. */ @@ -871,10 +1075,17 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, &kring->nr_hwcur); /* If there are new slots, disable notifications. */ - if (!nm_kr_rxempty(kring)) { + if (!nm_kr_wouldblock(kring)) { atok->appl_need_kick = 0; } } + + /* Ask for a kick from the guest to the host if needed. */ + if ((kring->rhead != kring->nr_hwcur || nm_kr_wouldblock(kring)) + && NM_ACCESS_ONCE(ktoa->kern_need_kick)) { + atok->sync_flags = flags; + notify = true; + } nm_prdis(1, "%s CSB(head:%u cur:%u hwtail:%u) KRING(head:%u cur:%u tail:%u)", kring->name, atok->head, atok->cur, ktoa->hwtail, Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Sat Feb 2 21:14:53 2019 (r343688) +++ head/sys/net/netmap.h Sat Feb 2 22:39:29 2019 (r343689) @@ -540,7 +540,8 @@ enum { enum { /* On NETMAP_REQ_REGISTER, ask netmap to use memory allocated - * from user-space allocated memory pools (e.g. hugepages). */ + * from user-space allocated memory pools (e.g. hugepages). + */ NETMAP_REQ_OPT_EXTMEM = 1, /* ON NETMAP_REQ_SYNC_KLOOP_START, ask netmap to use eventfd-based @@ -551,8 +552,15 @@ enum { /* On NETMAP_REQ_REGISTER, ask netmap to work in CSB mode, where * head, cur and tail pointers are not exchanged through the * struct netmap_ring header, but rather using an user-provided - * memory area (see struct nm_csb_atok and struct nm_csb_ktoa). */ + * memory area (see struct nm_csb_atok and struct nm_csb_ktoa). + */ NETMAP_REQ_OPT_CSB, + + /* An extension to NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS, which specifies + * if the TX and/or RX rings are synced in the context of the VM exit. + * This requires the 'ioeventfd' fields to be valid (cannot be < 0). + */ + NETMAP_REQ_OPT_SYNC_KLOOP_MODE, }; /* @@ -877,6 +885,12 @@ struct nmreq_opt_sync_kloop_eventfds { * their order must agree with the CSB arrays passed in the * NETMAP_REQ_OPT_CSB option. Each entry contains a file descriptor * backed by an eventfd. + * + * If any of the 'ioeventfd' entries is < 0, the event loop uses + * the sleeping synchronization strategy (according to sleep_us), + * and keeps kern_need_kick always disabled. + * Each 'irqfd' can be < 0, and in that case the corresponding queue + * is never notified. */ struct { /* Notifier for the application --> kernel loop direction. */ @@ -884,6 +898,13 @@ struct nmreq_opt_sync_kloop_eventfds { /* Notifier for the kernel loop --> application direction. */ int32_t irqfd; } eventfds[0]; +}; + +struct nmreq_opt_sync_kloop_mode { + struct nmreq_option nro_opt; /* common header */ +#define NM_OPT_SYNC_KLOOP_DIRECT_TX (1 << 0) +#define NM_OPT_SYNC_KLOOP_DIRECT_RX (1 << 1) + uint32_t mode; }; struct nmreq_opt_extmem {