From owner-svn-src-head@freebsd.org Sun Sep 11 01:11:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D835ABCF3E4; Sun, 11 Sep 2016 01:11:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 971A2F8C; Sun, 11 Sep 2016 01:11:48 +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 u8B1BlS5013523; Sun, 11 Sep 2016 01:11:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8B1BlPX013522; Sun, 11 Sep 2016 01:11:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609110111.u8B1BlPX013522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 11 Sep 2016 01:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305690 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 01:11:49 -0000 Author: emaste Date: Sun Sep 11 01:11:47 2016 New Revision: 305690 URL: https://svnweb.freebsd.org/changeset/base/305690 Log: cap_enter.2: describe flag returned by cap_getmode Previously the flag returned by cap_getmode was not described explicitly in the man page. Reviewed by: wblock Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7822 Modified: head/lib/libc/sys/cap_enter.2 Modified: head/lib/libc/sys/cap_enter.2 ============================================================================== --- head/lib/libc/sys/cap_enter.2 Sat Sep 10 17:45:35 2016 (r305689) +++ head/lib/libc/sys/cap_enter.2 Sun Sep 11 01:11:47 2016 (r305690) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd September 10, 2016 .Dt CAP_ENTER 2 .Os .Sh NAME @@ -84,6 +84,11 @@ to create a runtime environment inside t acquired rights as possible. .Sh RETURN VALUES .Rv -std cap_enter cap_getmode +.Pp +When the process is in capability mode, +.Fn cap_getmode +sets the flag to a non-zero value. +A zero value means the process is not in capability mode. .Sh ERRORS The .Fn cap_enter From owner-svn-src-head@freebsd.org Sun Sep 11 09:14:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6618BD4723; Sun, 11 Sep 2016 09:14: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 mx1.freebsd.org (Postfix) with ESMTPS id 781CB7DB; Sun, 11 Sep 2016 09:14: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 u8B9E7O0000396; Sun, 11 Sep 2016 09:14:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8B9E7FW000392; Sun, 11 Sep 2016 09:14:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609110914.u8B9E7FW000392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 11 Sep 2016 09:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305692 - in head: share/man/man9 sys/amd64/amd64 sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 09:14:08 -0000 Author: kib Date: Sun Sep 11 09:14:07 2016 New Revision: 305692 URL: https://svnweb.freebsd.org/changeset/base/305692 Log: Add FPU_KERN_NOCTX flag to the fpu_kern_enter() function on amd64. The flag specifies that the block which uses FPU must be executed in critical section, i.e. take no context switches, and does not need an FPU save area during the execution. It is intended to be applied around fast and short code pathes where save area allocation is impossible or undesirable, due to context or due to the relative cost of calculation vs. allocation. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/share/man/man9/fpu_kern.9 head/sys/amd64/amd64/fpu.c head/sys/amd64/include/fpu.h head/sys/amd64/include/pcb.h Modified: head/share/man/man9/fpu_kern.9 ============================================================================== --- head/share/man/man9/fpu_kern.9 Sun Sep 11 07:24:12 2016 (r305691) +++ head/share/man/man9/fpu_kern.9 Sun Sep 11 09:14:07 2016 (r305692) @@ -120,6 +120,16 @@ could be used from both kernel thread an The .Fn fpu_kern_leave function correctly handles such contexts. +.It Dv FPU_KERN_NOCTX +Avoid nesting save area. +If the flag is specified, the +.Fa ctx +must be passed as +.Va NULL . +The flag should only be used for really short code blocks +which can be executed in a critical section. +It avoids the need to allocate the FPU context by the cost +of increased system latency. .El .El .Pp Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sun Sep 11 07:24:12 2016 (r305691) +++ head/sys/amd64/amd64/fpu.c Sun Sep 11 09:14:07 2016 (r305692) @@ -633,6 +633,8 @@ fpudna(void) */ critical_enter(); + KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0, + ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)")); if (PCPU_GET(fpcurthread) == curthread) { printf("fpudna: fpcurthread == curthread\n"); stop_emulating(); @@ -964,13 +966,39 @@ fpu_kern_enter(struct thread *td, struct { struct pcb *pcb; - KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) == 0, ("using inuse ctx")); + pcb = td->td_pcb; + KASSERT((flags & FPU_KERN_NOCTX) != 0 || ctx != NULL, + ("ctx is required when !FPU_KERN_NOCTX")); + KASSERT(ctx == NULL || (ctx->flags & FPU_KERN_CTX_INUSE) == 0, + ("using inuse ctx")); + KASSERT((pcb->pcb_flags & PCB_FPUNOSAVE) == 0, + ("recursive fpu_kern_enter while in PCB_FPUNOSAVE state")); + if ((flags & FPU_KERN_NOCTX) != 0) { + critical_enter(); + stop_emulating(); + if (curthread == PCPU_GET(fpcurthread)) { + fpusave(curpcb->pcb_save); + PCPU_SET(fpcurthread, NULL); + } else { + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("invalid fpcurthread")); + } + + /* + * This breaks XSAVEOPT tracker, but + * PCB_FPUNOSAVE state is supposed to never need to + * save FPU context at all. + */ + fpurestore(fpu_initialstate); + set_pcb_flags(pcb, PCB_KERNFPU | PCB_FPUNOSAVE | + PCB_FPUINITDONE); + return (0); + } if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) { ctx->flags = FPU_KERN_CTX_DUMMY | FPU_KERN_CTX_INUSE; return (0); } - pcb = td->td_pcb; KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == get_pcb_user_save_pcb(pcb), ("mangled pcb_save")); ctx->flags = FPU_KERN_CTX_INUSE; @@ -989,19 +1017,34 @@ fpu_kern_leave(struct thread *td, struct { struct pcb *pcb; - KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, - ("leaving not inuse ctx")); - ctx->flags &= ~FPU_KERN_CTX_INUSE; - - if (is_fpu_kern_thread(0) && (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) - return (0); - KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, ("dummy ctx")); pcb = td->td_pcb; - critical_enter(); - if (curthread == PCPU_GET(fpcurthread)) - fpudrop(); - critical_exit(); - pcb->pcb_save = ctx->prev; + + if ((pcb->pcb_flags & PCB_FPUNOSAVE) != 0) { + KASSERT(ctx == NULL, ("non-null ctx after FPU_KERN_NOCTX")); + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("non-NULL fpcurthread for PCB_FPUNOSAVE")); + CRITICAL_ASSERT(td); + + clear_pcb_flags(pcb, PCB_FPUNOSAVE | PCB_FPUINITDONE); + start_emulating(); + critical_exit(); + } else { + KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, + ("leaving not inuse ctx")); + ctx->flags &= ~FPU_KERN_CTX_INUSE; + + if (is_fpu_kern_thread(0) && + (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) + return (0); + KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, + ("dummy ctx")); + critical_enter(); + if (curthread == PCPU_GET(fpcurthread)) + fpudrop(); + critical_exit(); + pcb->pcb_save = ctx->prev; + } + if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) { set_pcb_flags(pcb, PCB_FPUINITDONE); Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Sun Sep 11 07:24:12 2016 (r305691) +++ head/sys/amd64/include/fpu.h Sun Sep 11 09:14:07 2016 (r305692) @@ -86,6 +86,7 @@ void fpu_save_area_reset(struct savefpu #define FPU_KERN_NORMAL 0x0000 #define FPU_KERN_NOWAIT 0x0001 #define FPU_KERN_KTHR 0x0002 +#define FPU_KERN_NOCTX 0x0004 #endif Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Sun Sep 11 07:24:12 2016 (r305691) +++ head/sys/amd64/include/pcb.h Sun Sep 11 09:14:07 2016 (r305692) @@ -83,6 +83,7 @@ struct pcb { #define PCB_FPUINITDONE 0x08 /* fpu state is initialized */ #define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ +#define PCB_FPUNOSAVE 0x80 /* no save area for current FPU ctx */ uint16_t pcb_initial_fpucw; From owner-svn-src-head@freebsd.org Sun Sep 11 14:50:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D16FBD64F5; Sun, 11 Sep 2016 14:50:01 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D129098; Sun, 11 Sep 2016 14:50:00 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id l131so72162209lfl.2; Sun, 11 Sep 2016 07:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lmqp2v1Clc7JzdTPiqlfqrO11z5UqtK761SAtgFMgj4=; b=HKfBahnyEQ7YhTVokT+OcruDuERWVrj+t4p0F9vGLHH+NKdszoZerU5Ver1sOEXTVJ LeY8riKR8dn83fhRhCMkDeoWhAF+H5KS7apwTJSCPBOA2MTU/upwbEGhAlt6hpcqRkem Al+iNy4TYqNqWcAQ7Od0DxRtRETsNAlCLXiTdplQjle/dYAL/2DOeJ8BgH39AwnfNWrX NYsVTjel4cqqdxjT29GBfodDL2DzSnTZpd+Fy+VEDJhz9F9hUYIK4/UHMbptSeKT+V2k FZDOP1wJh8qyK3nblXBSsD+yoRomypJgR2WI6cUfWZaZsNQeR7lipo6S4ltvRRpvp81I RItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=lmqp2v1Clc7JzdTPiqlfqrO11z5UqtK761SAtgFMgj4=; b=cLjGGHICqyjxkmZIhwKJYoLChKEgm+1oIhPoHoOnrd59TQe7I0EfHxPk7FnEgfP5vA pWSDmEfLqSvFRFcxS0Y6fZ6qdetODcH8M8MK/CCUIaNau1KjQ1w/YrqXTP13ama3QqRX 5UPDd41dzgTGZtvtXbN0IKiriiJKZhuvT6d2fZL8BJVoRivF03NT3PedPMSkP1LY7iZz NC4sRwhsuHpA08NAQrIWBJ8oNqifoh5aTG29VRtRfDTxWc+2hyiUk9oCF+x4yww6Mpd5 ADYvz4YoW1MAOcZTVpvXXaK1WGHp0c8qPeZ+qaaGum+k1JiYFze7f7L0k0Syj0wucqh5 aLxA== X-Gm-Message-State: AE9vXwMbj6iAI8bZsWPGQONo4hjvEIGD8Qvpb+Sgrwwu3fiFipt8s2igtTMzSnXptZ3wRA== X-Received: by 10.25.142.203 with SMTP id q194mr3987160lfd.11.1473605398073; Sun, 11 Sep 2016 07:49:58 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id j196sm461364lfg.9.2016.09.11.07.49.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Sep 2016 07:49:57 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 11 Sep 2016 16:49:55 +0200 From: Baptiste Daroussin To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk Message-ID: <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> References: <201608251940.u7PJePv3023083@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qpafpqfkoojpvp2p" Content-Disposition: inline In-Reply-To: <201608251940.u7PJePv3023083@repo.freebsd.org> User-Agent: Mutt/1.6.2-neo (2016-08-08) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 14:50:01 -0000 --qpafpqfkoojpvp2p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 25, 2016 at 07:40:25PM +0000, Kristof Provost wrote: > Author: kp > Date: Thu Aug 25 19:40:25 2016 > New Revision: 304815 > URL: https://svnweb.freebsd.org/changeset/base/304815 >=20 > Log: > Add libifc, a library implementing core functionality that exists in if= config(8) today. > =20 > libifc (pronounced lib-ifconfig) aims to be a light abstraction layer b= etween > programs and the kernel APIs for managing the network configuration. > This should hopefully make programs easier to maintain, and reduce code > duplication. > =20 > Work will begin on making ifconfig(8) use this library in the near futu= re. > =20 > This code is still evolving. The interface should not be considered sta= ble until > it is announced as such. > =20 Sorry I come to this very late but: If it is not stable yet, it would probably be a good idea to make it a privatelib, so even if we end up shipping a release with the lib before considered stable we are safe updating it? It won't prevent any usage one can imagine in base. The private flag can be dropped once it is considered stable Best regards, Bapt --qpafpqfkoojpvp2p Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX1W8PAAoJEGOJi9zxtz5aEQcQAOFzFj/CLDUk7kcvR6Rmg1xU Rvb/ow4+L7T7XZPQXk94eREX61JPh71Ibd9eJNbq5BMQF0R1FQ7at549oSkEfLta zhsxuVF2oy5f3eRPCuw/V9XKOaSwu4ZEQ0VVnp5F6fyz0ByhA0+kcD00V/Q0Jpnp SpgiZDduQzbfWfoPpra6DgvNuU1MmfoBYtAAZdWU6bjnSELYkDCQD12p4dofwn2p hrSkhQ8UaCeW9hgG6PUtMPFTpNWf/yYiMYIVWb4LgRS3nD7oqZ/RQIBJONKm7Rz5 /vUXIL7m7ZswvuoD3azwFUQq8GlssKRx9n1l97zOxexzJ3g8jxLln0/ggonW2iFz 4UNNcPnkENKktqfeQxNYtxns0ETMjFr4C8DQzfrce7UakpAjdGeMM1c92qUwI3mk Gch7sueZQi0aKEcjSE9ov2fZ9M7AdJfb6aRl0X4f9e0Eu721+/vaNBlrB1u5liiC WEZut/mQiiUTDBLIkEHdnZkSkqO3Gh83YGuWaG6ELQrj+OgZccOLe8HxJlG4FN6e S3w0Q8S/8+PCYZbQPFwbSHsALI+EpSyM+D6mnTCpjumk6CPI/Dc2DQQQsXcU+bFY RZTZiE/1gp4I1Wi97l5lvQsFVIglnOSEqgW4boHoOpXGYs5qkRffWwl/nX4ScBZs KhwB1fgdDifzdgcHP6Fl =V6oX -----END PGP SIGNATURE----- --qpafpqfkoojpvp2p-- From owner-svn-src-head@freebsd.org Sun Sep 11 16:06:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B50FEBD67EE; Sun, 11 Sep 2016 16:06:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 85672914; Sun, 11 Sep 2016 16:06:18 +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 u8BG6HDW055682; Sun, 11 Sep 2016 16:06:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BG6HoB055680; Sun, 11 Sep 2016 16:06:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111606.u8BG6HoB055680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 16:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305695 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 16:06:18 -0000 Author: np Date: Sun Sep 11 16:06:17 2016 New Revision: 305695 URL: https://svnweb.freebsd.org/changeset/base/305695 Log: cxgbe(4): Set up fl_starve_threshold2 accurately for T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4vf_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 15:55:11 2016 (r305694) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 16:06:17 2016 (r305695) @@ -7866,8 +7866,10 @@ int t4_init_sge_params(struct adapter *a sp->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; if (is_t4(adapter)) sp->fl_starve_threshold2 = sp->fl_starve_threshold; - else + else if (is_t5(adapter)) sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1; + else + sp->fl_starve_threshold2 = G_T6_EGRTHRESHOLDPACKING(r) * 2 + 1; /* egress queues: log2 of # of doorbells per BAR2 page */ r = t4_read_reg(adapter, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); Modified: head/sys/dev/cxgbe/common/t4vf_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 15:55:11 2016 (r305694) +++ head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 16:06:17 2016 (r305695) @@ -130,9 +130,10 @@ int t4vf_get_sge_params(struct adapter * sp->fl_starve_threshold = G_EGRTHRESHOLD(vals[5]) * 2 + 1; if (is_t4(adapter)) sp->fl_starve_threshold2 = sp->fl_starve_threshold; + else if (is_t5(adapter)) + sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 + 1; else - sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 + - 1; + sp->fl_starve_threshold2 = G_T6_EGRTHRESHOLDPACKING(vals[5]) * 2 + 1; /* * We need the Queues/Page and Host Page Size for our VF. From owner-svn-src-head@freebsd.org Sun Sep 11 16:11:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7222BD693D; Sun, 11 Sep 2016 16:11:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6F821C40; Sun, 11 Sep 2016 16:11:52 +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 u8BGBpS3057217; Sun, 11 Sep 2016 16:11:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BGBptY057216; Sun, 11 Sep 2016 16:11:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111611.u8BGBptY057216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 16:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305696 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 16:11:52 -0000 Author: np Date: Sun Sep 11 16:11:51 2016 New Revision: 305696 URL: https://svnweb.freebsd.org/changeset/base/305696 Log: cxgbe(4): Use correct macro for header length with T6 ASICs. This affects the transmit of the VF driver only. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 16:06:17 2016 (r305695) +++ head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 16:11:51 2016 (r305696) @@ -229,8 +229,8 @@ static inline u_int txpkts0_len16(u_int) static inline u_int txpkts1_len16(void); static u_int write_txpkt_wr(struct sge_txq *, struct fw_eth_tx_pkt_wr *, struct mbuf *, u_int); -static u_int write_txpkt_vm_wr(struct sge_txq *, struct fw_eth_tx_pkt_vm_wr *, - struct mbuf *, u_int); +static u_int write_txpkt_vm_wr(struct adapter *, struct sge_txq *, + struct fw_eth_tx_pkt_vm_wr *, struct mbuf *, u_int); static int try_txpkts(struct mbuf *, struct mbuf *, struct txpkts *, u_int); static int add_to_txpkts(struct mbuf *, struct txpkts *, u_int); static u_int write_txpkts_wr(struct sge_txq *, struct fw_eth_tx_pkts_wr *, @@ -2460,7 +2460,8 @@ eth_tx(struct mp_ring *r, u_int cidx, u_ total++; remaining--; ETHER_BPF_MTAP(ifp, m0); - n = write_txpkt_vm_wr(txq, (void *)wr, m0, available); + n = write_txpkt_vm_wr(sc, txq, (void *)wr, m0, + available); } else if (remaining > 1 && try_txpkts(m0, r->items[next_cidx], &txp, available) == 0) { @@ -4039,8 +4040,8 @@ imm_payload(u_int ndesc) * The return value is the # of hardware descriptors used. */ static u_int -write_txpkt_vm_wr(struct sge_txq *txq, struct fw_eth_tx_pkt_vm_wr *wr, - struct mbuf *m0, u_int available) +write_txpkt_vm_wr(struct adapter *sc, struct sge_txq *txq, + struct fw_eth_tx_pkt_vm_wr *wr, struct mbuf *m0, u_int available) { struct sge_eq *eq = &txq->eq; struct tx_sdesc *txsd; @@ -4156,9 +4157,13 @@ write_txpkt_vm_wr(struct sge_txq *txq, s ("%s: mbuf %p needs checksum offload but missing header lengths", __func__, m0)); - /* XXX: T6 */ - ctrl1 |= V_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - - ETHER_HDR_LEN); + if (chip_id(sc) <= CHELSIO_T5) { + ctrl1 |= V_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - + ETHER_HDR_LEN); + } else { + ctrl1 |= V_T6_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - + ETHER_HDR_LEN); + } ctrl1 |= V_TXPKT_IPHDR_LEN(m0->m_pkthdr.l3hlen); ctrl1 |= V_TXPKT_CSUM_TYPE(csum_type); } else From owner-svn-src-head@freebsd.org Sun Sep 11 16:50:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EC6DBD6750; Sun, 11 Sep 2016 16:50:36 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 F0130C38; Sun, 11 Sep 2016 16:50:35 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 5DAE31805; Sun, 11 Sep 2016 16:50:29 +0000 (UTC) Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk To: Baptiste Daroussin , Kristof Provost , Marie Helene Kvello-Aune References: <201608251940.u7PJePv3023083@repo.freebsd.org> <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <9855ae5e-1c9a-caea-9b1a-cfda5ece7258@freebsd.org> Date: Sun, 11 Sep 2016 12:50:25 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 16:50:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a Content-Type: multipart/mixed; boundary="280LnlS3ljOLR7Etg31k37Q9XV4wOv1q0" From: Allan Jude To: Baptiste Daroussin , Kristof Provost , Marie Helene Kvello-Aune Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <9855ae5e-1c9a-caea-9b1a-cfda5ece7258@freebsd.org> Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk References: <201608251940.u7PJePv3023083@repo.freebsd.org> <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> In-Reply-To: <20160911144955.3s5cjd22li7xdcal@ivaldir.etoilebsd.net> --280LnlS3ljOLR7Etg31k37Q9XV4wOv1q0 Content-Type: multipart/mixed; boundary="------------F8B125D0689F1485C3EC70CA" This is a multi-part message in MIME format. --------------F8B125D0689F1485C3EC70CA Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-09-11 10:49, Baptiste Daroussin wrote: > On Thu, Aug 25, 2016 at 07:40:25PM +0000, Kristof Provost wrote: >> Author: kp >> Date: Thu Aug 25 19:40:25 2016 >> New Revision: 304815 >> URL: https://svnweb.freebsd.org/changeset/base/304815 >> >> Log: >> Add libifc, a library implementing core functionality that exists in= ifconfig(8) today. >> =20 >> libifc (pronounced lib-ifconfig) aims to be a light abstraction laye= r between >> programs and the kernel APIs for managing the network configuration.= >> This should hopefully make programs easier to maintain, and reduce c= ode >> duplication. >> =20 >> Work will begin on making ifconfig(8) use this library in the near f= uture. >> =20 >> This code is still evolving. The interface should not be considered = stable until >> it is announced as such. >> =20 >=20 > Sorry I come to this very late but: >=20 > If it is not stable yet, it would probably be a good idea to make it a > privatelib, so even if we end up shipping a release with the lib before= > considered stable we are safe updating it? >=20 > It won't prevent any usage one can imagine in base. >=20 > The private flag can be dropped once it is considered stable >=20 > Best regards, > Bapt >=20 That is a good idea, and is just a one line change: --=20 Allan Jude --------------F8B125D0689F1485C3EC70CA Content-Type: text/plain; charset=UTF-8; name="libifconfig_private.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="libifconfig_private.diff" Index: lib/libifconfig/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libifconfig/Makefile (revision 305635) +++ lib/libifconfig/Makefile (working copy) @@ -2,6 +2,7 @@ =20 PACKAGE=3D lib${LIB} LIB=3D ifconfig +PRIVATELIB=3D true # Don't build shared library, for now. NO_PIC=3D=20 =20 --------------F8B125D0689F1485C3EC70CA-- --280LnlS3ljOLR7Etg31k37Q9XV4wOv1q0-- --oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJX1YtUAAoJEBmVNT4SmAt+MwUQAJQVr0Zy8Qc3XhJAk4z/fVGt 6bVRYtsQ9cVrxIX4I7doz1bF1iOqcbzQIAfrPoI3zPBEz2Qc60iCaUHu92nP/ggO b/kE59R5KidnE4kh5zCCbtE4GBwf+HjaM19V03/pWS+nYoAM9enSwrPi+gv14R/I w/i6pYTqgSTyit23RouX32PpFxtc7fp9TstuCQjXXjJN0JtEsT60Y+7oAKtu2UbF vlPjSnkOxgotBgUkf7WMTvHoGpifvsMOjgNklYiZVamRxWSVrQSEKiXNbySuMgyJ 5R0FgXL5riuVtgvJIA9dIaIo+moxz6cZFhBgbQxYzzSEVNsmczu3+hHcW0n7n77Q 2z4ypQGW1cuh9/H8Qx2j+USksbvC7Sj1yPwXaqgVmOx/c/Q+W+t/muTP/qTmRhjX YfXf3G1a3hQ6iycTmAj3mI8Dx/DAG7SK0EPxnWnmLgDClNd0uO0HR4F+qCLMg8rJ EhgSnfQ0smvY2ZDTwnGbfxI4MbV0Vurm1x0URxsrpZCFymHQF4pWOcdXn+/gL9sf 80z9jj/e1dmpiaJ9Ch5gDbnSE2d5xU+kpd61rfyrUIWMxwReAufPSbmJ5kjgcyHf N2ELj06OSzlte889XBTXZTVP2SpsAUg55D2BsXN0KE0pYX3IpUURdO/YPgnXeY6e ajRTNDyNydw6mZXVS5g2 =Cphj -----END PGP SIGNATURE----- --oR7ucqnWJOgl8bjxaspF0VIabVcTl7A6a-- From owner-svn-src-head@freebsd.org Sun Sep 11 17:22:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B6E0BD688B; Sun, 11 Sep 2016 17:22:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id 18CC1BCC; Sun, 11 Sep 2016 17:22:56 +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 u8BHMtSZ086887; Sun, 11 Sep 2016 17:22:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHMtCs086884; Sun, 11 Sep 2016 17:22:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111722.u8BHMtCs086884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 17:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305699 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:22:56 -0000 Author: np Date: Sun Sep 11 17:22:54 2016 New Revision: 305699 URL: https://svnweb.freebsd.org/changeset/base/305699 Log: cxgbe(4): Update the pad_boundary calculation for T6, which has a different range of boundaries. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4vf_hw.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 17:19:30 2016 (r305698) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 17:22:54 2016 (r305699) @@ -7892,7 +7892,13 @@ int t4_init_sge_params(struct adapter *a sp->sge_control = r; sp->spg_len = r & F_EGRSTATUSPAGESIZE ? 128 : 64; sp->fl_pktshift = G_PKTSHIFT(r); - sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + 5); + if (chip_id(adapter) <= CHELSIO_T5) { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + + X_INGPADBOUNDARY_SHIFT); + } else { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + + X_T6_INGPADBOUNDARY_SHIFT); + } if (is_t4(adapter)) sp->pack_boundary = sp->pad_boundary; else { Modified: head/sys/dev/cxgbe/common/t4vf_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 17:19:30 2016 (r305698) +++ head/sys/dev/cxgbe/common/t4vf_hw.c Sun Sep 11 17:22:54 2016 (r305699) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "common.h" #include "t4_regs.h" +#include "t4_regs_values.h" #undef msleep #define msleep(x) do { \ @@ -169,7 +170,13 @@ int t4vf_get_sge_params(struct adapter * */ sp->spg_len = sp->sge_control & F_EGRSTATUSPAGESIZE ? 128 : 64; sp->fl_pktshift = G_PKTSHIFT(sp->sge_control); - sp->pad_boundary = 1 << (G_INGPADBOUNDARY(sp->sge_control) + 5); + if (chip_id(adapter) <= CHELSIO_T5) { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(sp->sge_control) + + X_INGPADBOUNDARY_SHIFT); + } else { + sp->pad_boundary = 1 << (G_INGPADBOUNDARY(sp->sge_control) + + X_T6_INGPADBOUNDARY_SHIFT); + } if (is_t4(adapter)) sp->pack_boundary = sp->pad_boundary; else { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:19:30 2016 (r305698) +++ head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:22:54 2016 (r305699) @@ -433,16 +433,20 @@ static inline void setup_pad_and_pack_boundaries(struct adapter *sc) { uint32_t v, m; - int pad, pack; + int pad, pack, pad_shift; + pad_shift = chip_id(sc) > CHELSIO_T5 ? X_T6_INGPADBOUNDARY_SHIFT : + X_INGPADBOUNDARY_SHIFT; pad = fl_pad; - if (fl_pad < 32 || fl_pad > 4096 || !powerof2(fl_pad)) { + if (fl_pad < (1 << pad_shift) || + fl_pad > (1 << (pad_shift + M_INGPADBOUNDARY)) || + !powerof2(fl_pad)) { /* * If there is any chance that we might use buffer packing and * the chip is a T4, then pick 64 as the pad/pack boundary. Set - * it to 32 in all other cases. + * it to the minimum allowed in all other cases. */ - pad = is_t4(sc) && buffer_packing ? 64 : 32; + pad = is_t4(sc) && buffer_packing ? 64 : 1 << pad_shift; /* * For fl_pad = 0 we'll still write a reasonable value to the @@ -456,7 +460,7 @@ setup_pad_and_pack_boundaries(struct ada } } m = V_INGPADBOUNDARY(M_INGPADBOUNDARY); - v = V_INGPADBOUNDARY(ilog2(pad) - 5); + v = V_INGPADBOUNDARY(ilog2(pad) - pad_shift); t4_set_reg_field(sc, A_SGE_CONTROL, m, v); if (is_t4(sc)) { From owner-svn-src-head@freebsd.org Sun Sep 11 17:44:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C20BD71EE; Sun, 11 Sep 2016 17:44:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7D1A1AB4; Sun, 11 Sep 2016 17:44:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BHiZSr095183; Sun, 11 Sep 2016 17:44:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHiZNb095182; Sun, 11 Sep 2016 17:44:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609111744.u8BHiZNb095182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 11 Sep 2016 17:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305700 - head/lib/libifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:44:36 -0000 Author: allanjude Date: Sun Sep 11 17:44:35 2016 New Revision: 305700 URL: https://svnweb.freebsd.org/changeset/base/305700 Log: Mark libifconfig as private until the API/ABI is stable libifconfig is still experimental and under active development. To avoid making any ABI promises, mark the library as private Suggested by: bapt Reviewed by: kp Modified: head/lib/libifconfig/Makefile Modified: head/lib/libifconfig/Makefile ============================================================================== --- head/lib/libifconfig/Makefile Sun Sep 11 17:22:54 2016 (r305699) +++ head/lib/libifconfig/Makefile Sun Sep 11 17:44:35 2016 (r305700) @@ -2,6 +2,7 @@ PACKAGE= lib${LIB} LIB= ifconfig +PRIVATELIB= true # Don't build shared library, for now. NO_PIC= From owner-svn-src-head@freebsd.org Sun Sep 11 17:48:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6BA9BD734F; Sun, 11 Sep 2016 17:48:07 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE141DCD; Sun, 11 Sep 2016 17:48:07 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BHm6lJ095431; Sun, 11 Sep 2016 17:48:06 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHm66n095430; Sun, 11 Sep 2016 17:48:06 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609111748.u8BHm66n095430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 11 Sep 2016 17:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305701 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:48:08 -0000 Author: allanjude Date: Sun Sep 11 17:48:06 2016 New Revision: 305701 URL: https://svnweb.freebsd.org/changeset/base/305701 Log: MFV r268120: 4936 lz4 could theoretically overflow a pointer with a certain input illumos/illumos-gate@58d0718061c87e3d647c891ec5281b93c08dba4e Reviewed by: delphij MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D7850 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Sun Sep 11 17:44:35 2016 (r305700) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Sun Sep 11 17:48:06 2016 (r305701) @@ -187,21 +187,18 @@ lz4_decompress(void *s_start, void *d_st defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \ defined(__LP64__) || defined(_LP64)) #define LZ4_ARCH64 1 -/* - * Illumos: On amd64 we have 20k of stack and 24k on sun4u and sun4v, so we - * can spend 16k on the algorithm - */ -/* FreeBSD: Use heap for all platforms for now */ -#define STACKLIMIT 0 #else #define LZ4_ARCH64 0 +#endif + /* - * Illumos: On i386 we only have 12k of stack, so in order to maintain the - * same COMPRESSIONLEVEL we have to use heap allocation. Performance will - * suck, but alas, it's ZFS on 32-bit we're talking about, so... + * Limits the amount of stack space that the algorithm may consume to hold + * the compression lookup table. The value `9' here means we'll never use + * more than 2k of stack (see above for a description of COMPRESSIONLEVEL). + * If more memory is needed, it is allocated from the heap. */ +/* FreeBSD: Use heap for all platforms for now */ #define STACKLIMIT 0 -#endif /* * Little Endian or Big Endian? @@ -870,7 +867,7 @@ real_LZ4_compress(const char *source, ch /* Decompression functions */ /* - * Note: The decoding functionLZ4_uncompress_unknownOutputSize() is safe + * Note: The decoding function LZ4_uncompress_unknownOutputSize() is safe * against "buffer overflow" attack type. They will never write nor * read outside of the provided output buffers. * LZ4_uncompress_unknownOutputSize() also insures that it will never @@ -913,6 +910,9 @@ LZ4_uncompress_unknownOutputSize(const c } /* copy literals */ cpy = op + length; + /* CORNER-CASE: cpy might overflow. */ + if (cpy < op) + goto _output_error; /* cpy was overflowed, bail! */ if ((cpy > oend - COPYLENGTH) || (ip + length > iend - COPYLENGTH)) { if (cpy > oend) From owner-svn-src-head@freebsd.org Sun Sep 11 17:51:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA1BBBD758B; Sun, 11 Sep 2016 17:51:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6D66B1ED; Sun, 11 Sep 2016 17:51:18 +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 u8BHpHLK096285; Sun, 11 Sep 2016 17:51:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHpH34096283; Sun, 11 Sep 2016 17:51:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111751.u8BHpH34096283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 17:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305702 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:51:18 -0000 Author: np Date: Sun Sep 11 17:51:17 2016 New Revision: 305702 URL: https://svnweb.freebsd.org/changeset/base/305702 Log: cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Sun Sep 11 17:48:06 2016 (r305701) +++ head/sys/dev/cxgbe/t4_netmap.c Sun Sep 11 17:51:17 2016 (r305702) @@ -139,8 +139,10 @@ alloc_nm_rxq_hwq(struct vi_info *vi, str (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) | (black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0)); c.fl0dcaen_to_fl0cidxfthresh = - htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) | - V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); + htobe16(V_FW_IQ_CMD_FL0FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B) | + V_FW_IQ_CMD_FL0FBMAX(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMAX_512B : X_FETCHBURSTMAX_256B)); c.fl0size = htobe16(na->num_rx_desc / 8 + sp->spg_len / EQ_ESIZE); c.fl0addr = htobe64(nm_rxq->fl_ba); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:48:06 2016 (r305701) +++ head/sys/dev/cxgbe/t4_sge.c Sun Sep 11 17:51:17 2016 (r305702) @@ -2733,8 +2733,10 @@ alloc_iq_fl(struct vi_info *vi, struct s F_FW_IQ_CMD_FL0CONGEN); } c.fl0dcaen_to_fl0cidxfthresh = - htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) | - V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); + htobe16(V_FW_IQ_CMD_FL0FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B) | + V_FW_IQ_CMD_FL0FBMAX(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMAX_512B : X_FETCHBURSTMAX_256B)); c.fl0size = htobe16(fl->qsize); c.fl0addr = htobe64(fl->ba); } From owner-svn-src-head@freebsd.org Sun Sep 11 17:57:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE360BD778F; Sun, 11 Sep 2016 17:57:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 82076ABB; Sun, 11 Sep 2016 17:57:54 +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 u8BHvrnb099655; Sun, 11 Sep 2016 17:57:53 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BHvrr7099654; Sun, 11 Sep 2016 17:57:53 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111757.u8BHvrr7099654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 17:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305703 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 17:57:54 -0000 Author: np Date: Sun Sep 11 17:57:53 2016 New Revision: 305703 URL: https://svnweb.freebsd.org/changeset/base/305703 Log: cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Sep 11 17:51:17 2016 (r305702) +++ head/sys/dev/cxgbe/t4_main.c Sun Sep 11 17:57:53 2016 (r305703) @@ -2027,11 +2027,11 @@ t4_map_bar_2(struct adapter *sc) } sc->udbs_base = rman_get_virtual(sc->udbs_res); - if (is_t5(sc)) { + if (chip_id(sc) >= CHELSIO_T5) { setbit(&sc->doorbells, DOORBELL_UDB); #if defined(__i386__) || defined(__amd64__) if (t5_write_combine) { - int rc; + int rc, mode; /* * Enable write combining on BAR2. This is the @@ -2054,8 +2054,9 @@ t4_map_bar_2(struct adapter *sc) rc); } + mode = is_t5(sc) ? V_STATMODE(0) : V_T6_STATMODE(0); t4_write_reg(sc, A_SGE_STAT_CFG, - V_STATSOURCE_T5(7) | V_STATMODE(0)); + V_STATSOURCE_T5(7) | mode); } #endif } @@ -7472,6 +7473,8 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) struct sbuf *sb; int rc, v; + MPASS(chip_id(sc) >= CHELSIO_T5); + rc = sysctl_wire_old_buffer(req, 0); if (rc != 0) return (rc); @@ -7482,14 +7485,19 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) v = t4_read_reg(sc, A_SGE_STAT_CFG); if (G_STATSOURCE_T5(v) == 7) { - if (G_STATMODE(v) == 0) { + int mode; + + mode = is_t5(sc) ? G_STATMODE(v) : G_T6_STATMODE(v); + if (mode == 0) { sbuf_printf(sb, "total %d, incomplete %d", t4_read_reg(sc, A_SGE_STAT_TOTAL), t4_read_reg(sc, A_SGE_STAT_MATCH)); - } else if (G_STATMODE(v) == 1) { + } else if (mode == 1) { sbuf_printf(sb, "total %d, data overflow %d", t4_read_reg(sc, A_SGE_STAT_TOTAL), t4_read_reg(sc, A_SGE_STAT_MATCH)); + } else { + sbuf_printf(sb, "unknown mode %d", mode); } } rc = sbuf_finish(sb); From owner-svn-src-head@freebsd.org Sun Sep 11 18:05:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D65BD7ABC; Sun, 11 Sep 2016 18:05:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id 721853ED; Sun, 11 Sep 2016 18:05:38 +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 u8BI5bWf004137; Sun, 11 Sep 2016 18:05:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BI5bso004136; Sun, 11 Sep 2016 18:05:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609111805.u8BI5bso004136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 18:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305704 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 18:05:38 -0000 Author: np Date: Sun Sep 11 18:05:37 2016 New Revision: 305704 URL: https://svnweb.freebsd.org/changeset/base/305704 Log: cxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags. Tunables that end with _flags are special. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Sep 11 17:57:53 2016 (r305703) +++ head/sys/dev/cxgbe/t4_main.c Sun Sep 11 18:05:37 2016 (r305704) @@ -675,7 +675,7 @@ t4_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - TUNABLE_INT_FETCH("hw.cxgbe.debug_flags", &sc->debug_flags); + TUNABLE_INT_FETCH("hw.cxgbe.dflags", &sc->debug_flags); if ((pci_get_device(dev) & 0xff00) == 0x5400) t5_attribute_workaround(dev); @@ -4642,7 +4642,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dflags", CTLFLAG_RW, &sc->debug_flags, 0, "flags to enable runtime debugging"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "tp_version", From owner-svn-src-head@freebsd.org Sun Sep 11 18:56:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC9FBD5F12; Sun, 11 Sep 2016 18:56: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 mx1.freebsd.org (Postfix) with ESMTPS id DC6F13FE; Sun, 11 Sep 2016 18:56:39 +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 u8BIudpI023563; Sun, 11 Sep 2016 18:56:39 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BIucU3023555; Sun, 11 Sep 2016 18:56:38 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609111856.u8BIucU3023555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 11 Sep 2016 18:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305706 - in head: etc/mtree include sys/conf sys/dev/evdev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 18:56:40 -0000 Author: gonzo Date: Sun Sep 11 18:56:38 2016 New Revision: 305706 URL: https://svnweb.freebsd.org/changeset/base/305706 Log: Add evdev protocol implementation evdev is a generic input event interface compatible with Linux evdev API at ioctl level. It allows using unmodified (apart from header name) input evdev drivers in Xorg, Wayland, Qt. This commit has only generic kernel API. evdev support for individual hardware drivers like ukbd, ums, atkbd, etc. will be committed later. Project was started by Jakub Klama as part of GSoC 2014. Jakub's evdev implementation was later used as a base, updated and finished by Vladimir Kondratiev. Submitted by: Vladimir Kondratiev Reviewed by: adrian, hans Differential Revision: https://reviews.freebsd.org/D6998 Added: head/sys/dev/evdev/ head/sys/dev/evdev/cdev.c (contents, props changed) head/sys/dev/evdev/evdev.c (contents, props changed) head/sys/dev/evdev/evdev.h (contents, props changed) head/sys/dev/evdev/evdev_mt.c (contents, props changed) head/sys/dev/evdev/evdev_private.h (contents, props changed) head/sys/dev/evdev/evdev_utils.c (contents, props changed) head/sys/dev/evdev/input-event-codes.h (contents, props changed) head/sys/dev/evdev/input.h (contents, props changed) head/sys/dev/evdev/uinput.c (contents, props changed) head/sys/dev/evdev/uinput.h (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Sep 11 18:15:34 2016 (r305705) +++ head/etc/mtree/BSD.include.dist Sun Sep 11 18:56:38 2016 (r305706) @@ -110,6 +110,8 @@ .. ciss .. + evdev + .. filemon .. firewire Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Sep 11 18:15:34 2016 (r305705) +++ head/include/Makefile Sun Sep 11 18:56:38 2016 (r305706) @@ -154,7 +154,7 @@ copies: .PHONY .META done; \ fi .endfor -.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} cd ${.CURDIR}/../sys; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${DESTDIR}${INCLUDEDIR}/$i @@ -177,6 +177,13 @@ copies: .PHONY .META ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \ ${DESTDIR}${INCLUDEDIR}/dev/nand .endif + cd ${.CURDIR}/../sys/dev/evdev; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input.h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input-event-codes.h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 uinput.h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev cd ${.CURDIR}/../sys/dev/pci; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \ ${DESTDIR}${INCLUDEDIR}/dev/pci @@ -238,7 +245,7 @@ symlinks: .PHONY .META ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor -.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/nand:Ndev/pci} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ @@ -266,6 +273,11 @@ symlinks: .PHONY .META ${DESTDIR}${INCLUDEDIR}/dev/nand; \ done .endif + cd ${.CURDIR}/../sys/dev/evdev; \ + for h in input.h input-event-codes.h uinput.h; do \ + ln -fs ../../../../sys/dev/evdev/$$h \ + ${DESTDIR}${INCLUDEDIR}/dev/evdev; \ + done cd ${.CURDIR}/../sys/dev/pci; \ for h in pcireg.h; do \ ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Sep 11 18:15:34 2016 (r305705) +++ head/sys/conf/NOTES Sun Sep 11 18:56:38 2016 (r305706) @@ -3052,3 +3052,8 @@ options GZIO # BHND(4) drivers options BHND_LOGLEVEL # Logging threshold level + +# evdev interface +options EVDEV +options EVDEV_DEBUG +options UINPUT_DEBUG Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Sep 11 18:15:34 2016 (r305705) +++ head/sys/conf/files Sun Sep 11 18:56:38 2016 (r305706) @@ -1501,6 +1501,11 @@ dev/etherswitch/ip17x/ip17x_vlans.c opti dev/etherswitch/miiproxy.c optional miiproxy dev/etherswitch/rtl8366/rtl8366rb.c optional rtl8366rb dev/etherswitch/ukswitch/ukswitch.c optional ukswitch +dev/evdev/cdev.c optional evdev +dev/evdev/evdev.c optional evdev +dev/evdev/evdev_mt.c optional evdev +dev/evdev/evdev_utils.c optional evdev +dev/evdev/uinput.c optional evdev uinput dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa dev/ex/if_ex_pccard.c optional ex pccard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Sep 11 18:15:34 2016 (r305705) +++ head/sys/conf/options Sun Sep 11 18:56:38 2016 (r305706) @@ -987,3 +987,8 @@ BHND_LOGLEVEL opt_global.h # GPIO and child devices GPIO_SPI_DEBUG opt_gpio.h + +# evdev protocol support +EVDEV opt_evdev.h +EVDEV_DEBUG opt_evdev.h +UINPUT_DEBUG opt_evdev.h Added: head/sys/dev/evdev/cdev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/evdev/cdev.c Sun Sep 11 18:56:38 2016 (r305706) @@ -0,0 +1,860 @@ +/*- + * Copyright (c) 2014 Jakub Wojciech Klama + * Copyright (c) 2015-2016 Vladimir Kondratyev + * 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 "opt_evdev.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef EVDEV_DEBUG +#define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args); +#else +#define debugf(client, fmt, args...) +#endif + +#define DEF_RING_REPORTS 8 + +static d_open_t evdev_open; +static d_read_t evdev_read; +static d_write_t evdev_write; +static d_ioctl_t evdev_ioctl; +static d_poll_t evdev_poll; +static d_kqfilter_t evdev_kqfilter; + +static int evdev_kqread(struct knote *kn, long hint); +static void evdev_kqdetach(struct knote *kn); +static void evdev_dtor(void *); +static int evdev_ioctl_eviocgbit(struct evdev_dev *, int, int, caddr_t); +static void evdev_client_filter_queue(struct evdev_client *, uint16_t); + +static struct cdevsw evdev_cdevsw = { + .d_version = D_VERSION, + .d_open = evdev_open, + .d_read = evdev_read, + .d_write = evdev_write, + .d_ioctl = evdev_ioctl, + .d_poll = evdev_poll, + .d_kqfilter = evdev_kqfilter, + .d_name = "evdev", +}; + +static struct filterops evdev_cdev_filterops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = evdev_kqdetach, + .f_event = evdev_kqread, +}; + +static int +evdev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct evdev_dev *evdev = dev->si_drv1; + struct evdev_client *client; + size_t buffer_size; + int ret; + + if (evdev == NULL) + return (ENODEV); + + /* Initialize client structure */ + buffer_size = evdev->ev_report_size * DEF_RING_REPORTS; + client = malloc(offsetof(struct evdev_client, ec_buffer) + + sizeof(struct input_event) * buffer_size, + M_EVDEV, M_WAITOK | M_ZERO); + + /* Initialize ring buffer */ + client->ec_buffer_size = buffer_size; + client->ec_buffer_head = 0; + client->ec_buffer_tail = 0; + client->ec_buffer_ready = 0; + + client->ec_evdev = evdev; + mtx_init(&client->ec_buffer_mtx, "evclient", "evdev", MTX_DEF); + knlist_init_mtx(&client->ec_selp.si_note, &client->ec_buffer_mtx); + + /* Avoid race with evdev_unregister */ + EVDEV_LOCK(evdev); + if (dev->si_drv1 == NULL) + ret = ENODEV; + else + ret = evdev_register_client(evdev, client); + + if (ret != 0) + evdev_revoke_client(client); + /* + * Unlock evdev here because non-sleepable lock held + * while calling devfs_set_cdevpriv upsets WITNESS + */ + EVDEV_UNLOCK(evdev); + + if (!ret) + ret = devfs_set_cdevpriv(client, evdev_dtor); + + if (ret != 0) { + debugf(client, "cannot register evdev client"); + evdev_dtor(client); + } + + return (ret); +} + +static void +evdev_dtor(void *data) +{ + struct evdev_client *client = (struct evdev_client *)data; + + EVDEV_LOCK(client->ec_evdev); + if (!client->ec_revoked) + evdev_dispose_client(client->ec_evdev, client); + EVDEV_UNLOCK(client->ec_evdev); + + knlist_clear(&client->ec_selp.si_note, 0); + seldrain(&client->ec_selp); + knlist_destroy(&client->ec_selp.si_note); + funsetown(&client->ec_sigio); + mtx_destroy(&client->ec_buffer_mtx); + free(client, M_EVDEV); +} + +static int +evdev_read(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct evdev_client *client; + struct input_event *event; + int ret = 0; + int remaining; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + debugf(client, "read %zd bytes by thread %d", uio->uio_resid, + uio->uio_td->td_tid); + + if (client->ec_revoked) + return (ENODEV); + + /* Zero-sized reads are allowed for error checking */ + if (uio->uio_resid != 0 && uio->uio_resid < sizeof(struct input_event)) + return (EINVAL); + + remaining = uio->uio_resid / sizeof(struct input_event); + + EVDEV_CLIENT_LOCKQ(client); + + if (EVDEV_CLIENT_EMPTYQ(client)) { + if (ioflag & O_NONBLOCK) + ret = EWOULDBLOCK; + else { + if (remaining != 0) { + client->ec_blocked = true; + ret = mtx_sleep(client, &client->ec_buffer_mtx, + PCATCH, "evread", 0); + } + } + } + + while (ret == 0 && !EVDEV_CLIENT_EMPTYQ(client) && remaining > 0) { + event = &client->ec_buffer[client->ec_buffer_head]; + client->ec_buffer_head = + (client->ec_buffer_head + 1) % client->ec_buffer_size; + remaining--; + + EVDEV_CLIENT_UNLOCKQ(client); + ret = uiomove(event, sizeof(struct input_event), uio); + EVDEV_CLIENT_LOCKQ(client); + } + + EVDEV_CLIENT_UNLOCKQ(client); + + return (ret); +} + +static int +evdev_write(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct evdev_dev *evdev = dev->si_drv1; + struct evdev_client *client; + struct input_event event; + int ret = 0; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + debugf(client, "write %zd bytes by thread %d", uio->uio_resid, + uio->uio_td->td_tid); + + if (client->ec_revoked || evdev == NULL) + return (ENODEV); + + if (uio->uio_resid % sizeof(struct input_event) != 0) { + debugf(client, "write size not multiple of input_event size"); + return (EINVAL); + } + + while (uio->uio_resid > 0 && ret == 0) { + ret = uiomove(&event, sizeof(struct input_event), uio); + if (ret == 0) + ret = evdev_inject_event(evdev, event.type, event.code, + event.value); + } + + return (ret); +} + +static int +evdev_poll(struct cdev *dev, int events, struct thread *td) +{ + struct evdev_client *client; + int ret; + int revents = 0; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (POLLNVAL); + + debugf(client, "poll by thread %d", td->td_tid); + + if (client->ec_revoked) + return (POLLHUP); + + if (events & (POLLIN | POLLRDNORM)) { + EVDEV_CLIENT_LOCKQ(client); + if (!EVDEV_CLIENT_EMPTYQ(client)) + revents = events & (POLLIN | POLLRDNORM); + else { + client->ec_selected = true; + selrecord(td, &client->ec_selp); + } + EVDEV_CLIENT_UNLOCKQ(client); + } + + return (revents); +} + +static int +evdev_kqfilter(struct cdev *dev, struct knote *kn) +{ + struct evdev_client *client; + int ret; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + if (client->ec_revoked) + return (ENODEV); + + switch(kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &evdev_cdev_filterops; + break; + default: + return(EINVAL); + } + kn->kn_hook = (caddr_t)client; + + knlist_add(&client->ec_selp.si_note, kn, 0); + return (0); +} + +static int +evdev_kqread(struct knote *kn, long hint) +{ + struct evdev_client *client; + int ret; + + client = (struct evdev_client *)kn->kn_hook; + + EVDEV_CLIENT_LOCKQ_ASSERT(client); + + if (client->ec_revoked) { + kn->kn_flags |= EV_EOF; + ret = 1; + } else { + kn->kn_data = EVDEV_CLIENT_SIZEQ(client) * + sizeof(struct input_event); + ret = !EVDEV_CLIENT_EMPTYQ(client); + } + return (ret); +} + +static void +evdev_kqdetach(struct knote *kn) +{ + struct evdev_client *client; + + client = (struct evdev_client *)kn->kn_hook; + knlist_remove(&client->ec_selp.si_note, kn, 0); +} + +static int +evdev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct evdev_dev *evdev = dev->si_drv1; + struct evdev_client *client; + struct input_keymap_entry *ke; + int ret, len, limit, type_num; + uint32_t code; + size_t nvalues; + + ret = devfs_get_cdevpriv((void **)&client); + if (ret != 0) + return (ret); + + if (client->ec_revoked || evdev == NULL) + return (ENODEV); + + /* file I/O ioctl handling */ + switch (cmd) { + case FIOSETOWN: + return (fsetown(*(int *)data, &client->ec_sigio)); + + case FIOGETOWN: + *(int *)data = fgetown(&client->ec_sigio); + return (0); + + case FIONBIO: + return (0); + + case FIOASYNC: + if (*(int *)data) + client->ec_async = true; + else + client->ec_async = false; + + return (0); + + case FIONREAD: + EVDEV_CLIENT_LOCKQ(client); + *(int *)data = + EVDEV_CLIENT_SIZEQ(client) * sizeof(struct input_event); + EVDEV_CLIENT_UNLOCKQ(client); + return (0); + } + + len = IOCPARM_LEN(cmd); + debugf(client, "ioctl called: cmd=0x%08lx, data=%p", cmd, data); + + /* evdev fixed-length ioctls handling */ + switch (cmd) { + case EVIOCGVERSION: + *(int *)data = EV_VERSION; + return (0); + + case EVIOCGID: + debugf(client, "EVIOCGID: bus=%d vendor=0x%04x product=0x%04x", + evdev->ev_id.bustype, evdev->ev_id.vendor, + evdev->ev_id.product); + memcpy(data, &evdev->ev_id, sizeof(struct input_id)); + return (0); + + case EVIOCGREP: + if (!evdev_event_supported(evdev, EV_REP)) + return (ENOTSUP); + + memcpy(data, evdev->ev_rep, sizeof(evdev->ev_rep)); + return (0); + + case EVIOCSREP: + if (!evdev_event_supported(evdev, EV_REP)) + return (ENOTSUP); + + evdev_inject_event(evdev, EV_REP, REP_DELAY, ((int *)data)[0]); + evdev_inject_event(evdev, EV_REP, REP_PERIOD, + ((int *)data)[1]); + return (0); + + case EVIOCGKEYCODE: + /* Fake unsupported ioctl */ + return (0); + + case EVIOCGKEYCODE_V2: + if (evdev->ev_methods == NULL || + evdev->ev_methods->ev_get_keycode == NULL) + return (ENOTSUP); + + ke = (struct input_keymap_entry *)data; + evdev->ev_methods->ev_get_keycode(evdev, evdev->ev_softc, ke); + return (0); + + case EVIOCSKEYCODE: + /* Fake unsupported ioctl */ + return (0); + + case EVIOCSKEYCODE_V2: + if (evdev->ev_methods == NULL || + evdev->ev_methods->ev_set_keycode == NULL) + return (ENOTSUP); + + ke = (struct input_keymap_entry *)data; + evdev->ev_methods->ev_set_keycode(evdev, evdev->ev_softc, ke); + return (0); + + case EVIOCGABS(0) ... EVIOCGABS(ABS_MAX): + if (evdev->ev_absinfo == NULL) + return (EINVAL); + + memcpy(data, &evdev->ev_absinfo[cmd - EVIOCGABS(0)], + sizeof(struct input_absinfo)); + return (0); + + case EVIOCSABS(0) ... EVIOCSABS(ABS_MAX): + if (evdev->ev_absinfo == NULL) + return (EINVAL); + + code = cmd - EVIOCSABS(0); + /* mt-slot number can not be changed */ + if (code == ABS_MT_SLOT) + return (EINVAL); + + EVDEV_LOCK(evdev); + evdev_set_absinfo(evdev, code, (struct input_absinfo *)data); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCSFF: + case EVIOCRMFF: + case EVIOCGEFFECTS: + /* Fake unsupported ioctls */ + return (0); + + case EVIOCGRAB: + EVDEV_LOCK(evdev); + if (*(int *)data) + ret = evdev_grab_client(evdev, client); + else + ret = evdev_release_client(evdev, client); + EVDEV_UNLOCK(evdev); + return (ret); + + case EVIOCREVOKE: + if (*(int *)data != 0) + return (EINVAL); + + EVDEV_LOCK(evdev); + if (dev->si_drv1 != NULL && !client->ec_revoked) { + evdev_dispose_client(evdev, client); + evdev_revoke_client(client); + } + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCSCLOCKID: + switch (*(int *)data) { + case CLOCK_REALTIME: + client->ec_clock_id = EV_CLOCK_REALTIME; + return (0); + case CLOCK_MONOTONIC: + client->ec_clock_id = EV_CLOCK_MONOTONIC; + return (0); + default: + return (EINVAL); + } + } + + /* evdev variable-length ioctls handling */ + switch (IOCBASECMD(cmd)) { + case EVIOCGNAME(0): + strlcpy(data, evdev->ev_name, len); + return (0); + + case EVIOCGPHYS(0): + if (evdev->ev_shortname[0] == 0) + return (ENOENT); + + strlcpy(data, evdev->ev_shortname, len); + return (0); + + case EVIOCGUNIQ(0): + if (evdev->ev_serial[0] == 0) + return (ENOENT); + + strlcpy(data, evdev->ev_serial, len); + return (0); + + case EVIOCGPROP(0): + limit = MIN(len, bitstr_size(INPUT_PROP_CNT)); + memcpy(data, evdev->ev_prop_flags, limit); + return (0); + + case EVIOCGMTSLOTS(0): + if (evdev->ev_mt == NULL) + return (EINVAL); + if (len < sizeof(uint32_t)) + return (EINVAL); + code = *(uint32_t *)data; + if (!ABS_IS_MT(code)) + return (EINVAL); + + nvalues = + MIN(len / sizeof(int32_t) - 1, MAXIMAL_MT_SLOT(evdev) + 1); + for (int i = 0; i < nvalues; i++) + ((int32_t *)data)[i + 1] = + evdev_get_mt_value(evdev, i, code); + return (0); + + case EVIOCGKEY(0): + limit = MIN(len, bitstr_size(KEY_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_KEY); + memcpy(data, evdev->ev_key_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGLED(0): + limit = MIN(len, bitstr_size(LED_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_LED); + memcpy(data, evdev->ev_led_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGSND(0): + limit = MIN(len, bitstr_size(SND_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_SND); + memcpy(data, evdev->ev_snd_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGSW(0): + limit = MIN(len, bitstr_size(SW_CNT)); + EVDEV_LOCK(evdev); + evdev_client_filter_queue(client, EV_SW); + memcpy(data, evdev->ev_sw_states, limit); + EVDEV_UNLOCK(evdev); + return (0); + + case EVIOCGBIT(0, 0) ... EVIOCGBIT(EV_MAX, 0): + type_num = IOCBASECMD(cmd) - EVIOCGBIT(0, 0); + debugf(client, "EVIOCGBIT(%d): data=%p, len=%d", type_num, + data, len); + return (evdev_ioctl_eviocgbit(evdev, type_num, len, data)); + } + + return (EINVAL); +} + +static int +evdev_ioctl_eviocgbit(struct evdev_dev *evdev, int type, int len, caddr_t data) +{ + unsigned long *bitmap; + int limit; + + switch (type) { + case 0: + bitmap = evdev->ev_type_flags; + limit = EV_CNT; + break; + case EV_KEY: + bitmap = evdev->ev_key_flags; + limit = KEY_CNT; + break; + case EV_REL: + bitmap = evdev->ev_rel_flags; + limit = REL_CNT; + break; + case EV_ABS: + bitmap = evdev->ev_abs_flags; + limit = ABS_CNT; + break; + case EV_MSC: + bitmap = evdev->ev_msc_flags; + limit = MSC_CNT; + break; + case EV_LED: + bitmap = evdev->ev_led_flags; + limit = LED_CNT; + break; + case EV_SND: + bitmap = evdev->ev_snd_flags; + limit = SND_CNT; + break; + case EV_SW: + bitmap = evdev->ev_sw_flags; + limit = SW_CNT; + break; + case EV_FF: + /* + * We don't support EV_FF now, so let's + * just fake it returning only zeros. + */ + bzero(data, len); + return (0); + default: + return (ENOTTY); + } + + /* + * Clear ioctl data buffer in case it's bigger than + * bitmap size + */ + bzero(data, len); + + limit = bitstr_size(limit); + len = MIN(limit, len); + memcpy(data, bitmap, len); + return (0); +} + +void +evdev_revoke_client(struct evdev_client *client) +{ + + EVDEV_LOCK_ASSERT(client->ec_evdev); + + client->ec_revoked = true; +} + +void +evdev_notify_event(struct evdev_client *client) +{ + + EVDEV_CLIENT_LOCKQ_ASSERT(client); + + if (client->ec_blocked) { + client->ec_blocked = false; + wakeup(client); + } + if (client->ec_selected) { + client->ec_selected = false; + selwakeup(&client->ec_selp); + } + KNOTE_LOCKED(&client->ec_selp.si_note, 0); + + if (client->ec_async && client->ec_sigio != NULL) + pgsigio(&client->ec_sigio, SIGIO, 0); +} + +int +evdev_cdev_create(struct evdev_dev *evdev) +{ + struct make_dev_args mda; + int ret, unit = 0; + + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME; + mda.mda_devsw = &evdev_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_si_drv1 = evdev; + + /* Try to coexist with cuse-backed input/event devices */ + while ((ret = make_dev_s(&mda, &evdev->ev_cdev, "input/event%d", unit)) + == EEXIST) + unit++; + + if (ret == 0) + evdev->ev_unit = unit; + + return (ret); +} + +int +evdev_cdev_destroy(struct evdev_dev *evdev) +{ + + destroy_dev(evdev->ev_cdev); + return (0); +} + +static void +evdev_client_gettime(struct evdev_client *client, struct timeval *tv) +{ + + switch (client->ec_clock_id) { + case EV_CLOCK_BOOTTIME: + /* + * XXX: FreeBSD does not support true POSIX monotonic clock. + * So aliase EV_CLOCK_BOOTTIME to EV_CLOCK_MONOTONIC. + */ + case EV_CLOCK_MONOTONIC: + microuptime(tv); + break; + + case EV_CLOCK_REALTIME: + default: + microtime(tv); + break; + } +} + +void +evdev_client_push(struct evdev_client *client, uint16_t type, uint16_t code, + int32_t value) +{ + struct timeval time; + size_t count, head, tail, ready; + + EVDEV_CLIENT_LOCKQ_ASSERT(client); + head = client->ec_buffer_head; + tail = client->ec_buffer_tail; + ready = client->ec_buffer_ready; + count = client->ec_buffer_size; + + /* If queue is full drop its content and place SYN_DROPPED event */ + if ((tail + 1) % count == head) { + debugf(client, "client %p: buffer overflow", client); + + head = (tail + count - 1) % count; + client->ec_buffer[head] = (struct input_event) { + .type = EV_SYN, + .code = SYN_DROPPED, + .value = 0 + }; + /* + * XXX: Here is a small race window from now till the end of + * report. The queue is empty but client has been already + * notified of data readyness. Can be fixed in two ways: + * 1. Implement bulk insert so queue lock would not be dropped + * till the SYN_REPORT event. + * 2. Insert SYN_REPORT just now and skip remaining events + */ + client->ec_buffer_head = head; + client->ec_buffer_ready = head; + } + + client->ec_buffer[tail].type = type; + client->ec_buffer[tail].code = code; + client->ec_buffer[tail].value = value; + client->ec_buffer_tail = (tail + 1) % count; + + /* Allow users to read events only after report has been completed */ + if (type == EV_SYN && code == SYN_REPORT) { + evdev_client_gettime(client, &time); + for (; ready != client->ec_buffer_tail; + ready = (ready + 1) % count) + client->ec_buffer[ready].time = time; + client->ec_buffer_ready = client->ec_buffer_tail; + } +} + +void +evdev_client_dumpqueue(struct evdev_client *client) +{ + struct input_event *event; + size_t i, head, tail, ready, size; + + head = client->ec_buffer_head; + tail = client->ec_buffer_tail; + ready = client->ec_buffer_ready; + size = client->ec_buffer_size; + + printf("evdev client: %p\n", client); + printf("event queue: head=%zu ready=%zu tail=%zu size=%zu\n", + head, ready, tail, size); + + printf("queue contents:\n"); + + for (i = 0; i < size; i++) { + event = &client->ec_buffer[i]; + printf("%zu: ", i); + + if (i < head || i > tail) + printf("unused\n"); + else + printf("type=%d code=%d value=%d ", event->type, + event->code, event->value); + + if (i == head) + printf("<- head\n"); + else if (i == tail) + printf("<- tail\n"); + else if (i == ready) + printf("<- ready\n"); + else + printf("\n"); + } +} + +static void +evdev_client_filter_queue(struct evdev_client *client, uint16_t type) +{ + struct input_event *event; + size_t head, tail, count, i; + bool last_was_syn = false; + + EVDEV_CLIENT_LOCKQ(client); + + i = head = client->ec_buffer_head; + tail = client->ec_buffer_tail; + count = client->ec_buffer_size; + client->ec_buffer_ready = client->ec_buffer_tail; + + while (i != client->ec_buffer_tail) { + event = &client->ec_buffer[i]; + i = (i + 1) % count; + + /* Skip event of given type */ + if (event->type == type) + continue; + + /* Remove empty SYN_REPORT events */ + if (event->type == EV_SYN && event->code == SYN_REPORT) { + if (last_was_syn) + continue; + else + client->ec_buffer_ready = (tail + 1) % count; + } + + /* Rewrite entry */ + memcpy(&client->ec_buffer[tail], event, + sizeof(struct input_event)); + + last_was_syn = (event->type == EV_SYN && + event->code == SYN_REPORT); + + tail = (tail + 1) % count; + } + + client->ec_buffer_head = i; + client->ec_buffer_tail = tail; + + EVDEV_CLIENT_UNLOCKQ(client); +} Added: head/sys/dev/evdev/evdev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/evdev/evdev.c Sun Sep 11 18:56:38 2016 (r305706) @@ -0,0 +1,917 @@ +/*- + * Copyright (c) 2014 Jakub Wojciech Klama + * Copyright (c) 2015-2016 Vladimir Kondratyev + * 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 "opt_evdev.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Sep 11 18:58:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0AABD5FED; Sun, 11 Sep 2016 18:58:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5D5D08F5; Sun, 11 Sep 2016 18:58:45 +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 u8BIwi6V023846; Sun, 11 Sep 2016 18:58:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BIwidO023845; Sun, 11 Sep 2016 18:58:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201609111858.u8BIwidO023845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 11 Sep 2016 18:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305707 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 18:58:45 -0000 Author: bapt Date: Sun Sep 11 18:58:44 2016 New Revision: 305707 URL: https://svnweb.freebsd.org/changeset/base/305707 Log: Directly set the O_NONBLOCK flags via open(2) Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sun Sep 11 18:56:38 2016 (r305706) +++ head/usr.sbin/syslogd/syslogd.c Sun Sep 11 18:58:44 2016 (r305707) @@ -621,10 +621,7 @@ main(int argc, char *argv[]) dprintf("sending on inet and/or inet6 socket\n"); } - if ((fklog = open(_PATH_KLOG, O_RDONLY, 0)) >= 0) - if (fcntl(fklog, F_SETFL, O_NONBLOCK) < 0) - fklog = -1; - if (fklog < 0) + if ((fklog = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0)) < 0) dprintf("can't open %s (%d)\n", _PATH_KLOG, errno); /* tuck my process id away */ From owner-svn-src-head@freebsd.org Sun Sep 11 19:08:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5CC1BD6576; Sun, 11 Sep 2016 19:08:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8A0F417B; Sun, 11 Sep 2016 19:08:22 +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 u8BJ8LOx027869; Sun, 11 Sep 2016 19:08:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BJ8Lth027865; Sun, 11 Sep 2016 19:08:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609111908.u8BJ8Lth027865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 11 Sep 2016 19:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305708 - in head/sys/arm: conf ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 19:08:22 -0000 Author: gonzo Date: Sun Sep 11 19:08:21 2016 New Revision: 305708 URL: https://svnweb.freebsd.org/changeset/base/305708 Log: Add evdev support to TI ADC/touchscreen driver Add generic evdev support to touchscreen part of ti_adc: two absolute coordinates + button touch to indicate pen position. Pressure value reporting is not implemented yet. Tested on: Beaglebone Black + 4DCAPE-43T + tslib Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/ti/ti_adc.c head/sys/arm/ti/ti_adcreg.h head/sys/arm/ti/ti_adcvar.h Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/conf/BEAGLEBONE Sun Sep 11 19:08:21 2016 (r305708) @@ -131,3 +131,6 @@ device hdmi device ums device ukbd device kbdmux + +# Uncomment to enable evdev support for ti_adc +# options EVDEV Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/ti/ti_adc.c Sun Sep 11 19:08:21 2016 (r305708) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_evdev.h" + #include #include #include @@ -52,6 +54,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EVDEV +#include +#include +#endif + #include #include #include @@ -80,6 +87,41 @@ static struct ti_adc_input ti_adc_inputs static int ti_adc_samples[5] = { 0, 2, 4, 8, 16 }; +static int ti_adc_detach(device_t dev); + +#ifdef EVDEV +static evdev_open_t ti_adc_ev_open; +static evdev_close_t ti_adc_ev_close; + +static struct evdev_methods ti_adc_evdev_methods = { + .ev_open = &ti_adc_ev_open, + .ev_close = &ti_adc_ev_close, +}; + +static void +ti_adc_ev_close(struct evdev_dev *evdev, void *ev_softc) +{ + /* Nothing to do here */ +} + +static int +ti_adc_ev_open(struct evdev_dev *evdev, void *ev_softc) +{ + /* Nothing to do here */ + return (0); +} + +static void +ti_adc_ev_report(struct ti_adc_softc *sc) +{ + + evdev_push_event(sc->sc_evdev, EV_ABS, ABS_X, sc->sc_x); + evdev_push_event(sc->sc_evdev, EV_ABS, ABS_Y, sc->sc_y); + evdev_push_event(sc->sc_evdev, EV_KEY, BTN_TOUCH, sc->sc_pen_down); + evdev_sync(sc->sc_evdev); +} +#endif /* EVDEV */ + static void ti_adc_enable(struct ti_adc_softc *sc) { @@ -450,7 +492,14 @@ ti_adc_tsc_read_data(struct ti_adc_softc #ifdef DEBUG_TSC device_printf(sc->sc_dev, "touchscreen x: %d, y: %d\n", x, y); #endif - /* TODO: That's where actual event reporting should take place */ + +#ifdef EVDEV + if ((sc->sc_x != x) || (sc->sc_y != y)) { + sc->sc_x = x; + sc->sc_y = y; + ti_adc_ev_report(sc); + } +#endif } static void @@ -488,11 +537,17 @@ ti_adc_intr(void *arg) status |= ADC_IRQ_HW_PEN_ASYNC; ADC_WRITE4(sc, ADC_IRQENABLE_CLR, ADC_IRQ_HW_PEN_ASYNC); +#ifdef EVDEV + ti_adc_ev_report(sc); +#endif } if (rawstatus & ADC_IRQ_PEN_UP) { sc->sc_pen_down = 0; status |= ADC_IRQ_PEN_UP; +#ifdef EVDEV + ti_adc_ev_report(sc); +#endif } if (status & ADC_IRQ_FIFO0_THRES) @@ -840,6 +895,39 @@ ti_adc_attach(device_t dev) ti_adc_setup(sc); TI_ADC_UNLOCK(sc); +#ifdef EVDEV + if (sc->sc_tsc_wires > 0) { + sc->sc_evdev = evdev_alloc(); + evdev_set_name(sc->sc_evdev, device_get_desc(dev)); + evdev_set_phys(sc->sc_evdev, device_get_nameunit(dev)); + evdev_set_serial(sc->sc_evdev, "0"); + evdev_set_methods(sc->sc_evdev, sc, &ti_adc_evdev_methods); + evdev_support_prop(sc->sc_evdev, INPUT_PROP_DIRECT); + evdev_support_event(sc->sc_evdev, EV_SYN); + evdev_support_event(sc->sc_evdev, EV_ABS); + evdev_support_event(sc->sc_evdev, EV_KEY); + + evdev_support_abs(sc->sc_evdev, ABS_X, 0, 0, + ADC_MAX_VALUE, 0, 0, 0); + evdev_support_abs(sc->sc_evdev, ABS_Y, 0, 0, + ADC_MAX_VALUE, 0, 0, 0); + + evdev_support_key(sc->sc_evdev, BTN_TOUCH); + + err = evdev_register(sc->sc_evdev); + if (err) { + device_printf(dev, + "failed to register evdev: error=%d\n", err); + ti_adc_detach(dev); + return (err); + } + + sc->sc_pen_down = 0; + sc->sc_x = -1; + sc->sc_y = -1; + } +#endif /* EVDEV */ + return (0); } @@ -854,6 +942,11 @@ ti_adc_detach(device_t dev) TI_ADC_LOCK(sc); ti_adc_reset(sc); ti_adc_setup(sc); + +#ifdef EVDEV + evdev_free(sc->sc_evdev); +#endif + TI_ADC_UNLOCK(sc); TI_ADC_LOCK_DESTROY(sc); Modified: head/sys/arm/ti/ti_adcreg.h ============================================================================== --- head/sys/arm/ti/ti_adcreg.h Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/ti/ti_adcreg.h Sun Sep 11 19:08:21 2016 (r305708) @@ -122,5 +122,6 @@ #define ADC_FIFO_STEP_ID_MSK 0x000f0000 #define ADC_FIFO_STEP_ID_SHIFT 16 #define ADC_FIFO_DATA_MSK 0x00000fff +#define ADC_MAX_VALUE 0xfff #endif /* _TI_ADCREG_H_ */ Modified: head/sys/arm/ti/ti_adcvar.h ============================================================================== --- head/sys/arm/ti/ti_adcvar.h Sun Sep 11 18:58:44 2016 (r305707) +++ head/sys/arm/ti/ti_adcvar.h Sun Sep 11 19:08:21 2016 (r305708) @@ -55,6 +55,11 @@ struct ti_adc_softc { int sc_yn_bit, sc_yn_inp; uint32_t sc_tsc_enabled; int sc_pen_down; +#ifdef EVDEV + int sc_x; + int sc_y; + struct evdev_dev *sc_evdev; +#endif }; struct ti_adc_input { From owner-svn-src-head@freebsd.org Sun Sep 11 19:15:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9976BD6766; Sun, 11 Sep 2016 19:15:51 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (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 9CFBC815; Sun, 11 Sep 2016 19:15:51 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [136.179.10.143] (helo=[10.140.230.85]) by id.bluezbox.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bjAEB-000NO1-IJ; Sun, 11 Sep 2016 12:15:44 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r305706 - in head: etc/mtree include sys/conf sys/dev/evdev From: Oleksandr Tymoshenko In-Reply-To: <201609111856.u8BIucU3023555@repo.freebsd.org> Date: Sun, 11 Sep 2016 12:15:13 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <87B6EE13-138A-4473-9953-7D70CBA284CB@freebsd.org> References: <201609111856.u8BIucU3023555@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3124) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Sep 11, 2016, at 11:56 AM, Oleksandr Tymoshenko wrote: > > Author: gonzo > Date: Sun Sep 11 18:56:38 2016 > New Revision: 305706 > URL: https://svnweb.freebsd.org/changeset/base/305706 > > Log: > Add evdev protocol implementation > > evdev is a generic input event interface compatible with Linux > evdev API at ioctl level. It allows using unmodified (apart from > header name) input evdev drivers in Xorg, Wayland, Qt. > > This commit has only generic kernel API. evdev support for individual > hardware drivers like ukbd, ums, atkbd, etc. will be committed later. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 19:15:51 -0000 > On Sep 11, 2016, at 11:56 AM, Oleksandr Tymoshenko = wrote: >=20 > Author: gonzo > Date: Sun Sep 11 18:56:38 2016 > New Revision: 305706 > URL: https://svnweb.freebsd.org/changeset/base/305706 >=20 > Log: > Add evdev protocol implementation >=20 > evdev is a generic input event interface compatible with Linux > evdev API at ioctl level. It allows using unmodified (apart from > header name) input evdev drivers in Xorg, Wayland, Qt. >=20 > This commit has only generic kernel API. evdev support for individual > hardware drivers like ukbd, ums, atkbd, etc. will be committed later. Those who would like to test evdev but doesn=E2=80=99t want to wait = until evdev support=20 patches for generic input hardware land in the tree can get them from = this repo: https://github.com/wulf7/freebsd/tree/evdev= From owner-svn-src-head@freebsd.org Sun Sep 11 19:51:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 164AEBD7028; Sun, 11 Sep 2016 19:51:34 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3BF27C5; Sun, 11 Sep 2016 19:51:33 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8BJpXd0045922; Sun, 11 Sep 2016 19:51:33 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BJpX1U045921; Sun, 11 Sep 2016 19:51:33 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201609111951.u8BJpX1U045921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Sun, 11 Sep 2016 19:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305709 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 19:51:34 -0000 Author: antoine Date: Sun Sep 11 19:51:32 2016 New Revision: 305709 URL: https://svnweb.freebsd.org/changeset/base/305709 Log: Add more obsolete files Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Sep 11 19:08:21 2016 (r305708) +++ head/ObsoleteFiles.inc Sun Sep 11 19:51:32 2016 (r305709) @@ -41,6 +41,8 @@ # 20160906: libkqueue tests moved to /usr/tests/sys/kqueue/libkqueue OLD_FILES+=usr/tests/sys/kqueue/kqtest OLD_FILES+=usr/tests/sys/kqueue/kqueue_test +# 20160903: idle page zeroing support removed +OLD_FILES+=usr/share/man/man9/pmap_zero_idle.9.gz # 20160901: Remove digi(4) OLD_FILES+=usr/share/man/man4/digi.4.gz # 20160819: Remove ie(4) @@ -59,6 +61,8 @@ OLD_FILES+=usr/share/man/man8/sicontrol. OLD_FILES+=usr/share/man/man4/scd.4.gz # 20160815: Remove mcd(4) OLD_FILES+=usr/share/man/man4/mcd.4.gz +# 20160805: lockmgr_waiters(9) removed +OLD_FILES+=usr/share/man/man9/lockmgr_waiters.9.gz # 20160703: POSIXify locales with variants OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE @@ -213,18 +217,23 @@ OLD_LIBS+=usr/lib32/pam_unix.so.5 OLD_FILES+=usr/include/altq/altq_codel.h OLD_FILES+=usr/include/altq/altq_fairq.h # 20160519: remove DTrace Toolkit from base +OLD_FILES+=usr/sbin/dtruss OLD_FILES+=usr/share/dtrace/toolkit/execsnoop OLD_FILES+=usr/share/dtrace/toolkit/hotkernel OLD_FILES+=usr/share/dtrace/toolkit/hotuser OLD_FILES+=usr/share/dtrace/toolkit/opensnoop OLD_FILES+=usr/share/dtrace/toolkit/procsystime OLD_DIRS+=usr/share/dtrace/toolkit +OLD_FILES+=usr/share/man/man1/dtruss.1.gz # 20160519: stale MLINK removed OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20160517: ReiserFS removed OLD_FILES+=usr/share/man/man5/reiserfs.5.gz +# 20160504: tests rework +OLD_FILES+=usr/tests/lib/libc/regex/data/README # 20160430: kvm_getfiles(3) removed from kvm(3) OLD_LIBS+=lib/libkvm.so.6 +OLD_LIBS+=usr/lib32/libkvm.so.6 OLD_FILES+=usr/share/man/man3/kvm_getfiles.3.gz # 20160423: remove mroute6d OLD_FILES+=etc/rc.d/mroute6d @@ -372,12 +381,18 @@ OLD_LIBS+=usr/lib32/libcapsicum.so.0 OLD_FILES+=usr/lib32/libcapsicum_p.a # 20160223: functionality from mkulzma(1) merged into mkuzip(1) OLD_FILES+=usr/bin/mkulzma +OLD_FILES+=usr/share/man/man4/geom_uncompress.4.gz +OLD_FILES+=usr/share/man/man8/mkulzma.8.gz # 20160211: Remove obsolete unbound-control-setup OLD_FILES+=usr/sbin/unbound-control-setup +# 20160121: cc.h moved +OLD_FILES+=usr/include/netinet/cc.h # 20160116: Update mandoc to cvs snapshot 20160116 OLD_FILES+=usr/share/mdocml/example.style.css OLD_FILES+=usr/share/mdocml/style.css OLD_DIRS+=usr/share/mdocml +# 20160114: SA-16:06.snmpd +OLD_FILES+=usr/share/examples/etc/snmpd.config # 20151225: new clang import which bumps version from 3.7.0 to 3.7.1. OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/asan_interface.h @@ -462,6 +477,9 @@ OLD_FILES+=usr/lib/clang/3.7.0/lib/freeb OLD_DIRS+=usr/lib/clang/3.7.0/lib/freebsd OLD_DIRS+=usr/lib/clang/3.7.0/lib OLD_DIRS+=usr/lib/clang/3.7.0 +# 20151201: mqueue tests 3 and 4 disabled +OLD_FILES+=usr/tests/sys/mqueue/mqtest3 +OLD_FILES+=usr/tests/sys/mqueue/mqtest4 # 20151130: libelf moved from /usr/lib to /lib (libkvm dependency in r291406) OLD_LIBS+=usr/lib/libelf.so.2 # 20151115: Fox bad upgrade scheme @@ -596,6 +614,8 @@ OLD_LIBS+=lib/libcrypto.so.7 OLD_LIBS+=usr/lib/libssl.so.7 OLD_LIBS+=usr/lib32/libcrypto.so.7 OLD_LIBS+=usr/lib32/libssl.so.7 +# 20151029: LinuxKPI moved to sys/compat/linuxkpi +OLD_FILES+=usr/include/dev/usb/usb_compat_linux.h # 20151015: test symbols moved to /usr/lib/debug OLD_DIRS+=usr/tests/lib/atf/libatf-c++/.debug OLD_FILES+=usr/tests/lib/atf/libatf-c++/.debug/atf_c++_test.debug From owner-svn-src-head@freebsd.org Sun Sep 11 20:14:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99C3DBD7507; Sun, 11 Sep 2016 20:14:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6A7541EC; Sun, 11 Sep 2016 20:14:20 +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 u8BKEJEY054254; Sun, 11 Sep 2016 20:14:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BKEJ9F054253; Sun, 11 Sep 2016 20:14:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201609112014.u8BKEJ9F054253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 11 Sep 2016 20:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305710 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 20:14:20 -0000 Author: cem Date: Sun Sep 11 20:14:19 2016 New Revision: 305710 URL: https://svnweb.freebsd.org/changeset/base/305710 Log: ioat(4): De-spam ioat_process_events KTR logs Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sun Sep 11 19:51:32 2016 (r305709) +++ head/sys/dev/ioat/ioat.c Sun Sep 11 20:14:19 2016 (r305710) @@ -663,8 +663,6 @@ ioat_process_events(struct ioat_softc *i boolean_t pending; int error; - CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - mtx_lock(&ioat->cleanup_lock); /* @@ -679,8 +677,6 @@ ioat_process_events(struct ioat_softc *i completed = 0; comp_update = ioat_get_chansts(ioat); - CTR4(KTR_IOAT, "%s channel=%u hw_status=0x%lx last_seen=0x%lx", - __func__, ioat->chan_idx, comp_update, ioat->last_seen); status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK; if (status == ioat->last_seen) { @@ -690,6 +686,8 @@ ioat_process_events(struct ioat_softc *i */ goto out; } + CTR4(KTR_IOAT, "%s channel=%u hw_status=0x%lx last_seen=0x%lx", + __func__, ioat->chan_idx, comp_update, ioat->last_seen); desc = ioat_get_ring_entry(ioat, ioat->tail - 1); while (desc->hw_desc_bus_addr != status && ioat_get_active(ioat) > 0) { From owner-svn-src-head@freebsd.org Sun Sep 11 20:15:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E41D9BD75CD; Sun, 11 Sep 2016 20:15:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id B72CE692; Sun, 11 Sep 2016 20:15:42 +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 u8BKFf9o054553; Sun, 11 Sep 2016 20:15:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BKFfgZ054552; Sun, 11 Sep 2016 20:15:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201609112015.u8BKFfgZ054552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 11 Sep 2016 20:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305711 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 20:15:43 -0000 Author: cem Date: Sun Sep 11 20:15:41 2016 New Revision: 305711 URL: https://svnweb.freebsd.org/changeset/base/305711 Log: ioat(4): Start poll timer when descriptors are released to HW Rather than when the software creates the descriptors. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sun Sep 11 20:14:19 2016 (r305710) +++ head/sys/dev/ioat/ioat.c Sun Sep 11 20:15:41 2016 (r305711) @@ -949,6 +949,13 @@ ioat_release(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head); + + if (!ioat->is_completion_pending) { + ioat->is_completion_pending = TRUE; + callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, + ioat); + callout_stop(&ioat->shrink_timer); + } mtx_unlock(&ioat->submit_lock); } @@ -1788,13 +1795,6 @@ ioat_submit_single(struct ioat_softc *io atomic_add_rel_int(&ioat->head, 1); atomic_add_rel_int(&ioat->hw_head, 1); - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); - callout_stop(&ioat->shrink_timer); - } - ioat->stats.descriptors_submitted++; } From owner-svn-src-head@freebsd.org Sun Sep 11 23:08:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FC49BD7412; Sun, 11 Sep 2016 23:08:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 16A8C802; Sun, 11 Sep 2016 23:08:59 +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 u8BN8wBD019304; Sun, 11 Sep 2016 23:08:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8BN8vru019300; Sun, 11 Sep 2016 23:08:57 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609112308.u8BN8vru019300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 11 Sep 2016 23:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305713 - in head/sys/dev/cxgbe: . common firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2016 23:08:59 -0000 Author: np Date: Sun Sep 11 23:08:57 2016 New Revision: 305713 URL: https://svnweb.freebsd.org/changeset/base/305713 Log: cxgbe(4): Add support for additional port types and link speeds. Sponsored by: Chelsio Communications. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/adapter.h Sun Sep 11 23:08:57 2016 (r305713) @@ -1040,12 +1040,26 @@ is_10G_port(const struct port_info *pi) } static inline bool +is_25G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) != 0); +} + +static inline bool is_40G_port(const struct port_info *pi) { return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); } +static inline bool +is_100G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) != 0); +} + static inline int port_top_speed(const struct port_info *pi) { @@ -1054,6 +1068,8 @@ port_top_speed(const struct port_info *p return (100); if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) return (40); + if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) + return (25); if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) return (10); if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Sep 11 23:08:57 2016 (r305713) @@ -3669,8 +3669,9 @@ void t4_ulprx_read_la(struct adapter *ad } #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ - FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \ - FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG) + FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_25G | \ + FW_PORT_CAP_SPEED_40G | FW_PORT_CAP_SPEED_100G | \ + FW_PORT_CAP_ANEG) /** * t4_link_l1cfg - apply link configuration to MAC/PHY @@ -5775,6 +5776,11 @@ const char *t4_get_port_type_description "QSA", "QSFP", "BP40_BA", + "KR4_100G", + "CR4_QSFP", + "CR_QSFP", + "CR2_QSFP", + "SFP28", }; if (port_type < ARRAY_SIZE(port_type_description)) @@ -7462,8 +7468,12 @@ int t4_handle_fw_rpl(struct adapter *ada speed = 1000; else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G)) speed = 10000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_25G)) + speed = 25000; else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G)) speed = 40000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100G)) + speed = 100000; for_each_port(adap, i) { pi = adap2pinfo(adap, i); Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Sun Sep 11 23:08:57 2016 (r305713) @@ -6305,7 +6305,7 @@ struct fw_acl_vlan_cmd { enum fw_port_cap { FW_PORT_CAP_SPEED_100M = 0x0001, FW_PORT_CAP_SPEED_1G = 0x0002, - FW_PORT_CAP_SPEED_2_5G = 0x0004, + FW_PORT_CAP_SPEED_25G = 0x0004, FW_PORT_CAP_SPEED_10G = 0x0008, FW_PORT_CAP_SPEED_40G = 0x0010, FW_PORT_CAP_SPEED_100G = 0x0020, @@ -6776,6 +6776,11 @@ enum fw_port_type { FW_PORT_TYPE_QSA = 13, /* No, 1, Yes, No, No, No, 10G */ FW_PORT_TYPE_QSFP = 14, /* No, 4, Yes, No, No, No, 40G */ FW_PORT_TYPE_BP40_BA = 15, /* No, 4, No, No, Yes, Yes, 40G/10G/1G, BP ANGE */ + FW_PORT_TYPE_KR4_100G = 16, /* No, 4, 100G */ + FW_PORT_TYPE_CR4_QSFP = 17, /* No, 4, 100G */ + FW_PORT_TYPE_CR_QSFP = 18, /* No, 1, 25G */ + FW_PORT_TYPE_CR2_QSFP = 19, /* No, 2, 50G */ + FW_PORT_TYPE_SFP28 = 20, /* No, 1, 25G */ FW_PORT_TYPE_NONE = M_FW_PORT_CMD_PTYPE }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Sep 11 22:13:22 2016 (r305712) +++ head/sys/dev/cxgbe/t4_main.c Sun Sep 11 23:08:57 2016 (r305713) @@ -3460,6 +3460,38 @@ build_medialist(struct port_info *pi, st } break; + case FW_PORT_TYPE_CR_QSFP: + case FW_PORT_TYPE_SFP28: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_SR: + MPASS(pi->port_type == FW_PORT_TYPE_SFP28); + ifmedia_add(media, m | IFM_25G_SR, 0, NULL); + ifmedia_set(media, m | IFM_25G_SR); + break; + + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_25G_CR, 0, NULL); + ifmedia_set(media, m | IFM_25G_CR); + break; + + case FW_PORT_MOD_TYPE_NONE: + m &= ~IFM_FDX; + ifmedia_add(media, m | IFM_NONE, 0, NULL); + ifmedia_set(media, m | IFM_NONE); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + case FW_PORT_TYPE_QSFP: switch (pi->mod_type) { @@ -3495,6 +3527,67 @@ build_medialist(struct port_info *pi, st } break; + case FW_PORT_TYPE_CR2_QSFP: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_50G_CR2, 0, NULL); + ifmedia_set(media, m | IFM_50G_CR2); + break; + + case FW_PORT_MOD_TYPE_NONE: + m &= ~IFM_FDX; + ifmedia_add(media, m | IFM_NONE, 0, NULL); + ifmedia_set(media, m | IFM_NONE); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + + case FW_PORT_TYPE_KR4_100G: + case FW_PORT_TYPE_CR4_QSFP: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_LR: + ifmedia_add(media, m | IFM_100G_LR4, 0, NULL); + ifmedia_set(media, m | IFM_100G_LR4); + break; + + case FW_PORT_MOD_TYPE_SR: + ifmedia_add(media, m | IFM_100G_SR4, 0, NULL); + ifmedia_set(media, m | IFM_100G_SR4); + break; + + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_100G_CR4, 0, NULL); + ifmedia_set(media, m | IFM_100G_CR4); + break; + + case FW_PORT_MOD_TYPE_NONE: + m &= ~IFM_FDX; + ifmedia_add(media, m | IFM_NONE, 0, NULL); + ifmedia_set(media, m | IFM_NONE); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + default: device_printf(pi->dev, "unknown port_type (%d), mod_type (%d)\n", pi->port_type, From owner-svn-src-head@freebsd.org Mon Sep 12 00:15:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF96BD42AB; Mon, 12 Sep 2016 00:15:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2FB9E854; Mon, 12 Sep 2016 00:15:41 +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 u8C0FeLd046244; Mon, 12 Sep 2016 00:15:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C0Fem9046241; Mon, 12 Sep 2016 00:15:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609120015.u8C0Fem9046241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 12 Sep 2016 00:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305715 - in head/sys/dev/cxgbe: . firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 00:15:41 -0000 Author: np Date: Mon Sep 12 00:15:40 2016 New Revision: 305715 URL: https://svnweb.freebsd.org/changeset/base/305715 Log: cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps. TLS is one of the capabilities of the crypto engine in T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Sep 12 00:03:14 2016 (r305714) +++ head/sys/dev/cxgbe/adapter.h Mon Sep 12 00:15:40 2016 (r305715) @@ -835,7 +835,7 @@ struct adapter { uint16_t niccaps; uint16_t toecaps; uint16_t rdmacaps; - uint16_t tlscaps; + uint16_t cryptocaps; uint16_t iscsicaps; uint16_t fcoecaps; Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Mon Sep 12 00:03:14 2016 (r305714) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Mon Sep 12 00:15:40 2016 (r305715) @@ -135,7 +135,9 @@ enum fw_wr_opcodes { FW_POFCOE_ULPTX_WR = 0x43, FW_ISCSI_TX_DATA_WR = 0x45, FW_PTP_TX_PKT_WR = 0x46, - FW_SEC_LOOKASIDE_LPBK_WR= 0x6d, + FW_TLSTX_DATA_WR = 0x68, + FW_TLS_KEYCTX_TX_WR = 0x69, + FW_CRYPTO_LOOKASIDE_WR = 0x6d, FW_COiSCSI_TGT_WR = 0x70, FW_COiSCSI_TGT_CONN_WR = 0x71, FW_COiSCSI_TGT_XMIT_WR = 0x72, @@ -3384,8 +3386,429 @@ struct fw_pi_error { #define G_FW_PI_ERROR_ERR_TYPE(x) \ (((x) >> S_FW_PI_ERROR_ERR_TYPE) & M_FW_PI_ERROR_ERR_TYPE) +struct fw_tlstx_data_wr { + __be32 op_to_immdlen; + __be32 flowid_len16; + __be32 plen; + __be32 lsodisable_to_flags; + __be32 ddraddr; + __be32 ctxloc_to_exp; + __be16 mfs; + __u8 r6[6]; +}; + +#define S_FW_TLSTX_DATA_WR_COMPL 21 +#define M_FW_TLSTX_DATA_WR_COMPL 0x1 +#define V_FW_TLSTX_DATA_WR_COMPL(x) ((x) << S_FW_TLSTX_DATA_WR_COMPL) +#define G_FW_TLSTX_DATA_WR_COMPL(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_COMPL) & M_FW_TLSTX_DATA_WR_COMPL) +#define F_FW_TLSTX_DATA_WR_COMPL V_FW_TLSTX_DATA_WR_COMPL(1U) + +#define S_FW_TLSTX_DATA_WR_IMMDLEN 0 +#define M_FW_TLSTX_DATA_WR_IMMDLEN 0xff +#define V_FW_TLSTX_DATA_WR_IMMDLEN(x) ((x) << S_FW_TLSTX_DATA_WR_IMMDLEN) +#define G_FW_TLSTX_DATA_WR_IMMDLEN(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_IMMDLEN) & M_FW_TLSTX_DATA_WR_IMMDLEN) + +#define S_FW_TLSTX_DATA_WR_FLOWID 8 +#define M_FW_TLSTX_DATA_WR_FLOWID 0xfffff +#define V_FW_TLSTX_DATA_WR_FLOWID(x) ((x) << S_FW_TLSTX_DATA_WR_FLOWID) +#define G_FW_TLSTX_DATA_WR_FLOWID(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_FLOWID) & M_FW_TLSTX_DATA_WR_FLOWID) + +#define S_FW_TLSTX_DATA_WR_LEN16 0 +#define M_FW_TLSTX_DATA_WR_LEN16 0xff +#define V_FW_TLSTX_DATA_WR_LEN16(x) ((x) << S_FW_TLSTX_DATA_WR_LEN16) +#define G_FW_TLSTX_DATA_WR_LEN16(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_LEN16) & M_FW_TLSTX_DATA_WR_LEN16) + +#define S_FW_TLSTX_DATA_WR_LSODISABLE 31 +#define M_FW_TLSTX_DATA_WR_LSODISABLE 0x1 +#define V_FW_TLSTX_DATA_WR_LSODISABLE(x) \ + ((x) << S_FW_TLSTX_DATA_WR_LSODISABLE) +#define G_FW_TLSTX_DATA_WR_LSODISABLE(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_LSODISABLE) & M_FW_TLSTX_DATA_WR_LSODISABLE) +#define F_FW_TLSTX_DATA_WR_LSODISABLE V_FW_TLSTX_DATA_WR_LSODISABLE(1U) + +#define S_FW_TLSTX_DATA_WR_ALIGNPLD 30 +#define M_FW_TLSTX_DATA_WR_ALIGNPLD 0x1 +#define V_FW_TLSTX_DATA_WR_ALIGNPLD(x) ((x) << S_FW_TLSTX_DATA_WR_ALIGNPLD) +#define G_FW_TLSTX_DATA_WR_ALIGNPLD(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_ALIGNPLD) & M_FW_TLSTX_DATA_WR_ALIGNPLD) +#define F_FW_TLSTX_DATA_WR_ALIGNPLD V_FW_TLSTX_DATA_WR_ALIGNPLD(1U) + +#define S_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE 29 +#define M_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE 0x1 +#define V_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE(x) \ + ((x) << S_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE) +#define G_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE) & \ + M_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE) +#define F_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE V_FW_TLSTX_DATA_WR_ALIGNPLDSHOVE(1U) + +#define S_FW_TLSTX_DATA_WR_FLAGS 0 +#define M_FW_TLSTX_DATA_WR_FLAGS 0xfffffff +#define V_FW_TLSTX_DATA_WR_FLAGS(x) ((x) << S_FW_TLSTX_DATA_WR_FLAGS) +#define G_FW_TLSTX_DATA_WR_FLAGS(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_FLAGS) & M_FW_TLSTX_DATA_WR_FLAGS) + +#define S_FW_TLSTX_DATA_WR_CTXLOC 30 +#define M_FW_TLSTX_DATA_WR_CTXLOC 0x3 +#define V_FW_TLSTX_DATA_WR_CTXLOC(x) ((x) << S_FW_TLSTX_DATA_WR_CTXLOC) +#define G_FW_TLSTX_DATA_WR_CTXLOC(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_CTXLOC) & M_FW_TLSTX_DATA_WR_CTXLOC) + +#define S_FW_TLSTX_DATA_WR_IVDSGL 29 +#define M_FW_TLSTX_DATA_WR_IVDSGL 0x1 +#define V_FW_TLSTX_DATA_WR_IVDSGL(x) ((x) << S_FW_TLSTX_DATA_WR_IVDSGL) +#define G_FW_TLSTX_DATA_WR_IVDSGL(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_IVDSGL) & M_FW_TLSTX_DATA_WR_IVDSGL) +#define F_FW_TLSTX_DATA_WR_IVDSGL V_FW_TLSTX_DATA_WR_IVDSGL(1U) + +#define S_FW_TLSTX_DATA_WR_KEYSIZE 24 +#define M_FW_TLSTX_DATA_WR_KEYSIZE 0x1f +#define V_FW_TLSTX_DATA_WR_KEYSIZE(x) ((x) << S_FW_TLSTX_DATA_WR_KEYSIZE) +#define G_FW_TLSTX_DATA_WR_KEYSIZE(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_KEYSIZE) & M_FW_TLSTX_DATA_WR_KEYSIZE) + +#define S_FW_TLSTX_DATA_WR_NUMIVS 14 +#define M_FW_TLSTX_DATA_WR_NUMIVS 0xff +#define V_FW_TLSTX_DATA_WR_NUMIVS(x) ((x) << S_FW_TLSTX_DATA_WR_NUMIVS) +#define G_FW_TLSTX_DATA_WR_NUMIVS(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_NUMIVS) & M_FW_TLSTX_DATA_WR_NUMIVS) + +#define S_FW_TLSTX_DATA_WR_EXP 0 +#define M_FW_TLSTX_DATA_WR_EXP 0x3fff +#define V_FW_TLSTX_DATA_WR_EXP(x) ((x) << S_FW_TLSTX_DATA_WR_EXP) +#define G_FW_TLSTX_DATA_WR_EXP(x) \ + (((x) >> S_FW_TLSTX_DATA_WR_EXP) & M_FW_TLSTX_DATA_WR_EXP) + +struct fw_tls_keyctx_tx_wr { + __be32 op_to_compl; + __be32 flowid_len16; + union fw_key_ctx { + struct fw_tx_keyctx_hdr { + __u8 ctxlen; + __u8 r2; + __be16 dualck_to_txvalid; + __u8 txsalt[4]; + __be64 r5; + } txhdr; + struct fw_rx_keyctx_hdr { + __u8 flitcnt_hmacctrl; + __u8 protover_ciphmode; + __u8 authmode_to_rxvalid; + __u8 ivpresent_to_rxmk_size; + __u8 rxsalt[4]; + __be64 ivinsert_to_authinsrt; + } rxhdr; + struct fw_keyctx_clear { + __be32 tx_key; + __be32 rx_key; + } kctx_clr; + } u; + struct keys { + __u8 edkey[32]; + __u8 ipad[64]; + __u8 opad[64]; + } keys; + __u8 reneg_to_write_rx; + __u8 protocol; + __u8 r7[2]; + __be32 ftid; +}; + +#define S_FW_TLS_KEYCTX_TX_WR_OPCODE 24 +#define M_FW_TLS_KEYCTX_TX_WR_OPCODE 0xff +#define V_FW_TLS_KEYCTX_TX_WR_OPCODE(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_OPCODE) +#define G_FW_TLS_KEYCTX_TX_WR_OPCODE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_OPCODE) & M_FW_TLS_KEYCTX_TX_WR_OPCODE) + +#define S_FW_TLS_KEYCTX_TX_WR_ATOMIC 23 +#define M_FW_TLS_KEYCTX_TX_WR_ATOMIC 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_ATOMIC(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_ATOMIC) +#define G_FW_TLS_KEYCTX_TX_WR_ATOMIC(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_ATOMIC) & M_FW_TLS_KEYCTX_TX_WR_ATOMIC) +#define F_FW_TLS_KEYCTX_TX_WR_ATOMIC V_FW_TLS_KEYCTX_TX_WR_ATOMIC(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_FLUSH 22 +#define M_FW_TLS_KEYCTX_TX_WR_FLUSH 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_FLUSH(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_FLUSH) +#define G_FW_TLS_KEYCTX_TX_WR_FLUSH(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_FLUSH) & M_FW_TLS_KEYCTX_TX_WR_FLUSH) +#define F_FW_TLS_KEYCTX_TX_WR_FLUSH V_FW_TLS_KEYCTX_TX_WR_FLUSH(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_COMPL 21 +#define M_FW_TLS_KEYCTX_TX_WR_COMPL 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_COMPL(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_COMPL) +#define G_FW_TLS_KEYCTX_TX_WR_COMPL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_COMPL) & M_FW_TLS_KEYCTX_TX_WR_COMPL) +#define F_FW_TLS_KEYCTX_TX_WR_COMPL V_FW_TLS_KEYCTX_TX_WR_COMPL(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_FLOWID 8 +#define M_FW_TLS_KEYCTX_TX_WR_FLOWID 0xfffff +#define V_FW_TLS_KEYCTX_TX_WR_FLOWID(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_FLOWID) +#define G_FW_TLS_KEYCTX_TX_WR_FLOWID(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_FLOWID) & M_FW_TLS_KEYCTX_TX_WR_FLOWID) + +#define S_FW_TLS_KEYCTX_TX_WR_LEN16 0 +#define M_FW_TLS_KEYCTX_TX_WR_LEN16 0xff +#define V_FW_TLS_KEYCTX_TX_WR_LEN16(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_LEN16) +#define G_FW_TLS_KEYCTX_TX_WR_LEN16(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_LEN16) & M_FW_TLS_KEYCTX_TX_WR_LEN16) + +#define S_FW_TLS_KEYCTX_TX_WR_DUALCK 12 +#define M_FW_TLS_KEYCTX_TX_WR_DUALCK 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_DUALCK(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_DUALCK) +#define G_FW_TLS_KEYCTX_TX_WR_DUALCK(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_DUALCK) & M_FW_TLS_KEYCTX_TX_WR_DUALCK) +#define F_FW_TLS_KEYCTX_TX_WR_DUALCK V_FW_TLS_KEYCTX_TX_WR_DUALCK(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT 11 +#define M_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT \ + V_FW_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT 10 +#define M_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT \ + V_FW_TLS_KEYCTX_TX_WR_SALT_PRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE 6 +#define M_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_TXCK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE 2 +#define M_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_TXMK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_TXVALID 0 +#define M_FW_TLS_KEYCTX_TX_WR_TXVALID 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_TXVALID(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_TXVALID) +#define G_FW_TLS_KEYCTX_TX_WR_TXVALID(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_TXVALID) & M_FW_TLS_KEYCTX_TX_WR_TXVALID) +#define F_FW_TLS_KEYCTX_TX_WR_TXVALID V_FW_TLS_KEYCTX_TX_WR_TXVALID(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_FLITCNT 3 +#define M_FW_TLS_KEYCTX_TX_WR_FLITCNT 0x1f +#define V_FW_TLS_KEYCTX_TX_WR_FLITCNT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_FLITCNT) +#define G_FW_TLS_KEYCTX_TX_WR_FLITCNT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_FLITCNT) & M_FW_TLS_KEYCTX_TX_WR_FLITCNT) + +#define S_FW_TLS_KEYCTX_TX_WR_HMACCTRL 0 +#define M_FW_TLS_KEYCTX_TX_WR_HMACCTRL 0x7 +#define V_FW_TLS_KEYCTX_TX_WR_HMACCTRL(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_HMACCTRL) +#define G_FW_TLS_KEYCTX_TX_WR_HMACCTRL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_HMACCTRL) & M_FW_TLS_KEYCTX_TX_WR_HMACCTRL) + +#define S_FW_TLS_KEYCTX_TX_WR_PROTOVER 4 +#define M_FW_TLS_KEYCTX_TX_WR_PROTOVER 0xf +#define V_FW_TLS_KEYCTX_TX_WR_PROTOVER(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_PROTOVER) +#define G_FW_TLS_KEYCTX_TX_WR_PROTOVER(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_PROTOVER) & M_FW_TLS_KEYCTX_TX_WR_PROTOVER) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHMODE 0 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHMODE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_CIPHMODE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHMODE) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHMODE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHMODE) & M_FW_TLS_KEYCTX_TX_WR_CIPHMODE) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHMODE 4 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHMODE 0xf +#define V_FW_TLS_KEYCTX_TX_WR_AUTHMODE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHMODE) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHMODE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHMODE) & M_FW_TLS_KEYCTX_TX_WR_AUTHMODE) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL 3 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL) & \ + M_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL) +#define F_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL \ + V_FW_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL 1 +#define M_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL 0x3 +#define V_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL) +#define G_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL) & \ + M_FW_TLS_KEYCTX_TX_WR_SEQNUMCTRL) + +#define S_FW_TLS_KEYCTX_TX_WR_RXVALID 0 +#define M_FW_TLS_KEYCTX_TX_WR_RXVALID 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_RXVALID(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXVALID) +#define G_FW_TLS_KEYCTX_TX_WR_RXVALID(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXVALID) & M_FW_TLS_KEYCTX_TX_WR_RXVALID) +#define F_FW_TLS_KEYCTX_TX_WR_RXVALID V_FW_TLS_KEYCTX_TX_WR_RXVALID(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_IVPRESENT 7 +#define M_FW_TLS_KEYCTX_TX_WR_IVPRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_IVPRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_IVPRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_IVPRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_IVPRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_IVPRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_IVPRESENT V_FW_TLS_KEYCTX_TX_WR_IVPRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT 6 +#define M_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT) +#define G_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT) & \ + M_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT) +#define F_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT \ + V_FW_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE 3 +#define M_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE 0x7 +#define V_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_RXCK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE 0 +#define M_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE 0x7 +#define V_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE) +#define G_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE) & \ + M_FW_TLS_KEYCTX_TX_WR_RXMK_SIZE) + +#define S_FW_TLS_KEYCTX_TX_WR_IVINSERT 55 +#define M_FW_TLS_KEYCTX_TX_WR_IVINSERT 0x1ffULL +#define V_FW_TLS_KEYCTX_TX_WR_IVINSERT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_IVINSERT) +#define G_FW_TLS_KEYCTX_TX_WR_IVINSERT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_IVINSERT) & M_FW_TLS_KEYCTX_TX_WR_IVINSERT) + +#define S_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST 47 +#define M_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST 0xffULL +#define V_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AADSTRTOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST 39 +#define M_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST 0xffULL +#define V_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AADSTOPOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST 30 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST 0x1ffULL +#define V_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_CIPHERSRTOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST 23 +#define M_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST 0x7f +#define V_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST) +#define G_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST 14 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST 0x1ff +#define V_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AUTHSRTOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST 7 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST 0x7f +#define V_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST) & \ + M_FW_TLS_KEYCTX_TX_WR_AUTHSTOPOFST) + +#define S_FW_TLS_KEYCTX_TX_WR_AUTHINSRT 0 +#define M_FW_TLS_KEYCTX_TX_WR_AUTHINSRT 0x7f +#define V_FW_TLS_KEYCTX_TX_WR_AUTHINSRT(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_AUTHINSRT) +#define G_FW_TLS_KEYCTX_TX_WR_AUTHINSRT(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_AUTHINSRT) & \ + M_FW_TLS_KEYCTX_TX_WR_AUTHINSRT) + +#define S_FW_TLS_KEYCTX_TX_WR_RENEG 4 +#define M_FW_TLS_KEYCTX_TX_WR_RENEG 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_RENEG(x) ((x) << S_FW_TLS_KEYCTX_TX_WR_RENEG) +#define G_FW_TLS_KEYCTX_TX_WR_RENEG(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_RENEG) & M_FW_TLS_KEYCTX_TX_WR_RENEG) +#define F_FW_TLS_KEYCTX_TX_WR_RENEG V_FW_TLS_KEYCTX_TX_WR_RENEG(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_DELETE_TX 3 +#define M_FW_TLS_KEYCTX_TX_WR_DELETE_TX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_DELETE_TX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_DELETE_TX) +#define G_FW_TLS_KEYCTX_TX_WR_DELETE_TX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_DELETE_TX) & \ + M_FW_TLS_KEYCTX_TX_WR_DELETE_TX) +#define F_FW_TLS_KEYCTX_TX_WR_DELETE_TX V_FW_TLS_KEYCTX_TX_WR_DELETE_TX(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_DELETE_RX 2 +#define M_FW_TLS_KEYCTX_TX_WR_DELETE_RX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_DELETE_RX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_DELETE_RX) +#define G_FW_TLS_KEYCTX_TX_WR_DELETE_RX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_DELETE_RX) & \ + M_FW_TLS_KEYCTX_TX_WR_DELETE_RX) +#define F_FW_TLS_KEYCTX_TX_WR_DELETE_RX V_FW_TLS_KEYCTX_TX_WR_DELETE_RX(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_WRITE_TX 1 +#define M_FW_TLS_KEYCTX_TX_WR_WRITE_TX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_WRITE_TX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_WRITE_TX) +#define G_FW_TLS_KEYCTX_TX_WR_WRITE_TX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_WRITE_TX) & M_FW_TLS_KEYCTX_TX_WR_WRITE_TX) +#define F_FW_TLS_KEYCTX_TX_WR_WRITE_TX V_FW_TLS_KEYCTX_TX_WR_WRITE_TX(1U) + +#define S_FW_TLS_KEYCTX_TX_WR_WRITE_RX 0 +#define M_FW_TLS_KEYCTX_TX_WR_WRITE_RX 0x1 +#define V_FW_TLS_KEYCTX_TX_WR_WRITE_RX(x) \ + ((x) << S_FW_TLS_KEYCTX_TX_WR_WRITE_RX) +#define G_FW_TLS_KEYCTX_TX_WR_WRITE_RX(x) \ + (((x) >> S_FW_TLS_KEYCTX_TX_WR_WRITE_RX) & M_FW_TLS_KEYCTX_TX_WR_WRITE_RX) +#define F_FW_TLS_KEYCTX_TX_WR_WRITE_RX V_FW_TLS_KEYCTX_TX_WR_WRITE_RX(1U) -struct fw_sec_lookaside_lpbk_wr { +struct fw_crypto_lookaside_wr { __be32 op_to_cctx_size; __be32 len16_pkd; __be32 session_id; @@ -3395,116 +3818,116 @@ struct fw_sec_lookaside_lpbk_wr { __be64 cookie; }; -#define S_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE 24 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_OPCODE) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_COMPL 23 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_COMPL 0x1 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_COMPL(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_COMPL) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_COMPL(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_COMPL) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_COMPL) -#define F_FW_SEC_LOOKASIDE_LPBK_WR_COMPL V_FW_SEC_LOOKASIDE_LPBK_WR_COMPL(1U) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN 15 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_IMM_LEN) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC 5 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_LOC) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE 0 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE 0x1f -#define V_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_CCTX_SIZE) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_LEN16 0 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_LEN16 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_LEN16(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_LEN16) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_LEN16(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_LEN16) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_LEN16) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID 29 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_RX_CHID) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_LCB 27 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_LCB 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_LCB(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_LCB) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_LCB(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_LCB) & M_FW_SEC_LOOKASIDE_LPBK_WR_LCB) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_PHASH 25 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_PHASH 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_PHASH(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_PHASH) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_PHASH(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_PHASH) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_PHASH) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_IV 23 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_IV 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_IV(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_IV) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_IV(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_IV) & M_FW_SEC_LOOKASIDE_LPBK_WR_IV) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH 10 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH 0x3 -#define V_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_TX_CH) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID 0 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID 0x3ff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_RX_Q_ID) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE 24 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE 0xff -#define V_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_PLD_SIZE) - -#define S_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE 17 -#define M_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE 0x7f -#define V_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE(x) \ - ((x) << S_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE) -#define G_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE(x) \ - (((x) >> S_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE) & \ - M_FW_SEC_LOOKASIDE_LPBK_WR_HASH_SIZE) +#define S_FW_CRYPTO_LOOKASIDE_WR_OPCODE 24 +#define M_FW_CRYPTO_LOOKASIDE_WR_OPCODE 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_OPCODE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_OPCODE) +#define G_FW_CRYPTO_LOOKASIDE_WR_OPCODE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_OPCODE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_OPCODE) + +#define S_FW_CRYPTO_LOOKASIDE_WR_COMPL 23 +#define M_FW_CRYPTO_LOOKASIDE_WR_COMPL 0x1 +#define V_FW_CRYPTO_LOOKASIDE_WR_COMPL(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_COMPL) +#define G_FW_CRYPTO_LOOKASIDE_WR_COMPL(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_COMPL) & \ + M_FW_CRYPTO_LOOKASIDE_WR_COMPL) +#define F_FW_CRYPTO_LOOKASIDE_WR_COMPL V_FW_CRYPTO_LOOKASIDE_WR_COMPL(1U) + +#define S_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN 15 +#define M_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN) +#define G_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN) & \ + M_FW_CRYPTO_LOOKASIDE_WR_IMM_LEN) + +#define S_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC 5 +#define M_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC) +#define G_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC) & \ + M_FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC) + +#define S_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE 0 +#define M_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE 0x1f +#define V_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE) +#define G_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE) + +#define S_FW_CRYPTO_LOOKASIDE_WR_LEN16 0 +#define M_FW_CRYPTO_LOOKASIDE_WR_LEN16 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_LEN16(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_LEN16) +#define G_FW_CRYPTO_LOOKASIDE_WR_LEN16(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_LEN16) & \ + M_FW_CRYPTO_LOOKASIDE_WR_LEN16) + +#define S_FW_CRYPTO_LOOKASIDE_WR_RX_CHID 29 +#define M_FW_CRYPTO_LOOKASIDE_WR_RX_CHID 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_RX_CHID) +#define G_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_RX_CHID) & \ + M_FW_CRYPTO_LOOKASIDE_WR_RX_CHID) + +#define S_FW_CRYPTO_LOOKASIDE_WR_LCB 27 +#define M_FW_CRYPTO_LOOKASIDE_WR_LCB 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_LCB(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_LCB) +#define G_FW_CRYPTO_LOOKASIDE_WR_LCB(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_LCB) & M_FW_CRYPTO_LOOKASIDE_WR_LCB) + +#define S_FW_CRYPTO_LOOKASIDE_WR_PHASH 25 +#define M_FW_CRYPTO_LOOKASIDE_WR_PHASH 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_PHASH(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_PHASH) +#define G_FW_CRYPTO_LOOKASIDE_WR_PHASH(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_PHASH) & \ + M_FW_CRYPTO_LOOKASIDE_WR_PHASH) + +#define S_FW_CRYPTO_LOOKASIDE_WR_IV 23 +#define M_FW_CRYPTO_LOOKASIDE_WR_IV 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_IV(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_IV) +#define G_FW_CRYPTO_LOOKASIDE_WR_IV(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_IV) & M_FW_CRYPTO_LOOKASIDE_WR_IV) + +#define S_FW_CRYPTO_LOOKASIDE_WR_TX_CH 10 +#define M_FW_CRYPTO_LOOKASIDE_WR_TX_CH 0x3 +#define V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_TX_CH) +#define G_FW_CRYPTO_LOOKASIDE_WR_TX_CH(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_TX_CH) & \ + M_FW_CRYPTO_LOOKASIDE_WR_TX_CH) + +#define S_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID 0 +#define M_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID 0x3ff +#define V_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID) +#define G_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID) & \ + M_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID) + +#define S_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE 24 +#define M_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE 0xff +#define V_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE) +#define G_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE) + +#define S_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE 17 +#define M_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE 0x7f +#define V_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE(x) \ + ((x) << S_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) +#define G_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE(x) \ + (((x) >> S_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) & \ + M_FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE) /****************************************************************************** * C O M M A N D s @@ -4095,8 +4518,9 @@ enum fw_caps_config_iscsi { FW_CAPS_CONFIG_ISCSI_TARGET_CMDOFLD = 0x00000100, }; -enum fw_caps_config_tls { - FW_CAPS_CONFIG_TLSKEYS = 0x00000001, +enum fw_caps_config_crypto { + FW_CAPS_CONFIG_CRYPTO_LOOKASIDE = 0x00000001, + FW_CAPS_CONFIG_TLSKEYS = 0x00000002, }; enum fw_caps_config_fcoe { @@ -4128,7 +4552,7 @@ struct fw_caps_config_cmd { __be16 niccaps; __be16 toecaps; __be16 rdmacaps; - __be16 tlscaps; + __be16 cryptocaps; __be16 iscsicaps; __be16 fcoecaps; __be32 cfcsum; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Sep 12 00:03:14 2016 (r305714) +++ head/sys/dev/cxgbe/t4_main.c Mon Sep 12 00:15:40 2016 (r305715) @@ -355,8 +355,8 @@ TUNABLE_INT("hw.cxgbe.toecaps_allowed", static int t4_rdmacaps_allowed = -1; TUNABLE_INT("hw.cxgbe.rdmacaps_allowed", &t4_rdmacaps_allowed); -static int t4_tlscaps_allowed = 0; -TUNABLE_INT("hw.cxgbe.tlscaps_allowed", &t4_tlscaps_allowed); +static int t4_cryptocaps_allowed = 0; +TUNABLE_INT("hw.cxgbe.cryptocaps_allowed", &t4_cryptocaps_allowed); static int t4_iscsicaps_allowed = -1; TUNABLE_INT("hw.cxgbe.iscsicaps_allowed", &t4_iscsicaps_allowed); @@ -3114,7 +3114,7 @@ use_config_on_flash: LIMIT_CAPS(niccaps); LIMIT_CAPS(toecaps); LIMIT_CAPS(rdmacaps); - LIMIT_CAPS(tlscaps); + LIMIT_CAPS(cryptocaps); LIMIT_CAPS(iscsicaps); LIMIT_CAPS(fcoecaps); #undef LIMIT_CAPS @@ -3251,7 +3251,7 @@ get_params__post_init(struct adapter *sc READ_CAPS(niccaps); READ_CAPS(toecaps); READ_CAPS(rdmacaps); - READ_CAPS(tlscaps); + READ_CAPS(cryptocaps); READ_CAPS(iscsicaps); READ_CAPS(fcoecaps); @@ -4684,7 +4684,7 @@ static char *caps_decoder[] = { "\005INITIATOR_SSNOFLD\006TARGET_SSNOFLD" "\007T10DIF" "\010INITIATOR_CMDOFLD\011TARGET_CMDOFLD", - "\20\00KEYS", /* 7: TLS */ + "\20\001LOOKASIDE\002TLSKEYS", /* 7: Crypto */ "\20\001INITIATOR\002TARGET\003CTRL_OFLD" /* 8: FCoE */ "\004PO_INITIATOR\005PO_TARGET", }; @@ -4792,7 +4792,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_CAP(toecaps, 4, "TCP offload"); SYSCTL_CAP(rdmacaps, 5, "RDMA"); SYSCTL_CAP(iscsicaps, 6, "iSCSI"); - SYSCTL_CAP(tlscaps, 7, "TLS"); + SYSCTL_CAP(cryptocaps, 7, "crypto"); SYSCTL_CAP(fcoecaps, 8, "FCoE"); #undef SYSCTL_CAP From owner-svn-src-head@freebsd.org Mon Sep 12 01:18:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1327DBD4FFC; Mon, 12 Sep 2016 01:18:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id DA407750; Mon, 12 Sep 2016 01:18:26 +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 u8C1IQbW068894; Mon, 12 Sep 2016 01:18:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C1IQJD068893; Mon, 12 Sep 2016 01:18:26 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609120118.u8C1IQJD068893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 12 Sep 2016 01:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305719 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 01:18:27 -0000 Author: gonzo Date: Mon Sep 12 01:18:25 2016 New Revision: 305719 URL: https://svnweb.freebsd.org/changeset/base/305719 Log: Cleanup evdev support for TI ADC/TS - evdev_set_methods call is not required if actual methods are no-ops - evdev_set_serial is also optional if there is no meaningful input device identifier - evdev_set_id on the other hand is mandatory, so set virtual bus with dummy vendor/product/version Suggested by: Vladimir Kondratiev Modified: head/sys/arm/ti/ti_adc.c Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Mon Sep 12 00:24:56 2016 (r305718) +++ head/sys/arm/ti/ti_adc.c Mon Sep 12 01:18:25 2016 (r305719) @@ -90,27 +90,6 @@ static int ti_adc_samples[5] = { 0, 2, 4 static int ti_adc_detach(device_t dev); #ifdef EVDEV -static evdev_open_t ti_adc_ev_open; -static evdev_close_t ti_adc_ev_close; - -static struct evdev_methods ti_adc_evdev_methods = { - .ev_open = &ti_adc_ev_open, - .ev_close = &ti_adc_ev_close, -}; - -static void -ti_adc_ev_close(struct evdev_dev *evdev, void *ev_softc) -{ - /* Nothing to do here */ -} - -static int -ti_adc_ev_open(struct evdev_dev *evdev, void *ev_softc) -{ - /* Nothing to do here */ - return (0); -} - static void ti_adc_ev_report(struct ti_adc_softc *sc) { @@ -900,8 +879,7 @@ ti_adc_attach(device_t dev) sc->sc_evdev = evdev_alloc(); evdev_set_name(sc->sc_evdev, device_get_desc(dev)); evdev_set_phys(sc->sc_evdev, device_get_nameunit(dev)); - evdev_set_serial(sc->sc_evdev, "0"); - evdev_set_methods(sc->sc_evdev, sc, &ti_adc_evdev_methods); + evdev_set_id(sc->sc_evdev, BUS_VIRTUAL, 0, 0, 0); evdev_support_prop(sc->sc_evdev, INPUT_PROP_DIRECT); evdev_support_event(sc->sc_evdev, EV_SYN); evdev_support_event(sc->sc_evdev, EV_ABS); From owner-svn-src-head@freebsd.org Mon Sep 12 04:50:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A32C8BD5CDA; Mon, 12 Sep 2016 04:50:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 486AD949; Mon, 12 Sep 2016 04:50:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4oeLT048933; Mon, 12 Sep 2016 04:50:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4oewv048932; Mon, 12 Sep 2016 04:50:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609120450.u8C4oewv048932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 12 Sep 2016 04:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305720 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 04:50:41 -0000 Author: adrian Date: Mon Sep 12 04:50:40 2016 New Revision: 305720 URL: https://svnweb.freebsd.org/changeset/base/305720 Log: [ath] tweak the TX EDMA debugging a bit. I've used this to debug some amusing issues with the EDMA code. Tested: * AR9380, STA mode * AR9380, TDMA mode (master, slave) Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon Sep 12 01:18:25 2016 (r305719) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Sep 12 04:50:40 2016 (r305720) @@ -268,7 +268,7 @@ ath_tx_edma_push_staging_list(struct ath /* Bump FIFO queue */ txq->axq_fifo_depth++; - DPRINTF(sc, ATH_DEBUG_XMIT, + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_TX_PROC, "%s: queued %d packets; depth=%d, fifo depth=%d\n", __func__, sqdepth, txq->fifo.axq_depth, txq->axq_fifo_depth); @@ -296,16 +296,21 @@ ath_edma_tx_fifo_fill(struct ath_softc * ATH_TXQ_LOCK_ASSERT(txq); - DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: Q%d: called\n", + DPRINTF(sc, ATH_DEBUG_TX_PROC, + "%s: Q%d: called; fifo.depth=%d, fifo depth=%d, depth=%d, aggr_depth=%d\n", __func__, - txq->axq_qnum); + txq->axq_qnum, + txq->fifo.axq_depth, + txq->axq_fifo_depth, + txq->axq_depth, + txq->axq_aggr_depth); /* - * For now, push up to 4 frames per TX FIFO slot. + * For now, push up to 32 frames per TX FIFO slot. * If more are in the hardware queue then they'll * get populated when we try to send another frame * or complete a frame - so at most there'll be - * 32 non-AMPDU frames per TXQ. + * 32 non-AMPDU frames per node/TID anyway. * * Note that the hardware staging queue will limit * how many frames in total we will have pushed into @@ -811,10 +816,11 @@ ath_edma_tx_processq(struct ath_softc *s } #if defined(ATH_DEBUG_ALQ) && defined(ATH_DEBUG) - if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS)) + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS)) { if_ath_alq_post(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS, sc->sc_tx_statuslen, (char *) txstatus); + } #endif /* ATH_DEBUG_ALQ */ /* From owner-svn-src-head@freebsd.org Mon Sep 12 04:55:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3316EBD5E87; Mon, 12 Sep 2016 04:55:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7E8BDCC; Mon, 12 Sep 2016 04:55:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4tEfX052541; Mon, 12 Sep 2016 04:55:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4tEgJ052540; Mon, 12 Sep 2016 04:55:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609120455.u8C4tEgJ052540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 12 Sep 2016 04:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305721 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 04:55:15 -0000 Author: adrian Date: Mon Sep 12 04:55:13 2016 New Revision: 305721 URL: https://svnweb.freebsd.org/changeset/base/305721 Log: [ath] set the relevant TOA/TOD locationing bits when trying to do locationing. * Don't do RTS/CTS - experiments show that we get ACK frames for each of them and this ends up causing the timestamps to look all funny. * Set the HAL_TXDESC_POS bit, so the AR9300 HAL sets up the hardware to return location and CSI information. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Sep 12 04:50:40 2016 (r305720) +++ head/sys/dev/ath/if_ath_tx.c Mon Sep 12 04:55:13 2016 (r305721) @@ -1042,6 +1042,14 @@ ath_tx_calc_protection(struct ath_softc shortPreamble = bf->bf_state.bfs_shpream; wh = mtod(bf->bf_m, struct ieee80211_frame *); + /* Disable frame protection for TOA probe frames */ + if (bf->bf_flags & ATH_BUF_TOA_PROBE) { + /* XXX count */ + flags &= ~(HAL_TXDESC_CTSENA | HAL_TXDESC_RTSENA); + bf->bf_state.bfs_doprot = 0; + goto finish; + } + /* * If 802.11g protection is enabled, determine whether * to use RTS/CTS or just CTS. Note that this is only @@ -1081,6 +1089,8 @@ ath_tx_calc_protection(struct ath_softc flags |= HAL_TXDESC_RTSENA; sc->sc_stats.ast_tx_htprotect++; } + +finish: bf->bf_state.bfs_txflags = flags; } @@ -1739,6 +1749,34 @@ ath_tx_normal_setup(struct ath_softc *sc } #endif + /* + * If it's a frame to do location reporting on, + * communicate it to the HAL. + */ + if (ieee80211_get_toa_params(m0, NULL)) { + device_printf(sc->sc_dev, + "%s: setting TX positioning bit\n", __func__); + flags |= HAL_TXDESC_POS; + + /* + * Note: The hardware reports timestamps for + * each of the RX'ed packets as part of the packet + * exchange. So this means things like RTS/CTS + * exchanges, as well as the final ACK. + * + * So, if you send a RTS-protected NULL data frame, + * you'll get an RX report for the RTS response, then + * an RX report for the NULL frame, and then the TX + * completion at the end. + * + * NOTE: it doesn't work right for CCK frames; + * there's no channel info data provided unless + * it's OFDM or HT. Will have to dig into it. + */ + flags &= ~(HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + bf->bf_flags |= ATH_BUF_TOA_PROBE; + } + #if 0 /* * Placeholder: if you want to transmit with the azimuth @@ -2175,6 +2213,18 @@ ath_tx_raw_start(struct ath_softc *sc, s try0 = ATH_TXMAXTRY; /* XXX?too many? */ } + /* + * If it's a frame to do location reporting on, + * communicate it to the HAL. + */ + if (ieee80211_get_toa_params(m0, NULL)) { + device_printf(sc->sc_dev, + "%s: setting TX positioning bit\n", __func__); + flags |= HAL_TXDESC_POS; + flags &= ~(HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + bf->bf_flags |= ATH_BUF_TOA_PROBE; + } + txrate = rt->info[rix].rateCode; if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) txrate |= rt->info[rix].shortPreamble; From owner-svn-src-head@freebsd.org Mon Sep 12 04:57:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A0BBD5F08; Mon, 12 Sep 2016 04:57:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33FA2F57; Mon, 12 Sep 2016 04:57:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4vwRK052666; Mon, 12 Sep 2016 04:57:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4vw9S052665; Mon, 12 Sep 2016 04:57:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120457.u8C4vw9S052665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 04:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305722 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 04:57:59 -0000 Author: sephe Date: Mon Sep 12 04:57:58 2016 New Revision: 305722 URL: https://svnweb.freebsd.org/changeset/base/305722 Log: x86: Use sx lock for interrupt sources. - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long call chain. For msi_assign_cpu, mutex makes complex PCI bridge drivers more tricky, e.g. sleep can note be called, etc, it will be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI pass-through. - It is not used on any hot code path nor non-sleepable context, so sx should have the same effect as mutex. PIC list is still protected by mutex to keep suspend/resume work. Discussed with: jhb Reviewed by: jhb MFC after: 3 weeks Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7784 Modified: head/sys/x86/x86/intr_machdep.c Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Mon Sep 12 04:55:13 2016 (r305721) +++ head/sys/x86/x86/intr_machdep.c Mon Sep 12 04:57:58 2016 (r305722) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -73,7 +74,8 @@ typedef void (*mask_fn)(void *); static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; -static struct mtx intr_table_lock; +static struct sx intrsrc_lock; +static struct mtx intrpic_lock; static struct mtx intrcnt_lock; static TAILQ_HEAD(pics_head, pic) pics; @@ -117,14 +119,14 @@ intr_register_pic(struct pic *pic) { int error; - mtx_lock(&intr_table_lock); + mtx_lock(&intrpic_lock); if (intr_pic_registered(pic)) error = EBUSY; else { TAILQ_INSERT_TAIL(&pics, pic, pics); error = 0; } - mtx_unlock(&intr_table_lock); + mtx_unlock(&intrpic_lock); return (error); } @@ -148,16 +150,16 @@ intr_register_source(struct intsrc *isrc vector); if (error) return (error); - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); if (interrupt_sources[vector] != NULL) { - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); intr_event_destroy(isrc->is_event); return (EEXIST); } intrcnt_register(isrc); interrupt_sources[vector] = isrc; isrc->is_handlers = 0; - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); return (0); } @@ -181,14 +183,14 @@ intr_add_handler(const char *name, int v error = intr_event_add_handler(isrc->is_event, name, filter, handler, arg, intr_priority(flags), flags, cookiep); if (error == 0) { - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); intrcnt_updatename(isrc); isrc->is_handlers++; if (isrc->is_handlers == 1) { isrc->is_pic->pic_enable_intr(isrc); isrc->is_pic->pic_enable_source(isrc); } - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } return (error); } @@ -202,14 +204,14 @@ intr_remove_handler(void *cookie) isrc = intr_handler_source(cookie); error = intr_event_remove_handler(cookie); if (error == 0) { - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); isrc->is_handlers--; if (isrc->is_handlers == 0) { isrc->is_pic->pic_disable_source(isrc, PIC_NO_EOI); isrc->is_pic->pic_disable_intr(isrc); } intrcnt_updatename(isrc); - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } return (error); } @@ -283,12 +285,12 @@ intr_resume(bool suspend_cancelled) #ifndef DEV_ATPIC atpic_reset(); #endif - mtx_lock(&intr_table_lock); + mtx_lock(&intrpic_lock); TAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) pic->pic_resume(pic, suspend_cancelled); } - mtx_unlock(&intr_table_lock); + mtx_unlock(&intrpic_lock); } void @@ -296,12 +298,12 @@ intr_suspend(void) { struct pic *pic; - mtx_lock(&intr_table_lock); + mtx_lock(&intrpic_lock); TAILQ_FOREACH_REVERSE(pic, &pics, pics_head, pics) { if (pic->pic_suspend != NULL) pic->pic_suspend(pic); } - mtx_unlock(&intr_table_lock); + mtx_unlock(&intrpic_lock); } static int @@ -322,9 +324,9 @@ intr_assign_cpu(void *arg, int cpu) if (assign_cpu && cpu != NOCPU) { #endif isrc = arg; - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); error = isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]); - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } else error = 0; return (error); @@ -384,7 +386,8 @@ intr_init(void *dummy __unused) intrcnt_setname("???", 0); intrcnt_index = 1; TAILQ_INIT(&pics); - mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF); + mtx_init(&intrpic_lock, "intrpic", NULL, MTX_DEF); + sx_init(&intrsrc_lock, "intrsrc"); mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN); } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); @@ -449,7 +452,7 @@ intr_reprogram(void) struct intsrc *is; int v; - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); for (v = 0; v < NUM_IO_INTS; v++) { is = interrupt_sources[v]; if (is == NULL) @@ -457,7 +460,7 @@ intr_reprogram(void) if (is->is_pic->pic_reprogram_pin != NULL) is->is_pic->pic_reprogram_pin(is); } - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } #ifdef DDB @@ -562,7 +565,7 @@ intr_shuffle_irqs(void *arg __unused) return; /* Round-robin assign a CPU to each enabled source. */ - mtx_lock(&intr_table_lock); + sx_xlock(&intrsrc_lock); assign_cpu = 1; for (i = 0; i < NUM_IO_INTS; i++) { isrc = interrupt_sources[i]; @@ -583,7 +586,7 @@ intr_shuffle_irqs(void *arg __unused) } } - mtx_unlock(&intr_table_lock); + sx_xunlock(&intrsrc_lock); } SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs, NULL); From owner-svn-src-head@freebsd.org Mon Sep 12 04:59:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33493BD5F8E; Mon, 12 Sep 2016 04:59:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05F1F10D7; Mon, 12 Sep 2016 04:58:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C4wxiF052745; Mon, 12 Sep 2016 04:58:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C4wxPp052744; Mon, 12 Sep 2016 04:58:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609120458.u8C4wxPp052744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 12 Sep 2016 04:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305723 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 04:59:00 -0000 Author: adrian Date: Mon Sep 12 04:58:59 2016 New Revision: 305723 URL: https://svnweb.freebsd.org/changeset/base/305723 Log: [ath_hal] quieten a bit of the boot messages - this stuff has been working for a while. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Mon Sep 12 04:57:58 2016 (r305722) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Mon Sep 12 04:58:59 2016 (r305723) @@ -2339,7 +2339,9 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC } else { ar9300_disable_pcie_phy(ah); } +#if 0 ath_hal_printf(ah, "%s: calling ar9300_hw_attach\n", __func__); +#endif ecode = ar9300_hw_attach(ah); if (ecode != HAL_OK) { goto bad; @@ -3234,7 +3236,9 @@ ar9300_hw_attach(struct ath_hal *ah) return HAL_ESELFTEST; } +#if 0 ath_hal_printf(ah, "%s: calling ar9300_eeprom_attach\n", __func__); +#endif ecode = ar9300_eeprom_attach(ah); ath_hal_printf(ah, "%s: ar9300_eeprom_attach returned %d\n", __func__, ecode); if (ecode != HAL_OK) { From owner-svn-src-head@freebsd.org Mon Sep 12 05:09:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48074BD6351; Mon, 12 Sep 2016 05:09:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0229D1746; Mon, 12 Sep 2016 05:09:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C59jK3056567; Mon, 12 Sep 2016 05:09:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C59jfA056566; Mon, 12 Sep 2016 05:09:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120509.u8C59jfA056566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305724 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:09:46 -0000 Author: sephe Date: Mon Sep 12 05:09:45 2016 New Revision: 305724 URL: https://svnweb.freebsd.org/changeset/base/305724 Log: hyperv/hn: Rename RXBUF connect/disconnect functions. Minor cleanup and wording in error messages. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7823 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 04:58:59 2016 (r305723) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:09:45 2016 (r305724) @@ -58,9 +58,9 @@ MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper * Forward declarations */ static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc); -static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *); +static int hn_nvs_conn_rxbuf(struct hn_softc *); static int hv_nv_destroy_send_buffer(struct hn_softc *sc); -static int hv_nv_destroy_rx_buffer(struct hn_softc *sc); +static int hn_nvs_disconn_rxbuf(struct hn_softc *sc); static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct hn_softc *, struct vmbus_channel *chan, @@ -154,14 +154,8 @@ hn_nvs_req_send(struct hn_softc *sc, voi req, reqlen, &hn_send_ctx_none)); } -/* - * Net VSC initialize receive buffer with net VSP - * - * Net VSP: Network virtual services client, also known as the - * Hyper-V extensible switch and the synthetic data path. - */ static int -hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc) +hn_nvs_conn_rxbuf(struct hn_softc *sc) { struct vmbus_xact *xact = NULL; struct hn_nvs_rxbuf_conn *conn; @@ -188,7 +182,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct error = vmbus_chan_gpadl_connect(sc->hn_prichan, sc->hn_rxbuf_dma.hv_paddr, rxbuf_size, &sc->hn_rxbuf_gpadl); if (error) { - if_printf(sc->hn_ifp, "rxbuf gpadl connect failed: %d\n", + if_printf(sc->hn_ifp, "rxbuf gpadl conn failed: %d\n", error); goto cleanup; } @@ -212,7 +206,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct resp = hn_nvs_xact_execute(sc, xact, conn, sizeof(*conn), &resp_len, HN_NVS_TYPE_RXBUF_CONNRESP); if (resp == NULL) { - if_printf(sc->hn_ifp, "exec rxbuf conn failed\n"); + if_printf(sc->hn_ifp, "exec nvs rxbuf conn failed\n"); error = EIO; goto cleanup; } @@ -222,7 +216,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct xact = NULL; if (status != HN_NVS_STATUS_OK) { - if_printf(sc->hn_ifp, "rxbuf conn failed: %x\n", status); + if_printf(sc->hn_ifp, "nvs rxbuf conn failed: %x\n", status); error = EIO; goto cleanup; } @@ -233,7 +227,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct cleanup: if (xact != NULL) vmbus_xact_put(xact); - hv_nv_destroy_rx_buffer(sc); + hn_nvs_disconn_rxbuf(sc); return (error); } @@ -336,13 +330,10 @@ cleanup: return (error); } -/* - * Net VSC destroy receive buffer - */ static int -hv_nv_destroy_rx_buffer(struct hn_softc *sc) +hn_nvs_disconn_rxbuf(struct hn_softc *sc) { - int ret = 0; + int error; if (sc->hn_flags & HN_FLAG_RXBUF_CONNECTED) { struct hn_nvs_rxbuf_disconn disconn; @@ -355,29 +346,29 @@ hv_nv_destroy_rx_buffer(struct hn_softc disconn.nvs_sig = HN_NVS_RXBUF_SIG; /* NOTE: No response. */ - ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); - if (ret != 0) { + error = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); + if (error) { if_printf(sc->hn_ifp, - "send rxbuf disconn failed: %d\n", ret); - return (ret); + "send nvs rxbuf disconn failed: %d\n", error); + return (error); } sc->hn_flags &= ~HN_FLAG_RXBUF_CONNECTED; } - + if (sc->hn_rxbuf_gpadl != 0) { /* * Disconnect RXBUF from primary channel. */ - ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + error = vmbus_chan_gpadl_disconnect(sc->hn_prichan, sc->hn_rxbuf_gpadl); - if (ret != 0) { + if (error) { if_printf(sc->hn_ifp, - "rxbuf disconn failed: %d\n", ret); - return (ret); + "rxbuf gpadl disconn failed: %d\n", error); + return (error); } sc->hn_rxbuf_gpadl = 0; } - return (ret); + return (0); } /* @@ -566,10 +557,17 @@ hv_nv_connect_to_vsp(struct hn_softc *sc if (ret != 0) return (ret); - ret = hv_nv_init_rx_buffer_with_net_vsp(sc); - if (ret == 0) - ret = hv_nv_init_send_buffer_with_net_vsp(sc); - return (ret); + /* + * Connect RXBUF. + */ + ret = hn_nvs_conn_rxbuf(sc); + if (ret != 0) + return (ret); + + /* + * Connect chimney sending buffer. + */ + return hv_nv_init_send_buffer_with_net_vsp(sc); } /* @@ -578,7 +576,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc static void hv_nv_disconnect_from_vsp(struct hn_softc *sc) { - hv_nv_destroy_rx_buffer(sc); + hn_nvs_disconn_rxbuf(sc); hv_nv_destroy_send_buffer(sc); } From owner-svn-src-head@freebsd.org Mon Sep 12 05:18:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B16BBD6731; Mon, 12 Sep 2016 05:18:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8741D6C; Mon, 12 Sep 2016 05:18:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5IVQS060520; Mon, 12 Sep 2016 05:18:31 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5IVFX060519; Mon, 12 Sep 2016 05:18:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120518.u8C5IVFX060519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305725 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:18:32 -0000 Author: sephe Date: Mon Sep 12 05:18:30 2016 New Revision: 305725 URL: https://svnweb.freebsd.org/changeset/base/305725 Log: hyperv/hn: Rename chimney sending buffer connect/disconnect functions. Minor cleanup and wording in error messages. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7825 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:09:45 2016 (r305724) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:18:30 2016 (r305725) @@ -57,9 +57,9 @@ MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper /* * Forward declarations */ -static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc); +static int hn_nvs_conn_chim(struct hn_softc *sc); static int hn_nvs_conn_rxbuf(struct hn_softc *); -static int hv_nv_destroy_send_buffer(struct hn_softc *sc); +static int hn_nvs_disconn_chim(struct hn_softc *sc); static int hn_nvs_disconn_rxbuf(struct hn_softc *sc); static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, @@ -231,11 +231,8 @@ cleanup: return (error); } -/* - * Net VSC initialize send buffer with net VSP - */ static int -hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc) +hn_nvs_conn_chim(struct hn_softc *sc) { struct vmbus_xact *xact = NULL; struct hn_nvs_chim_conn *chim; @@ -255,8 +252,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru sc->hn_chim_dma.hv_paddr, NETVSC_SEND_BUFFER_SIZE, &sc->hn_chim_gpadl); if (error) { - if_printf(sc->hn_ifp, "chimney sending buffer gpadl " - "connect failed: %d\n", error); + if_printf(sc->hn_ifp, "chim gpadl conn failed: %d\n", error); goto cleanup; } @@ -279,7 +275,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru resp = hn_nvs_xact_execute(sc, xact, chim, sizeof(*chim), &resp_len, HN_NVS_TYPE_CHIM_CONNRESP); if (resp == NULL) { - if_printf(sc->hn_ifp, "exec chim conn failed\n"); + if_printf(sc->hn_ifp, "exec nvs chim conn failed\n"); error = EIO; goto cleanup; } @@ -290,14 +286,14 @@ hv_nv_init_send_buffer_with_net_vsp(stru xact = NULL; if (status != HN_NVS_STATUS_OK) { - if_printf(sc->hn_ifp, "chim conn failed: %x\n", status); + if_printf(sc->hn_ifp, "nvs chim conn failed: %x\n", status); error = EIO; goto cleanup; } if (sectsz == 0) { if_printf(sc->hn_ifp, "zero chimney sending buffer " "section size\n"); - return 0; + return (0); } sc->hn_chim_szmax = sectsz; @@ -321,12 +317,12 @@ hv_nv_init_send_buffer_with_net_vsp(stru if_printf(sc->hn_ifp, "chimney sending buffer %d/%d\n", sc->hn_chim_szmax, sc->hn_chim_cnt); } - return 0; + return (0); cleanup: if (xact != NULL) vmbus_xact_put(xact); - hv_nv_destroy_send_buffer(sc); + hn_nvs_disconn_chim(sc); return (error); } @@ -371,13 +367,10 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc return (0); } -/* - * Net VSC destroy send buffer - */ static int -hv_nv_destroy_send_buffer(struct hn_softc *sc) +hn_nvs_disconn_chim(struct hn_softc *sc) { - int ret = 0; + int error; if (sc->hn_flags & HN_FLAG_CHIM_CONNECTED) { struct hn_nvs_chim_disconn disconn; @@ -390,25 +383,25 @@ hv_nv_destroy_send_buffer(struct hn_soft disconn.nvs_sig = HN_NVS_CHIM_SIG; /* NOTE: No response. */ - ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); - if (ret != 0) { + error = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); + if (error) { if_printf(sc->hn_ifp, - "send chim disconn failed: %d\n", ret); - return (ret); + "send nvs chim disconn failed: %d\n", error); + return (error); } sc->hn_flags &= ~HN_FLAG_CHIM_CONNECTED; } - + if (sc->hn_chim_gpadl != 0) { /* * Disconnect chimney sending buffer from primary channel. */ - ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + error = vmbus_chan_gpadl_disconnect(sc->hn_prichan, sc->hn_chim_gpadl); - if (ret != 0) { + if (error) { if_printf(sc->hn_ifp, - "chim disconn failed: %d\n", ret); - return (ret); + "chim gpadl disconn failed: %d\n", error); + return (error); } sc->hn_chim_gpadl = 0; } @@ -417,8 +410,7 @@ hv_nv_destroy_send_buffer(struct hn_soft free(sc->hn_chim_bmap, M_NETVSC); sc->hn_chim_bmap = NULL; } - - return (ret); + return (0); } static int @@ -567,7 +559,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc /* * Connect chimney sending buffer. */ - return hv_nv_init_send_buffer_with_net_vsp(sc); + return hn_nvs_conn_chim(sc); } /* @@ -577,7 +569,7 @@ static void hv_nv_disconnect_from_vsp(struct hn_softc *sc) { hn_nvs_disconn_rxbuf(sc); - hv_nv_destroy_send_buffer(sc); + hn_nvs_disconn_chim(sc); } /* From owner-svn-src-head@freebsd.org Mon Sep 12 05:19:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A158BD67A5; Mon, 12 Sep 2016 05:19:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2D91EE7; Mon, 12 Sep 2016 05:19:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5Jubw060614; Mon, 12 Sep 2016 05:19:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5Jubv060613; Mon, 12 Sep 2016 05:19:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201609120519.u8C5Jubv060613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Sep 2016 05:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305726 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:19:57 -0000 Author: imp Date: Mon Sep 12 05:19:56 2016 New Revision: 305726 URL: https://svnweb.freebsd.org/changeset/base/305726 Log: Report the Silicon Revisions for the AM335x SoCs correctly. Modified: head/sys/arm/ti/ti_cpuid.c Modified: head/sys/arm/ti/ti_cpuid.c ============================================================================== --- head/sys/arm/ti/ti_cpuid.c Mon Sep 12 05:18:30 2016 (r305725) +++ head/sys/arm/ti/ti_cpuid.c Mon Sep 12 05:19:56 2016 (r305726) @@ -201,8 +201,10 @@ static void am335x_get_revision(void) { uint32_t dev_feature; - uint8_t cpu_last_char; + char cpu_last_char; bus_space_handle_t bsh; + int major; + int minor; bus_space_map(fdtbus_bs_tag, AM335X_CONTROL_BASE, AM335X_CONTROL_SIZE, 0, &bsh); chip_revision = bus_space_read_4(fdtbus_bs_tag, bsh, AM335X_CONTROL_DEVICE_ID); @@ -232,8 +234,26 @@ am335x_get_revision(void) cpu_last_char='x'; } - printf("Texas Instruments AM335%c Processor, Revision ES1.%u\n", - cpu_last_char, AM335X_DEVREV(chip_revision)); + switch(AM335X_DEVREV(chip_revision)) { + case 0: + major = 1; + minor = 0; + break; + case 1: + major = 2; + minor = 0; + break; + case 2: + major = 2; + minor = 1; + break; + default: + major = 0; + minor = AM335X_DEVREV(chip_revision); + break; + } + printf("Texas Instruments AM335%c Processor, Revision ES%u.%u\n", + cpu_last_char, major, minor); } /** From owner-svn-src-head@freebsd.org Mon Sep 12 05:28:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A6D9BD6A56; Mon, 12 Sep 2016 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1219B3E2; Mon, 12 Sep 2016 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5SpdJ064238; Mon, 12 Sep 2016 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5SpS1064235; Mon, 12 Sep 2016 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120528.u8C5SpS1064235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305727 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:28:52 -0000 Author: sephe Date: Mon Sep 12 05:28:50 2016 New Revision: 305727 URL: https://svnweb.freebsd.org/changeset/base/305727 Log: hyperv/hn: Function rename. - Minor style changes. - Nuke unnecessary indirection. - Nuke unapplied comment. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7827 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:19:56 2016 (r305726) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:28:50 2016 (r305727) @@ -61,7 +61,6 @@ static int hn_nvs_conn_chim(struct hn_s static int hn_nvs_conn_rxbuf(struct hn_softc *); static int hn_nvs_disconn_chim(struct hn_softc *sc); static int hn_nvs_disconn_rxbuf(struct hn_softc *sc); -static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct hn_softc *, struct vmbus_channel *chan, const void *, int); @@ -521,45 +520,48 @@ hn_nvs_init(struct hn_softc *sc) return (ENXIO); } -static int -hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu) +int +hn_nvs_attach(struct hn_softc *sc, int mtu) { - int ret; + int error; /* * Initialize NVS. */ - ret = hn_nvs_init(sc); - if (ret != 0) - return (ret); + error = hn_nvs_init(sc); + if (error) + return (error); if (sc->hn_nvs_ver >= HN_NVS_VERSION_2) { /* * Configure NDIS before initializing it. */ - ret = hn_nvs_conf_ndis(sc, mtu); - if (ret != 0) - return (ret); + error = hn_nvs_conf_ndis(sc, mtu); + if (error) + return (error); } /* * Initialize NDIS. */ - ret = hn_nvs_init_ndis(sc); - if (ret != 0) - return (ret); + error = hn_nvs_init_ndis(sc); + if (error) + return (error); /* * Connect RXBUF. */ - ret = hn_nvs_conn_rxbuf(sc); - if (ret != 0) - return (ret); + error = hn_nvs_conn_rxbuf(sc); + if (error) + return (error); /* * Connect chimney sending buffer. */ - return hn_nvs_conn_chim(sc); + error = hn_nvs_conn_chim(sc); + if (error) + return (error); + return (0); } /* @@ -573,21 +575,6 @@ hv_nv_disconnect_from_vsp(struct hn_soft } /* - * Net VSC on device add - * - * Callback when the device belonging to this driver is added - */ -int -hv_nv_on_device_add(struct hn_softc *sc, int mtu) -{ - - /* - * Connect with the NetVsp - */ - return (hv_nv_connect_to_vsp(sc, mtu)); -} - -/* * Net VSC on device remove */ int Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:19:56 2016 (r305726) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:28:50 2016 (r305727) @@ -261,7 +261,7 @@ extern int hv_promisc_mode; struct hn_send_ctx; void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); -int hv_nv_on_device_add(struct hn_softc *sc, int mtu); +int hn_nvs_attach(struct hn_softc *sc, int mtu); int hv_nv_on_device_remove(struct hn_softc *sc); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:19:56 2016 (r305726) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:28:50 2016 (r305727) @@ -1025,13 +1025,7 @@ hv_rf_on_device_add(struct hn_softc *sc, int nchan = *nchan0; int rxr_cnt; - /* - * Let the inner driver handle this first to create the netvsc channel - * NOTE! Once the channel is created, we may get a receive callback - * (hv_rf_on_receive()) before this call is completed. - * Note: Earlier code used a function pointer here. - */ - ret = hv_nv_on_device_add(sc, mtu); + ret = hn_nvs_attach(sc, mtu); if (ret != 0) return (ret); From owner-svn-src-head@freebsd.org Mon Sep 12 05:37:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5880BD6CB6; Mon, 12 Sep 2016 05:37:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3591B58; Mon, 12 Sep 2016 05:37:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5bjeS067994; Mon, 12 Sep 2016 05:37:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5biRx067991; Mon, 12 Sep 2016 05:37:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120537.u8C5biRx067991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305728 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:37:46 -0000 Author: sephe Date: Mon Sep 12 05:37:44 2016 New Revision: 305728 URL: https://svnweb.freebsd.org/changeset/base/305728 Log: hyperv/hn: Reorganize sub-channel allocation. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7829 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:28:50 2016 (r305727) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:37:44 2016 (r305728) @@ -102,7 +102,7 @@ hn_chim_alloc(struct hn_softc *sc) return (ret); } -const void * +static const void * hn_nvs_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, void *req, int reqlen, size_t *resplen0, uint32_t type) { @@ -653,3 +653,54 @@ hv_nv_on_send(struct vmbus_channel *chan return (ret); } + +int +hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch0) +{ + struct vmbus_xact *xact; + struct hn_nvs_subch_req *req; + const struct hn_nvs_subch_resp *resp; + int error, nsubch_req; + uint32_t nsubch; + size_t resp_len; + + nsubch_req = *nsubch0; + KASSERT(nsubch_req > 0, ("invalid # of sub-channels %d", nsubch_req)); + + xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for nvs subch alloc\n"); + return (ENXIO); + } + req = vmbus_xact_req_data(xact); + req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; + req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; + req->nvs_nsubch = nsubch_req; + + resp_len = sizeof(*resp); + resp = hn_nvs_xact_execute(sc, xact, req, sizeof(*req), &resp_len, + HN_NVS_TYPE_SUBCH_RESP); + if (resp == NULL) { + if_printf(sc->hn_ifp, "exec nvs subch alloc failed\n"); + error = EIO; + goto done; + } + if (resp->nvs_status != HN_NVS_STATUS_OK) { + if_printf(sc->hn_ifp, "nvs subch alloc failed: %x\n", + resp->nvs_status); + error = EIO; + goto done; + } + + nsubch = resp->nvs_nsubch; + if (nsubch > nsubch_req) { + if_printf(sc->hn_ifp, "%u subchans are allocated, " + "requested %d\n", nsubch, nsubch_req); + nsubch = nsubch_req; + } + *nsubch0 = nsubch; + error = 0; +done: + vmbus_xact_put(xact); + return (error); +} Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:28:50 2016 (r305727) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:37:44 2016 (r305728) @@ -1017,13 +1017,7 @@ hv_rf_on_device_add(struct hn_softc *sc, int ret; netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; - struct hn_nvs_subch_req *req; - const struct hn_nvs_subch_resp *resp; - size_t resp_len; - struct vmbus_xact *xact = NULL; - uint32_t status, nsubch; - int nchan = *nchan0; - int rxr_cnt; + int nchan = *nchan0, rxr_cnt, nsubch; ret = hn_nvs_attach(sc, mtu); if (ret != 0) @@ -1072,65 +1066,40 @@ hv_rf_on_device_add(struct hn_softc *sc, *nchan0 = 1; return (0); } - if (nchan > rxr_cnt) - nchan = rxr_cnt; if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", rxr_cnt, nchan); + if (nchan > rxr_cnt) + nchan = rxr_cnt; if (nchan == 1) { device_printf(dev, "only 1 channel is supported, no vRSS\n"); - goto out; + *nchan0 = 1; + return (0); } /* - * Ask NVS to allocate sub-channels. + * Allocate sub-channels from NVS. */ - xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); - if (xact == NULL) { - if_printf(sc->hn_ifp, "no xact for nvs subch req\n"); - ret = ENXIO; - goto out; - } - req = vmbus_xact_req_data(xact); - req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; - req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; - req->nvs_nsubch = nchan - 1; - - resp_len = sizeof(*resp); - resp = hn_nvs_xact_execute(sc, xact, req, sizeof(*req), &resp_len, - HN_NVS_TYPE_SUBCH_RESP); - if (resp == NULL) { - if_printf(sc->hn_ifp, "exec subch failed\n"); - ret = EIO; - goto out; - } - - status = resp->nvs_status; - nsubch = resp->nvs_nsubch; - vmbus_xact_put(xact); - xact = NULL; - - if (status != HN_NVS_STATUS_OK) { - if_printf(sc->hn_ifp, "subch req failed: %x\n", status); - ret = EIO; - goto out; - } - if (nsubch > nchan - 1) { - if_printf(sc->hn_ifp, "%u subchans are allocated, requested %u\n", - nsubch, nchan - 1); - nsubch = nchan - 1; + nsubch = nchan - 1; + ret = hn_nvs_alloc_subchans(sc, &nsubch); + if (ret || nsubch == 0) { + /* Failed to allocate sub-channels. */ + *nchan0 = 1; + return (0); } nchan = nsubch + 1; + /* + * Configure RSS key and indirect table after all sub-channels + * are allocated. + */ ret = hn_rndis_conf_rss(sc, nchan); - if (ret != 0) - *nchan0 = 1; - else - *nchan0 = nchan; -out: - if (xact != NULL) - vmbus_xact_put(xact); - return (ret); + if (ret != 0) { + /* Failed to configure RSS key or indirect table. */ + nchan = 1; + } + *nchan0 = nchan; + return (0); } /* Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 05:28:50 2016 (r305727) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 05:37:44 2016 (r305728) @@ -114,9 +114,6 @@ hn_nvs_send_sglist(struct vmbus_channel struct vmbus_xact; struct rndis_packet_msg; -const void *hn_nvs_xact_execute(struct hn_softc *sc, - struct vmbus_xact *xact, void *req, int reqlen, - size_t *resp_len, uint32_t type); void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); uint32_t hn_chim_alloc(struct hn_softc *sc); @@ -125,6 +122,7 @@ void hn_chim_free(struct hn_softc *sc, void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); +int hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch); int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info); void hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); From owner-svn-src-head@freebsd.org Mon Sep 12 05:59:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16A32BD7330; Mon, 12 Sep 2016 05:59:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C39AF842; Mon, 12 Sep 2016 05:59:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5xemm079229; Mon, 12 Sep 2016 05:59:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5xe06079228; Mon, 12 Sep 2016 05:59:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120559.u8C5xe06079228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305729 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:59:41 -0000 Author: sephe Date: Mon Sep 12 05:59:39 2016 New Revision: 305729 URL: https://svnweb.freebsd.org/changeset/base/305729 Log: hyperv/hn: Reorganize RNDIS attach MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7830 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:37:44 2016 (r305728) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:59:39 2016 (r305729) @@ -78,7 +78,6 @@ static void hv_rf_receive_data(struct hn static int hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr); static int hv_rf_query_device_link_status(struct hn_softc *sc, uint32_t *link_status); -static int hv_rf_init_device(struct hn_softc *sc); static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); @@ -922,11 +921,8 @@ hn_rndis_set_rxfilter(struct hn_softc *s return (error); } -/* - * RNDIS filter init device - */ static int -hv_rf_init_device(struct hn_softc *sc) +hn_rndis_init(struct hn_softc *sc) { struct rndis_init_req *req; const struct rndis_init_comp *comp; @@ -1007,9 +1003,26 @@ hv_rf_halt_device(struct hn_softc *sc) return (0); } -/* - * RNDIS filter on device add - */ +static int +hn_rndis_attach(struct hn_softc *sc) +{ + int error; + + /* + * Initialize RNDIS. + */ + error = hn_rndis_init(sc); + if (error) + return (error); + + /* + * Configure NDIS offload settings. + * XXX no offloading, if error happened? + */ + hn_rndis_conf_offload(sc); + return (0); +} + int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan0, int mtu) @@ -1023,28 +1036,15 @@ hv_rf_on_device_add(struct hn_softc *sc, if (ret != 0) return (ret); - /* - * Initialize the rndis device - */ - - /* Send the rndis initialization message */ - ret = hv_rf_init_device(sc); - if (ret != 0) { - /* - * TODO: If rndis init failed, we will need to shut down - * the channel - */ - } + ret = hn_rndis_attach(sc); + if (ret != 0) + return (ret); /* Get the mac address */ ret = hv_rf_query_device_mac(sc, dev_info->mac_addr); if (ret != 0) { /* TODO: shut down rndis device and the channel */ } - - /* Configure NDIS offload settings */ - hn_rndis_conf_offload(sc); - hv_rf_query_device_link_status(sc, &dev_info->link_state); if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { From owner-svn-src-head@freebsd.org Mon Sep 12 06:12:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19401BD7648; Mon, 12 Sep 2016 06:12:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8BC1EAD; Mon, 12 Sep 2016 06:12:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C6CThw090040; Mon, 12 Sep 2016 06:12:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C6CSLG090032; Mon, 12 Sep 2016 06:12:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120612.u8C6CSLG090032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 06:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305730 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 06:12:30 -0000 Author: sephe Date: Mon Sep 12 06:12:28 2016 New Revision: 305730 URL: https://svnweb.freebsd.org/changeset/base/305730 Log: hyperv/hn: Pull ether address and link status extraction up. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7831 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 06:12:28 2016 (r305730) @@ -99,11 +99,6 @@ struct vmbus_channel; #define NETVSC_DEVICE_RING_BUFFER_SIZE (128 * PAGE_SIZE) #define NETVSC_PACKET_MAXPAGE 32 -typedef struct { - uint8_t mac_addr[ETHER_ADDR_LEN]; - uint32_t link_state; -} netvsc_device_info; - #define HN_XACT_REQ_PGCNT 2 #define HN_XACT_RESP_PGCNT 2 #define HN_XACT_REQ_SIZE (HN_XACT_REQ_PGCNT * PAGE_SIZE) Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Sep 12 06:12:28 2016 (r305730) @@ -440,7 +440,8 @@ netvsc_attach(device_t dev) { struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; - netvsc_device_info device_info; + uint8_t eaddr[ETHER_ADDR_LEN]; + uint32_t link_status; hn_softc_t *sc; int unit = device_get_unit(dev); struct ifnet *ifp = NULL; @@ -564,7 +565,7 @@ netvsc_attach(device_t dev) if (sc->hn_xact == NULL) goto failed; - error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, ETHERMTU); + error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); if (error) goto failed; KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_inuse, @@ -597,9 +598,11 @@ netvsc_attach(device_t dev) } #endif - if (device_info.link_state == NDIS_MEDIA_STATE_CONNECTED) { + error = hn_rndis_get_linkstatus(sc, &link_status); + if (error) + goto failed; + if (link_status == NDIS_MEDIA_STATE_CONNECTED) sc->hn_carrier = 1; - } #if __FreeBSD_version >= 1100045 tso_maxlen = hn_tso_maxlen; @@ -612,7 +615,10 @@ netvsc_attach(device_t dev) (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); #endif - ether_ifattach(ifp, device_info.mac_addr); + error = hn_rndis_get_eaddr(sc, eaddr); + if (error) + goto failed; + ether_ifattach(ifp, eaddr); #if __FreeBSD_version >= 1100045 if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, @@ -1503,7 +1509,6 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; #endif - netvsc_device_info device_info; int mask, error = 0, ring_cnt; int retry_cnt = 500; @@ -1583,8 +1588,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_chan_attach(sc, sc->hn_prichan); /* XXX check error */ ring_cnt = sc->hn_rx_ring_inuse; - error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, - ifr->ifr_mtu); + error = hv_rf_on_device_add(sc, &ring_cnt, ifr->ifr_mtu); if (error) { NV_LOCK(sc); sc->temp_unusable = FALSE; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 06:12:28 2016 (r305730) @@ -75,9 +75,6 @@ static void hv_rf_receive_indicate_statu const void *data, int dlen); static void hv_rf_receive_data(struct hn_rx_ring *rxr, const void *data, int dlen); -static int hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr); -static int hv_rf_query_device_link_status(struct hn_softc *sc, - uint32_t *link_status); static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); @@ -479,11 +476,8 @@ hv_rf_on_receive(struct hn_softc *sc, st } } -/* - * RNDIS filter query device MAC address - */ -static int -hv_rf_query_device_mac(struct hn_softc *sc, uint8_t *eaddr) +int +hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr) { size_t eaddr_len; int error; @@ -500,11 +494,8 @@ hv_rf_query_device_mac(struct hn_softc * return (0); } -/* - * RNDIS filter query device link status - */ -static int -hv_rf_query_device_link_status(struct hn_softc *sc, uint32_t *link_status) +int +hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status) { size_t size; int error; @@ -1024,11 +1015,9 @@ hn_rndis_attach(struct hn_softc *sc) } int -hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, - int *nchan0, int mtu) +hv_rf_on_device_add(struct hn_softc *sc, int *nchan0, int mtu) { int ret; - netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; int nchan = *nchan0, rxr_cnt, nsubch; @@ -1040,13 +1029,6 @@ hv_rf_on_device_add(struct hn_softc *sc, if (ret != 0) return (ret); - /* Get the mac address */ - ret = hv_rf_query_device_mac(sc, dev_info->mac_addr); - if (ret != 0) { - /* TODO: shut down rndis device and the channel */ - } - hv_rf_query_device_link_status(sc, &dev_info->link_state); - if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { /* * Either RSS is not supported, or multiple RX/TX rings Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Sep 12 06:12:28 2016 (r305730) @@ -43,8 +43,7 @@ struct hn_rx_ring; void hv_rf_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, const void *data, int dlen); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); -int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan, - int mtu); +int hv_rf_on_device_add(struct hn_softc *sc, int *nchan, int mtu); int hv_rf_on_device_remove(struct hn_softc *sc); int hv_rf_on_open(struct hn_softc *sc); int hv_rf_on_close(struct hn_softc *sc); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 05:59:39 2016 (r305729) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Sep 12 06:12:28 2016 (r305730) @@ -122,6 +122,9 @@ void hn_chim_free(struct hn_softc *sc, void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); +int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr); +int hn_rndis_get_linkstatus(struct hn_softc *sc, + uint32_t *link_status); int hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch); int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info); From owner-svn-src-head@freebsd.org Mon Sep 12 08:32:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE9E3BD7B7F; Mon, 12 Sep 2016 08:32:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 597F01B3; Mon, 12 Sep 2016 08:32:33 +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 u8C8WSST061504 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 12 Sep 2016 11:32:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u8C8WSST061504 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u8C8WSkS061503; Mon, 12 Sep 2016 11:32:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Sep 2016 11:32:28 +0300 From: Konstantin Belousov To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305722 - head/sys/x86/x86 Message-ID: <20160912083228.GW38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201609120457.u8C4vw9S052665@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 08:32:33 -0000 On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: > Author: sephe > Date: Mon Sep 12 04:57:58 2016 > New Revision: 305722 > URL: https://svnweb.freebsd.org/changeset/base/305722 > > Log: > x86: Use sx lock for interrupt sources. > > - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long > call chain. For msi_assign_cpu, mutex makes complex PCI bridge > drivers more tricky, e.g. sleep can note be called, etc, it will > be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI > pass-through. > - It is not used on any hot code path nor non-sleepable context, so > sx should have the same effect as mutex. Did you tested ACPI_DMAR interrupt remapping mode with your patch and witness enabled ? > > PIC list is still protected by mutex to keep suspend/resume work. From owner-svn-src-head@freebsd.org Mon Sep 12 08:39:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26CB0BD7E3D; Mon, 12 Sep 2016 08:39:58 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7040975; Mon, 12 Sep 2016 08:39:57 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x235.google.com with SMTP id v189so123898122vkv.1; Mon, 12 Sep 2016 01:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=kbBco9dIv7oYIJlhmjGhaO30B9ptsGC87MhXHDFMd+c=; b=sjc/j2+t19wmkqmETdEUVveWEaLHxpWed9kAtLIbI7+8cCTlHHlTTYXlNqiEG3r72P aBRfVfr1UbFp+dx+OcykA7OYylhC4232mFR1QmqDIKJUq6o3xNY5AS5NazCWeRE9nlCL IsyE63DItCXh1qQeqNFbCbxEdEo4tHdZSU5DimIAvPGuypt4NLwQ5wrhvEfNT/EtL/K8 xc7A2QeG5KvJz8i/HT/2P2DFFaerL151zJxdVbb3LAx5CcSdz6Btpb4y8ypT2vhLC4p3 ya/F1M8e6Ry14BRWJ0ps/gNqa1AfuN3SQO1pfeLvs4NSnTaS50byLKvIqfO5Ma6lAyDp 2UVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=kbBco9dIv7oYIJlhmjGhaO30B9ptsGC87MhXHDFMd+c=; b=Uzyw55u9/rJBopr9sSUfYnngswDMxplru9cJqXxjkcFNx4oHvvqso2KLgyiKy1fDPs QQslsT6dCif8SiMLqf7a9+TPL2/TIZDO2FvTwQrjkEjIQhqNV5dMMleDzFsgI5uR6aun IFIBQeCfrsYcuzCM06SJuovRz6jlfV3Bq+h0/66MgHDgPuq8qaVobe95gpOs9XfOo9pw VuyO+wLr2hIduBC05C6Ip9UBmUC/E109MS9+jgSWd96jM7n+iLp6sMKZe7RPqJ17c/P3 N4ErLx1nfk2r/sc2lzYce/JMj0HX5h9goDgTxEo/puBYCN6F5oTU2NhAQaUFx8FZxJNO 1cjw== X-Gm-Message-State: AE9vXwM+sa7xSv2LfJbtVSryiHAuLdq1OuJRIU73YTMQR7kd9cxyV6fYyDA0ZDrdkIDbp67u8JgMWv7WRoMl0Q== X-Received: by 10.31.174.131 with SMTP id x125mr10891632vke.11.1473669596855; Mon, 12 Sep 2016 01:39:56 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Mon, 12 Sep 2016 01:39:54 -0700 (PDT) In-Reply-To: <20160912083228.GW38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 16:39:54 +0800 X-Google-Sender-Auth: bsWlCFoAOB780G5S6vetP99ymzw Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 08:39:58 -0000 On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov wrote: > On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: >> Author: sephe >> Date: Mon Sep 12 04:57:58 2016 >> New Revision: 305722 >> URL: https://svnweb.freebsd.org/changeset/base/305722 >> >> Log: >> x86: Use sx lock for interrupt sources. >> >> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long >> call chain. For msi_assign_cpu, mutex makes complex PCI bridge >> drivers more tricky, e.g. sleep can note be called, etc, it will >> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI >> pass-through. > >> - It is not used on any hot code path nor non-sleepable context, so >> sx should have the same effect as mutex. > Did you tested ACPI_DMAR interrupt remapping mode with your patch and > witness enabled ? Nope, I am about to try it now. BTW, I just checked the code for ACPI_DMAR, I didn't see anything obviously w/ the lock type change though. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Mon Sep 12 08:47:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37CAFBD70C6; Mon, 12 Sep 2016 08:47:37 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x233.google.com (mail-vk0-x233.google.com [IPv6:2607:f8b0:400c:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2553DF6; Mon, 12 Sep 2016 08:47:36 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x233.google.com with SMTP id v189so124108887vkv.1; Mon, 12 Sep 2016 01:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=oO1erJfWbLPFbUnt8lRGQ+7RUkywAShFNvhl2QGog40=; b=QQc4LgUJfqOiDSJIrThM0zfrnjJQ2VP9bGrWKnsFlKz0Mn/37JOub3MSS404VDsD38 PLB71hVTdiy8eSHG9RLLaIr0MJVH/5BAgfxfgJgK6YfcJyCZNcX3sUknY30SEuKwkK4Q tDn2L4yRz5fNHeWXmTBI8h/mh9f35OP62nJ1uxgoFwqPaWP6DQrjS12oZadDT5S1GCwu Dq3zJw8m1fLAXm+aVhRX1N6EkIcy3V4ziHy6720Qs7MhweOg4trXAkGHwOkR8KL3wUbX HKzMtanbUIcmF9Nwm++9N+n8zsLxA7uX+fl6p0A43MEfABpvgfn0P3VYKrxCu8BS4JNH Kthw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=oO1erJfWbLPFbUnt8lRGQ+7RUkywAShFNvhl2QGog40=; b=Udwt8y1+svtLhPDpgo1/tJHCEUXhyZ53zuwugPreA9171SEUnU7t8wNYYseC/xTHPw mMXqPtPeLRHRxAd3XkDAPcces5x/f3SpROgxppFpSKi0MP//nNkmSU434gFLg6DJrFn7 ImmFaFaLBS89aToyZSMC2DKktX/9MW3IBC6lCJJv4fvwEAihETWnNRwhalRZN641BjuQ BgQqXMgWhVN1lGuio/QDtKe87kKWwOe3uQh25B0xPzn81WgxftNxFeyS7UGDSAZQH4Va 80OiB62Hvepd2MOChfoCsn1GWXrhTtv7I7x++PfZJZ/6X+LN0WtPzC0uHYKPvXlVA0JP 2eng== X-Gm-Message-State: AE9vXwNQ2NySmCep/kyVMjF8NbzS5kGEMomseQbvsxaBF09MTJqsPlVallgNcHS7YDKMHSMQS6giiN29sswwfw== X-Received: by 10.31.244.207 with SMTP id s198mr6246007vkh.126.1473670056057; Mon, 12 Sep 2016 01:47:36 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Mon, 12 Sep 2016 01:47:35 -0700 (PDT) In-Reply-To: References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 16:47:35 +0800 X-Google-Sender-Auth: GF5awTCM-ZUBoReObjUGvtRYeU0 Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 08:47:37 -0000 On Mon, Sep 12, 2016 at 4:39 PM, Sepherosa Ziehau wrote: > On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov > wrote: >> On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: >>> Author: sephe >>> Date: Mon Sep 12 04:57:58 2016 >>> New Revision: 305722 >>> URL: https://svnweb.freebsd.org/changeset/base/305722 >>> >>> Log: >>> x86: Use sx lock for interrupt sources. >>> >>> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long >>> call chain. For msi_assign_cpu, mutex makes complex PCI bridge >>> drivers more tricky, e.g. sleep can note be called, etc, it will >>> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI >>> pass-through. >> >>> - It is not used on any hot code path nor non-sleepable context, so >>> sx should have the same effect as mutex. >> Did you tested ACPI_DMAR interrupt remapping mode with your patch and >> witness enabled ? > > Nope, I am about to try it now. BTW, I just checked the code for > ACPI_DMAR, I didn't see anything obviously w/ the lock type change > though. I didn't notice anything wrong w/ options ACPI_DMAR+WITNESS+INVARIANTS. If you saw anything wrong, please let me know. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Mon Sep 12 10:00:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8745FBD683F; Mon, 12 Sep 2016 10:00:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 057DF824; Mon, 12 Sep 2016 10:00:14 +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 u8CA059Z081819 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 12 Sep 2016 13:00:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u8CA059Z081819 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u8CA03om081761; Mon, 12 Sep 2016 13:00:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Sep 2016 13:00:03 +0300 From: Konstantin Belousov To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305722 - head/sys/x86/x86 Message-ID: <20160912100003.GX38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 10:00:15 -0000 On Mon, Sep 12, 2016 at 04:47:35PM +0800, Sepherosa Ziehau wrote: > On Mon, Sep 12, 2016 at 4:39 PM, Sepherosa Ziehau wrote: > > On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov > > wrote: > >> On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: > >>> Author: sephe > >>> Date: Mon Sep 12 04:57:58 2016 > >>> New Revision: 305722 > >>> URL: https://svnweb.freebsd.org/changeset/base/305722 > >>> > >>> Log: > >>> x86: Use sx lock for interrupt sources. > >>> > >>> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long > >>> call chain. For msi_assign_cpu, mutex makes complex PCI bridge > >>> drivers more tricky, e.g. sleep can note be called, etc, it will > >>> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI > >>> pass-through. > >> > >>> - It is not used on any hot code path nor non-sleepable context, so > >>> sx should have the same effect as mutex. > >> Did you tested ACPI_DMAR interrupt remapping mode with your patch and > >> witness enabled ? > > > > Nope, I am about to try it now. BTW, I just checked the code for > > ACPI_DMAR, I didn't see anything obviously w/ the lock type change > > though. > > I didn't notice anything wrong w/ options > ACPI_DMAR+WITNESS+INVARIANTS. If you saw anything wrong, please let > me know. Options are not enough, you should explicitely enable interrupt remapping with loader tunable hw.dmar.ir=1. From owner-svn-src-head@freebsd.org Mon Sep 12 14:28:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D620BD8710; Mon, 12 Sep 2016 14:28:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4482D418; Mon, 12 Sep 2016 14:28:39 +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 u8CESceC042824; Mon, 12 Sep 2016 14:28:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CEScb5042823; Mon, 12 Sep 2016 14:28:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609121428.u8CEScb5042823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Sep 2016 14:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305737 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 14:28:39 -0000 Author: emaste Date: Mon Sep 12 14:28:38 2016 New Revision: 305737 URL: https://svnweb.freebsd.org/changeset/base/305737 Log: bspatch: remove superfluous newlines from errx strings Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Mon Sep 12 10:23:24 2016 (r305736) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Mon Sep 12 14:28:38 2016 (r305737) @@ -183,13 +183,13 @@ int main(int argc, char *argv[]) /* Read header */ if (fread(header, 1, 32, f) < 32) { if (feof(f)) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); err(1, "fread(%s)", argv[3]); } /* Check for appropriate magic */ if (memcmp(header, "BSDIFF40", 8) != 0) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Read lengths from header */ bzctrllen = offtin(header + 8); @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) if (bzctrllen < 0 || bzctrllen > OFF_MAX - 32 || bzdatalen < 0 || bzctrllen + 32 > OFF_MAX - bzdatalen || newsize < 0 || newsize > SSIZE_MAX) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Close patch file and re-open it via libbzip2 at the right places */ if (fclose(f)) @@ -237,24 +237,24 @@ int main(int argc, char *argv[]) lenread = BZ2_bzRead(&cbz2err, cpfbz2, buf, 8); if ((lenread < 8) || ((cbz2err != BZ_OK) && (cbz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); ctrl[i] = offtin(buf); } /* Sanity-check */ if (ctrl[0] < 0 || ctrl[0] > INT_MAX || ctrl[1] < 0 || ctrl[1] > INT_MAX) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Sanity-check */ if (newpos + ctrl[0] > newsize) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Read diff string */ lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]); if ((lenread < ctrl[0]) || ((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Add old data to diff string */ for (i = 0; i < ctrl[0]; i++) @@ -267,13 +267,13 @@ int main(int argc, char *argv[]) /* Sanity-check */ if (newpos + ctrl[1] > newsize) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Read extra string */ lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]); if ((lenread < ctrl[1]) || ((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END))) - errx(1, "Corrupt patch\n"); + errx(1, "Corrupt patch"); /* Adjust pointers */ newpos+=ctrl[1]; From owner-svn-src-head@freebsd.org Mon Sep 12 16:10:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57242BD7326; Mon, 12 Sep 2016 16:10:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A29982B; Mon, 12 Sep 2016 16:10:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGAltJ088917; Mon, 12 Sep 2016 16:10:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGAlmH088916; Mon, 12 Sep 2016 16:10:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201609121610.u8CGAlmH088916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 12 Sep 2016 16:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305739 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 16:10:48 -0000 Author: manu Date: Mon Sep 12 16:10:47 2016 New Revision: 305739 URL: https://svnweb.freebsd.org/changeset/base/305739 Log: Use "generic" ALLWINNER_UP kernel config for Cubieboard release. Reviewed by: gjb MFC after: 2 week Modified: head/release/arm/CUBIEBOARD.conf Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Mon Sep 12 15:57:35 2016 (r305738) +++ head/release/arm/CUBIEBOARD.conf Mon Sep 12 16:10:47 2016 (r305739) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" -KERNEL="CUBIEBOARD" +KERNEL="ALLWINNER_UP" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" From owner-svn-src-head@freebsd.org Mon Sep 12 16:13:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C51BBD765D; Mon, 12 Sep 2016 16:13:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 556CCE38; Mon, 12 Sep 2016 16:13:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGDRLi092386; Mon, 12 Sep 2016 16:13:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGDRUB092385; Mon, 12 Sep 2016 16:13:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201609121613.u8CGDRUB092385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 12 Sep 2016 16:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305740 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 16:13:28 -0000 Author: manu Date: Mon Sep 12 16:13:27 2016 New Revision: 305740 URL: https://svnweb.freebsd.org/changeset/base/305740 Log: Remove CUBIEBOARD kernel config file. Every Allwinner board should either use ALLWINNER (SMP) or ALLWINER_UP kernel config files. MFC after: 2 week Deleted: head/sys/arm/conf/CUBIEBOARD From owner-svn-src-head@freebsd.org Mon Sep 12 16:38:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE46BD7E30; Mon, 12 Sep 2016 16:38:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29E28108; Mon, 12 Sep 2016 16:38:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CGcqXT000808; Mon, 12 Sep 2016 16:38:52 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGcqmD000805; Mon, 12 Sep 2016 16:38:52 GMT (envelope-from br@FreeBSD.org) Message-Id: <201609121638.u8CGcqmD000805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 12 Sep 2016 16:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305743 - in head/sys/mips: malta mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 16:38:53 -0000 Author: br Date: Mon Sep 12 16:38:51 2016 New Revision: 305743 URL: https://svnweb.freebsd.org/changeset/base/305743 Log: Add SMP support for MTI Malta 34kf CPU. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/mips/malta/asm_malta.S head/sys/mips/malta/malta_mp.c head/sys/mips/mips/locore.S Modified: head/sys/mips/malta/asm_malta.S ============================================================================== --- head/sys/mips/malta/asm_malta.S Mon Sep 12 16:36:44 2016 (r305742) +++ head/sys/mips/malta/asm_malta.S Mon Sep 12 16:38:51 2016 (r305743) @@ -37,6 +37,7 @@ #include #define VPECONF0_MVP (1 << 1) +#define VPECONF0_VPA (1 << 0) .set noreorder @@ -54,16 +55,16 @@ LEAF(platform_processor_id) .set pop END(platform_processor_id) -LEAF(enable_mvp) +LEAF(malta_cpu_configure) .set push .set mips32r2 .set noat - li t2, (VPECONF0_MVP) + li t2, (VPECONF0_MVP | VPECONF0_VPA) move $1, t2 jr ra .word 0x41810000 | (1 << 11) | 2 # mttc0 t2, $1, 2 .set pop -END(enable_mvp) +END(malta_cpu_configure) /* * Called on APs to wait until they are told to launch. Modified: head/sys/mips/malta/malta_mp.c ============================================================================== --- head/sys/mips/malta/malta_mp.c Mon Sep 12 16:36:44 2016 (r305742) +++ head/sys/mips/malta/malta_mp.c Mon Sep 12 16:38:51 2016 (r305743) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #define MALTA_MAXCPU 2 +#define VPECONF0_VPA (1 << 0) +#define MVPCONTROL_VPC (1 << 1) +#define TCSTATUS_A (1 << 13) unsigned malta_ap_boot = ~0; @@ -62,6 +65,19 @@ unsigned malta_ap_boot = ~0; #define C_IRQ5 (1 << 15) static inline void +evpe(void) +{ + __asm __volatile( + " .set push \n" + " .set noreorder \n" + " .set noat \n" + " .set mips32r2 \n" + " .word 0x41600021 # evpe \n" + " ehb \n" + " .set pop \n"); +} + +static inline void ehb(void) { __asm __volatile( @@ -118,25 +134,30 @@ ehb(void) __retval; \ }) -void -platform_ipi_send(int cpuid) +static void +set_thread_context(int cpuid) { uint32_t reg; - /* - * Set thread context. - * Note this is not global, so we don't need lock. - */ reg = read_c0_register32(1, 1); reg &= ~(0xff); reg |= cpuid; write_c0_register32(1, 1, reg); ehb(); +} + +void +platform_ipi_send(int cpuid) +{ + uint32_t reg; + + set_thread_context(cpuid); /* Set cause */ reg = mftc0(13, 0); - mttc0(13, 0, (reg | C_SW1)); + reg |= (C_SW1); + mttc0(13, 0, reg); } void @@ -204,8 +225,42 @@ platform_smp_topo(void) int platform_start_ap(int cpuid) { + uint32_t reg; int timeout; + /* Enter into configuration */ + reg = read_c0_register32(0, 1); + reg |= (MVPCONTROL_VPC); + write_c0_register32(0, 1, reg); + + set_thread_context(cpuid); + + /* + * Hint: how to set entry point. + * reg = 0x80000000; + * mttc0(2, 3, reg); + */ + + /* Enable thread */ + reg = mftc0(2, 1); + reg |= (TCSTATUS_A); + mttc0(2, 1, reg); + + /* Unhalt CPU core */ + mttc0(2, 4, 0); + + /* Activate VPE */ + reg = mftc0(1, 2); + reg |= (VPECONF0_VPA); + mttc0(1, 2, reg); + + /* Out of configuration */ + reg = read_c0_register32(0, 1); + reg &= ~(MVPCONTROL_VPC); + write_c0_register32(0, 1, reg); + + evpe(); + if (atomic_cmpset_32(&malta_ap_boot, ~0, cpuid) == 0) return (-1); Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Mon Sep 12 16:36:44 2016 (r305742) +++ head/sys/mips/mips/locore.S Mon Sep 12 16:38:51 2016 (r305743) @@ -161,7 +161,7 @@ VECTOR(_locore, unknown) #if defined(CPU_MALTA) && defined(SMP) .set push .set mips32r2 - jal enable_mvp + jal malta_cpu_configure nop jal platform_processor_id nop From owner-svn-src-head@freebsd.org Mon Sep 12 16:44:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445A5BD8047; Mon, 12 Sep 2016 16:44:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1204C888; Mon, 12 Sep 2016 16:44: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 u8CGiLLR004470; Mon, 12 Sep 2016 16:44:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGiLcs004469; Mon, 12 Sep 2016 16:44:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609121644.u8CGiLcs004469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 12 Sep 2016 16:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305744 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 16:44:22 -0000 Author: kib Date: Mon Sep 12 16:44:21 2016 New Revision: 305744 URL: https://svnweb.freebsd.org/changeset/base/305744 Log: Fix typo in comment. MFC after: 3 days Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Mon Sep 12 16:38:51 2016 (r305743) +++ head/sys/x86/x86/identcpu.c Mon Sep 12 16:44:21 2016 (r305744) @@ -1725,7 +1725,7 @@ print_AMD_info(void) * As long as that bug pops up very rarely (intensive machine usage * on other operating systems generally generates one unexplainable * crash any 2 months) and as long as a model specific fix would be - * impratical at this stage, print out a warning string if the broken + * impractical at this stage, print out a warning string if the broken * model and family are identified. */ if (CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x20 && From owner-svn-src-head@freebsd.org Mon Sep 12 16:46:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92D05BD81AB; Mon, 12 Sep 2016 16:46:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id 658ACB27; Mon, 12 Sep 2016 16:46:15 +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 u8CGkEuw004616; Mon, 12 Sep 2016 16:46:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CGkEck004615; Mon, 12 Sep 2016 16:46:14 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609121646.u8CGkEck004615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 12 Sep 2016 16:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305745 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 16:46:15 -0000 Author: avos Date: Mon Sep 12 16:46:14 2016 New Revision: 305745 URL: https://svnweb.freebsd.org/changeset/base/305745 Log: urtwn: fix possible driver hang when beacon miss is detected. Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 (r305744) +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 (r305745) @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); end: - if (error != 0) + if (error != 0) { + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 1); m_freem(m); + } URTWN_UNLOCK(sc); From owner-svn-src-head@freebsd.org Mon Sep 12 17:29:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E8D2BD8141; Mon, 12 Sep 2016 17:29:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id F3D91272; Mon, 12 Sep 2016 17:29:21 +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 u8CHTLO2021788; Mon, 12 Sep 2016 17:29:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CHTL7K021786; Mon, 12 Sep 2016 17:29:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609121729.u8CHTL7K021786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 12 Sep 2016 17:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305749 - head/sys/dev/evdev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 17:29:22 -0000 Author: gonzo Date: Mon Sep 12 17:29:20 2016 New Revision: 305749 URL: https://svnweb.freebsd.org/changeset/base/305749 Log: Remove semicolon from the end of the macro definition Reported by: hans Modified: head/sys/dev/evdev/cdev.c head/sys/dev/evdev/uinput.c Modified: head/sys/dev/evdev/cdev.c ============================================================================== --- head/sys/dev/evdev/cdev.c Mon Sep 12 17:05:42 2016 (r305748) +++ head/sys/dev/evdev/cdev.c Mon Sep 12 17:29:20 2016 (r305749) @@ -49,7 +49,7 @@ #include #ifdef EVDEV_DEBUG -#define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args); +#define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args) #else #define debugf(client, fmt, args...) #endif Modified: head/sys/dev/evdev/uinput.c ============================================================================== --- head/sys/dev/evdev/uinput.c Mon Sep 12 17:05:42 2016 (r305748) +++ head/sys/dev/evdev/uinput.c Mon Sep 12 17:29:20 2016 (r305749) @@ -50,7 +50,7 @@ #include #ifdef UINPUT_DEBUG -#define debugf(state, fmt, args...) printf("uinput: " fmt "\n", ##args); +#define debugf(state, fmt, args...) printf("uinput: " fmt "\n", ##args) #else #define debugf(state, fmt, args...) #endif From owner-svn-src-head@freebsd.org Mon Sep 12 18:06:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF48BD8AB8; Mon, 12 Sep 2016 18:06:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id 76B54DBD; Mon, 12 Sep 2016 18:06:43 +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 u8CI6glJ037491; Mon, 12 Sep 2016 18:06:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CI6gqg037489; Mon, 12 Sep 2016 18:06:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609121806.u8CI6gqg037489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 12 Sep 2016 18:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305751 - in head: share/man/man9 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 18:06:43 -0000 Author: jhb Date: Mon Sep 12 18:06:42 2016 New Revision: 305751 URL: https://svnweb.freebsd.org/changeset/base/305751 Log: Make device_quiet() an attachment property. In particular, reset the DF_QUIET flag when detaching from a device so that a driver that marks a device quiet doesn't dictate policy for a different driver that may claim the device in the future. Reviewed by: rpokala, wblock MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7803 Modified: head/share/man/man9/device_quiet.9 head/sys/kern/subr_bus.c Modified: head/share/man/man9/device_quiet.9 ============================================================================== --- head/share/man/man9/device_quiet.9 Mon Sep 12 17:35:45 2016 (r305750) +++ head/share/man/man9/device_quiet.9 Mon Sep 12 18:06:42 2016 (r305751) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 1999 +.Dd September 12, 2016 .Dt DEVICE_QUIET 9 .Os .Sh NAME @@ -49,16 +49,18 @@ Each device has a quiet flag associated with it. A device is verbose by default when it is created but may be quieted to prevent -the device identification string to be printed during probe. +printing of the device identification string during attach +and printing of a message during detach. To quiet a device, call -.Fn device_quiet , -to re-enable to probe message (to make the message appear again, for -example after a -.Xr device_detach 9 ) +.Fn device_quiet +during a device driver probe routine. +To re-enable probe messages, call .Fn device_verbose . To test to see if a device is quieted, call .Fn device_is_quiet . +.Pp +Devices are implicitly marked verbose after a driver detaches. .Sh SEE ALSO .Xr device 9 .Sh AUTHORS Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Sep 12 17:35:45 2016 (r305750) +++ head/sys/kern/subr_bus.c Mon Sep 12 18:06:42 2016 (r305751) @@ -2146,6 +2146,12 @@ device_probe_child(device_t dev, device_ } /* + * Reset DF_QUIET in case this driver doesn't + * end up as the best driver. + */ + device_verbose(child); + + /* * Probes that return BUS_PROBE_NOWILDCARD or lower * only match on devices whose driver was explicitly * specified. @@ -2970,6 +2976,7 @@ device_detach(device_t dev) if (!(dev->flags & DF_FIXEDCLASS)) devclass_delete_device(dev->devclass, dev); + device_verbose(dev); dev->state = DS_NOTPRESENT; (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); From owner-svn-src-head@freebsd.org Mon Sep 12 18:07:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05308BD8B28; Mon, 12 Sep 2016 18:07:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id CA146C6; Mon, 12 Sep 2016 18:07:07 +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 u8CI776N037559; Mon, 12 Sep 2016 18:07:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CI77ER037558; Mon, 12 Sep 2016 18:07:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609121807.u8CI77ER037558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 12 Sep 2016 18:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305752 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 18:07:08 -0000 Author: jhb Date: Mon Sep 12 18:07:06 2016 New Revision: 305752 URL: https://svnweb.freebsd.org/changeset/base/305752 Log: Remove explicit device_verbose() from the t4iov driver detach routine now that this case is handled generically. Modified: head/sys/dev/cxgbe/t4_iov.c Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Mon Sep 12 18:06:42 2016 (r305751) +++ head/sys/dev/cxgbe/t4_iov.c Mon Sep 12 18:07:06 2016 (r305752) @@ -217,7 +217,6 @@ t4iov_detach(device_t dev) if (error) return (error); } - device_verbose(dev); return (0); } From owner-svn-src-head@freebsd.org Mon Sep 12 18:10:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E31FBD8CAC; Mon, 12 Sep 2016 18:10:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com [IPv6:2607:f8b0:4003:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47907756; Mon, 12 Sep 2016 18:10:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-oi0-x230.google.com with SMTP id q188so211619884oia.3; Mon, 12 Sep 2016 11:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6VIFyNiCfTw1hnrk3+y50gARArdpNVDsmXbQWobkLl0=; b=bO4qPXI00O8TagvFxOEJxsJJwDs8A5ZyoxaprSQr3O3NQTKP0wH3pa5BdemXXq4OXM +cTzmCfl1dh/QkPTq+xr0YGWXTyCixhSbQicPejWzd32OVJc7k3Llcx0N9W8weZ6/y8F F5LDkB7rTHRVplVP30+qlCZyiqW/fjA6bDfEKxHTE0HYbIa0cukpQtoeksqDAbZGOSFx 1d5a10QSREAmJkgN6eMrHIx6GmZHqsrhbx4nI3I/puzQQli+BHWleihhMFhKG8AnawcU FNXAM3g0+1ukZXv4McSa5N7IO7Z1az+/2e7s0xCYrqgUkOFT9uMf05jKmbdeGqjfnMBa HZFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6VIFyNiCfTw1hnrk3+y50gARArdpNVDsmXbQWobkLl0=; b=C8X2xuzGs9R7ZAKT4AP1iSYWYQwE+LmYBjSi7G5U3b/K8CGx6UnxO/m/QwRALq2MLq jT6qoHXjUDtclQ2m4fj3pDY6Jlo0dC21eWgWb0ilGmiI18ojgajb8+XgRHufBSw45Gll XO2y7RpsITpMngmP1ZARQyXkfhHdoZsHCgzbD/SF75u5v8RXdb16MzBnWWnejUeN+Ugt 7WZgOrExkwpyBOSeYL8PZYVgDZDJGacj7rXzeMMt/Q4NdjL5rDJGCQEJZRsyiz9NVlyX 4g+K/uUfw+FB28VNr6NQkCsq4QKKpX4hMD5FEjsShPT41rdf8IaE32vuVN8OpQCB9zIO gpMw== X-Gm-Message-State: AE9vXwNDT0M7v51lpt+ew9w2AhTUXb521/6wII+/OoWfwj/XrU62tud2/5D8xzk3rkR7uXhhObd0pffI742FQA== X-Received: by 10.202.87.76 with SMTP id l73mr440432oib.84.1473703855172; Mon, 12 Sep 2016 11:10:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Mon, 12 Sep 2016 11:10:54 -0700 (PDT) In-Reply-To: <201609121646.u8CGkEck004615@repo.freebsd.org> References: <201609121646.u8CGkEck004615@repo.freebsd.org> From: Adrian Chadd Date: Mon, 12 Sep 2016 11:10:54 -0700 Message-ID: Subject: Re: svn commit: r305745 - head/sys/dev/urtwn To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 18:10:56 -0000 Hi, That's why I created ieee80211_tx_complete(). Is that not "right" here? -a On 12 September 2016 at 09:46, Andriy Voskoboinyk wrote: > Author: avos > Date: Mon Sep 12 16:46:14 2016 > New Revision: 305745 > URL: https://svnweb.freebsd.org/changeset/base/305745 > > Log: > urtwn: fix possible driver hang when beacon miss is detected. > > Modified: > head/sys/dev/urtwn/if_urtwn.c > > Modified: head/sys/dev/urtwn/if_urtwn.c > ============================================================================== > --- head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 (r305744) > +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 (r305745) > @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni > callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); > > end: > - if (error != 0) > + if (error != 0) { > + if (m->m_flags & M_TXCB) > + ieee80211_process_callback(ni, m, 1); > m_freem(m); > + } > > URTWN_UNLOCK(sc); > > From owner-svn-src-head@freebsd.org Mon Sep 12 18:41:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D479FBD872B; Mon, 12 Sep 2016 18:41:18 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64ED3BF8; Mon, 12 Sep 2016 18:41:18 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f46.google.com with SMTP id h127so94397595lfh.0; Mon, 12 Sep 2016 11:41:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=BefrUrcfXp3noE+gyd3qDc6vj89Ka3W40Nz9tmMJ1I0=; b=JQbzMwdoJ9rJYropKBn6ll4mmcZoPGRHo4JOpgtYcKX3hjMOmSfi4h0zbUe36Mg6ss dq7e8aBqEc+cTkeMRUd1gQoHSyiYDWyGJW0Q6UwPxuBKa6t/Z7vvgmK5OLmxWuwJkfE6 Gc4yI/EuOq6GmTZoKaJmI2Z0bW/szEAHmDOMa6FvPA4KXaq/luHQi3FYIltQ0wIMPOPk YjLoWx6vlN/EBsIK/if+q/jbFL3IcRUHtRz64EtXOTadEVsuA+vGUgwMLw/KZrRYW1Fz XOgbhqXo9j0OQF4vQQjwwevN+TJH/pq4P/j8cU1+ulO+HKlD9ccsBBLC+CTQx+4e4jJX y08g== X-Gm-Message-State: AE9vXwNF3EI+WZOOce8UGio4gWS+kqZJb/FUZLnjcX11aeYUAnYLlx6ybtdPSo57+CsbUg== X-Received: by 10.25.215.35 with SMTP id o35mr6363466lfg.40.1473705675914; Mon, 12 Sep 2016 11:41:15 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id r196sm3251952lfd.41.2016.09.12.11.41.14 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Sep 2016 11:41:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Adrian Chadd" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r305745 - head/sys/dev/urtwn References: <201609121646.u8CGkEck004615@repo.freebsd.org> Date: Mon, 12 Sep 2016 21:40:54 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 18:41:18 -0000 Mon, 12 Sep 2016 21:10:54 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd = : Hi, The error handling is splitted between ieee80211_raw_output() and = ic_raw_xmit(); it cannot be moved completely to net80211 because of https://lists.freebsd.org/pipermail/freebsd-wireless/2015-November/00627= 2.html > Hi, > > That's why I created ieee80211_tx_complete(). Is that not "right" here= ? > > > > -a > > > On 12 September 2016 at 09:46, Andriy Voskoboinyk = > wrote: >> Author: avos >> Date: Mon Sep 12 16:46:14 2016 >> New Revision: 305745 >> URL: https://svnweb.freebsd.org/changeset/base/305745 >> >> Log: >> urtwn: fix possible driver hang when beacon miss is detected. >> >> Modified: >> head/sys/dev/urtwn/if_urtwn.c >> >> Modified: head/sys/dev/urtwn/if_urtwn.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/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 = = >> (r305744) >> +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 = = >> (r305745) >> @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni >> callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); >> >> end: >> - if (error !=3D 0) >> + if (error !=3D 0) { >> + if (m->m_flags & M_TXCB) >> + ieee80211_process_callback(ni, m, 1); >> m_freem(m); >> + } >> >> URTWN_UNLOCK(sc); >> From owner-svn-src-head@freebsd.org Mon Sep 12 19:31:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05769BD84B8; Mon, 12 Sep 2016 19:31: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 mx1.freebsd.org (Postfix) with ESMTPS id C58B9A91; Mon, 12 Sep 2016 19:31:15 +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 u8CJVFIg070881; Mon, 12 Sep 2016 19:31:15 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CJVF2k070880; Mon, 12 Sep 2016 19:31:15 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201609121931.u8CJVF2k070880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 12 Sep 2016 19:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305753 - head/usr.sbin/amd/amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 19:31:16 -0000 Author: cy Date: Mon Sep 12 19:31:14 2016 New Revision: 305753 URL: https://svnweb.freebsd.org/changeset/base/305753 Log: Fixup whitespace, repace space with a tab. X-MFC-with: Upcoming amd update. Modified: head/usr.sbin/amd/amd/Makefile Modified: head/usr.sbin/amd/amd/Makefile ============================================================================== --- head/usr.sbin/amd/amd/Makefile Mon Sep 12 18:07:06 2016 (r305752) +++ head/usr.sbin/amd/amd/Makefile Mon Sep 12 19:31:14 2016 (r305753) @@ -8,7 +8,7 @@ .include -.PATH: ${.CURDIR}/../../../contrib/amd/amd +.PATH: ${.CURDIR}/../../../contrib/amd/amd PROG= amd MAN= amd.8 From owner-svn-src-head@freebsd.org Mon Sep 12 20:35:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683D3BD8790; Mon, 12 Sep 2016 20:35:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30E3F86F; Mon, 12 Sep 2016 20:35:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x232.google.com with SMTP id 186so27971475itf.0; Mon, 12 Sep 2016 13:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TjE5xudLs/08O7nNzSYpSdyjONVLUM+vIZElrmL7aeE=; b=DHSj5oQ4D5k3J3/K54YSnzOJ66wJiMZkYWki1On2E6hrLz/VjEYlkYpUE5ThDAyp9F zF7ocfjrNkGSqEEYho2+lKTWcFnGwnijahb/rqkoGFvH71i0OFAMj8EVmfDiYmVe5h+P HP6m37eT7mkZQ0YEdQYx8uSsNjHiJyAKWbOxFKgGRC0/oSCOuSrc4X1AN2r9ZQsNjJvH nHfbyzzCchEVgz5NzSFlVPWpSYwHzGKezfnXFGr3nTi0Xqu99Np9yLuB33fHVhabhKzA pr88cyoWFwJ2O2PwyEH8DDFeFipCtjJlMsbWLCRpo1Iq0LWrcQR6b9trJX768+jZWuGp YSmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=TjE5xudLs/08O7nNzSYpSdyjONVLUM+vIZElrmL7aeE=; b=OyUaRJ/IEn2fZJVFexLWLMn3Tf+tA2s5ZxO9AESTrPPV6wrKVZ9Y/JUHg9FxIMiH/Q MODQedHZTkQEExszv25W2GJ1t4sZcP02xuoTmqG8kJirUtTQPLQ7UdFPu5xhdA+X8gOZ Gbl/ypDUxHBpqI2VYml/ffeQbJQ4FLBkL+oqhygCPi3g+KTYwYkSI+L696mXDZQmRmuZ 1LU6ye+ZBYxXwSE7ELcTwNqWcYn9qaoNwauGoCsNIzn/kea8qhY7d23Z3WEadZNKGIO7 dH8imr2uxMpBXVuqSqojccJat8FAWq18MMKEyxALyLUd22YHOkeavVg6f4U0D7TcsvAv OcIw== X-Gm-Message-State: AE9vXwOJNXE8DcqOIMHzneFPG04/4lBCt/HHTui0fFeRyJ5Z6rnX0isetvBJDLqmGgbAzRcb3I4npmEj/SqhYQ== X-Received: by 10.157.57.137 with SMTP id y9mr28521858otb.21.1473712556260; Mon, 12 Sep 2016 13:35:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Mon, 12 Sep 2016 13:35:55 -0700 (PDT) In-Reply-To: References: <201609121646.u8CGkEck004615@repo.freebsd.org> From: Adrian Chadd Date: Mon, 12 Sep 2016 13:35:55 -0700 Message-ID: Subject: Re: svn commit: r305745 - head/sys/dev/urtwn To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 20:35:57 -0000 Ah, ugh, that thing.. :( -adrian On 12 September 2016 at 11:40, Andriy Voskoboinyk wrote: > Mon, 12 Sep 2016 21:10:54 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd > : > > Hi, > > The error handling is splitted between ieee80211_raw_output() and > ic_raw_xmit(); > it cannot be moved completely to net80211 because of > https://lists.freebsd.org/pipermail/freebsd-wireless/2015-November/006272= .html > > >> Hi, >> >> That's why I created ieee80211_tx_complete(). Is that not "right" here? >> >> >> >> -a >> >> >> On 12 September 2016 at 09:46, Andriy Voskoboinyk >> wrote: >>> >>> Author: avos >>> Date: Mon Sep 12 16:46:14 2016 >>> New Revision: 305745 >>> URL: https://svnweb.freebsd.org/changeset/base/305745 >>> >>> Log: >>> urtwn: fix possible driver hang when beacon miss is detected. >>> >>> Modified: >>> head/sys/dev/urtwn/if_urtwn.c >>> >>> Modified: head/sys/dev/urtwn/if_urtwn.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/urtwn/if_urtwn.c Mon Sep 12 16:44:21 2016 >>> (r305744) >>> +++ head/sys/dev/urtwn/if_urtwn.c Mon Sep 12 16:46:14 2016 >>> (r305745) >>> @@ -5628,8 +5628,11 @@ urtwn_raw_xmit(struct ieee80211_node *ni >>> callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); >>> >>> end: >>> - if (error !=3D 0) >>> + if (error !=3D 0) { >>> + if (m->m_flags & M_TXCB) >>> + ieee80211_process_callback(ni, m, 1); >>> m_freem(m); >>> + } >>> >>> URTWN_UNLOCK(sc); >>> > From owner-svn-src-head@freebsd.org Mon Sep 12 22:46:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42128BD7849; Mon, 12 Sep 2016 22:46:21 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 065DF981; Mon, 12 Sep 2016 22:46:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CMkKNG044445; Mon, 12 Sep 2016 22:46:20 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CMkKoI044443; Mon, 12 Sep 2016 22:46:20 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201609122246.u8CMkKoI044443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 12 Sep 2016 22:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305756 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 22:46:21 -0000 Author: oshogbo Date: Mon Sep 12 22:46:19 2016 New Revision: 305756 URL: https://svnweb.freebsd.org/changeset/base/305756 Log: fd: add fget_cap and fget_cap_locked primitives They can be used to obtain capabilities along with a referenced fp. Reviewed by: mjg@ Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Sep 12 22:07:35 2016 (r305755) +++ head/sys/kern/kern_descrip.c Mon Sep 12 22:46:19 2016 (r305756) @@ -2446,6 +2446,77 @@ finit(struct file *fp, u_int flag, short } int +fget_cap_locked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp) +{ + struct filedescent *fde; + int error; + + FILEDESC_LOCK_ASSERT(fdp); + + fde = fdeget_locked(fdp, fd); + if (fde == NULL) { + error = EBADF; + goto out; + } + +#ifdef CAPABILITIES + error = cap_check(cap_rights_fde(fde), needrightsp); + if (error != 0) + goto out; +#endif + + if (havecapsp != NULL) + filecaps_copy(&fde->fde_caps, havecapsp, true); + + fhold(fde->fde_file); + *fpp = fde->fde_file; + + error = 0; +out: + return (error); +} + +int +fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp) +{ + struct filedesc *fdp; + struct file *fp; + int error; + seq_t seq; + + fdp = td->td_proc->p_fd; + for (;;) { + error = fget_unlocked(fdp, fd, needrightsp, &fp, &seq); + if (error != 0) + return (error); + + if (havecapsp != NULL) { + if (!filecaps_copy(&fdp->fd_ofiles[fd].fde_caps, + havecapsp, false)) { + fdrop(fp, td); + goto get_locked; + } + } + + if (!fd_modified(fdp, fd, seq)) + break; + fdrop(fp, td); + } + + *fpp = fp; + return (0); + +get_locked: + FILEDESC_SLOCK(fdp); + error = fget_cap_locked(fdp, fd, needrightsp, fpp, havecapsp); + FILEDESC_SUNLOCK(fdp); + + return (error); +} + +int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seq_t *seqp) { Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Mon Sep 12 22:07:35 2016 (r305755) +++ head/sys/sys/filedesc.h Mon Sep 12 22:46:19 2016 (r305756) @@ -190,6 +190,11 @@ int getvnode(struct thread *td, int fd, struct file **fpp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); +int fget_cap_locked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp); +int fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, + struct file **fpp, struct filecaps *havecapsp); + /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seq_t *seqp); From owner-svn-src-head@freebsd.org Mon Sep 12 23:00:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE55FBD7B04; Mon, 12 Sep 2016 23:00: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 mx1.freebsd.org (Postfix) with ESMTPS id BDE22ED3; Mon, 12 Sep 2016 23:00: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 u8CN0WSr048600; Mon, 12 Sep 2016 23:00:32 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8CN0W88048599; Mon, 12 Sep 2016 23:00:32 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609122300.u8CN0W88048599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 12 Sep 2016 23:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305757 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 23:00:33 -0000 Author: avos Date: Mon Sep 12 23:00:31 2016 New Revision: 305757 URL: https://svnweb.freebsd.org/changeset/base/305757 Log: net80211: fix possible panic in adhoc mode (INIT -> RUN state transition). In case if there is already running interface, a second non-sta interface will omit scanning, going directly to RUN state. Handle this case for adhoc mode appropriately. Tested with RTL8821AU, 2 vaps in IBSS mode. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Sep 12 22:46:19 2016 (r305756) +++ head/sys/net80211/ieee80211_adhoc.c Mon Sep 12 23:00:31 2016 (r305757) @@ -215,6 +215,19 @@ adhoc_newstate(struct ieee80211vap *vap, /* XXX validate prerequisites */ } switch (ostate) { + case IEEE80211_S_INIT: + /* + * Already have a channel; bypass the + * scan and startup immediately. + * Note that ieee80211_create_ibss will call + * back to do a RUN->RUN state change. + */ + ieee80211_create_ibss(vap, + ieee80211_ht_adjust_channel(ic, + ic->ic_curchan, vap->iv_flags_ht)); + /* NB: iv_bss is changed on return */ + ni = vap->iv_bss; + break; case IEEE80211_S_SCAN: #ifdef IEEE80211_DEBUG if (ieee80211_msg_debug(vap)) { From owner-svn-src-head@freebsd.org Tue Sep 13 01:21:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 602A5BD775A; Tue, 13 Sep 2016 01:21:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x22a.google.com (mail-vk0-x22a.google.com [IPv6:2607:f8b0:400c:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 172DDCEC; Tue, 13 Sep 2016 01:21:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x22a.google.com with SMTP id v189so159560511vkv.1; Mon, 12 Sep 2016 18:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XCr+jeLrl2VPUuXQDl8zmSQfc6tN19XsuVBlZ+lUkJY=; b=RbYbKBXMWcjOsa1FV2Qc7+MRlCQGyz65jicJlKlEVsF2OQCijyTLLfaR6T+XkWnXAb vX1QSDZwJEyenrt2VhimbQP+PYJokmMmgkS+7T0YxawVdduSGUZrhejI8pwAWsq4ouNJ lXQALdCWPjWyokXU6WNlJUtSx6X4KJ6Lu2KgY6clb7tRbTYkUhpSHNCa5aTSjiWsLNF+ len4NoczEt6cS7D28Bzmr6wLRSyi5zRHi7FtYnSwi3n60XdCAaSLQPlBtpV9AsSo7n6D UBPIaUGKzXmpN6EO2NWihWMsrgGJsfGb12ajgah6VTaoroDMlGKC9EB9dy6UXBSJ3iPA ZysQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XCr+jeLrl2VPUuXQDl8zmSQfc6tN19XsuVBlZ+lUkJY=; b=GFuTppgL/vakZNi40Ps2Hke5pcLvSXaGcwITwbOz9VeUAPQMXGW/K2cHCY4BDaICC0 Cc2QZjpq0pOflQWMzaKY/vDeUDjkgeAn43H81bcV3AdyY0dqa5OzVsWKJA+OQatqzGjf JmhD0vFF3HjzIanP5jddXHLGiGN0Y4G28XMABKwRZvshTIHC/c1Gu1thJFoXNCM7e2Tk UdKNOr+lWDI86dAcL8bv+UTHKYtsJ6PPqxKnRwz8fAc2jsfv5OuPy48s78ELn13pLEMy AIVSmwhdJTEc1+K/oLN8vARE1CDettww+jNdTP2h5HkgNiAVGcEC6ShgII8OVxSQxu3I tf1A== X-Gm-Message-State: AE9vXwOgjDf5Nrs7a25IZDN0bPHtLlthsVMfSozzRLvcfc2htsEbqpd042mxB2eM77kgkFQAlyM6ekVofeAYxg== X-Received: by 10.31.65.210 with SMTP id o201mr12195322vka.0.1473729686220; Mon, 12 Sep 2016 18:21:26 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Mon, 12 Sep 2016 18:21:25 -0700 (PDT) In-Reply-To: <20160912100003.GX38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> <20160912100003.GX38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 09:21:25 +0800 X-Google-Sender-Auth: SW23PSrQB-LdPTsukKQnraRj6qs Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 01:21:27 -0000 On Mon, Sep 12, 2016 at 6:00 PM, Konstantin Belousov wrote: > On Mon, Sep 12, 2016 at 04:47:35PM +0800, Sepherosa Ziehau wrote: >> On Mon, Sep 12, 2016 at 4:39 PM, Sepherosa Ziehau wrote: >> > On Mon, Sep 12, 2016 at 4:32 PM, Konstantin Belousov >> > wrote: >> >> On Mon, Sep 12, 2016 at 04:57:58AM +0000, Sepherosa Ziehau wrote: >> >>> Author: sephe >> >>> Date: Mon Sep 12 04:57:58 2016 >> >>> New Revision: 305722 >> >>> URL: https://svnweb.freebsd.org/changeset/base/305722 >> >>> >> >>> Log: >> >>> x86: Use sx lock for interrupt sources. >> >>> >> >>> - Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long >> >>> call chain. For msi_assign_cpu, mutex makes complex PCI bridge >> >>> drivers more tricky, e.g. sleep can note be called, etc, it will >> >>> be pretty tricky for upcoming Hyper-V PCI bridge driver for PCI >> >>> pass-through. >> >> >> >>> - It is not used on any hot code path nor non-sleepable context, so >> >>> sx should have the same effect as mutex. >> >> Did you tested ACPI_DMAR interrupt remapping mode with your patch and >> >> witness enabled ? >> > >> > Nope, I am about to try it now. BTW, I just checked the code for >> > ACPI_DMAR, I didn't see anything obviously w/ the lock type change >> > though. >> >> I didn't notice anything wrong w/ options >> ACPI_DMAR+WITNESS+INVARIANTS. If you saw anything wrong, please let >> me know. > > Options are not enough, you should explicitely enable interrupt remapping > with loader tunable hw.dmar.ir=1. Still didn't find anything wrong with this tunable set. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Tue Sep 13 02:18:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEBEABD8A03; Tue, 13 Sep 2016 02:18:30 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70EF917BE; Tue, 13 Sep 2016 02:18:30 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D2ITrn023138; Tue, 13 Sep 2016 02:18:29 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D2ITdv023137; Tue, 13 Sep 2016 02:18:29 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201609130218.u8D2ITdv023137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Tue, 13 Sep 2016 02:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305758 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 02:18:30 -0000 Author: wblock (doc committer) Date: Tue Sep 13 02:18:29 2016 New Revision: 305758 URL: https://svnweb.freebsd.org/changeset/base/305758 Log: Add another badly-needed simple example to the pw(8) man page. Modified: head/usr.sbin/pw/pw.8 Modified: head/usr.sbin/pw/pw.8 ============================================================================== --- head/usr.sbin/pw/pw.8 Mon Sep 12 23:00:31 2016 (r305757) +++ head/usr.sbin/pw/pw.8 Tue Sep 13 02:18:29 2016 (r305758) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2016 +.Dd September 12, 2016 .Dt PW 8 .Os .Sh NAME @@ -966,6 +966,11 @@ Finally, a random password is generated .Bd -literal -offset indent pw useradd -n gsmith -c "Glurmo Smith" -s /bin/csh -m -w random .Ed +.Pp +Delete the gsmith user and their home directory, including contents. +.Bd -literal -offset indent +pw userdel -n gsmith -r +.Ed .Sh EXIT STATUS The .Nm From owner-svn-src-head@freebsd.org Tue Sep 13 05:27:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEB7BD85DE; Tue, 13 Sep 2016 05:27:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB0DE33; Tue, 13 Sep 2016 05:27:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5RbOE095382; Tue, 13 Sep 2016 05:27:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5RbZh095380; Tue, 13 Sep 2016 05:27:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609130527.u8D5RbZh095380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 05:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305760 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 05:27:38 -0000 Author: sephe Date: Tue Sep 13 05:27:36 2016 New Revision: 305760 URL: https://svnweb.freebsd.org/changeset/base/305760 Log: hyperv/hn: Reorganize channel attach/detach code. This paves the way for further attach/detach code reorganization. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7858 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Sep 13 05:22:08 2016 (r305759) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Sep 13 05:27:36 2016 (r305760) @@ -582,11 +582,6 @@ hv_nv_on_device_remove(struct hn_softc * { hv_nv_disconnect_from_vsp(sc); - - /* Now, we can close the channel safely */ - - vmbus_chan_close(sc->hn_prichan); - return (0); } Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:22:08 2016 (r305759) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:27:36 2016 (r305760) @@ -345,8 +345,11 @@ static int hn_create_rx_data(struct hn_s static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_chim_size(struct hn_softc *, int); static int hn_chan_attach(struct hn_softc *, struct vmbus_channel *); +static void hn_chan_detach(struct hn_softc *, struct vmbus_channel *); static int hn_attach_subchans(struct hn_softc *); +static void hn_detach_allchans(struct hn_softc *); static void hn_chan_callback(struct vmbus_channel *chan, void *xrxr); +static void hn_set_ring_inuse(struct hn_softc *, int); static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt); @@ -520,7 +523,7 @@ netvsc_attach(device_t dev) goto failed; /* - * Associate the first TX/RX ring w/ the primary channel. + * Attach the primary channel before attaching NVS and RNDIS. */ error = hn_chan_attach(sc, sc->hn_prichan); if (error) @@ -576,17 +579,14 @@ netvsc_attach(device_t dev) * Set the # of TX/RX rings that could be used according to * the # of channels that host offered. */ - if (sc->hn_tx_ring_inuse > ring_cnt) - sc->hn_tx_ring_inuse = ring_cnt; - sc->hn_rx_ring_inuse = ring_cnt; - device_printf(dev, "%d TX ring, %d RX ring\n", - sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); + hn_set_ring_inuse(sc, ring_cnt); - if (sc->hn_rx_ring_inuse > 1) { - error = hn_attach_subchans(sc); - if (error) - goto failed; - } + /* + * Attach the sub-channels, if any. + */ + error = hn_attach_subchans(sc); + if (error) + goto failed; #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { @@ -669,6 +669,7 @@ netvsc_detach(device_t dev) */ hv_rf_on_device_remove(sc); + hn_detach_allchans(sc); hn_stop_tx_tasks(sc); @@ -1580,14 +1581,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, break; } - /* Wait for subchannels to be destroyed */ - vmbus_subchan_drain(sc->hn_prichan); + /* + * Detach all of the channels. + */ + hn_detach_allchans(sc); - sc->hn_rx_ring[0].hn_rx_flags &= ~HN_RX_FLAG_ATTACHED; - sc->hn_tx_ring[0].hn_tx_flags &= ~HN_TX_FLAG_ATTACHED; - hn_chan_attach(sc, sc->hn_prichan); /* XXX check error */ + /* + * Attach the primary channel before attaching NVS and RNDIS. + */ + hn_chan_attach(sc, sc->hn_prichan); - ring_cnt = sc->hn_rx_ring_inuse; + ring_cnt = sc->hn_rx_ring_cnt; error = hv_rf_on_device_add(sc, &ring_cnt, ifr->ifr_mtu); if (error) { NV_LOCK(sc); @@ -1595,27 +1599,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, NV_UNLOCK(sc); break; } - /* # of channels can _not_ be changed */ - KASSERT(sc->hn_rx_ring_inuse == ring_cnt, - ("RX ring count %d and channel count %u mismatch", - sc->hn_rx_ring_cnt, ring_cnt)); - if (sc->hn_rx_ring_inuse > 1) { - int r; - /* - * Skip the rings on primary channel; they are - * handled by the hv_rf_on_device_add() above. - */ - for (r = 1; r < sc->hn_rx_ring_cnt; ++r) { - sc->hn_rx_ring[r].hn_rx_flags &= - ~HN_RX_FLAG_ATTACHED; - } - for (r = 1; r < sc->hn_tx_ring_cnt; ++r) { - sc->hn_tx_ring[r].hn_tx_flags &= - ~HN_TX_FLAG_ATTACHED; - } - hn_attach_subchans(sc); /* XXX check error */ - } + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that host offered. + */ + hn_set_ring_inuse(sc, ring_cnt); + + /* + * Attach the sub-channels, if any. + */ + hn_attach_subchans(sc); /* XXX check error */ if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); @@ -3022,6 +3016,42 @@ hn_chan_attach(struct hn_softc *sc, stru return (error); } +static void +hn_chan_detach(struct hn_softc *sc, struct vmbus_channel *chan) +{ + struct hn_rx_ring *rxr; + int idx; + + idx = vmbus_chan_subidx(chan); + + /* + * Link this channel to RX/TX ring. + */ + KASSERT(idx >= 0 && idx < sc->hn_rx_ring_inuse, + ("invalid channel index %d, should > 0 && < %d", + idx, sc->hn_rx_ring_inuse)); + rxr = &sc->hn_rx_ring[idx]; + KASSERT((rxr->hn_rx_flags & HN_RX_FLAG_ATTACHED), + ("RX ring %d is not attached", idx)); + rxr->hn_rx_flags &= ~HN_RX_FLAG_ATTACHED; + + if (idx < sc->hn_tx_ring_inuse) { + struct hn_tx_ring *txr = &sc->hn_tx_ring[idx]; + + KASSERT((txr->hn_tx_flags & HN_TX_FLAG_ATTACHED), + ("TX ring %d is not attached attached", idx)); + txr->hn_tx_flags &= ~HN_TX_FLAG_ATTACHED; + } + + /* + * Close this channel. + * + * NOTE: + * Channel closing does _not_ destroy the target channel. + */ + vmbus_chan_close(chan); +} + static int hn_attach_subchans(struct hn_softc *sc) { @@ -3029,6 +3059,9 @@ hn_attach_subchans(struct hn_softc *sc) int subchan_cnt = sc->hn_rx_ring_inuse - 1; int i, error = 0; + if (subchan_cnt == 0) + return (0); + /* Wait for sub-channels setup to complete. */ subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); @@ -3054,6 +3087,64 @@ hn_attach_subchans(struct hn_softc *sc) } static void +hn_detach_allchans(struct hn_softc *sc) +{ + struct vmbus_channel **subchans; + int subchan_cnt = sc->hn_rx_ring_inuse - 1; + int i; + + if (subchan_cnt == 0) + goto back; + + /* Detach the sub-channels. */ + subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); + for (i = 0; i < subchan_cnt; ++i) + hn_chan_detach(sc, subchans[i]); + vmbus_subchan_rel(subchans, subchan_cnt); + +back: + /* + * Detach the primary channel, _after_ all sub-channels + * are detached. + */ + hn_chan_detach(sc, sc->hn_prichan); + + /* Wait for sub-channels to be destroyed, if any. */ + vmbus_subchan_drain(sc->hn_prichan); + +#ifdef INVARIANTS + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + KASSERT((sc->hn_rx_ring[i].hn_rx_flags & + HN_RX_FLAG_ATTACHED) == 0, + ("%dth RX ring is still attached", i)); + } + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + KASSERT((sc->hn_tx_ring[i].hn_tx_flags & + HN_TX_FLAG_ATTACHED) == 0, + ("%dth TX ring is still attached", i)); + } +#endif +} + +static void +hn_set_ring_inuse(struct hn_softc *sc, int ring_cnt) +{ + KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_cnt, + ("invalid ring count %d", ring_cnt)); + + if (sc->hn_tx_ring_cnt > ring_cnt) + sc->hn_tx_ring_inuse = ring_cnt; + else + sc->hn_tx_ring_inuse = sc->hn_tx_ring_cnt; + sc->hn_rx_ring_inuse = ring_cnt; + + if (bootverbose) { + if_printf(sc->hn_ifp, "%d TX ring, %d RX ring\n", + sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); + } +} + +static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) { const struct hn_nvs_hdr *hdr; From owner-svn-src-head@freebsd.org Tue Sep 13 05:41:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AECBDBD8906; Tue, 13 Sep 2016 05:41:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 656CD7D4; Tue, 13 Sep 2016 05:41:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5fDdt002305; Tue, 13 Sep 2016 05:41:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5fDcV002304; Tue, 13 Sep 2016 05:41:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609130541.u8D5fDcV002304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 05:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305761 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 05:41:14 -0000 Author: sephe Date: Tue Sep 13 05:41:13 2016 New Revision: 305761 URL: https://svnweb.freebsd.org/changeset/base/305761 Log: hyperv/hn: Regroup synthetic parts attach code. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7859 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:27:36 2016 (r305760) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:41:13 2016 (r305761) @@ -523,12 +523,40 @@ netvsc_attach(device_t dev) goto failed; /* + * Create transaction context for NVS and RNDIS transactions. + */ + sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev), + HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE, 0); + if (sc->hn_xact == NULL) + goto failed; + + /* * Attach the primary channel before attaching NVS and RNDIS. */ error = hn_chan_attach(sc, sc->hn_prichan); if (error) goto failed; + /* + * Attach NVS and RNDIS (synthetic parts). + */ + error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); + if (error) + goto failed; + + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that host offered. + */ + hn_set_ring_inuse(sc, ring_cnt); + + /* + * Attach the sub-channels, if any. + */ + error = hn_attach_subchans(sc); + if (error) + goto failed; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; ifp->if_init = hn_ifinit; @@ -563,31 +591,6 @@ netvsc_attach(device_t dev) IFCAP_LRO; ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO; - sc->hn_xact = vmbus_xact_ctx_create(bus_get_dma_tag(dev), - HN_XACT_REQ_SIZE, HN_XACT_RESP_SIZE, 0); - if (sc->hn_xact == NULL) - goto failed; - - error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); - if (error) - goto failed; - KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_inuse, - ("invalid channel count %d, should be less than %d", - ring_cnt, sc->hn_rx_ring_inuse)); - - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that host offered. - */ - hn_set_ring_inuse(sc, ring_cnt); - - /* - * Attach the sub-channels, if any. - */ - error = hn_attach_subchans(sc); - if (error) - goto failed; - #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { /* From owner-svn-src-head@freebsd.org Tue Sep 13 05:54:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C930BD8BE9; Tue, 13 Sep 2016 05:54:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4FD4F98; Tue, 13 Sep 2016 05:54:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8D5sW3F006789; Tue, 13 Sep 2016 05:54:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8D5sV05006785; Tue, 13 Sep 2016 05:54:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609130554.u8D5sV05006785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 05:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305763 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 05:54:33 -0000 Author: sephe Date: Tue Sep 13 05:54:31 2016 New Revision: 305763 URL: https://svnweb.freebsd.org/changeset/base/305763 Log: hyperv/hn: Reorganize synthetic parts attach code. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7860 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 13 05:54:31 2016 (r305763) @@ -350,6 +350,7 @@ static int hn_attach_subchans(struct hn_ static void hn_detach_allchans(struct hn_softc *); static void hn_chan_callback(struct vmbus_channel *chan, void *xrxr); static void hn_set_ring_inuse(struct hn_softc *, int); +static int hn_synth_attach(struct hn_softc *, int); static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt); @@ -531,29 +532,9 @@ netvsc_attach(device_t dev) goto failed; /* - * Attach the primary channel before attaching NVS and RNDIS. + * Attach the synthetic parts, i.e. NVS and RNDIS. */ - error = hn_chan_attach(sc, sc->hn_prichan); - if (error) - goto failed; - - /* - * Attach NVS and RNDIS (synthetic parts). - */ - error = hv_rf_on_device_add(sc, &ring_cnt, ETHERMTU); - if (error) - goto failed; - - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that host offered. - */ - hn_set_ring_inuse(sc, ring_cnt); - - /* - * Attach the sub-channels, if any. - */ - error = hn_attach_subchans(sc); + error = hn_synth_attach(sc, ETHERMTU); if (error) goto failed; @@ -1513,7 +1494,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; #endif - int mask, error = 0, ring_cnt; + int mask, error = 0; int retry_cnt = 500; switch(cmd) { @@ -1590,29 +1571,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_detach_allchans(sc); /* - * Attach the primary channel before attaching NVS and RNDIS. - */ - hn_chan_attach(sc, sc->hn_prichan); - - ring_cnt = sc->hn_rx_ring_cnt; - error = hv_rf_on_device_add(sc, &ring_cnt, ifr->ifr_mtu); - if (error) { - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); - break; - } - - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that host offered. + * Attach the synthetic parts, i.e. NVS and RNDIS. + * XXX check error. */ - hn_set_ring_inuse(sc, ring_cnt); - - /* - * Attach the sub-channels, if any. - */ - hn_attach_subchans(sc); /* XXX check error */ + hn_synth_attach(sc, ifr->ifr_mtu); if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); @@ -3065,17 +3027,13 @@ hn_attach_subchans(struct hn_softc *sc) if (subchan_cnt == 0) return (0); - /* Wait for sub-channels setup to complete. */ - subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); - /* Attach the sub-channels. */ + subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); for (i = 0; i < subchan_cnt; ++i) { error = hn_chan_attach(sc, subchans[i]); if (error) break; } - - /* Release the sub-channels */ vmbus_subchan_rel(subchans, subchan_cnt); if (error) { @@ -3129,6 +3087,132 @@ back: #endif } +static int +hn_synth_alloc_subchans(struct hn_softc *sc, int *nsubch) +{ + struct vmbus_channel **subchans; + int nchan, rxr_cnt, error; + + nchan = *nsubch + 1; + if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { + /* + * Either RSS is not supported, or multiple RX/TX rings + * are not requested. + */ + *nsubch = 0; + return (0); + } + + /* + * Get RSS capabilities, e.g. # of RX rings, and # of indirect + * table entries. + */ + error = hn_rndis_get_rsscaps(sc, &rxr_cnt); + if (error) { + /* No RSS; this is benign. */ + *nsubch = 0; + return (0); + } + if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", + rxr_cnt, nchan); + + if (nchan > rxr_cnt) + nchan = rxr_cnt; + if (nchan == 1) { + if_printf(sc->hn_ifp, "only 1 channel is supported, no vRSS\n"); + *nsubch = 0; + return (0); + } + + /* + * Allocate sub-channels from NVS. + */ + *nsubch = nchan - 1; + error = hn_nvs_alloc_subchans(sc, nsubch); + if (error || *nsubch == 0) { + /* Failed to allocate sub-channels. */ + *nsubch = 0; + return (0); + } + + /* + * Wait for all sub-channels to become ready before moving on. + */ + subchans = vmbus_subchan_get(sc->hn_prichan, *nsubch); + vmbus_subchan_rel(subchans, *nsubch); + return (0); +} + +static int +hn_synth_attach(struct hn_softc *sc, int mtu) +{ + int error, nsubch; + + /* + * Attach the primary channel _before_ attaching NVS and RNDIS. + */ + error = hn_chan_attach(sc, sc->hn_prichan); + if (error) + return (error); + + /* + * Attach NVS. + */ + error = hn_nvs_attach(sc, mtu); + if (error) + return (error); + + /* + * Attach RNDIS _after_ NVS is attached. + */ + error = hn_rndis_attach(sc); + if (error) + return (error); + + /* + * Allocate sub-channels for multi-TX/RX rings. + * + * NOTE: + * The # of RX rings that can be used is equivalent to the # of + * channels to be requested. + */ + nsubch = sc->hn_rx_ring_cnt - 1; + error = hn_synth_alloc_subchans(sc, &nsubch); + if (error) + return (error); + if (nsubch == 0) { + /* Only the primary channel can be used; done */ + goto back; + } + + /* + * Configure RSS key and indirect table _after_ all sub-channels + * are allocated. + */ + error = hn_rndis_conf_rss(sc, nsubch + 1); + if (error) { + /* + * Failed to configure RSS key or indirect table; only + * the primary channel can be used. + */ + nsubch = 0; + } +back: + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that NVS offered. + */ + hn_set_ring_inuse(sc, nsubch + 1); + + /* + * Attach the sub-channels, if any. + */ + error = hn_attach_subchans(sc); + if (error) + return (error); + return (0); +} + static void hn_set_ring_inuse(struct hn_softc *sc, int ring_cnt) { Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Sep 13 05:54:31 2016 (r305763) @@ -81,8 +81,6 @@ static int hn_rndis_query(struct hn_soft static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, size_t dlen); static int hn_rndis_conf_offload(struct hn_softc *sc); -static int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); -static int hn_rndis_conf_rss(struct hn_softc *sc, int nchan); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) @@ -711,7 +709,7 @@ done: return (error); } -static int +int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt) { struct ndis_rss_caps in, caps; @@ -846,7 +844,7 @@ hn_rndis_conf_offload(struct hn_softc *s return (error); } -static int +int hn_rndis_conf_rss(struct hn_softc *sc, int nchan) { struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; @@ -994,7 +992,7 @@ hv_rf_halt_device(struct hn_softc *sc) return (0); } -static int +int hn_rndis_attach(struct hn_softc *sc) { int error; @@ -1014,76 +1012,6 @@ hn_rndis_attach(struct hn_softc *sc) return (0); } -int -hv_rf_on_device_add(struct hn_softc *sc, int *nchan0, int mtu) -{ - int ret; - device_t dev = sc->hn_dev; - int nchan = *nchan0, rxr_cnt, nsubch; - - ret = hn_nvs_attach(sc, mtu); - if (ret != 0) - return (ret); - - ret = hn_rndis_attach(sc); - if (ret != 0) - return (ret); - - if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) { - /* - * Either RSS is not supported, or multiple RX/TX rings - * are not requested. - */ - *nchan0 = 1; - return (0); - } - - /* - * Get RSS capabilities, e.g. # of RX rings, and # of indirect - * table entries. - */ - ret = hn_rndis_get_rsscaps(sc, &rxr_cnt); - if (ret) { - /* No RSS; this is benign. */ - *nchan0 = 1; - return (0); - } - if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", - rxr_cnt, nchan); - - if (nchan > rxr_cnt) - nchan = rxr_cnt; - if (nchan == 1) { - device_printf(dev, "only 1 channel is supported, no vRSS\n"); - *nchan0 = 1; - return (0); - } - - /* - * Allocate sub-channels from NVS. - */ - nsubch = nchan - 1; - ret = hn_nvs_alloc_subchans(sc, &nsubch); - if (ret || nsubch == 0) { - /* Failed to allocate sub-channels. */ - *nchan0 = 1; - return (0); - } - nchan = nsubch + 1; - - /* - * Configure RSS key and indirect table after all sub-channels - * are allocated. - */ - ret = hn_rndis_conf_rss(sc, nchan); - if (ret != 0) { - /* Failed to configure RSS key or indirect table. */ - nchan = 1; - } - *nchan0 = nchan; - return (0); -} - /* * RNDIS filter on device remove */ Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Tue Sep 13 05:54:31 2016 (r305763) @@ -43,7 +43,6 @@ struct hn_rx_ring; void hv_rf_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, const void *data, int dlen); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); -int hv_rf_on_device_add(struct hn_softc *sc, int *nchan, int mtu); int hv_rf_on_device_remove(struct hn_softc *sc); int hv_rf_on_open(struct hn_softc *sc); int hv_rf_on_close(struct hn_softc *sc); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 13 05:47:59 2016 (r305762) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 13 05:54:31 2016 (r305763) @@ -114,18 +114,23 @@ hn_nvs_send_sglist(struct vmbus_channel struct vmbus_xact; struct rndis_packet_msg; -void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, - struct vmbus_channel *chan, const void *data, int dlen); uint32_t hn_chim_alloc(struct hn_softc *sc); void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); +int hn_rndis_attach(struct hn_softc *sc); +int hn_rndis_conf_rss(struct hn_softc *sc, int nchan); void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); - +int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr); int hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status); + +int hn_nvs_attach(struct hn_softc *sc, int mtu); int hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch); +void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc, + struct vmbus_channel *chan, const void *data, int dlen); + int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info); void hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); From owner-svn-src-head@freebsd.org Tue Sep 13 08:28:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89CD2BD1CA8; Tue, 13 Sep 2016 08:28:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD40162; Tue, 13 Sep 2016 08:28:00 +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 u8D8RttT014993 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 13 Sep 2016 11:27:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u8D8RttT014993 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u8D8Rtp9014992; Tue, 13 Sep 2016 11:27:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Sep 2016 11:27:55 +0300 From: Konstantin Belousov To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305722 - head/sys/x86/x86 Message-ID: <20160913082755.GD38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> <20160912100003.GX38409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 08:28:01 -0000 On Tue, Sep 13, 2016 at 09:21:25AM +0800, Sepherosa Ziehau wrote: > Still didn't find anything wrong with this tunable set. Hm, did you have DMAR globally enabled ? I.e. did you get messages about dmar attachment, and then reports about dmar routing interrupts, like msi: Assigning MSI-X IRQ 264 to local APIC 4 vector 51 dmar1: programming irte[5] rid 0xf078 high 0x4f078 low 0x400330001 ? Ok, I tested this on my box. Indeed, this mutex (now sx) seems to not participate there. Thanks. From owner-svn-src-head@freebsd.org Tue Sep 13 08:42:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E6EBD6206; Tue, 13 Sep 2016 08:42:50 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x236.google.com (mail-vk0-x236.google.com [IPv6:2607:f8b0:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0279BCA7; Tue, 13 Sep 2016 08:42:49 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x236.google.com with SMTP id f76so167738703vke.0; Tue, 13 Sep 2016 01:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6rlMKn79tw9tG/xmKHFVilZgL7rpWBFwhH6XxvoMM4c=; b=NwOK0b5y7w00d2854KIQtfXdX0sikYBeOTnY6WkNYVCDnXfxjYURJFEzYANkD6d597 LORYQ/Zg1tQWCDysQQoMPHRgABntwqik72RbAOWg5Kp5IiLY4MESfjRDggExwyErd2j4 d0QpzLLWZMgWZ1LhZj8wQEOK3OzwXv2i+FUXoCPCvt7L3U7teaSa2nfuPFD33tOeRcii m9xekj7PfK9faQcPL/YqQb1hn81pdbOZkn2nVOrV1HeBvCJUAEjfJNqcCQWEHsTGx0tS eqGZ/orE1sSZJeSctB10CTHhkCoud+R+IUZOnG0/a4rlF/mDzU3YLYvH+z3HxNCEoaxW wyYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=6rlMKn79tw9tG/xmKHFVilZgL7rpWBFwhH6XxvoMM4c=; b=aAwKiPbkQlJWiuEurEOeyvT4aUgLQdpeBSBpmNtasmJZaFDIas+xNqi1hNxef4VQUF 3rFbhHR2WQnaUi6vOtVIcK+SesAdC5PLfsE7KelCnBOfogVpromWxcLnXTXfr0UpnrC8 BjL/F4CUy99ElDGuBF+uK8w7kFKvoWBYNzQJtg181NQs8tdR5Jtzny9R3/T+qC1FzyEq JbX5ud9qyKFLVEQgbfy5L55fOkVQLiJfm/JEMl0N2Ta664Bll2c2EGPULapP6Yp2gp2i WnNdISI2a1Qt/AzSWL3MVU2S//KdW1LxwAMOHzqvffA2s4+/P+WVU7IbYi4oPT8IEedp 80oA== X-Gm-Message-State: AE9vXwNL2ip8r9acNsxHCwx5IhO0kcEYPayA/Xo08C8r5+8mPYyW/lfU5TpgflbRc8ksIP0b+RQ26wv4jXUExA== X-Received: by 10.31.244.207 with SMTP id s198mr11033643vkh.126.1473756169196; Tue, 13 Sep 2016 01:42:49 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.69.228 with HTTP; Tue, 13 Sep 2016 01:42:48 -0700 (PDT) In-Reply-To: <20160913082755.GD38409@kib.kiev.ua> References: <201609120457.u8C4vw9S052665@repo.freebsd.org> <20160912083228.GW38409@kib.kiev.ua> <20160912100003.GX38409@kib.kiev.ua> <20160913082755.GD38409@kib.kiev.ua> From: Sepherosa Ziehau Date: Tue, 13 Sep 2016 16:42:48 +0800 X-Google-Sender-Auth: IFPGfyWq-NNPtL5RYm9HGB_0xx0 Message-ID: Subject: Re: svn commit: r305722 - head/sys/x86/x86 To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 08:42:50 -0000 On Tue, Sep 13, 2016 at 4:27 PM, Konstantin Belousov wrote: > On Tue, Sep 13, 2016 at 09:21:25AM +0800, Sepherosa Ziehau wrote: >> Still didn't find anything wrong with this tunable set. > Hm, did you have DMAR globally enabled ? I.e. did you get messages > about dmar attachment, and then reports about dmar routing interrupts, like > msi: Assigning MSI-X IRQ 264 to local APIC 4 vector 51 > dmar1: programming irte[5] rid 0xf078 high 0x4f078 low 0x400330001 > ? Let me try it on other boxes. > > Ok, I tested this on my box. Indeed, this mutex (now sx) seems to not > participate there. Thanks. Thank you for the information. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Tue Sep 13 14:10:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A59DBD9D9A; Tue, 13 Sep 2016 14:10:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4CCA3B28; Tue, 13 Sep 2016 14:10:50 +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 u8DEAnHH092018; Tue, 13 Sep 2016 14:10:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DEAnAD092017; Tue, 13 Sep 2016 14:10:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131410.u8DEAnAD092017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 14:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305767 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 14:10:50 -0000 Author: andrew Date: Tue Sep 13 14:10:49 2016 New Revision: 305767 URL: https://svnweb.freebsd.org/changeset/base/305767 Log: Add a warning about a known erratum we have observed on ThunderX pass 1.1. As this is evaluation hardware with only a few users, and there is a lack of information add a warning when booting on this hardware. Reported by: cognet Obtained from: ABT Systems Ltd MFC after: Instant Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue Sep 13 13:23:24 2016 (r305766) +++ head/sys/arm64/arm64/identcpu.c Tue Sep 13 14:10:49 2016 (r305767) @@ -179,6 +179,28 @@ print_cpu_features(u_int cpu) } printf("\n"); + /* + * There is a hardware errata where, if one CPU is performing a TLB + * invalidation while another is performing a store-exclusive the + * store-exclusive may return the wrong status. A workaround seems + * to be to use an IPI to invalidate on each CPU, however given the + * limited number of affected units (pass 1.1 is the evaluation + * hardware revision), and the lack of information from Cavium + * this has not been implemented. + * + * At the time of writing this the only information is from: + * https://lkml.org/lkml/2016/8/4/722 + */ + /* + * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 on it's own also + * triggers on pass 2.0+. + */ + if (cpu == 0 && CPU_VAR(PCPU_GET(midr)) == 0 && + CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1) + printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known " + "hardware bugs that may cause the incorrect operation of " + "atomic operations.\n"); + if (cpu != 0 && cpu_print_regs == 0) return; From owner-svn-src-head@freebsd.org Tue Sep 13 15:37:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D844BD981D; Tue, 13 Sep 2016 15:37:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1B5D7FFA; Tue, 13 Sep 2016 15:37:24 +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 u8DFbNOx027209; Tue, 13 Sep 2016 15:37:23 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DFbN5i027208; Tue, 13 Sep 2016 15:37:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201609131537.u8DFbN5i027208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 13 Sep 2016 15:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305769 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 15:37:24 -0000 Author: bapt Date: Tue Sep 13 15:37:23 2016 New Revision: 305769 URL: https://svnweb.freebsd.org/changeset/base/305769 Log: Remove code that crept in r305125 by accident Reported by: tsoome Modified: head/sys/boot/common/dev_net.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Tue Sep 13 14:14:39 2016 (r305768) +++ head/sys/boot/common/dev_net.c Tue Sep 13 15:37:23 2016 (r305769) @@ -368,7 +368,7 @@ net_print(int verbose) uint32_t net_parse_rootpath() { - int i, ipstart; + int i; n_long addr = INADDR_NONE; netproto = NET_NFS; @@ -383,7 +383,7 @@ net_parse_rootpath() break; if (i && i != FNAME_SIZE && rootpath[i] == ':') { rootpath[i++] = '\0'; - addr = inet_addr(&rootpath[ipstart]); + addr = inet_addr(&rootpath[0]); bcopy(&rootpath[i], rootpath, strlen(&rootpath[i])+1); } From owner-svn-src-head@freebsd.org Tue Sep 13 15:41:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A99BD9A44; Tue, 13 Sep 2016 15:41:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1AC933BB; Tue, 13 Sep 2016 15:41:06 +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 u8DFf5Pm027394; Tue, 13 Sep 2016 15:41:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DFf5lR027393; Tue, 13 Sep 2016 15:41:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201609131541.u8DFf5lR027393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 13 Sep 2016 15:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305770 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 15:41:06 -0000 Author: bapt Date: Tue Sep 13 15:41:05 2016 New Revision: 305770 URL: https://svnweb.freebsd.org/changeset/base/305770 Log: Add a comment on the #endif related to the guards Reported by: tsoome Modified: head/lib/libstand/net.h Modified: head/lib/libstand/net.h ============================================================================== --- head/lib/libstand/net.h Tue Sep 13 15:37:23 2016 (r305769) +++ head/lib/libstand/net.h Tue Sep 13 15:41:05 2016 (r305770) @@ -130,4 +130,4 @@ n_long inet_addr(char *); /* Machine-dependent functions: */ time_t getsecs(void); -#endif +#endif /* ! _STAND_NET_H */ From owner-svn-src-head@freebsd.org Tue Sep 13 15:45:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C8BCBD9B51; Tue, 13 Sep 2016 15:45:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0F2E0C24; Tue, 13 Sep 2016 15:45:23 +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 u8DFjNOr031132; Tue, 13 Sep 2016 15:45:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DFjNmr031130; Tue, 13 Sep 2016 15:45:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131545.u8DFjNmr031130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 15:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305771 - in head/sys: arm64/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 15:45:24 -0000 Author: andrew Date: Tue Sep 13 15:45:22 2016 New Revision: 305771 URL: https://svnweb.freebsd.org/changeset/base/305771 Log: Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on DDB, and is unused when it's disabled. Obtained from: ABT Systems Ltd MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/debug_monitor.h head/sys/conf/files.arm64 Modified: head/sys/arm64/include/debug_monitor.h ============================================================================== --- head/sys/arm64/include/debug_monitor.h Tue Sep 13 15:41:05 2016 (r305770) +++ head/sys/arm64/include/debug_monitor.h Tue Sep 13 15:45:22 2016 (r305771) @@ -32,7 +32,7 @@ #ifndef _MACHINE_DEBUG_MONITOR_H_ #define _MACHINE_DEBUG_MONITOR_H_ -#ifdef KDB +#ifdef DDB #include Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Sep 13 15:41:05 2016 (r305770) +++ head/sys/conf/files.arm64 Tue Sep 13 15:45:22 2016 (r305771) @@ -62,7 +62,7 @@ arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb arm64/arm64/db_trace.c optional ddb -arm64/arm64/debug_monitor.c optional kdb +arm64/arm64/debug_monitor.c optional ddb arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard arm64/arm64/elf_machdep.c standard From owner-svn-src-head@freebsd.org Tue Sep 13 16:20:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5CB5BD9794; Tue, 13 Sep 2016 16:20:32 +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 mx1.freebsd.org (Postfix) with ESMTPS id 95F9EB05; Tue, 13 Sep 2016 16:20:32 +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 u8DGKVnt043182; Tue, 13 Sep 2016 16:20:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DGKVs8043180; Tue, 13 Sep 2016 16:20:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609131620.u8DGKVs8043180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Sep 2016 16:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305772 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 16:20:32 -0000 Author: andrew Date: Tue Sep 13 16:20:31 2016 New Revision: 305772 URL: https://svnweb.freebsd.org/changeset/base/305772 Log: Add a missing opt_ddb.h include from places that include debug_moditor.h to fix the build. Obtained from: ABT Systems Ltd X-MFC with: r305771 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/db_trace.c head/sys/arm64/arm64/debug_monitor.c Modified: head/sys/arm64/arm64/db_trace.c ============================================================================== --- head/sys/arm64/arm64/db_trace.c Tue Sep 13 15:45:22 2016 (r305771) +++ head/sys/arm64/arm64/db_trace.c Tue Sep 13 16:20:31 2016 (r305772) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); #include Modified: head/sys/arm64/arm64/debug_monitor.c ============================================================================== --- head/sys/arm64/arm64/debug_monitor.c Tue Sep 13 15:45:22 2016 (r305771) +++ head/sys/arm64/arm64/debug_monitor.c Tue Sep 13 16:20:31 2016 (r305772) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD$"); From owner-svn-src-head@freebsd.org Tue Sep 13 18:16:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13170BD920F; Tue, 13 Sep 2016 18:16:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id CA6FF98; Tue, 13 Sep 2016 18:16:16 +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 u8DIGGNg091069; Tue, 13 Sep 2016 18:16:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DIGGpa091068; Tue, 13 Sep 2016 18:16:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201609131816.u8DIGGpa091068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 13 Sep 2016 18:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305778 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 18:16:17 -0000 Author: ae Date: Tue Sep 13 18:16:15 2016 New Revision: 305778 URL: https://svnweb.freebsd.org/changeset/base/305778 Log: Fix swap tables between sets when this functional is enabled. We have 6 opcode rewriters for table opcodes. When `set swap' command invoked, it is called for each rewriter, so at the end we get the same result, because opcode rewriter uses ETLV type to match opcode. And all tables opcodes have the same ETLV type. To solve this problem, use separate sets handler for one opcode rewriter. Use it to handle TEST_ALL, SWAP_ALL and MOVE_ALL commands. PR: 212630 MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Tue Sep 13 17:51:51 2016 (r305777) +++ head/sys/netpfil/ipfw/ip_fw_table.c Tue Sep 13 18:16:15 2016 (r305778) @@ -2876,13 +2876,12 @@ table_manage_sets(struct ip_fw_chain *ch switch (cmd) { case SWAP_ALL: case TEST_ALL: + case MOVE_ALL: /* - * Return success for TEST_ALL, since nothing prevents - * move rules from one set to another. All tables are - * accessible from all sets when per-set tables sysctl - * is disabled. + * Always return success, the real action and decision + * should make table_manage_sets_all(). */ - case MOVE_ALL: + return (0); case TEST_ONE: case MOVE_ONE: /* @@ -2907,6 +2906,39 @@ table_manage_sets(struct ip_fw_chain *ch set, new_set, cmd)); } +/* + * We register several opcode rewriters for lookup tables. + * All tables opcodes have the same ETLV type, but different subtype. + * To avoid invoking sets handler several times for XXX_ALL commands, + * we use separate manage_sets handler. O_RECV has the lowest value, + * so it should be called first. + */ +static int +table_manage_sets_all(struct ip_fw_chain *ch, uint16_t set, uint8_t new_set, + enum ipfw_sets_cmd cmd) +{ + + switch (cmd) { + case SWAP_ALL: + case TEST_ALL: + /* + * Return success for TEST_ALL, since nothing prevents + * move rules from one set to another. All tables are + * accessible from all sets when per-set tables sysctl + * is disabled. + */ + case MOVE_ALL: + if (V_fw_tables_sets == 0) + return (0); + break; + default: + return (table_manage_sets(ch, set, new_set, cmd)); + } + /* Use generic sets handler when per-set sysctl is enabled. */ + return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME, + set, new_set, cmd)); +} + static struct opcode_obj_rewrite opcodes[] = { { .opcode = O_IP_SRC_LOOKUP, @@ -2956,7 +2988,7 @@ static struct opcode_obj_rewrite opcodes .find_byname = table_findbyname, .find_bykidx = table_findbykidx, .create_object = create_table_compat, - .manage_sets = table_manage_sets, + .manage_sets = table_manage_sets_all, }, { .opcode = O_VIA, From owner-svn-src-head@freebsd.org Tue Sep 13 22:17:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 676B8BD9F6B; Tue, 13 Sep 2016 22:17:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A75ECB6; Tue, 13 Sep 2016 22:17:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8DMHPD9085843; Tue, 13 Sep 2016 22:17:25 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DMHPoU085842; Tue, 13 Sep 2016 22:17:25 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201609132217.u8DMHPoU085842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 13 Sep 2016 22:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305783 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 22:17:26 -0000 Author: sjg Date: Tue Sep 13 22:17:25 2016 New Revision: 305783 URL: https://svnweb.freebsd.org/changeset/base/305783 Log: Avoid clobbering existing value of META_COOKIE_TOUCH Modified: head/share/mk/meta.sys.mk Modified: head/share/mk/meta.sys.mk ============================================================================== --- head/share/mk/meta.sys.mk Tue Sep 13 20:13:19 2016 (r305782) +++ head/share/mk/meta.sys.mk Tue Sep 13 22:17:25 2016 (r305783) @@ -114,16 +114,13 @@ _metaError: .NOMETA .NOTMAIN .endif -META_COOKIE_TOUCH= -# some targets need to be .PHONY in non-meta mode -META_NOPHONY= .PHONY # Are we, after all, in meta mode? .if ${.MAKE.MODE:Uno:Mmeta*} != "" MKDEP_MK = meta.autodep.mk # we can afford to use cookies to prevent some targets # re-running needlessly -META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET:T}} +META_COOKIE_TOUCH?= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET:T}} META_NOPHONY= # some targets involve old pre-built targets @@ -159,5 +156,9 @@ BUILD_AT_LEVEL0 ?= no .endif .endif +.else +META_COOKIE_TOUCH= +# some targets need to be .PHONY in non-meta mode +META_NOPHONY= .PHONY .endif .endif From owner-svn-src-head@freebsd.org Tue Sep 13 22:59:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91AB2BD9B9F; Tue, 13 Sep 2016 22:59:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5428961A; Tue, 13 Sep 2016 22:59:39 +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 u8DMxcKJ001310; Tue, 13 Sep 2016 22:59:38 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8DMxcoh001309; Tue, 13 Sep 2016 22:59:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609132259.u8DMxcoh001309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 13 Sep 2016 22:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305785 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 22:59:39 -0000 Author: avos Date: Tue Sep 13 22:59:38 2016 New Revision: 305785 URL: https://svnweb.freebsd.org/changeset/base/305785 Log: net80211: improve error checking in ieee80211_parse_{wpa,rsn}() - Add few checks for group/pairwise ciphers into ieee80211_parse_{wpa,rsn}(). - Split error code and cipher value in wpa_cipher() / rsn_cipher(); current hack with (1 << 32) does not work - it's 1, not 0 (detected by CSA). - Return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION instead of IEEE80211_REASON_IE_INVALID when version field is not equal to RSN_VERSION. Tested with wpi(4) / urtwn(4) (HOSTAP mode). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D7887 Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Tue Sep 13 22:56:21 2016 (r305784) +++ head/sys/net80211/ieee80211_hostap.c Tue Sep 13 22:59:38 2016 (r305785) @@ -1153,28 +1153,36 @@ bad: * record any key length. */ static int -wpa_cipher(const uint8_t *sel, uint8_t *keylen) +wpa_cipher(const uint8_t *sel, uint8_t *keylen, uint8_t *cipher) { #define WPA_SEL(x) (((x)<<24)|WPA_OUI) uint32_t w = le32dec(sel); switch (w) { case WPA_SEL(WPA_CSE_NULL): - return IEEE80211_CIPHER_NONE; + *cipher = IEEE80211_CIPHER_NONE; + break; case WPA_SEL(WPA_CSE_WEP40): if (keylen) *keylen = 40 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case WPA_SEL(WPA_CSE_WEP104): if (keylen) *keylen = 104 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case WPA_SEL(WPA_CSE_TKIP): - return IEEE80211_CIPHER_TKIP; + *cipher = IEEE80211_CIPHER_TKIP; + break; case WPA_SEL(WPA_CSE_CCMP): - return IEEE80211_CIPHER_AES_CCM; + *cipher = IEEE80211_CIPHER_AES_CCM; + break; + default: + return (EINVAL); } - return 32; /* NB: so 1<< is discarded */ + + return (0); #undef WPA_SEL } @@ -1212,7 +1220,7 @@ ieee80211_parse_wpa(struct ieee80211vap { uint8_t len = frm[1]; uint32_t w; - int n; + int error, n; /* * Check the length once for fixed parts: OUI, type, @@ -1245,7 +1253,14 @@ ieee80211_parse_wpa(struct ieee80211vap memset(rsn, 0, sizeof(*rsn)); /* multicast/group cipher */ - rsn->rsn_mcastcipher = wpa_cipher(frm, &rsn->rsn_mcastkeylen); + error = wpa_cipher(frm, &rsn->rsn_mcastkeylen, &rsn->rsn_mcastcipher); + if (error != 0) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "WPA", "unknown mcast cipher suite %08X", + le32dec(frm)); + return IEEE80211_REASON_GROUP_CIPHER_INVALID; + } frm += 4, len -= 4; /* unicast ciphers */ @@ -1260,13 +1275,26 @@ ieee80211_parse_wpa(struct ieee80211vap } w = 0; for (; n > 0; n--) { - w |= 1<rsn_ucastkeylen); + uint8_t cipher; + + error = wpa_cipher(frm, &rsn->rsn_ucastkeylen, &cipher); + if (error == 0) + w |= 1 << cipher; + frm += 4, len -= 4; } - if (w & (1<rsn_ucastcipher = IEEE80211_CIPHER_TKIP; - else + if (w == 0) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "WPA", "no usable pairwise cipher suite found (w=%d)", + w); + return IEEE80211_REASON_PAIRWISE_CIPHER_INVALID; + } + /* XXX other? */ + if (w & (1 << IEEE80211_CIPHER_AES_CCM)) rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; + else + rsn->rsn_ucastcipher = IEEE80211_CIPHER_TKIP; /* key management algorithms */ n = le16dec(frm); @@ -1300,30 +1328,39 @@ ieee80211_parse_wpa(struct ieee80211vap * record any key length. */ static int -rsn_cipher(const uint8_t *sel, uint8_t *keylen) +rsn_cipher(const uint8_t *sel, uint8_t *keylen, uint8_t *cipher) { #define RSN_SEL(x) (((x)<<24)|RSN_OUI) uint32_t w = le32dec(sel); switch (w) { case RSN_SEL(RSN_CSE_NULL): - return IEEE80211_CIPHER_NONE; + *cipher = IEEE80211_CIPHER_NONE; + break; case RSN_SEL(RSN_CSE_WEP40): if (keylen) *keylen = 40 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case RSN_SEL(RSN_CSE_WEP104): if (keylen) *keylen = 104 / NBBY; - return IEEE80211_CIPHER_WEP; + *cipher = IEEE80211_CIPHER_WEP; + break; case RSN_SEL(RSN_CSE_TKIP): - return IEEE80211_CIPHER_TKIP; + *cipher = IEEE80211_CIPHER_TKIP; + break; case RSN_SEL(RSN_CSE_CCMP): - return IEEE80211_CIPHER_AES_CCM; + *cipher = IEEE80211_CIPHER_AES_CCM; + break; case RSN_SEL(RSN_CSE_WRAP): - return IEEE80211_CIPHER_AES_OCB; + *cipher = IEEE80211_CIPHER_AES_OCB; + break; + default: + return (EINVAL); } - return 32; /* NB: so 1<< is discarded */ + + return (0); #undef WPA_SEL } @@ -1360,7 +1397,7 @@ ieee80211_parse_rsn(struct ieee80211vap { uint8_t len = frm[1]; uint32_t w; - int n; + int error, n; /* * Check the length once for fixed parts: @@ -1373,6 +1410,7 @@ ieee80211_parse_rsn(struct ieee80211vap wh, "WPA", "not RSN, flags 0x%x", vap->iv_flags); return IEEE80211_REASON_IE_INVALID; } + /* XXX may be shorter */ if (len < 10) { IEEE80211_DISCARD_IE(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, @@ -1385,14 +1423,28 @@ ieee80211_parse_rsn(struct ieee80211vap IEEE80211_DISCARD_IE(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, wh, "RSN", "bad version %u", w); - return IEEE80211_REASON_IE_INVALID; + return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION; } frm += 2, len -= 2; memset(rsn, 0, sizeof(*rsn)); /* multicast/group cipher */ - rsn->rsn_mcastcipher = rsn_cipher(frm, &rsn->rsn_mcastkeylen); + error = rsn_cipher(frm, &rsn->rsn_mcastkeylen, &rsn->rsn_mcastcipher); + if (error != 0) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "RSN", "unknown mcast cipher suite %08X", + le32dec(frm)); + return IEEE80211_REASON_GROUP_CIPHER_INVALID; + } + if (rsn->rsn_mcastcipher == IEEE80211_CIPHER_NONE) { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "RSN", "invalid mcast cipher suite %d", + rsn->rsn_mcastcipher); + return IEEE80211_REASON_GROUP_CIPHER_INVALID; + } frm += 4, len -= 4; /* unicast ciphers */ @@ -1406,14 +1458,33 @@ ieee80211_parse_rsn(struct ieee80211vap return IEEE80211_REASON_IE_INVALID; } w = 0; + for (; n > 0; n--) { - w |= 1<rsn_ucastkeylen); + uint8_t cipher; + + error = rsn_cipher(frm, &rsn->rsn_ucastkeylen, &cipher); + if (error == 0) + w |= 1 << cipher; + frm += 4, len -= 4; } - if (w & (1<rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; + else if (w & (1 << IEEE80211_CIPHER_AES_OCB)) + rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_OCB; + else if (w & (1 << IEEE80211_CIPHER_TKIP)) rsn->rsn_ucastcipher = IEEE80211_CIPHER_TKIP; - else - rsn->rsn_ucastcipher = IEEE80211_CIPHER_AES_CCM; + else if ((w & (1 << IEEE80211_CIPHER_NONE)) && + (rsn->rsn_mcastcipher == IEEE80211_CIPHER_WEP || + rsn->rsn_mcastcipher == IEEE80211_CIPHER_TKIP)) + rsn->rsn_ucastcipher = IEEE80211_CIPHER_NONE; + else { + IEEE80211_DISCARD_IE(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_WPA, + wh, "RSN", "no usable pairwise cipher suite found (w=%d)", + w); + return IEEE80211_REASON_PAIRWISE_CIPHER_INVALID; + } /* key management algorithms */ n = le16dec(frm); @@ -1510,6 +1581,7 @@ wpa_assocreq(struct ieee80211_node *ni, else reason = ieee80211_parse_rsn(vap, rsn, rsnparms, wh); if (reason != 0) { + /* XXX wpa->rsn fallback? */ /* XXX distinguish WPA/RSN? */ vap->iv_stats.is_rx_assoc_badwpaie++; goto bad; From owner-svn-src-head@freebsd.org Wed Sep 14 01:47:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C86C6BDA5C8; Wed, 14 Sep 2016 01:47:03 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8B7D0C93; Wed, 14 Sep 2016 01:47:03 +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 u8E1l2YG065271; Wed, 14 Sep 2016 01:47:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E1l1qh065260; Wed, 14 Sep 2016 01:47:01 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201609140147.u8E1l1qh065260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 14 Sep 2016 01:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 01:47:03 -0000 Author: cy Date: Wed Sep 14 01:47:01 2016 New Revision: 305787 URL: https://svnweb.freebsd.org/changeset/base/305787 Log: Switch from .CURDIR to the simpler, more legible SRCTOP. Suggested by: emaste X-MFC-with: upcoming amd upgrade Modified: head/usr.sbin/amd/amd/Makefile head/usr.sbin/amd/amq/Makefile head/usr.sbin/amd/fixmount/Makefile head/usr.sbin/amd/fsinfo/Makefile head/usr.sbin/amd/hlfsd/Makefile head/usr.sbin/amd/include/Makefile head/usr.sbin/amd/libamu/Makefile head/usr.sbin/amd/mk-amd-map/Makefile head/usr.sbin/amd/pawd/Makefile head/usr.sbin/amd/scripts/Makefile head/usr.sbin/amd/wire-test/Makefile Modified: head/usr.sbin/amd/amd/Makefile ============================================================================== --- head/usr.sbin/amd/amd/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/amd/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -8,7 +8,7 @@ .include -.PATH: ${.CURDIR}/../../../contrib/amd/amd +.PATH: ${SRCTOP}/contrib/amd/amd PROG= amd MAN= amd.8 @@ -24,7 +24,7 @@ SRCS+= ops_nullfs.c ops_pcfs.c ops_tfs.c SRCS+= ops_unionfs.c opts.c readdir.c restart.c rpc_fwd.c sched.c SRCS+= srvr_amfs_auto.c srvr_nfs.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amd \ +CFLAGS+= -I${SRCTOP}/contrib/amd/amd \ -I${DESTDIR}/usr/include/rpcsvc LIBADD= amu wrap Modified: head/usr.sbin/amd/amq/Makefile ============================================================================== --- head/usr.sbin/amd/amq/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/amq/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -6,13 +6,13 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/../../../contrib/amd/amq +.PATH: ${SRCTOP}/contrib/amd/amq PROG= amq MAN= amq.8 SRCS= amq.c amq_clnt.c amq_xdr.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amq +CFLAGS+= -I${SRCTOP}/contrib/amd/amq LIBADD= amu Modified: head/usr.sbin/amd/fixmount/Makefile ============================================================================== --- head/usr.sbin/amd/fixmount/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/fixmount/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,8 +5,8 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/fixmount \ - ${.CURDIR}/../../../contrib/amd/conf/checkmount +.PATH: ${SRCTOP}/contrib/amd/fixmount \ + ${SRCTOP}/contrib/amd/conf/checkmount PROG= fixmount MAN= fixmount.8 Modified: head/usr.sbin/amd/fsinfo/Makefile ============================================================================== --- head/usr.sbin/amd/fsinfo/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/fsinfo/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,7 +5,7 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/fsinfo +.PATH: ${SRCTOP}/contrib/amd/fsinfo PROG= fsinfo MAN= fsinfo.8 @@ -13,7 +13,7 @@ SRCS= fsi_gram.y fsi_lex.l SRCS+= fsi_analyze.c fsi_dict.c fsi_util.c fsinfo.c wr_atab.c SRCS+= wr_bparam.c wr_dumpset.c wr_exportfs.c wr_fstab.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/fsinfo +CFLAGS+= -I${SRCTOP}/contrib/amd/fsinfo LIBADD= amu Modified: head/usr.sbin/amd/hlfsd/Makefile ============================================================================== --- head/usr.sbin/amd/hlfsd/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/hlfsd/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,13 +5,13 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/hlfsd +.PATH: ${SRCTOP}/contrib/amd/hlfsd PROG= hlfsd MAN= hlfsd.8 SRCS= hlfsd.c homedir.c nfs_prot_svc.c stubs.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/hlfsd +CFLAGS+= -I${SRCTOP}/contrib/amd/hlfsd LIBADD= amu Modified: head/usr.sbin/amd/include/Makefile ============================================================================== --- head/usr.sbin/amd/include/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/include/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -17,7 +17,7 @@ CLEANFILES= ${SRCS} all depend: ${SRCS} -config_local.h: newvers.sh ${.CURDIR}/../../../sys/conf/newvers.sh +config_local.h: newvers.sh ${SRCTOP}/sys/conf/newvers.sh @rm -f ${.TARGET} sh ${.ALLSRC} > ${.TARGET} Modified: head/usr.sbin/amd/libamu/Makefile ============================================================================== --- head/usr.sbin/amd/libamu/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/libamu/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,10 +5,10 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/libamu \ - ${.CURDIR}/../../../contrib/amd/conf/transp \ - ${.CURDIR}/../../../contrib/amd/conf/mtab \ - ${.CURDIR}/../../../contrib/amd/conf/umount +.PATH: ${SRCTOP}/contrib/amd/libamu \ + ${SRCTOP}/contrib/amd/conf/transp \ + ${SRCTOP}/contrib/amd/conf/mtab \ + ${SRCTOP}/contrib/amd/conf/umount LIB= amu INTERNALLIB= @@ -22,13 +22,13 @@ SRCS+= transp_sockets.c mtab_bsd.c umoun SRCS+= nfs_prot_x.c xdr_func_%undef.c CLEANFILES+= nfs_prot_x.c xdr_func_%undef.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/libamu \ +CFLAGS+= -I${SRCTOP}/contrib/amd/libamu \ -I${DESTDIR}/usr/include/rpcsvc nfs_prot_x.c: ${NFS_PROT_X} ${RPCCOM} -c -C -DWANT_NFS3 ${NFS_PROT_X} -o ${.TARGET} -XDRDEFS!= grep 'ifndef.*HAVE_XDR' ${.CURDIR}/../../../contrib/amd/libamu/xdr_func.c | awk '{print "-D"$$2}' +XDRDEFS!= grep 'ifndef.*HAVE_XDR' ${SRCTOP}/contrib/amd/libamu/xdr_func.c | awk '{print "-D"$$2}' xdr_func_%undef.c: xdr_func.c -unifdef ${XDRDEFS} < ${.ALLSRC} > ${.TARGET} Modified: head/usr.sbin/amd/mk-amd-map/Makefile ============================================================================== --- head/usr.sbin/amd/mk-amd-map/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/mk-amd-map/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,7 +5,7 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/mk-amd-map +.PATH: ${SRCTOP}/contrib/amd/mk-amd-map PROG= mk-amd-map MAN= mk-amd-map.8 Modified: head/usr.sbin/amd/pawd/Makefile ============================================================================== --- head/usr.sbin/amd/pawd/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/pawd/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,14 +5,14 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/amq +.PATH: ${SRCTOP}/contrib/amd/amq BINDIR= /usr/bin PROG= pawd SRCS= pawd.c amq_clnt.c amq_xdr.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amq +CFLAGS+= -I${SRCTOP}/contrib/amd/amq LIBADD= amu Modified: head/usr.sbin/amd/scripts/Makefile ============================================================================== --- head/usr.sbin/amd/scripts/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/scripts/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/scripts +.PATH: ${SRCTOP}/contrib/amd/scripts MAN= amd.conf.5 Modified: head/usr.sbin/amd/wire-test/Makefile ============================================================================== --- head/usr.sbin/amd/wire-test/Makefile Wed Sep 14 00:00:11 2016 (r305786) +++ head/usr.sbin/amd/wire-test/Makefile Wed Sep 14 01:47:01 2016 (r305787) @@ -5,7 +5,7 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../../../contrib/amd/wire-test +.PATH: ${SRCTOP}/contrib/amd/wire-test PROG= wire-test MAN= wire-test.8 From owner-svn-src-head@freebsd.org Wed Sep 14 05:00:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85368BD8EAD; Wed, 14 Sep 2016 05:00:59 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28A7F211; Wed, 14 Sep 2016 05:00:59 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id 1so7918076wmz.1; Tue, 13 Sep 2016 22:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/duY/jz06LU2xQiW9c5Bqxaf1GrygyiLaKBnxP0bYW0=; b=nQTKqBaKU/aVCrSpnoTEiqiUctmqWmeEirvA2EMWy9mqVqBlc34SCNz7tpdVTxftIw CEaJJvXMPhd6ImN/B1p9TdrjtUkqJg6Jz00L7Yy9sPAxthJBAM+rhAB7/lnMALL8IPtS dbqm0vBIpjP1DEOZrcYpHdDujhvUxV688c1BCBGSHdRGIvBd49HuQhasn6EaD10aVqbq gX1PCkk4oUzPqfKfC0vlcyspO6Vcz7lD3qsumhdJr4FWHq3a1eFIiuaUXqFZVA6A2S0E HDvOEw2Qv5HuifZbb09slA3mjtgmdoeJXuedaydJtvpqVvxHSJkllKvd7pJobBOfH5Ic F1lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/duY/jz06LU2xQiW9c5Bqxaf1GrygyiLaKBnxP0bYW0=; b=PYsY+//LmWvlIpfRtnCVSnlFOMBfqIuB1f1yqYZmWXXZIcQXKG6Vp6CnHCkGr3AbB1 nwOyP04E3riiOZYdtB20e/DYIHfno9M+WCi7S+xQevBAuz7RmsSABy2UBcYllm0FXXx0 FD+bGm4whl/17hVt4HYp/L4QCIhme8oTiWb7/hQeYy0W4hS6RrRff7wdeYAvsl/R4tWi WRTjyoV5gaBOI1VRi9jkmrX0Pfe1cyTuXMAYiGz3gOnUrv47OTIoXkzV/hCa9l2EjG4W TJTzh0B7sIgHulTXsCVHGnliIMnp0h3ULFJuTTonjpqVArmvWgWdzcWieKE+9Gb6R9uS 1Qmg== X-Gm-Message-State: AE9vXwMpd+IFPIrNQZQ9qq+p2kzOPZC6Z7vlC42WewklKh8tFR91XI3j40tD/UTSpwQFIA== X-Received: by 10.28.93.14 with SMTP id r14mr467401wmb.89.1473829257119; Tue, 13 Sep 2016 22:00:57 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id q65sm2087550wmd.24.2016.09.13.22.00.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Sep 2016 22:00:56 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 14 Sep 2016 07:00:55 +0200 From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test Message-ID: <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> References: <201609140147.u8E1l1qh065260@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="55tggrzvwhw6q2vy" Content-Disposition: inline In-Reply-To: <201609140147.u8E1l1qh065260@repo.freebsd.org> User-Agent: Mutt/1.6.2-neo (2016-08-08) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 05:00:59 -0000 --55tggrzvwhw6q2vy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: > Author: cy > Date: Wed Sep 14 01:47:01 2016 > New Revision: 305787 > URL: https://svnweb.freebsd.org/changeset/base/305787 >=20 > Log: > Switch from .CURDIR to the simpler, more legible SRCTOP. > =20 > Suggested by: emaste > X-MFC-with: upcoming amd upgrade >=20 I thought the plans was more to deprecated and remove amd at some points gi= ven we now have autofs/automountd? Am I missing something? Best regards, Bapt --55tggrzvwhw6q2vy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX2NmEAAoJEGOJi9zxtz5aIhUQAKfxNcQVibIQHM3rKdD6BZo9 3T5UX8SLTVcAtBSTCG7l/UMzMhQNTS/504wq2NqTxQCALixbU5pQgojQTHvIAzkJ Y8vnU2Kkan8y3oKmgsiErUTuKlbme3aTd1JLXSlmclSyYdb7TJjTjnNzqla87l4b rq0NzYrFFee30CM02Y/4shfw769Y5tiRTo4TmcCCgBsS2+Sx0qGngqG7d0OSMthu J2RDSaOdnM7keSo9LTC7rGYSxvjBqBpxASl1XqmNeYUXeYYfqre5u1uS1ZkXeqkQ pDqr3dMmEsxNr19uXPnyqdQBwPH4SAvRCrZ0wlmyhIE94JPhzbPRHmJNoCFuJoUP /fUajBI/W8qm3T/3SzvXZ4wE9pxuqJg6jBFMHdEqA0BhWHaBvOg88KFsJff1gzlW pnfn1EKVYXW4pqKR+FI9T+aF8KJPNpKr2wQMVrHjcoZo0eEH+mi/ZN0ngYeHHSQn 5wAldOdtOcIyryyvZ9w5CYEgfu3C3G5tZFgrSGeOjDBjCPu8ijRCySgEUBazL7gd yYEYH4p5u18D99fWxXPhckiy/LWRffYsSzGaw3p/DBJJHI+5ZQUuJ3hbubioHnhl WmlJpEhqIImEu9xXct7R5Qt7+p+aGjmVevh/WUFivU931MgOlR7jFBUemf0i1Xjn hN/L2pfStHrVi6wK4VPl =c2dK -----END PGP SIGNATURE----- --55tggrzvwhw6q2vy-- From owner-svn-src-head@freebsd.org Wed Sep 14 05:42:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B044BD9755; Wed, 14 Sep 2016 05:42:56 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EDFF6A77; Wed, 14 Sep 2016 05:42:54 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id k2yBbKBpygdalk2yCbNJXg; Tue, 13 Sep 2016 23:42:53 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=sol3VE4AAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=wSLEgQkh1tfowslqv0wA:9 a=CjuIK1q_8ugA:10 a=OpeU2goXl_1Y2kLAtfwV:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 91FC61D5; Tue, 13 Sep 2016 22:42:51 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u8E5gp5r094375; Tue, 13 Sep 2016 22:42:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201609140542.u8E5gp5r094375@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test In-Reply-To: Message from Baptiste Daroussin of "Wed, 14 Sep 2016 07:00:55 +0200." <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 13 Sep 2016 22:42:51 -0700 X-CMAE-Envelope: MS4wfBFboHIxQrbBzNUzi/Z4wQ20n94KjkhQvHb6xrgew/GaxLThRm1P0MZE6MBOlzx3D/zVthbbLaBDuymvW86cWVj0kgFiIc9UMWoSTQh+F32W9ankG43J 34fNCaf2G/DJGGULmp4jAZJZZi8ubjrJHXoYSz1PtKtiCE2J5b7Cw1BBqL89oFsdKDolb5lx40LMeYjFe8ndUSQmfFxCBwPx5VOA6exPs7EK0b2NSksFxF4T OpBKi04+DvOLJFJjq//PHff+LH1P72Dv7VwHQYrRzLT2lBhb/8oCUovi5zqdkaQ55MsoiZecw1TFr8Cl7uDC2g== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 05:42:56 -0000 In message <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net>, Baptiste Da roussin writes: > > > --55tggrzvwhw6q2vy > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: > > Author: cy > > Date: Wed Sep 14 01:47:01 2016 > > New Revision: 305787 > > URL: https://svnweb.freebsd.org/changeset/base/305787 > >=20 > > Log: > > Switch from .CURDIR to the simpler, more legible SRCTOP. > > =20 > > Suggested by: emaste > > X-MFC-with: upcoming amd upgrade > >=20 > > I thought the plans was more to deprecated and remove amd at some points gi= > ven > we now have autofs/automountd? Am I missing something? The upgrade was suggested by pfg@. Additionally, amd does support different maps based upon the client hostname, which I recall from my Solaris and RH Linux days automountd doesn't do (when using a mapping service such as NIS or LDAP, though automountd can do the same using local files). Comparing amd to Solaris, amd has the function of the Solaris automounter and vold in a single daemon. Previous versions weren't compatible with Sun automount maps however this version is, though I'm not sure if I want to enable that first pass. Back in the days when I was the Solaris Team Lead for the BC Government we used vendor automountd for /home and /net while using amd for certain NFS shares (e.g. /usr/common depending on where the server was), depending on architecture, e.g Sun Sparc Solaris, Tru64, DG/UX and HP-UX. Automountd couldn't do that and the only other option was mounts in fstab and vfstab. It appears there is some development upstream, albeit it's slow, but their repo has had activity over the last year. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Sep 14 06:15:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 751A7BDA19E; Wed, 14 Sep 2016 06:15:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30B6AD62; Wed, 14 Sep 2016 06:15:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E6FkIK069987; Wed, 14 Sep 2016 06:15:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E6FkkX069984; Wed, 14 Sep 2016 06:15:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140615.u8E6FkkX069984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 06:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305788 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 06:15:47 -0000 Author: sephe Date: Wed Sep 14 06:15:45 2016 New Revision: 305788 URL: https://svnweb.freebsd.org/changeset/base/305788 Log: hyperv/hn: Pull RSS key and indirect table setup up. This paves the way for the dynamic RSS key and indirect table setting. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7864 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 01:47:01 2016 (r305787) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:15:45 2016 (r305788) @@ -368,6 +368,14 @@ static void hn_xmit_txeof(struct hn_tx_r static void hn_xmit_taskfunc(void *, int); static void hn_xmit_txeof_taskfunc(void *, int); +static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { + 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, + 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, + 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, + 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, + 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa +}; + #if __FreeBSD_version >= 1100099 static void hn_set_lro_lenlim(struct hn_softc *sc, int lenlim) @@ -3146,7 +3154,8 @@ hn_synth_alloc_subchans(struct hn_softc static int hn_synth_attach(struct hn_softc *sc, int mtu) { - int error, nsubch; + struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; + int error, nsubch, nchan, i; /* * Attach the primary channel _before_ attaching NVS and RNDIS. @@ -3180,7 +3189,9 @@ hn_synth_attach(struct hn_softc *sc, int error = hn_synth_alloc_subchans(sc, &nsubch); if (error) return (error); - if (nsubch == 0) { + + nchan = nsubch + 1; + if (nchan == 1) { /* Only the primary channel can be used; done */ goto back; } @@ -3189,20 +3200,29 @@ hn_synth_attach(struct hn_softc *sc, int * Configure RSS key and indirect table _after_ all sub-channels * are allocated. */ - error = hn_rndis_conf_rss(sc, nsubch + 1); + + /* Setup default RSS key. */ + memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key)); + + /* Setup default RSS indirect table. */ + /* TODO: Take ndis_rss_caps.ndis_nind into account. */ + for (i = 0; i < NDIS_HASH_INDCNT; ++i) + rss->rss_ind[i] = i % nchan; + + error = hn_rndis_conf_rss(sc); if (error) { /* * Failed to configure RSS key or indirect table; only * the primary channel can be used. */ - nsubch = 0; + nchan = 1; } back: /* * Set the # of TX/RX rings that could be used according to * the # of channels that NVS offered. */ - hn_set_ring_inuse(sc, nsubch + 1); + hn_set_ring_inuse(sc, nchan); /* * Attach the sub-channels, if any. Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Sep 14 01:47:01 2016 (r305787) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Sep 14 06:15:45 2016 (r305788) @@ -510,14 +510,6 @@ hn_rndis_get_linkstatus(struct hn_softc return (0); } -static uint8_t netvsc_hash_key[NDIS_HASH_KEYSIZE_TOEPLITZ] = { - 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, - 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, - 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, - 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, - 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa -}; - static const void * hn_rndis_xact_exec1(struct hn_softc *sc, struct vmbus_xact *xact, size_t reqlen, struct hn_send_ctx *sndc, size_t *comp_len) @@ -845,11 +837,11 @@ hn_rndis_conf_offload(struct hn_softc *s } int -hn_rndis_conf_rss(struct hn_softc *sc, int nchan) +hn_rndis_conf_rss(struct hn_softc *sc) { struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; struct ndis_rss_params *prm = &rss->rss_params; - int i, error; + int error; /* * Only NDIS 6.30+ is supported. @@ -857,7 +849,12 @@ hn_rndis_conf_rss(struct hn_softc *sc, i KASSERT(sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30, ("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); - memset(rss, 0, sizeof(*rss)); + /* + * NOTE: + * DO NOT whack rss_key and rss_ind, which are setup by the caller. + */ + memset(prm, 0, sizeof(*prm)); + prm->ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_PARAMS; prm->ndis_hdr.ndis_rev = NDIS_RSS_PARAMS_REV_2; prm->ndis_hdr.ndis_size = sizeof(*rss); @@ -872,14 +869,6 @@ hn_rndis_conf_rss(struct hn_softc *sc, i prm->ndis_keyoffset = __offsetof(struct ndis_rssprm_toeplitz, rss_key[0]); - /* Setup RSS key */ - memcpy(rss->rss_key, netvsc_hash_key, sizeof(rss->rss_key)); - - /* Setup RSS indirect table */ - /* TODO: Take ndis_rss_caps.ndis_nind into account */ - for (i = 0; i < NDIS_HASH_INDCNT; ++i) - rss->rss_ind[i] = i % nchan; - error = hn_rndis_set(sc, OID_GEN_RECEIVE_SCALE_PARAMETERS, rss, sizeof(*rss)); if (error) { Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Sep 14 01:47:01 2016 (r305787) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Sep 14 06:15:45 2016 (r305788) @@ -118,7 +118,7 @@ uint32_t hn_chim_alloc(struct hn_softc * void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); int hn_rndis_attach(struct hn_softc *sc); -int hn_rndis_conf_rss(struct hn_softc *sc, int nchan); +int hn_rndis_conf_rss(struct hn_softc *sc); void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, size_t pktsize, size_t pi_dlen, uint32_t pi_type); int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt); From owner-svn-src-head@freebsd.org Wed Sep 14 06:30:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5755BBDA3D8; Wed, 14 Sep 2016 06:30:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA9329F; Wed, 14 Sep 2016 06:30:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E6UENX073817; Wed, 14 Sep 2016 06:30:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E6UEIU073816; Wed, 14 Sep 2016 06:30:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140630.u8E6UEIU073816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 06:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305789 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 06:30:15 -0000 Author: sephe Date: Wed Sep 14 06:30:14 2016 New Revision: 305789 URL: https://svnweb.freebsd.org/changeset/base/305789 Log: hyperv/vmbus: Make sure that the sub-channel count is valid. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7865 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Sep 14 06:15:45 2016 (r305788) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Sep 14 06:30:14 2016 (r305789) @@ -1346,6 +1346,8 @@ vmbus_subchan_get(struct vmbus_channel * struct vmbus_channel **ret, *chan; int i; + KASSERT(subchan_cnt > 0, ("invalid sub-channel count %d", subchan_cnt)); + ret = malloc(subchan_cnt * sizeof(struct vmbus_channel *), M_TEMP, M_WAITOK); From owner-svn-src-head@freebsd.org Wed Sep 14 06:47:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD91DBDA6B7; Wed, 14 Sep 2016 06:47:26 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66B3FCCE; Wed, 14 Sep 2016 06:47:26 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E6lPUg081236; Wed, 14 Sep 2016 06:47:25 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E6lPmT081234; Wed, 14 Sep 2016 06:47:25 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140647.u8E6lPmT081234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 06:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305790 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 06:47:26 -0000 Author: sephe Date: Wed Sep 14 06:47:25 2016 New Revision: 305790 URL: https://svnweb.freebsd.org/changeset/base/305790 Log: hyperv/hn: Remove unused softc field MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7866 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 06:30:14 2016 (r305789) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 06:47:25 2016 (r305790) @@ -202,7 +202,6 @@ typedef struct hn_softc { struct ifnet *hn_ifp; struct ifmedia hn_media; device_t hn_dev; - uint8_t hn_unit; int hn_carrier; int hn_if_flags; struct mtx hn_lock; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:30:14 2016 (r305789) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:47:25 2016 (r305790) @@ -455,7 +455,6 @@ netvsc_attach(device_t dev) uint8_t eaddr[ETHER_ADDR_LEN]; uint32_t link_status; hn_softc_t *sc; - int unit = device_get_unit(dev); struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; #if __FreeBSD_version >= 1100045 @@ -464,7 +463,6 @@ netvsc_attach(device_t dev) sc = device_get_softc(dev); - sc->hn_unit = unit; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -1855,11 +1853,9 @@ hn_ifinit(void *xsc) static void hn_watchdog(struct ifnet *ifp) { - hn_softc_t *sc; - sc = ifp->if_softc; - printf("hn%d: watchdog timeout -- resetting\n", sc->hn_unit); - hn_ifinit(sc); /*???*/ + if_printf(ifp, "watchdog timeout -- resetting\n"); + hn_ifinit(ifp->if_softc); /* XXX */ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } #endif From owner-svn-src-head@freebsd.org Wed Sep 14 08:00:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 349E7BDA9B1; Wed, 14 Sep 2016 08:00:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 104093F8; Wed, 14 Sep 2016 08:00:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E80ViC007790; Wed, 14 Sep 2016 08:00:31 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E80Vf3007788; Wed, 14 Sep 2016 08:00:31 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140800.u8E80Vf3007788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305791 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 08:00:32 -0000 Author: sephe Date: Wed Sep 14 08:00:30 2016 New Revision: 305791 URL: https://svnweb.freebsd.org/changeset/base/305791 Log: hyperv/hn: Deprecate hn_softc_t MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7867 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 06:47:25 2016 (r305790) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 08:00:30 2016 (r305791) @@ -198,7 +198,7 @@ struct hn_tx_ring { /* * Device-specific softc structure */ -typedef struct hn_softc { +struct hn_softc { struct ifnet *hn_ifp; struct ifmedia hn_media; device_t hn_dev; @@ -243,7 +243,7 @@ typedef struct hn_softc { uint32_t hn_ndis_ver; struct ndis_rssprm_toeplitz hn_rss; -} hn_softc_t; +}; #define HN_FLAG_RXBUF_CONNECTED 0x0001 #define HN_FLAG_CHIM_CONNECTED 0x0002 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 06:47:25 2016 (r305790) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:00:30 2016 (r305791) @@ -312,8 +312,8 @@ static u_int hn_cpu_index; /* * Forward declarations */ -static void hn_stop(hn_softc_t *sc); -static void hn_ifinit_locked(hn_softc_t *sc); +static void hn_stop(struct hn_softc *sc); +static void hn_ifinit_locked(struct hn_softc *sc); static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int hn_start_locked(struct hn_tx_ring *txr, int len); @@ -450,19 +450,17 @@ netvsc_probe(device_t dev) static int netvsc_attach(device_t dev) { + struct hn_softc *sc = device_get_softc(dev); struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; uint8_t eaddr[ETHER_ADDR_LEN]; uint32_t link_status; - hn_softc_t *sc; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; #if __FreeBSD_version >= 1100045 int tso_maxlen; #endif - sc = device_get_softc(dev); - sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -1495,7 +1493,7 @@ skip: static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - hn_softc_t *sc = ifp->if_softc; + struct hn_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; @@ -1708,11 +1706,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, return (error); } -/* - * - */ static void -hn_stop(hn_softc_t *sc) +hn_stop(struct hn_softc *sc) { struct ifnet *ifp; int ret, i; @@ -1791,11 +1786,8 @@ do_sched: } } -/* - * - */ static void -hn_ifinit_locked(hn_softc_t *sc) +hn_ifinit_locked(struct hn_softc *sc) { struct ifnet *ifp; int ret, i; @@ -1829,7 +1821,7 @@ hn_ifinit_locked(hn_softc_t *sc) static void hn_ifinit(void *xsc) { - hn_softc_t *sc = xsc; + struct hn_softc *sc = xsc; NV_LOCK(sc); if (sc->temp_unusable) { @@ -3485,7 +3477,7 @@ static device_method_t netvsc_methods[] static driver_t netvsc_driver = { NETVSC_DEVNAME, netvsc_methods, - sizeof(hn_softc_t) + sizeof(struct hn_softc) }; static devclass_t netvsc_devclass; From owner-svn-src-head@freebsd.org Wed Sep 14 08:08:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F59EBDAB25; Wed, 14 Sep 2016 08:08:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5326CA7D; Wed, 14 Sep 2016 08:08:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E88jiR011501; Wed, 14 Sep 2016 08:08:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E88jvV011500; Wed, 14 Sep 2016 08:08:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140808.u8E88jvV011500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305792 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 08:08:46 -0000 Author: sephe Date: Wed Sep 14 08:08:45 2016 New Revision: 305792 URL: https://svnweb.freebsd.org/changeset/base/305792 Log: hyperv/hn: Function renaming: hn_ifinit -> hn_init No functional changes. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7868 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:00:30 2016 (r305791) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:08:45 2016 (r305792) @@ -313,8 +313,8 @@ static u_int hn_cpu_index; * Forward declarations */ static void hn_stop(struct hn_softc *sc); -static void hn_ifinit_locked(struct hn_softc *sc); -static void hn_ifinit(void *xsc); +static void hn_init_locked(struct hn_softc *sc); +static void hn_init(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int hn_start_locked(struct hn_tx_ring *txr, int len); static void hn_start(struct ifnet *ifp); @@ -544,7 +544,7 @@ netvsc_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; - ifp->if_init = hn_ifinit; + ifp->if_init = hn_init; ifp->if_mtu = ETHERMTU; if (hn_use_if_start) { int qdepth = hn_get_txswq_depth(&sc->hn_tx_ring[0]); @@ -1508,7 +1508,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (ifa->ifa_addr->sa_family == AF_INET) { ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - hn_ifinit(sc); + hn_init(sc); arp_ifinit(ifp, ifa); } else #endif @@ -1583,7 +1583,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); - hn_ifinit_locked(sc); + hn_init_locked(sc); NV_LOCK(sc); sc->temp_unusable = FALSE; @@ -1629,7 +1629,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, /* do something here for Hyper-V */ } else #endif - hn_ifinit_locked(sc); + hn_init_locked(sc); } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { hn_stop(sc); @@ -1787,7 +1787,7 @@ do_sched: } static void -hn_ifinit_locked(struct hn_softc *sc) +hn_init_locked(struct hn_softc *sc) { struct ifnet *ifp; int ret, i; @@ -1819,7 +1819,7 @@ hn_ifinit_locked(struct hn_softc *sc) * */ static void -hn_ifinit(void *xsc) +hn_init(void *xsc) { struct hn_softc *sc = xsc; @@ -1831,7 +1831,7 @@ hn_ifinit(void *xsc) sc->temp_unusable = TRUE; NV_UNLOCK(sc); - hn_ifinit_locked(sc); + hn_init_locked(sc); NV_LOCK(sc); sc->temp_unusable = FALSE; @@ -1847,7 +1847,7 @@ hn_watchdog(struct ifnet *ifp) { if_printf(ifp, "watchdog timeout -- resetting\n"); - hn_ifinit(ifp->if_softc); /* XXX */ + hn_init(ifp->if_softc); /* XXX */ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } #endif From owner-svn-src-head@freebsd.org Wed Sep 14 08:24:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2E0DBDA0A7; Wed, 14 Sep 2016 08:24:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC765F7; Wed, 14 Sep 2016 08:24:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8O1ZE018703; Wed, 14 Sep 2016 08:24:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8O1L4018702; Wed, 14 Sep 2016 08:24:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140824.u8E8O1L4018702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305793 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 08:24:03 -0000 Author: sephe Date: Wed Sep 14 08:24:01 2016 New Revision: 305793 URL: https://svnweb.freebsd.org/changeset/base/305793 Log: hyperv/hn: Cleanup hn_ioctl. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7869 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:08:45 2016 (r305792) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:24:01 2016 (r305793) @@ -1495,27 +1495,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, { struct hn_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; -#ifdef INET - struct ifaddr *ifa = (struct ifaddr *)data; -#endif int mask, error = 0; int retry_cnt = 500; - switch(cmd) { - - case SIOCSIFADDR: -#ifdef INET - if (ifa->ifa_addr->sa_family == AF_INET) { - ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - hn_init(sc); - arp_ifinit(ifp, ifa); - } else -#endif - error = ether_ioctl(ifp, cmd, data); - break; + switch (cmd) { case SIOCSIFMTU: - /* Check MTU value change */ if (ifp->if_mtu == ifr->ifr_mtu) break; @@ -1589,6 +1573,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; + case SIOCSIFFLAGS: do { NV_LOCK(sc); @@ -1639,8 +1624,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, sc->temp_unusable = FALSE; NV_UNLOCK(sc); sc->hn_if_flags = ifp->if_flags; - error = 0; break; + case SIOCSIFCAP: NV_LOCK(sc); @@ -1679,30 +1664,27 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } NV_UNLOCK(sc); - error = 0; break; + case SIOCADDMULTI: case SIOCDELMULTI: -#ifdef notyet - /* Fixme: Multicast mode? */ - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - NV_LOCK(sc); - netvsc_setmulti(sc); - NV_UNLOCK(sc); - error = 0; - } -#endif - error = EINVAL; + /* Always all-multi */ + /* + * TODO: + * Enable/disable all-multi according to the emptiness of + * the mcast address list. + */ break; + case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd); break; + default: error = ether_ioctl(ifp, cmd, data); break; } - return (error); } From owner-svn-src-head@freebsd.org Wed Sep 14 08:33:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C785BDA25B; Wed, 14 Sep 2016 08:33:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA03B6F; Wed, 14 Sep 2016 08:33:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8X9ac022581; Wed, 14 Sep 2016 08:33:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8X9Zf022579; Wed, 14 Sep 2016 08:33:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140833.u8E8X9Zf022579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305794 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 08:33:10 -0000 Author: sephe Date: Wed Sep 14 08:33:08 2016 New Revision: 305794 URL: https://svnweb.freebsd.org/changeset/base/305794 Log: hyperv/hn: Use sx for the main lock. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7870 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 08:24:01 2016 (r305793) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Sep 14 08:33:08 2016 (r305794) @@ -204,10 +204,7 @@ struct hn_softc { device_t hn_dev; int hn_carrier; int hn_if_flags; - struct mtx hn_lock; - int hn_initdone; - /* See hv_netvsc_drv_freebsd.c for rules on how to use */ - int temp_unusable; + struct sx hn_lock; struct vmbus_channel *hn_prichan; int hn_rx_ring_cnt; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:24:01 2016 (r305793) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:33:08 2016 (r305794) @@ -195,21 +195,12 @@ struct hn_txdesc { #define HN_LRO_ACKCNT_DEF 1 -/* - * Be aware that this sleepable mutex will exhibit WITNESS errors when - * certain TCP and ARP code paths are taken. This appears to be a - * well-known condition, as all other drivers checked use a sleeping - * mutex to protect their transmit paths. - * Also Be aware that mutexes do not play well with semaphores, and there - * is a conflicting semaphore in a certain channel code path. - */ -#define NV_LOCK_INIT(_sc, _name) \ - mtx_init(&(_sc)->hn_lock, _name, MTX_NETWORK_LOCK, MTX_DEF) -#define NV_LOCK(_sc) mtx_lock(&(_sc)->hn_lock) -#define NV_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->hn_lock, MA_OWNED) -#define NV_UNLOCK(_sc) mtx_unlock(&(_sc)->hn_lock) -#define NV_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->hn_lock) - +#define HN_LOCK_INIT(sc) \ + sx_init(&(sc)->hn_lock, device_get_nameunit((sc)->hn_dev)) +#define HN_LOCK_ASSERT(sc) sx_assert(&(sc)->hn_lock, SA_XLOCKED) +#define HN_LOCK_DESTROY(sc) sx_destroy(&(sc)->hn_lock) +#define HN_LOCK(sc) sx_xlock(&(sc)->hn_lock) +#define HN_UNLOCK(sc) sx_xunlock(&(sc)->hn_lock) /* * Globals @@ -463,6 +454,7 @@ netvsc_attach(device_t dev) sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); + HN_LOCK_INIT(sc); if (hn_tx_taskq == NULL) { sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, @@ -484,7 +476,6 @@ netvsc_attach(device_t dev) } else { sc->hn_tx_taskq = hn_tx_taskq; } - NV_LOCK_INIT(sc, "NetVSCLock"); ifp = sc->hn_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; @@ -669,6 +660,7 @@ netvsc_detach(device_t dev) taskqueue_free(sc->hn_tx_taskq); vmbus_xact_ctx_destroy(sc->hn_xact); + HN_LOCK_DESTROY(sc); return (0); } @@ -1475,39 +1467,27 @@ skip: return (0); } -/* - * Rules for using sc->temp_unusable: - * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() - * 2. code reading sc->temp_unusable under NV_LOCK(), and finding - * sc->temp_unusable set, must release NV_LOCK() and exit - * 3. to retain exclusive control of the interface, - * sc->temp_unusable must be set by code before releasing NV_LOCK() - * 4. only code setting sc->temp_unusable can clear sc->temp_unusable - * 5. code setting sc->temp_unusable must eventually clear sc->temp_unusable - */ - -/* - * Standard ioctl entry point. Called when the user wants to configure - * the interface. - */ static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct hn_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int mask, error = 0; - int retry_cnt = 500; - + switch (cmd) { case SIOCSIFMTU: - if (ifp->if_mtu == ifr->ifr_mtu) - break; - if (ifr->ifr_mtu > NETVSC_MAX_CONFIGURABLE_MTU) { error = EINVAL; break; } + HN_LOCK(sc); + + if (ifp->if_mtu == ifr->ifr_mtu) { + HN_UNLOCK(sc); + break; + } + /* Obtain and record requested MTU */ ifp->if_mtu = ifr->ifr_mtu; @@ -1516,40 +1496,18 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, * Make sure that LRO aggregation length limit is still * valid, after the MTU change. */ - NV_LOCK(sc); if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp)) hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp)); - NV_UNLOCK(sc); #endif - do { - NV_LOCK(sc); - if (!sc->temp_unusable) { - sc->temp_unusable = TRUE; - retry_cnt = -1; - } - NV_UNLOCK(sc); - if (retry_cnt > 0) { - retry_cnt--; - DELAY(5 * 1000); - } - } while (retry_cnt > 0); - - if (retry_cnt == 0) { - error = EINVAL; - break; - } - /* We must remove and add back the device to cause the new * MTU to take effect. This includes tearing down, but not * deleting the channel, then bringing it back up. */ error = hv_rf_on_device_remove(sc); if (error) { - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); + HN_UNLOCK(sc); break; } @@ -1569,29 +1527,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_init_locked(sc); - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); + HN_UNLOCK(sc); break; case SIOCSIFFLAGS: - do { - NV_LOCK(sc); - if (!sc->temp_unusable) { - sc->temp_unusable = TRUE; - retry_cnt = -1; - } - NV_UNLOCK(sc); - if (retry_cnt > 0) { - retry_cnt--; - DELAY(5 * 1000); - } - } while (retry_cnt > 0); - - if (retry_cnt == 0) { - error = EINVAL; - break; - } + HN_LOCK(sc); if (ifp->if_flags & IFF_UP) { /* @@ -1620,14 +1560,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_stop(sc); } } - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); sc->hn_if_flags = ifp->if_flags; + + HN_UNLOCK(sc); break; case SIOCSIFCAP: - NV_LOCK(sc); + HN_LOCK(sc); mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { @@ -1663,7 +1602,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, ifp->if_hwassist &= ~CSUM_IP6_TSO; } - NV_UNLOCK(sc); + HN_UNLOCK(sc); break; case SIOCADDMULTI: @@ -1694,6 +1633,8 @@ hn_stop(struct hn_softc *sc) struct ifnet *ifp; int ret, i; + HN_LOCK_ASSERT(sc); + ifp = sc->hn_ifp; if (bootverbose) @@ -1705,7 +1646,6 @@ hn_stop(struct hn_softc *sc) sc->hn_tx_ring[i].hn_oactive = 0; if_link_state_change(ifp, LINK_STATE_DOWN); - sc->hn_initdone = 0; ret = hv_rf_on_close(sc); } @@ -1774,6 +1714,8 @@ hn_init_locked(struct hn_softc *sc) struct ifnet *ifp; int ret, i; + HN_LOCK_ASSERT(sc); + ifp = sc->hn_ifp; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { @@ -1783,11 +1725,8 @@ hn_init_locked(struct hn_softc *sc) hv_promisc_mode = 1; ret = hv_rf_on_open(sc); - if (ret != 0) { + if (ret != 0) return; - } else { - sc->hn_initdone = 1; - } atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) @@ -1797,27 +1736,14 @@ hn_init_locked(struct hn_softc *sc) if_link_state_change(ifp, LINK_STATE_UP); } -/* - * - */ static void hn_init(void *xsc) { struct hn_softc *sc = xsc; - NV_LOCK(sc); - if (sc->temp_unusable) { - NV_UNLOCK(sc); - return; - } - sc->temp_unusable = TRUE; - NV_UNLOCK(sc); - + HN_LOCK(sc); hn_init_locked(sc); - - NV_LOCK(sc); - sc->temp_unusable = FALSE; - NV_UNLOCK(sc); + HN_UNLOCK(sc); } #ifdef LATER @@ -1848,13 +1774,15 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS if (error || req->newptr == NULL) return error; + HN_LOCK(sc); if (lenlim < HN_LRO_LENLIM_MIN(sc->hn_ifp) || - lenlim > TCP_LRO_LENGTH_MAX) + lenlim > TCP_LRO_LENGTH_MAX) { + HN_UNLOCK(sc); return EINVAL; - - NV_LOCK(sc); + } hn_set_lro_lenlim(sc, lenlim); - NV_UNLOCK(sc); + HN_UNLOCK(sc); + return 0; } @@ -1881,10 +1809,10 @@ hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS * count limit. */ --ackcnt; - NV_LOCK(sc); + HN_LOCK(sc); for (i = 0; i < sc->hn_rx_ring_inuse; ++i) sc->hn_rx_ring[i].hn_lro.lro_ackcnt_lim = ackcnt; - NV_UNLOCK(sc); + HN_UNLOCK(sc); return 0; } @@ -1905,7 +1833,7 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG if (error || req->newptr == NULL) return error; - NV_LOCK(sc); + HN_LOCK(sc); for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; @@ -1914,7 +1842,7 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG else rxr->hn_trust_hcsum &= ~hcsum; } - NV_UNLOCK(sc); + HN_UNLOCK(sc); return 0; } @@ -1932,7 +1860,9 @@ hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS) if (chim_size > sc->hn_chim_szmax || chim_size <= 0) return EINVAL; + HN_LOCK(sc); hn_set_chim_size(sc, chim_size); + HN_UNLOCK(sc); return 0; } @@ -2028,12 +1958,12 @@ hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARG if (error || req->newptr == NULL) return error; - NV_LOCK(sc); + HN_LOCK(sc); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { txr = &sc->hn_tx_ring[i]; *((int *)((uint8_t *)txr + ofs)) = conf; } - NV_UNLOCK(sc); + HN_UNLOCK(sc); return 0; } @@ -2677,10 +2607,8 @@ hn_set_chim_size(struct hn_softc *sc, in { int i; - NV_LOCK(sc); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_chim_size = chim_size; - NV_UNLOCK(sc); } static void From owner-svn-src-head@freebsd.org Wed Sep 14 08:48:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05873BDA535; Wed, 14 Sep 2016 08:48:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4E1C2FC; Wed, 14 Sep 2016 08:48:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8m9hw026582; Wed, 14 Sep 2016 08:48:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8m9oN026581; Wed, 14 Sep 2016 08:48:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140848.u8E8m9oN026581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305795 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 08:48:10 -0000 Author: sephe Date: Wed Sep 14 08:48:08 2016 New Revision: 305795 URL: https://svnweb.freebsd.org/changeset/base/305795 Log: hyperv/hn: Bring in shims from stable/10 This eases future MFCs to stable/10. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7871 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:33:08 2016 (r305794) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:48:08 2016 (r305795) @@ -318,8 +318,12 @@ static int hn_lro_ackcnt_sysctl(SYSCTL_H #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS); -static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); +#if __FreeBSD_version < 1100095 +static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS); +#else static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); +#endif +static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); static int hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS); @@ -1866,32 +1870,33 @@ hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS) return 0; } +#if __FreeBSD_version < 1100095 static int -hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - u_long stat; + uint64_t stat; stat = 0; - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - stat += *((u_long *)((uint8_t *)rxr + ofs)); + stat += *((int *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_long(oidp, &stat, 0, req); + error = sysctl_handle_64(oidp, &stat, 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - *((u_long *)((uint8_t *)rxr + ofs)) = 0; + *((int *)((uint8_t *)rxr + ofs)) = 0; } return 0; } - +#else static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1918,6 +1923,34 @@ hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARG return 0; } +#endif + +static int +hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error; + struct hn_rx_ring *rxr; + u_long stat; + + stat = 0; + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + rxr = &sc->hn_rx_ring[i]; + stat += *((u_long *)((uint8_t *)rxr + ofs)); + } + + error = sysctl_handle_long(oidp, &stat, 0, req); + if (error || req->newptr == NULL) + return error; + + /* Zero out this stat. */ + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + rxr = &sc->hn_rx_ring[i]; + *((u_long *)((uint8_t *)rxr + ofs)) = 0; + } + return 0; +} + static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) { @@ -2168,11 +2201,21 @@ hn_create_rx_data(struct hn_softc *sc, i SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_queued), - hn_rx_stat_u64_sysctl, "LU", "LRO queued"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO queued"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_flushed), - hn_rx_stat_u64_sysctl, "LU", "LRO flushed"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO flushed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried", CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro_tried), From owner-svn-src-head@freebsd.org Wed Sep 14 08:59:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 223E6BDA824; Wed, 14 Sep 2016 08:59:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC0FCDC1; Wed, 14 Sep 2016 08:59:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E8xEWu030419; Wed, 14 Sep 2016 08:59:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E8xDuc030418; Wed, 14 Sep 2016 08:59:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140859.u8E8xDuc030418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 08:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305796 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 08:59:15 -0000 Author: sephe Date: Wed Sep 14 08:59:13 2016 New Revision: 305796 URL: https://svnweb.freebsd.org/changeset/base/305796 Log: hyperv/hn: Remove the FreeBSD_version check for TSO configuration It is available on both stable/10 and stable/11. This eases future MFCs to stable/10. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7872 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:48:08 2016 (r305795) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 08:59:13 2016 (r305796) @@ -232,12 +232,10 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosti "Trust ip packet verification on host side, " "when csum info is missing (global setting)"); -#if __FreeBSD_version >= 1100045 /* Limit TSO burst size */ static int hn_tso_maxlen = 0; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, &hn_tso_maxlen, 0, "TSO burst limit"); -#endif /* Limit chimney send size */ static int hn_tx_chimney_size = 0; @@ -452,9 +450,7 @@ netvsc_attach(device_t dev) uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; -#if __FreeBSD_version >= 1100045 int tso_maxlen; -#endif sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -587,7 +583,6 @@ netvsc_attach(device_t dev) if (link_status == NDIS_MEDIA_STATE_CONNECTED) sc->hn_carrier = 1; -#if __FreeBSD_version >= 1100045 tso_maxlen = hn_tso_maxlen; if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) tso_maxlen = IP_MAXPACKET; @@ -596,17 +591,14 @@ netvsc_attach(device_t dev) ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ifp->if_hw_tsomax = tso_maxlen - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); -#endif error = hn_rndis_get_eaddr(sc, eaddr); if (error) goto failed; ether_ifattach(ifp, eaddr); -#if __FreeBSD_version >= 1100045 if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); -#endif hn_set_chim_size(sc, sc->hn_chim_szmax); if (hn_tx_chimney_size > 0 && From owner-svn-src-head@freebsd.org Wed Sep 14 09:17:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71CE2BD8007; Wed, 14 Sep 2016 09:17:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41D76352; Wed, 14 Sep 2016 09:17:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8E9H0fo038226; Wed, 14 Sep 2016 09:17:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8E9H0o7038225; Wed, 14 Sep 2016 09:17:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609140917.u8E9H0o7038225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 14 Sep 2016 09:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305801 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 09:17:01 -0000 Author: sephe Date: Wed Sep 14 09:17:00 2016 New Revision: 305801 URL: https://svnweb.freebsd.org/changeset/base/305801 Log: hyperv/hn: Fix some ifnet settings - ifnet.if_mtu does not require explicit setting. - ifnet.if_hdrlen must be set after ether_ifattach(). MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7873 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 09:13:17 2016 (r305800) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 14 09:17:00 2016 (r305801) @@ -536,7 +536,6 @@ netvsc_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; ifp->if_init = hn_init; - ifp->if_mtu = ETHERMTU; if (hn_use_if_start) { int qdepth = hn_get_txswq_depth(&sc->hn_tx_ring[0]); @@ -558,7 +557,6 @@ netvsc_attach(device_t dev) /* * Tell upper layers that we support full VLAN capability. */ - ifp->if_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO | IFCAP_LRO; @@ -600,6 +598,9 @@ netvsc_attach(device_t dev) if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); + /* Inform the upper layer about the long frame support. */ + ifp->if_hdrlen = sizeof(struct ether_vlan_header); + hn_set_chim_size(sc, sc->hn_chim_szmax); if (hn_tx_chimney_size > 0 && hn_tx_chimney_size < sc->hn_chim_szmax) From owner-svn-src-head@freebsd.org Wed Sep 14 11:16:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1ABAC4435; Wed, 14 Sep 2016 11:16:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8DFF51E1C; Wed, 14 Sep 2016 11:16:01 +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 u8EBG0gU082901; Wed, 14 Sep 2016 11:16:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EBG06e082899; Wed, 14 Sep 2016 11:16:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609141116.u8EBG06e082899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 14 Sep 2016 11:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305804 - head/sys/boot/kshim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 11:16:01 -0000 Author: hselasky Date: Wed Sep 14 11:16:00 2016 New Revision: 305804 URL: https://svnweb.freebsd.org/changeset/base/305804 Log: Make the callout structure in the boot loader's kernel shim more similar to the kernel one. MFC after: 1 week Modified: head/sys/boot/kshim/bsd_kernel.c head/sys/boot/kshim/bsd_kernel.h Modified: head/sys/boot/kshim/bsd_kernel.c ============================================================================== --- head/sys/boot/kshim/bsd_kernel.c Wed Sep 14 10:51:06 2016 (r305803) +++ head/sys/boot/kshim/bsd_kernel.c Wed Sep 14 11:16:00 2016 (r305804) @@ -432,8 +432,8 @@ callout_callback(struct callout *c) } mtx_unlock(&mtx_callout); - if (c->func) - (c->func) (c->arg); + if (c->c_func != NULL) + (c->c_func) (c->c_arg); if (!(c->flags & CALLOUT_RETURNUNLOCKED)) mtx_unlock(c->mtx); @@ -487,8 +487,8 @@ callout_reset(struct callout *c, int to_ { callout_stop(c); - c->func = func; - c->arg = arg; + c->c_func = func; + c->c_arg = arg; c->timeout = ticks + to_ticks; mtx_lock(&mtx_callout); @@ -507,8 +507,8 @@ callout_stop(struct callout *c) } mtx_unlock(&mtx_callout); - c->func = NULL; - c->arg = NULL; + c->c_func = NULL; + c->c_arg = NULL; } void Modified: head/sys/boot/kshim/bsd_kernel.h ============================================================================== --- head/sys/boot/kshim/bsd_kernel.h Wed Sep 14 10:51:06 2016 (r305803) +++ head/sys/boot/kshim/bsd_kernel.h Wed Sep 14 11:16:00 2016 (r305804) @@ -299,8 +299,8 @@ extern volatile int ticks; struct callout { LIST_ENTRY(callout) entry; - callout_fn_t *func; - void *arg; + callout_fn_t *c_func; + void *c_arg; struct mtx *mtx; int flags; int timeout; From owner-svn-src-head@freebsd.org Wed Sep 14 11:21:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C409AC454D; Wed, 14 Sep 2016 11:21:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D5EE1125; Wed, 14 Sep 2016 11:21:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EBKxb0083888; Wed, 14 Sep 2016 11:20:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EBKx1A083885; Wed, 14 Sep 2016 11:20:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201609141120.u8EBKx1A083885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 14 Sep 2016 11:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305805 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 11:21:00 -0000 Author: trasz Date: Wed Sep 14 11:20:58 2016 New Revision: 305805 URL: https://svnweb.freebsd.org/changeset/base/305805 Log: Use proper argument order for calloc(3). MFC after: 1 month Modified: head/usr.sbin/autofs/automountd.c head/usr.sbin/autofs/autounmountd.c head/usr.sbin/autofs/defined.c Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Wed Sep 14 11:16:00 2016 (r305804) +++ head/usr.sbin/autofs/automountd.c Wed Sep 14 11:20:58 2016 (r305805) @@ -97,7 +97,7 @@ pick_option(const char *option, char **o tofree = *optionsp; - newoptions = calloc(strlen(*optionsp) + 1, 1); + newoptions = calloc(1, strlen(*optionsp) + 1); if (newoptions == NULL) log_err(1, "calloc"); Modified: head/usr.sbin/autofs/autounmountd.c ============================================================================== --- head/usr.sbin/autofs/autounmountd.c Wed Sep 14 11:16:00 2016 (r305804) +++ head/usr.sbin/autofs/autounmountd.c Wed Sep 14 11:20:58 2016 (r305805) @@ -78,7 +78,7 @@ automounted_add(fsid_t fsid, const char { struct automounted_fs *af; - af = calloc(sizeof(*af), 1); + af = calloc(1, sizeof(*af)); if (af == NULL) log_err(1, "calloc"); af->af_mount_time = time(NULL); Modified: head/usr.sbin/autofs/defined.c ============================================================================== --- head/usr.sbin/autofs/defined.c Wed Sep 14 11:16:00 2016 (r305804) +++ head/usr.sbin/autofs/defined.c Wed Sep 14 11:20:58 2016 (r305805) @@ -225,7 +225,7 @@ defined_add(const char *name, const char log_debugx("defining variable %s=%s", name, value); - d = calloc(sizeof(*d), 1); + d = calloc(1, sizeof(*d)); if (d == NULL) log_err(1, "calloc"); d->d_name = checked_strdup(name); From owner-svn-src-head@freebsd.org Wed Sep 14 12:07:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F61BDAD15; Wed, 14 Sep 2016 12:07:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6F9791CE0; Wed, 14 Sep 2016 12:07:37 +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 u8EC7aYT001983; Wed, 14 Sep 2016 12:07:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EC7Yab001962; Wed, 14 Sep 2016 12:07:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609141207.u8EC7Yab001962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 14 Sep 2016 12:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305806 - in head/sys/dev/usb: . input quirk serial storage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 12:07:37 -0000 Author: hselasky Date: Wed Sep 14 12:07:34 2016 New Revision: 305806 URL: https://svnweb.freebsd.org/changeset/base/305806 Log: Improve USB polling mode by not locking any mutexes, asserting any mutexes or using any callouts when active. Trying to lock a mutex when KDB is active or the scheduler is stopped can result in infinite wait loops. The same goes for calling callout related functions which in turn lock mutexes. If the USB controller at which a USB keyboard is connected is idle when KDB is entered, polling the USB keyboard via USB will always succeed. Else polling may fail depending on which state the USB subsystem and USB interrupt handler is in. This is unavoidable unless KDB can wait for USB interrupt threads to complete before stalling the CPU(s). Tested by: Bruce Evans MFC after: 4 weeks Modified: head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usb_busdma.c head/sys/dev/usb/usb_core.c head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/input/ukbd.c Wed Sep 14 12:07:34 2016 (r305806) @@ -60,8 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include @@ -248,32 +246,9 @@ struct ukbd_softc { SCAN_PREFIX_CTL | SCAN_PREFIX_SHIFT) #define SCAN_CHAR(c) ((c) & 0x7f) -#define UKBD_LOCK() mtx_lock(&Giant) -#define UKBD_UNLOCK() mtx_unlock(&Giant) - -#ifdef INVARIANTS - -/* - * Assert that the lock is held in all contexts - * where the code can be executed. - */ -#define UKBD_LOCK_ASSERT() mtx_assert(&Giant, MA_OWNED) - -/* - * Assert that the lock is held in the contexts - * where it really has to be so. - */ -#define UKBD_CTX_LOCK_ASSERT() \ - do { \ - if (!kdb_active && panicstr == NULL) \ - mtx_assert(&Giant, MA_OWNED); \ - } while (0) -#else - -#define UKBD_LOCK_ASSERT() (void)0 -#define UKBD_CTX_LOCK_ASSERT() (void)0 - -#endif +#define UKBD_LOCK() USB_MTX_LOCK(&Giant) +#define UKBD_UNLOCK() USB_MTX_UNLOCK(&Giant) +#define UKBD_LOCK_ASSERT() USB_MTX_ASSERT(&Giant, MA_OWNED) struct ukbd_mods { uint32_t mask, key; @@ -400,7 +375,7 @@ ukbd_start_timer(struct ukbd_softc *sc) sc->sc_co_basetime += delay; /* This is rarely called, so prefer precision to efficiency. */ prec = qmin(delay >> 7, SBT_1MS * 10); - callout_reset_sbt(&sc->sc_callout.co, sc->sc_co_basetime, prec, + usb_callout_reset_sbt(&sc->sc_callout, sc->sc_co_basetime, prec, ukbd_timeout, sc, C_ABSOLUTE); } @@ -408,7 +383,7 @@ static void ukbd_put_key(struct ukbd_softc *sc, uint32_t key) { - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); DPRINTF("0x%02x (%d) %s\n", key, key, (key & KEY_RELEASE) ? "released" : "pressed"); @@ -429,12 +404,12 @@ static void ukbd_do_poll(struct ukbd_softc *sc, uint8_t wait) { - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); KASSERT((sc->sc_flags & UKBD_FLAG_POLLING) != 0, ("ukbd_do_poll called when not polling\n")); DPRINTFN(2, "polling\n"); - if (!kdb_active && !SCHEDULER_STOPPED()) { + if (USB_IN_POLLING_MODE_FUNC() == 0) { /* * In this context the kernel is polling for input, * but the USB subsystem works in normal interrupt-driven @@ -479,9 +454,9 @@ ukbd_get_key(struct ukbd_softc *sc, uint { int32_t c; - UKBD_CTX_LOCK_ASSERT(); - KASSERT((!kdb_active && !SCHEDULER_STOPPED()) - || (sc->sc_flags & UKBD_FLAG_POLLING) != 0, + UKBD_LOCK_ASSERT(); + KASSERT((USB_IN_POLLING_MODE_FUNC() == 0) || + (sc->sc_flags & UKBD_FLAG_POLLING) != 0, ("not polling in kdb or panic\n")); if (sc->sc_inputs == 0 && @@ -519,7 +494,7 @@ ukbd_interrupt(struct ukbd_softc *sc) uint8_t i; uint8_t j; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (sc->sc_ndata.keycode[0] == KEY_ERROR) return; @@ -615,7 +590,7 @@ ukbd_event_keyinput(struct ukbd_softc *s { int c; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if ((sc->sc_flags & UKBD_FLAG_POLLING) != 0) return; @@ -838,7 +813,7 @@ ukbd_intr_callback(struct usb_xfer *xfer ukbd_interrupt(sc); - if (ukbd_any_key_pressed(sc)) { + if (ukbd_any_key_pressed(sc) != 0) { ukbd_start_timer(sc); } @@ -1507,7 +1482,7 @@ ukbd_check(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (0); @@ -1532,7 +1507,7 @@ ukbd_check_char_locked(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (0); @@ -1569,7 +1544,7 @@ ukbd_read(keyboard_t *kbd, int wait) #endif - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (-1); @@ -1618,7 +1593,7 @@ ukbd_read_char_locked(keyboard_t *kbd, i uint32_t scancode; #endif - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd)) return (NOKEY); @@ -1962,7 +1937,7 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, case KDGKBSTATE: case KDSKBSTATE: case KDSETLED: - if (!mtx_owned(&Giant) && !SCHEDULER_STOPPED()) + if (!mtx_owned(&Giant) && !USB_IN_POLLING_MODE_FUNC()) return (EDEADLK); /* best I could come up with */ /* FALLTHROUGH */ default: @@ -1980,7 +1955,7 @@ ukbd_clear_state(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - UKBD_CTX_LOCK_ASSERT(); + UKBD_LOCK_ASSERT(); sc->sc_flags &= ~(UKBD_FLAG_COMPOSE | UKBD_FLAG_POLLING); sc->sc_state &= LOCK_MASK; /* preserve locking key state */ Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 14 12:07:34 2016 (r305806) @@ -659,7 +659,7 @@ usb_test_quirk_by_info(const struct usbd if (quirk == UQ_NONE) goto done; - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); for (x = 0; x != USB_DEV_QUIRKS_MAX; x++) { /* see if quirk information does not match */ @@ -683,13 +683,13 @@ usb_test_quirk_by_info(const struct usbd /* lookup quirk */ for (y = 0; y != USB_SUB_QUIRKS_MAX; y++) { if (usb_quirks[x].quirks[y] == quirk) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); DPRINTF("Found quirk '%s'.\n", usb_quirkstr(quirk)); return (1); } } } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); done: return (0); /* no quirk match */ } @@ -700,7 +700,7 @@ usb_quirk_get_entry(uint16_t vid, uint16 { uint16_t x; - mtx_assert(&usb_quirk_mtx, MA_OWNED); + USB_MTX_ASSERT(&usb_quirk_mtx, MA_OWNED); if ((vid | pid | lo_rev | hi_rev) == 0) { /* all zero - special case */ @@ -768,7 +768,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr if (y >= USB_DEV_QUIRKS_MAX) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); /* copy out data */ pgq->vid = usb_quirks[y].vid; pgq->pid = usb_quirks[y].pid; @@ -777,7 +777,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr strlcpy(pgq->quirkname, usb_quirkstr(usb_quirks[y].quirks[x]), sizeof(pgq->quirkname)); - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (0); /* success */ case USB_QUIRK_NAME_GET: @@ -810,11 +810,11 @@ usb_quirk_ioctl(unsigned long cmd, caddr if (y == UQ_NONE) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); pqe = usb_quirk_get_entry(pgq->vid, pgq->pid, pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 1); if (pqe == NULL) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (EINVAL); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -823,7 +823,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr break; } } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); if (x == USB_SUB_QUIRKS_MAX) { return (ENOMEM); } @@ -848,11 +848,11 @@ usb_quirk_ioctl(unsigned long cmd, caddr if (y == UQ_NONE) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); pqe = usb_quirk_get_entry(pgq->vid, pgq->pid, pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 0); if (pqe == NULL) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (EINVAL); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -862,7 +862,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr } } if (x == USB_SUB_QUIRKS_MAX) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (ENOMEM); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -874,7 +874,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr /* all quirk entries are unused - release */ memset(pqe, 0, sizeof(*pqe)); } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (0); /* success */ default: @@ -965,14 +965,14 @@ usb_quirk_add_entry_from_str(const char printf("%s: Too many USB quirks, only %d allowed!\n", name, USB_SUB_QUIRKS_MAX); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); new = usb_quirk_get_entry(entry.vid, entry.pid, entry.lo_rev, entry.hi_rev, 1); if (new == NULL) printf("%s: USB quirks table is full!\n", name); else memcpy(new->quirks, entry.quirks, sizeof(entry.quirks)); - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); } else { printf("%s: No USB quirks found!\n", name); } Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/serial/usb_serial.c Wed Sep 14 12:07:34 2016 (r305806) @@ -79,7 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -1575,7 +1574,7 @@ ucom_cngetc(struct consdev *cd) UCOM_MTX_UNLOCK(sc); /* poll if necessary */ - if (kdb_active && sc->sc_callback->ucom_poll) + if (USB_IN_POLLING_MODE_FUNC() && sc->sc_callback->ucom_poll) (sc->sc_callback->ucom_poll) (sc); return (c); @@ -1611,7 +1610,7 @@ ucom_cnputc(struct consdev *cd, int c) UCOM_MTX_UNLOCK(sc); /* poll if necessary */ - if (kdb_active && sc->sc_callback->ucom_poll) { + if (USB_IN_POLLING_MODE_FUNC() && sc->sc_callback->ucom_poll) { (sc->sc_callback->ucom_poll) (sc); /* simple flow control */ if (temp == 0) Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/serial/usb_serial.h Wed Sep 14 12:07:34 2016 (r305806) @@ -194,9 +194,9 @@ struct ucom_softc { uint8_t sc_jitterbuf[UCOM_JITTERBUF_SIZE]; }; -#define UCOM_MTX_ASSERT(sc, what) mtx_assert((sc)->sc_mtx, what) -#define UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx) -#define UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx) +#define UCOM_MTX_ASSERT(sc, what) USB_MTX_ASSERT((sc)->sc_mtx, what) +#define UCOM_MTX_LOCK(sc) USB_MTX_LOCK((sc)->sc_mtx) +#define UCOM_MTX_UNLOCK(sc) USB_MTX_UNLOCK((sc)->sc_mtx) #define UCOM_UNLOAD_DRAIN(x) \ SYSUNINIT(var, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_drain_all, 0) Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/storage/umass.c Wed Sep 14 12:07:34 2016 (r305806) @@ -1141,7 +1141,7 @@ umass_cancel_ccb(struct umass_softc *sc) { union ccb *ccb; - mtx_assert(&sc->sc_mtx, MA_OWNED); + USB_MTX_ASSERT(&sc->sc_mtx, MA_OWNED); ccb = sc->sc_transfer.ccb; sc->sc_transfer.ccb = NULL; Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_busdma.c Wed Sep 14 12:07:34 2016 (r305806) @@ -508,7 +508,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ done: owned = mtx_owned(uptag->mtx); if (!owned) - mtx_lock(uptag->mtx); + USB_MTX_LOCK(uptag->mtx); uptag->dma_error = (error ? 1 : 0); if (isload) { @@ -517,7 +517,7 @@ done: cv_broadcast(uptag->cv); } if (!owned) - mtx_unlock(uptag->mtx); + USB_MTX_UNLOCK(uptag->mtx); } /*------------------------------------------------------------------------* @@ -592,7 +592,7 @@ usb_pc_alloc_mem(struct usb_page_cache * pc->tag = utag->tag; pc->ismultiseg = (align == 1); - mtx_lock(uptag->mtx); + USB_MTX_LOCK(uptag->mtx); /* load memory into DMA */ err = bus_dmamap_load( @@ -603,7 +603,7 @@ usb_pc_alloc_mem(struct usb_page_cache * cv_wait(uptag->cv, uptag->mtx); err = 0; } - mtx_unlock(uptag->mtx); + USB_MTX_UNLOCK(uptag->mtx); if (err || uptag->dma_error) { bus_dmamem_free(utag->tag, ptr, map); @@ -659,7 +659,7 @@ usb_pc_load_mem(struct usb_page_cache *p pc->page_offset_end = size; pc->ismultiseg = 1; - mtx_assert(pc->tag_parent->mtx, MA_OWNED); + USB_MTX_ASSERT(pc->tag_parent->mtx, MA_OWNED); if (size > 0) { if (sync) { @@ -917,7 +917,7 @@ usb_bdma_work_loop(struct usb_xfer_queue xfer = pq->curr; info = xfer->xroot; - mtx_assert(info->xfer_mtx, MA_OWNED); + USB_MTX_ASSERT(info->xfer_mtx, MA_OWNED); if (xfer->error) { /* some error happened */ @@ -1041,7 +1041,7 @@ usb_bdma_done_event(struct usb_dma_paren info = USB_DMATAG_TO_XROOT(udpt); - mtx_assert(info->xfer_mtx, MA_OWNED); + USB_MTX_ASSERT(info->xfer_mtx, MA_OWNED); /* copy error */ info->dma_error = udpt->dma_error; Modified: head/sys/dev/usb/usb_core.c ============================================================================== --- head/sys/dev/usb/usb_core.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_core.c Wed Sep 14 12:07:34 2016 (r305806) @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include #include @@ -64,4 +66,16 @@ const struct usb_string_lang usb_string_ MALLOC_DEFINE(M_USB, "USB", "USB"); MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device"); +int +usbd_in_polling_mode(void) +{ + return (USB_IN_POLLING_MODE_VALUE()); +} + +void +usbd_dummy_timeout(void *arg) +{ + /* NOP */ +} + MODULE_VERSION(usb, 1); Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_core.h Wed Sep 14 12:07:34 2016 (r305806) @@ -39,17 +39,20 @@ USB_MODE_DEVICE ? (((xfer)->endpointno & UE_DIR_IN) ? 0 : 1) : \ (((xfer)->endpointno & UE_DIR_IN) ? 1 : 0)) -/* macros */ - -#define USB_BUS_LOCK(_b) mtx_lock(&(_b)->bus_mtx) -#define USB_BUS_UNLOCK(_b) mtx_unlock(&(_b)->bus_mtx) -#define USB_BUS_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_mtx, _t) -#define USB_BUS_SPIN_LOCK(_b) mtx_lock_spin(&(_b)->bus_spin_lock) -#define USB_BUS_SPIN_UNLOCK(_b) mtx_unlock_spin(&(_b)->bus_spin_lock) -#define USB_BUS_SPIN_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_spin_lock, _t) -#define USB_XFER_LOCK(_x) mtx_lock((_x)->xroot->xfer_mtx) -#define USB_XFER_UNLOCK(_x) mtx_unlock((_x)->xroot->xfer_mtx) -#define USB_XFER_LOCK_ASSERT(_x, _t) mtx_assert((_x)->xroot->xfer_mtx, _t) +/* locking wrappers for BUS lock */ +#define USB_BUS_LOCK(_b) USB_MTX_LOCK(&(_b)->bus_mtx) +#define USB_BUS_UNLOCK(_b) USB_MTX_UNLOCK(&(_b)->bus_mtx) +#define USB_BUS_LOCK_ASSERT(_b, _t) USB_MTX_ASSERT(&(_b)->bus_mtx, _t) + +/* locking wrappers for BUS spin lock */ +#define USB_BUS_SPIN_LOCK(_b) USB_MTX_LOCK_SPIN(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_UNLOCK(_b) USB_MTX_UNLOCK_SPIN(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_LOCK_ASSERT(_b, _t) USB_MTX_ASSERT(&(_b)->bus_spin_lock, _t) + +/* locking wrappers for XFER lock */ +#define USB_XFER_LOCK(_x) USB_MTX_LOCK((_x)->xroot->xfer_mtx) +#define USB_XFER_UNLOCK(_x) USB_MTX_UNLOCK((_x)->xroot->xfer_mtx) +#define USB_XFER_LOCK_ASSERT(_x, _t) USB_MTX_ASSERT((_x)->xroot->xfer_mtx, _t) /* helper for converting pointers to integers */ #define USB_P2U(ptr) \ Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_dev.c Wed Sep 14 12:07:34 2016 (r305806) @@ -1159,7 +1159,7 @@ usb_filter_write(struct knote *kn, long f = kn->kn_hook; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); cpd = f->curr_cpd; if (cpd == NULL) { @@ -1200,7 +1200,7 @@ usb_filter_read(struct knote *kn, long h f = kn->kn_hook; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); cpd = f->curr_cpd; if (cpd == NULL) { @@ -1730,7 +1730,7 @@ usb_fifo_wait(struct usb_fifo *f) { int err; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); if (f->flag_iserror) { /* we are gone */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_device.c Wed Sep 14 12:07:34 2016 (r305806) @@ -1511,13 +1511,13 @@ usbd_clear_stall_proc(struct usb_proc_ms /* Change lock */ USB_BUS_UNLOCK(udev->bus); - mtx_lock(&udev->device_mtx); + USB_MTX_LOCK(&udev->device_mtx); /* Start clear stall callback */ usbd_transfer_start(udev->ctrl_xfer[1]); /* Change lock */ - mtx_unlock(&udev->device_mtx); + USB_MTX_UNLOCK(&udev->device_mtx); USB_BUS_LOCK(udev->bus); } Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_freebsd.h Wed Sep 14 12:07:34 2016 (r305806) @@ -90,6 +90,9 @@ #define USB_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ +#define USB_IN_POLLING_MODE_FUNC() usbd_in_polling_mode() +#define USB_IN_POLLING_MODE_VALUE() (SCHEDULER_STOPPED() || kdb_active) + typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_frlength_t; /* bytes */ typedef uint32_t usb_frcount_t; /* units */ Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_freebsd_loader.h Wed Sep 14 12:07:34 2016 (r305806) @@ -85,6 +85,9 @@ #define USB_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ +#define USB_IN_POLLING_MODE_FUNC() 0 +#define USB_IN_POLLING_MODE_VALUE() 0 + typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_frlength_t; /* bytes */ typedef uint32_t usb_frcount_t; /* units */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_generic.c Wed Sep 14 12:07:34 2016 (r305806) @@ -236,7 +236,7 @@ ugen_open_pipe_write(struct usb_fifo *f) struct usb_endpoint *ep = usb_fifo_softc(f); struct usb_endpoint_descriptor *ed = ep->edesc; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); if (f->xfer[0] || f->xfer[1]) { /* transfers are already opened */ @@ -305,7 +305,7 @@ ugen_open_pipe_read(struct usb_fifo *f) struct usb_endpoint *ep = usb_fifo_softc(f); struct usb_endpoint_descriptor *ed = ep->edesc; - mtx_assert(f->priv_mtx, MA_OWNED); + USB_MTX_ASSERT(f->priv_mtx, MA_OWNED); if (f->xfer[0] || f->xfer[1]) { /* transfers are already opened */ Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_hub.c Wed Sep 14 12:07:34 2016 (r305806) @@ -270,11 +270,11 @@ uhub_reset_tt_proc(struct usb_proc_msg * /* Change lock */ USB_BUS_UNLOCK(udev->bus); - mtx_lock(&sc->sc_mtx); + USB_MTX_LOCK(&sc->sc_mtx); /* Start transfer */ usbd_transfer_start(sc->sc_xfer[UHUB_RESET_TT_TRANSFER]); /* Change lock */ - mtx_unlock(&sc->sc_mtx); + USB_MTX_UNLOCK(&sc->sc_mtx); USB_BUS_LOCK(udev->bus); } #endif @@ -1519,9 +1519,9 @@ uhub_attach(device_t dev) /* Start the interrupt endpoint, if any */ - mtx_lock(&sc->sc_mtx); + USB_MTX_LOCK(&sc->sc_mtx); usbd_transfer_start(sc->sc_xfer[UHUB_INTR_TRANSFER]); - mtx_unlock(&sc->sc_mtx); + USB_MTX_UNLOCK(&sc->sc_mtx); /* Enable automatic power save on all USB HUBs */ Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_msctest.c Wed Sep 14 12:07:34 2016 (r305806) @@ -551,13 +551,13 @@ bbb_command_start(struct bbb_transfer *s memcpy(&sc->cbw->CBWCDB, cmd_ptr, cmd_len); DPRINTFN(1, "SCSI cmd = %*D\n", (int)cmd_len, (char *)sc->cbw->CBWCDB, ":"); - mtx_lock(&sc->mtx); + USB_MTX_LOCK(&sc->mtx); usbd_transfer_start(sc->xfer[sc->state]); while (usbd_transfer_pending(sc->xfer[sc->state])) { cv_wait(&sc->cv, &sc->mtx); } - mtx_unlock(&sc->mtx); + USB_MTX_UNLOCK(&sc->mtx); return (sc->error); } @@ -582,11 +582,11 @@ bbb_raw_write(struct bbb_transfer *sc, c DPRINTFN(1, "BULK DATA = %*D\n", (int)data_len, (const char *)data_ptr, ":"); - mtx_lock(&sc->mtx); + USB_MTX_LOCK(&sc->mtx); usbd_transfer_start(sc->xfer[0]); while (usbd_transfer_pending(sc->xfer[0])) cv_wait(&sc->cv, &sc->mtx); - mtx_unlock(&sc->mtx); + USB_MTX_UNLOCK(&sc->mtx); return (sc->error); } Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_process.c Wed Sep 14 12:07:34 2016 (r305806) @@ -115,7 +115,7 @@ usb_process(void *arg) sched_prio(td, up->up_prio); thread_unlock(td); - mtx_lock(up->up_mtx); + USB_MTX_LOCK(up->up_mtx); up->up_curtd = td; @@ -195,7 +195,7 @@ usb_process(void *arg) up->up_ptr = NULL; cv_signal(&up->up_cv); - mtx_unlock(up->up_mtx); + USB_MTX_UNLOCK(up->up_mtx); #if (__FreeBSD_version >= 800000) /* Clear the proc pointer if this is the last thread. */ if (--usb_pcount == 0) @@ -291,11 +291,12 @@ usb_proc_msignal(struct usb_process *up, usb_size_t d; uint8_t t; - /* check if gone, return dummy value */ - if (up->up_gone) + /* check if gone or in polling mode, return dummy value */ + if (up->up_gone != 0 || + USB_IN_POLLING_MODE_FUNC() != 0) return (_pm0); - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); t = 0; @@ -376,7 +377,7 @@ usb_proc_is_gone(struct usb_process *up) * structure is initialised. */ if (up->up_mtx != NULL) - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); return (0); } @@ -397,7 +398,7 @@ usb_proc_mwait(struct usb_process *up, v if (up->up_gone) return; - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); if (up->up_curtd == curthread) { /* Just remove the messages from the queue. */ @@ -437,9 +438,9 @@ usb_proc_drain(struct usb_process *up) return; /* handle special case with Giant */ if (up->up_mtx != &Giant) - mtx_assert(up->up_mtx, MA_NOTOWNED); + USB_MTX_ASSERT(up->up_mtx, MA_NOTOWNED); - mtx_lock(up->up_mtx); + USB_MTX_LOCK(up->up_mtx); /* Set the gone flag */ @@ -472,7 +473,7 @@ usb_proc_drain(struct usb_process *up) DPRINTF("WARNING: Someone is waiting " "for USB process drain!\n"); } - mtx_unlock(up->up_mtx); + USB_MTX_UNLOCK(up->up_mtx); } /*------------------------------------------------------------------------* @@ -493,7 +494,7 @@ usb_proc_rewakeup(struct usb_process *up if (up->up_gone) return; - mtx_assert(up->up_mtx, MA_OWNED); + USB_MTX_ASSERT(up->up_mtx, MA_OWNED); if (up->up_msleep == 0) { /* re-wakeup */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_request.c Wed Sep 14 12:07:34 2016 (r305806) @@ -455,8 +455,8 @@ usbd_do_request_flags(struct usb_device return (USB_ERR_INVAL); #endif if ((mtx != NULL) && (mtx != &Giant)) { - mtx_unlock(mtx); - mtx_assert(mtx, MA_NOTOWNED); + USB_MTX_UNLOCK(mtx); + USB_MTX_ASSERT(mtx, MA_NOTOWNED); } /* @@ -710,7 +710,7 @@ done: usbd_ctrl_unlock(udev); if ((mtx != NULL) && (mtx != &Giant)) - mtx_lock(mtx); + USB_MTX_LOCK(mtx); switch (err) { case USB_ERR_NORMAL_COMPLETION: Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usb_transfer.c Wed Sep 14 12:07:34 2016 (r305806) @@ -45,7 +45,6 @@ #include #include #include -#include #include #include @@ -329,12 +328,12 @@ usbd_transfer_setup_sub_malloc(struct us pc->buffer = USB_ADD_BYTES(buf, y * size); pc->page_start = pg; - mtx_lock(pc->tag_parent->mtx); + USB_MTX_LOCK(pc->tag_parent->mtx); if (usb_pc_load_mem(pc, size, 1 /* synchronous */ )) { - mtx_unlock(pc->tag_parent->mtx); + USB_MTX_UNLOCK(pc->tag_parent->mtx); return (1); /* failure */ } - mtx_unlock(pc->tag_parent->mtx); + USB_MTX_UNLOCK(pc->tag_parent->mtx); } } } @@ -2262,14 +2261,14 @@ usb_callback_proc(struct usb_proc_msg *_ * We exploit the fact that the mutex is the same for all * callbacks that will be called from this thread: */ - mtx_lock(info->xfer_mtx); + USB_MTX_LOCK(info->xfer_mtx); USB_BUS_LOCK(info->bus); /* Continue where we lost track */ usb_command_wrapper(&info->done_q, info->done_q.curr); - mtx_unlock(info->xfer_mtx); + USB_MTX_UNLOCK(info->xfer_mtx); } /*------------------------------------------------------------------------* @@ -2322,7 +2321,7 @@ usbd_callback_wrapper(struct usb_xfer_qu USB_BUS_LOCK_ASSERT(info->bus, MA_OWNED); if ((pq->recurse_3 != 0 || mtx_owned(info->xfer_mtx) == 0) && - SCHEDULER_STOPPED() == 0) { + USB_IN_POLLING_MODE_FUNC() == 0) { /* * Cases that end up here: * @@ -3303,7 +3302,9 @@ usbd_transfer_poll(struct usb_xfer **ppx struct usb_xfer_root *xroot; struct usb_device *udev; struct usb_proc_msg *pm; + struct usb_bus *bus; uint16_t n; + uint16_t drop_bus_spin; uint16_t drop_bus; uint16_t drop_xfer; @@ -3318,36 +3319,47 @@ usbd_transfer_poll(struct usb_xfer **ppx udev = xroot->udev; if (udev == NULL) continue; /* no USB device */ - if (udev->bus == NULL) + bus = udev->bus; + if (bus == NULL) continue; /* no BUS structure */ - if (udev->bus->methods == NULL) + if (bus->methods == NULL) continue; /* no BUS methods */ - if (udev->bus->methods->xfer_poll == NULL) + if (bus->methods->xfer_poll == NULL) continue; /* no poll method */ - /* make sure that the BUS mutex is not locked */ + drop_bus_spin = 0; drop_bus = 0; - while (mtx_owned(&xroot->udev->bus->bus_mtx) && !SCHEDULER_STOPPED()) { - mtx_unlock(&xroot->udev->bus->bus_mtx); - drop_bus++; - } - - /* make sure that the transfer mutex is not locked */ drop_xfer = 0; - while (mtx_owned(xroot->xfer_mtx) && !SCHEDULER_STOPPED()) { - mtx_unlock(xroot->xfer_mtx); - drop_xfer++; + + if (USB_IN_POLLING_MODE_FUNC() == 0) { + /* make sure that the BUS spin mutex is not locked */ + while (mtx_owned(&bus->bus_spin_lock)) { + mtx_unlock_spin(&bus->bus_spin_lock); + drop_bus_spin++; + } + + /* make sure that the BUS mutex is not locked */ + while (mtx_owned(&bus->bus_mtx)) { + mtx_unlock(&bus->bus_mtx); + drop_bus++; + } + + /* make sure that the transfer mutex is not locked */ + while (mtx_owned(xroot->xfer_mtx)) { + mtx_unlock(xroot->xfer_mtx); + drop_xfer++; + } } /* Make sure cv_signal() and cv_broadcast() is not called */ - USB_BUS_CONTROL_XFER_PROC(udev->bus)->up_msleep = 0; - USB_BUS_EXPLORE_PROC(udev->bus)->up_msleep = 0; - USB_BUS_GIANT_PROC(udev->bus)->up_msleep = 0; - USB_BUS_NON_GIANT_ISOC_PROC(udev->bus)->up_msleep = 0; - USB_BUS_NON_GIANT_BULK_PROC(udev->bus)->up_msleep = 0; + USB_BUS_CONTROL_XFER_PROC(bus)->up_msleep = 0; + USB_BUS_EXPLORE_PROC(bus)->up_msleep = 0; + USB_BUS_GIANT_PROC(bus)->up_msleep = 0; + USB_BUS_NON_GIANT_ISOC_PROC(bus)->up_msleep = 0; + USB_BUS_NON_GIANT_BULK_PROC(bus)->up_msleep = 0; /* poll USB hardware */ - (udev->bus->methods->xfer_poll) (udev->bus); + (bus->methods->xfer_poll) (bus); USB_BUS_LOCK(xroot->bus); @@ -3375,7 +3387,11 @@ usbd_transfer_poll(struct usb_xfer **ppx /* restore BUS mutex */ while (drop_bus--) - mtx_lock(&xroot->udev->bus->bus_mtx); + mtx_lock(&bus->bus_mtx); + + /* restore BUS spin mutex */ + while (drop_bus_spin--) + mtx_lock_spin(&bus->bus_spin_lock); } } Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Wed Sep 14 11:20:58 2016 (r305805) +++ head/sys/dev/usb/usbdi.h Wed Sep 14 12:07:34 2016 (r305806) @@ -435,6 +435,39 @@ struct usb_attach_arg { }; /* + * General purpose locking wrappers to ease supporting + * USB polled mode: + */ +#ifdef INVARIANTS +#define USB_MTX_ASSERT(_m, _t) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_assert(_m, _t); \ +} while (0) +#else +#define USB_MTX_ASSERT(_m, _t) do { } while (0) +#endif + +#define USB_MTX_LOCK(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_lock(_m); \ +} while (0) + +#define USB_MTX_UNLOCK(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_unlock(_m); \ +} while (0) + +#define USB_MTX_LOCK_SPIN(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_lock_spin(_m); \ +} while (0) + +#define USB_MTX_UNLOCK_SPIN(_m) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + mtx_unlock_spin(_m); \ +} while (0) + +/* * The following is a wrapper for the callout structure to ease * porting the code to other platforms. */ @@ -442,8 +475,26 @@ struct usb_callout { struct callout co; }; #define usb_callout_init_mtx(c,m,f) callout_init_mtx(&(c)->co,m,f) -#define usb_callout_reset(c,t,f,d) callout_reset(&(c)->co,t,f,d) -#define usb_callout_stop(c) callout_stop(&(c)->co) +#define usb_callout_reset(c,...) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + callout_reset(&(c)->co, __VA_ARGS__); \ +} while (0) +#define usb_callout_reset_sbt(c,...) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + callout_reset_sbt(&(c)->co, __VA_ARGS__); \ +} while (0) +#define usb_callout_stop(c) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) { \ + callout_stop(&(c)->co); \ + } else { \ + /* \ + * Cannot stop callout when \ + * polling. Set dummy callback \ + * function instead: \ + */ \ + (c)->co.c_func = &usbd_dummy_timeout; \ + } \ +} while (0) #define usb_callout_drain(c) callout_drain(&(c)->co) #define usb_callout_pending(c) callout_pending(&(c)->co) @@ -623,6 +674,8 @@ void usbd_frame_zero(struct usb_page_cac void usbd_start_re_enumerate(struct usb_device *udev); usb_error_t usbd_start_set_config(struct usb_device *, uint8_t); +int usbd_in_polling_mode(void); +void usbd_dummy_timeout(void *); int usb_fifo_attach(struct usb_device *udev, void *priv_sc, struct mtx *priv_mtx, struct usb_fifo_methods *pm, From owner-svn-src-head@freebsd.org Wed Sep 14 12:57:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48DB8BDA5B2; Wed, 14 Sep 2016 12:57:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0D0C210EE; Wed, 14 Sep 2016 12:57:41 +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 u8ECvfOr020354; Wed, 14 Sep 2016 12:57:41 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ECveAs020350; Wed, 14 Sep 2016 12:57:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609141257.u8ECveAs020350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 14 Sep 2016 12:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 12:57:42 -0000 Author: bde Date: Wed Sep 14 12:57:40 2016 New Revision: 305807 URL: https://svnweb.freebsd.org/changeset/base/305807 Log: Use the MI macro TRAPF_USERMODE() instead of open-coded checks for SEL_UPL and sometimes PSL_VM. This is just a style change on amd64, but on i386 it fixes 1 unimportant place where the PSL_VM check was missing and starts fixing 1 important place where the PSL_VM check had a logic error. Fix logic errors in treating vm86 bioscall mode as kernel mode. The main place checked all the necessary flags, but put the necessary parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong place. The broken case is only reached if a vm86 bioscall uses a %cs which is nonzero mod 4, but that is unusual -- most bios calls start with %cs = 0xc000 or 0xf000 and rarely change it. Another place was missing the check for PCB_VM86CALL, but was only reachable if there are bugs virtualizing PSL_I. Add a macro TF_HAS_STACKREGS() and use this instead of converting open-coded checks of SEL_UPL, etc. to TRAPF_USERMODE() when we only care about whether the frame has stack registers. This fixes 3 places in my recent fix for register variables in vm86 mode where I messed up the PSL_VM check and cleans up other places. Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/db_trace.c head/sys/i386/i386/trap.c head/sys/x86/include/frame.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/amd64/amd64/trap.c Wed Sep 14 12:57:40 2016 (r305807) @@ -236,7 +236,7 @@ trap(struct trapframe *frame) * interrupts disabled until they are accidentally * enabled later. */ - if (ISPL(frame->tf_cs) == SEL_UPL) + if (TRAPF_USERMODE(frame)) uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); @@ -260,7 +260,7 @@ trap(struct trapframe *frame) code = frame->tf_err; - if (ISPL(frame->tf_cs) == SEL_UPL) { + if (TRAPF_USERMODE(frame)) { /* user trap */ td->td_pticks = 0; @@ -787,7 +787,7 @@ trap_fatal(frame, eva) else msg = "UNKNOWN"; printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg, - ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel"); + TRAPF_USERMODE(frame) ? "user" : "kernel"); #ifdef SMP /* two separate prints in case of a trap on an unmapped page */ printf("cpuid = %d; ", PCPU_GET(cpuid)); @@ -804,7 +804,7 @@ trap_fatal(frame, eva) } printf("instruction pointer = 0x%lx:0x%lx\n", frame->tf_cs & 0xffff, frame->tf_rip); - if (ISPL(frame->tf_cs) == SEL_UPL) { + if (TF_HAS_STACKREGS(frame)) { ss = frame->tf_ss & 0xffff; esp = frame->tf_rsp; } else { @@ -934,7 +934,7 @@ amd64_syscall(struct thread *td, int tra ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (ISPL(td->td_frame->tf_cs) != SEL_UPL) { + if (!TRAPF_USERMODE(frame)) { panic("syscall"); /* NOT REACHED */ } Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/i386/i386/db_trace.c Wed Sep 14 12:57:40 2016 (r305807) @@ -82,8 +82,7 @@ struct db_variable *db_eregs = db_regs + static __inline int get_esp(struct trapframe *tf) { - return ((ISPL(tf->tf_cs) || kdb_frame->tf_eflags & PSL_VM) ? - tf->tf_esp : (intptr_t)&tf->tf_esp); + return (TF_HAS_STACKREGS(tf) ? tf->tf_esp : (intptr_t)&tf->tf_esp); } static int @@ -147,7 +146,7 @@ db_esp(struct db_variable *vp, db_expr_t if (op == DB_VAR_GET) *valuep = get_esp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) + else if (TF_HAS_STACKREGS(kdb_frame)) kdb_frame->tf_esp = *valuep; return (1); } @@ -180,9 +179,9 @@ db_ss(struct db_variable *vp, db_expr_t return (0); if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs) || - kdb_frame->tf_eflags & PSL_VM) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs) || kdb_frame->tf_eflags & PSL_VM) + *valuep = TF_HAS_STACKREGS(kdb_frame) ? kdb_frame->tf_ss : + rss(); + else if (TF_HAS_STACKREGS(kdb_frame)) kdb_frame->tf_ss = *valuep; return (1); } @@ -439,7 +438,7 @@ db_backtrace(struct thread *td, struct t * Find where the trap frame actually ends. * It won't contain tf_esp or tf_ss unless crossing rings. */ - if (ISPL(kdb_frame->tf_cs)) + if (TF_HAS_STACKREGS(kdb_frame)) instr = (int)(kdb_frame + 1); else instr = (int)&kdb_frame->tf_esp; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/i386/i386/trap.c Wed Sep 14 12:57:40 2016 (r305807) @@ -267,7 +267,8 @@ trap(struct trapframe *frame) * interrupts disabled until they are accidentally * enabled later. */ - if (ISPL(frame->tf_cs) == SEL_UPL || (frame->tf_eflags & PSL_VM)) + if (TRAPF_USERMODE(frame) && + (curpcb->pcb_flags & PCB_VM86CALL) == 0) uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); @@ -307,9 +308,7 @@ trap(struct trapframe *frame) enable_intr(); } - if ((ISPL(frame->tf_cs) == SEL_UPL) || - ((frame->tf_eflags & PSL_VM) && - !(curpcb->pcb_flags & PCB_VM86CALL))) { + if (TRAPF_USERMODE(frame) && (curpcb->pcb_flags & PCB_VM86CALL) == 0) { /* user trap */ td->td_pticks = 0; @@ -963,7 +962,7 @@ trap_fatal(frame, eva) } printf("instruction pointer = 0x%x:0x%x\n", frame->tf_cs & 0xffff, frame->tf_eip); - if ((ISPL(frame->tf_cs) == SEL_UPL) || (frame->tf_eflags & PSL_VM)) { + if (TF_HAS_STACKREGS(frame)) { ss = frame->tf_ss & 0xffff; esp = frame->tf_esp; } else { @@ -1117,7 +1116,8 @@ syscall(struct trapframe *frame) ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { + if (!(TRAPF_USERMODE(frame) && + (curpcb->pcb_flags & PCB_VM86CALL) == 0)) { panic("syscall"); /* NOT REACHED */ } Modified: head/sys/x86/include/frame.h ============================================================================== --- head/sys/x86/include/frame.h Wed Sep 14 12:07:34 2016 (r305806) +++ head/sys/x86/include/frame.h Wed Sep 14 12:57:40 2016 (r305807) @@ -64,7 +64,7 @@ struct trapframe { int tf_eip; int tf_cs; int tf_eflags; - /* below only when crossing rings (e.g. user to kernel) */ + /* below only when crossing rings (user to kernel) */ int tf_esp; int tf_ss; }; @@ -89,10 +89,10 @@ struct trapframe_vm86 { int tf_eip; int tf_cs; int tf_eflags; - /* below only when crossing rings (e.g. user to kernel) */ + /* below only when crossing rings (user (including vm86) to kernel) */ int tf_esp; int tf_ss; - /* below only when switching out of VM86 mode */ + /* below only when crossing from vm86 mode to kernel */ int tf_vm86_es; int tf_vm86_ds; int tf_vm86_fs; @@ -136,6 +136,7 @@ struct trapframe { register_t tf_rip; register_t tf_cs; register_t tf_rflags; + /* below only when crossing rings (user to kernel) */ register_t tf_rsp; register_t tf_ss; }; @@ -145,4 +146,13 @@ struct trapframe { #define TF_HASFPXSTATE 0x4 #endif /* __amd64__ */ +/* + * This alias for the MI TRAPF_USERMODE() should be used when we don't + * care about user mode itself, but need to know if a frame has stack + * registers. The difference is only logical, but on i386 the logic + * for using TRAPF_USERMODE() is complicated by sometimes treating vm86 + * bioscall mode (which is a special ring 3 user mode) as kernel mode. + */ +#define TF_HAS_STACKREGS(tf) TRAPF_USERMODE(tf) + #endif /* _MACHINE_FRAME_H_ */ From owner-svn-src-head@freebsd.org Wed Sep 14 13:48:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6C1BD9947; Wed, 14 Sep 2016 13:48:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2859A1E2E; Wed, 14 Sep 2016 13:47:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7F0633C5890; Wed, 14 Sep 2016 23:25:43 +1000 (AEST) Date: Wed, 14 Sep 2016 23:25:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include In-Reply-To: <201609141257.u8ECveAs020350@repo.freebsd.org> Message-ID: <20160914230412.P1341@besplex.bde.org> References: <201609141257.u8ECveAs020350@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.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=xVT1lvnswLCTB-VdiCcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 13:48:00 -0000 On Wed, 14 Sep 2016, Bruce Evans wrote: > ... > Log: > ... > Fix logic errors in treating vm86 bioscall mode as kernel mode. The > main place checked all the necessary flags, but put the necessary > parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong > place. The broken case is only reached if a vm86 bioscall uses a > %cs which is nonzero mod 4, but that is unusual -- most bios calls > start with %cs = 0xc000 or 0xf000 and rarely change it. Another > place was missing the check for PCB_VM86CALL, but was only reachable > if there are bugs virtualizing PSL_I. Forgot: Reviewed by: kib Just before committing, I checked when this was broken. It was in the Giant attack for SMPng. vm86 bios calls need mutual exclusion, and apparently Giant was used, and WITNESS warned about this, so as a quick fix vm86 bios calls were treated as kernel mode although this causes other problems. Now vm86 bios calls use vm86_lock instead of Giant, but the quick fix is still in place. vm86 bios calls shouldn't be treated as kernel mode, but I used this recently to debug one. ddb almost worked on them without really trying. It should work similarly on normal vm86 user mode and normal user mode if we sent the debugger traps to ddb instead of to the thread. There is the problem that users must not be allowed to enter the kernel using unprivileged debugger traps. Already for vm86 bios calls, we depend on BIOSes not generating any debugger traps. My recent changes to keep the trace flag set by ddb will have to be reviewed to make sure that if vm86 mode initiates the setting of the trace flag then the resulting trap doesn't go to the kernel. Bruce From owner-svn-src-head@freebsd.org Wed Sep 14 13:50:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B38BD9A50 for ; Wed, 14 Sep 2016 13:50:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm33-vm7.bullet.mail.bf1.yahoo.com (nm33-vm7.bullet.mail.bf1.yahoo.com [72.30.239.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B6C911E4 for ; Wed, 14 Sep 2016 13:50:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473860249; bh=guOGPWpn10ETnmQ94zx9ITgFkGjBkmp4g7fqG1y8qj0=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=rHdaRhFNSbCC+f4pTFvuUu7951KB1vFwd4mRJcprPcHl8O24cGtVK5QwhGfQrk097ZHTUp6aUcMn8a0SmLAOTpq7AXRhuguK7nna4NRT/2lHDAs71tJduilsSWQxMa0kcoXmKx/h3HD/ZELLu+zz2fmT+fHZLSrlefNYy8hTeJ7PwnElL9dOA3iway+HwtUoOkhpSJTEnzIc+y9VAGaxHpVaNQT0bIiirleYnvk/85oPvtkUfH+1tLNop22nHjM5LW4xACKmEy8r+A7khnoB2Ev3CVbNjCToMqUaGan5UbiJmyVT6MTomUKspHEWVypEzwB+jxcvkMLTnTkDGgfs7g== Received: from [66.196.81.172] by nm33.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 13:37:29 -0000 Received: from [98.139.211.196] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 13:37:29 -0000 Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP; 14 Sep 2016 13:37:29 -0000 X-Yahoo-Newman-Id: 622272.71725.bm@smtp205.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: gY.07hsVM1kU3ul1nWePX44cVLuRpHuya7feQLujmUEEPm8 UVs2nlgXD7pNJTa_qQs.kcuT1u4_C5p8i4yuEep9ncx6f92plUufJFOA8ZVc hEwR0VTnbdQuMr_zv0CmYKtKQ6zWgjRp3yGWKukOpfxiK_3qlz3xmDQpvB8H I8UFdsqKmdf9kUUMUp29FOvxcB16mSu0l0i1DjMltEYOnIwLUm7gEVhvFJaA seRbHefHHhYMB0zVGmedzVqM2BzdJw5q9n1S1vLICLODWpOSAzA8y9oHFXRR tcfIiOGd6vqKBrvMLkGwtb9qn5qGy0RPzWl4FDgctm1V6TnF0oOIu0vCtXKW eN3Kpz90ykyUMWQf_y6swM1YSji_eGCs.mapLihi6izEjYMISozOPw1TqHlh ..g2ZR72nmDPQjavHzaE.kiIfgkpLUxAHBom6rbMIVu1PBwABoMDMKZF32w5 BNVYnlyMH1_B5nnENX50tpFhBs3gf7u_z5Mf0eWIQxkp4rPITeNt.6npLtca _50vaBOGuAUelUR6nkQxv.O29Ff51OQWjSJ43TwM6S3hwsQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test To: Baptiste Daroussin , Cy Schubert References: <201609140147.u8E1l1qh065260@repo.freebsd.org> <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: Date: Wed, 14 Sep 2016 08:37:37 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160914050055.hcrkodky7ds6ywou@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 13:50:43 -0000 Hello; On 14/09/2016 00:00, Baptiste Daroussin wrote: > On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: >> Author: cy >> Date: Wed Sep 14 01:47:01 2016 >> New Revision: 305787 >> URL: https://svnweb.freebsd.org/changeset/base/305787 >> >> Log: >> Switch from .CURDIR to the simpler, more legible SRCTOP. >> >> Suggested by: emaste >> X-MFC-with: upcoming amd upgrade >> > I thought the plans was more to deprecated and remove amd at some points given > we now have autofs/automountd? Am I missing something? We haven't discussed deprecation, although it's not off the table. From what I read about amd, it gets along with autofs well. It appears some sysadmins may be used to amd and just removing it may violate POLA. It may be that the port/pkg is sufficient but before removing we should update it to match what the port has. Pedro. From owner-svn-src-head@freebsd.org Wed Sep 14 14:48:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52711BDAFAF; Wed, 14 Sep 2016 14:48: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 mx1.freebsd.org (Postfix) with ESMTPS id 1F3851834; Wed, 14 Sep 2016 14:48: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 u8EEm0KP062878; Wed, 14 Sep 2016 14:48:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EEm0CD062877; Wed, 14 Sep 2016 14:48:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201609141448.u8EEm0CD062877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 14 Sep 2016 14:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305810 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 14:48:01 -0000 Author: tuexen Date: Wed Sep 14 14:48:00 2016 New Revision: 305810 URL: https://svnweb.freebsd.org/changeset/base/305810 Log: Ensure that the IPPROTO_TCP level socket options * TCP_KEEPINIT * TCP_KEEPINTVL * TCP_KEEPIDLE * TCP_KEEPCNT always always report the values currently used when getsockopt() is used. This wasn't the case when the sysctl-inherited default values where used. Ensure that the IPPROTO_TCP level socket option TCP_INFO has the TCPI_OPT_ECN flag set in the tcpi_options field when ECN support has been negotiated successfully. Reviewed by: rrs, jtl, hiren MFC after: 1 month Differential Revision: 7833 Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Sep 14 14:05:31 2016 (r305809) +++ head/sys/netinet/tcp_usrreq.c Wed Sep 14 14:48:00 2016 (r305810) @@ -1329,6 +1329,8 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_snd_wscale = tp->snd_scale; ti->tcpi_rcv_wscale = tp->rcv_scale; } + if (tp->t_flags & TF_ECN_PERMIT) + ti->tcpi_options |= TCPI_OPT_ECN; ti->tcpi_rto = tp->t_rxtcur * tick; ti->tcpi_last_data_recv = (long)(ticks - (int)tp->t_rcvtime) * tick; @@ -1817,16 +1819,16 @@ unlock_and_done: case TCP_KEEPCNT: switch (sopt->sopt_name) { case TCP_KEEPIDLE: - ui = tp->t_keepidle / hz; + ui = TP_KEEPIDLE(tp) / hz; break; case TCP_KEEPINTVL: - ui = tp->t_keepintvl / hz; + ui = TP_KEEPINTVL(tp) / hz; break; case TCP_KEEPINIT: - ui = tp->t_keepinit / hz; + ui = TP_KEEPINIT(tp) / hz; break; case TCP_KEEPCNT: - ui = tp->t_keepcnt; + ui = TP_KEEPCNT(tp); break; } INP_WUNLOCK(inp); From owner-svn-src-head@freebsd.org Wed Sep 14 16:03:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CF93BDAC5D; Wed, 14 Sep 2016 16:03:47 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E9834177A; Wed, 14 Sep 2016 16:03:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4C44625D3A9D; Wed, 14 Sep 2016 16:03:42 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 7728AD1F7F1; Wed, 14 Sep 2016 16:03:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 1wKPvZsxEJ6G; Wed, 14 Sep 2016 16:03:39 +0000 (UTC) Received: from [10.248.105.13] (fresh-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4920:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id EA660D1F7DF; Wed, 14 Sep 2016 16:03:38 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Bruce Evans" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include Date: Wed, 14 Sep 2016 16:03:37 +0000 Message-ID: <439B0258-5FEB-4136-BF30-72A0B6E0AEDD@lists.zabbadoz.net> In-Reply-To: <201609141257.u8ECveAs020350@repo.freebsd.org> References: <201609141257.u8ECveAs020350@repo.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (2.0BETAr6054) Content-Type: text/plain; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 16:03:47 -0000 On 14 Sep 2016, at 12:57, Bruce Evans wrote: > Author: bde > Date: Wed Sep 14 12:57:40 2016 > New Revision: 305807 > URL: https://svnweb.freebsd.org/changeset/base/305807 > > Log: > > Modified: > head/sys/amd64/amd64/trap.c breaks all amd64 LINT* kernels: /scratch/tmp/bz/head.svn/sys/amd64/amd64/trap.c:937:22: error: use of undeclared identifier 'frame'; did you mean 'free'? if (!TRAPF_USERMODE(frame)) { ^~~~~ free ./machine/cpu.h:53:9: note: expanded from macro 'TRAPF_USERMODE' (ISPL((framep)->tf_cs) == SEL_UPL) ^ ./x86/segments.h:48:20: note: expanded from macro 'ISPL' #define ISPL(s) ((s)&3) /* priority level of a selector */ ^ /scratch/tmp/bz/head.svn/sys/sys/malloc.h:175:6: note: 'free' declared here void free(void *addr, struct malloc_type *type); ^ /scratch/tmp/bz/head.svn/sys/amd64/amd64/trap.c:937:7: error: member reference base type 'void (void *, struct malloc_type *)' is not a structure or union if (!TRAPF_USERMODE(frame)) { ^~~~~~~~~~~~~~~~~~~~~ ./machine/cpu.h:53:16: note: expanded from macro 'TRAPF_USERMODE' (ISPL((framep)->tf_cs) == SEL_UPL) ~~~~~~~~~~~~~^~~~~~~~ ./x86/segments.h:48:20: note: expanded from macro 'ISPL' #define ISPL(s) ((s)&3) /* priority level of a selector */ ^ 2 errors generated. --- trap.o --- *** [trap.o] Error code 1 bmake[5]: stopped in /storage/head/obj/scratch/tmp/bz/head.svn/sys/LINT From owner-svn-src-head@freebsd.org Wed Sep 14 16:08:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A4ADBDAE69; Wed, 14 Sep 2016 16:08:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE691B6C; Wed, 14 Sep 2016 16:08:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EG8OX7001241; Wed, 14 Sep 2016 16:08:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EG8O9H001240; Wed, 14 Sep 2016 16:08:24 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201609141608.u8EG8O9H001240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 14 Sep 2016 16:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305811 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 16:08:25 -0000 Author: bz Date: Wed Sep 14 16:08:23 2016 New Revision: 305811 URL: https://svnweb.freebsd.org/changeset/base/305811 Log: Try to fix LINT builds after r305807. Seems to be a simple s&r error I missed while reading through the 1st time as well. Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Sep 14 14:48:00 2016 (r305810) +++ head/sys/amd64/amd64/trap.c Wed Sep 14 16:08:23 2016 (r305811) @@ -934,7 +934,7 @@ amd64_syscall(struct thread *td, int tra ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (!TRAPF_USERMODE(frame)) { + if (!TRAPF_USERMODE(td->td_frame)) { panic("syscall"); /* NOT REACHED */ } From owner-svn-src-head@freebsd.org Wed Sep 14 16:34:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3455CBDB648; Wed, 14 Sep 2016 16:34:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECA3E1A3E; Wed, 14 Sep 2016 16:34:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EGYrXp012430; Wed, 14 Sep 2016 16:34:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EGYqIJ012426; Wed, 14 Sep 2016 16:34:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201609141634.u8EGYqIJ012426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 14 Sep 2016 16:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305812 - head/usr.sbin/fifolog/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 16:34:54 -0000 Author: pfg Date: Wed Sep 14 16:34:52 2016 New Revision: 305812 URL: https://svnweb.freebsd.org/changeset/base/305812 Log: fifolog(1): invert order of calloc(3) arguments. The second argment to calloc(3) should be the size, make it so. While here be a little bit more cautious in fifolog_reader_open() to protect in the unlikely event of an overflowed allocation. MFC after: 3 weeks Modified: head/usr.sbin/fifolog/lib/fifolog_create.c head/usr.sbin/fifolog/lib/fifolog_reader.c head/usr.sbin/fifolog/lib/fifolog_write_poll.c head/usr.sbin/fifolog/lib/miniobj.h Modified: head/usr.sbin/fifolog/lib/fifolog_create.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_create.c Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/fifolog_create.c Wed Sep 14 16:34:52 2016 (r305812) @@ -97,7 +97,7 @@ fifolog_create(const char *fn, off_t siz if (S_ISREG(st.st_mode) && ftruncate(fd, size) < 0) return ("Could not ftrunc"); - buf = calloc(recsize, 1); + buf = calloc(1, recsize); if (buf == NULL) return ("Could not malloc"); Modified: head/usr.sbin/fifolog/lib/fifolog_reader.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_reader.c Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/fifolog_reader.c Wed Sep 14 16:34:52 2016 (r305812) @@ -67,10 +67,10 @@ fifolog_reader_open(const char *fname) if (retval != NULL) err(1, "%s", retval); - fr->olen = fr->ff->recsize * 16; - fr->obuf = calloc(fr->olen, 1); + fr->obuf = calloc(16, fr->ff->recsize); if (fr->obuf == NULL) err(1, "Cannot malloc"); + fr->olen = fr->ff->recsize * 16; i = inflateInit(fr->ff->zs); assert(i == Z_OK); Modified: head/usr.sbin/fifolog/lib/fifolog_write_poll.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_write_poll.c Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/fifolog_write_poll.c Wed Sep 14 16:34:52 2016 (r305812) @@ -45,7 +45,7 @@ static int fifolog_write_gzip(struct fifolog_writer *f, time_t now); #define ALLOC(ptr, size) do { \ - (*(ptr)) = calloc(size, 1); \ + (*(ptr)) = calloc(1, size); \ assert(*(ptr) != NULL); \ } while (0) Modified: head/usr.sbin/fifolog/lib/miniobj.h ============================================================================== --- head/usr.sbin/fifolog/lib/miniobj.h Wed Sep 14 16:08:23 2016 (r305811) +++ head/usr.sbin/fifolog/lib/miniobj.h Wed Sep 14 16:34:52 2016 (r305812) @@ -28,7 +28,7 @@ #define ALLOC_OBJ(to, type_magic) \ do { \ - (to) = calloc(sizeof *(to), 1); \ + (to) = calloc(1, sizeof *(to)); \ if ((to) != NULL) \ (to)->magic = (type_magic); \ } while (0) From owner-svn-src-head@freebsd.org Wed Sep 14 16:47:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4FE7BDBA4A; Wed, 14 Sep 2016 16:47:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9564711B0; Wed, 14 Sep 2016 16:47:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EGlHTB016589; Wed, 14 Sep 2016 16:47:17 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EGlHYv016588; Wed, 14 Sep 2016 16:47:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201609141647.u8EGlHYv016588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 14 Sep 2016 16:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305813 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 16:47:18 -0000 Author: pfg Date: Wed Sep 14 16:47:17 2016 New Revision: 305813 URL: https://svnweb.freebsd.org/changeset/base/305813 Log: localedef(1): make better use of calloc(3) arguments. The first argument of calloc(3) should be an ordinal type, and the second a size: split a multiplication to make better use of calloc(3) and detect overflows. Do some other re-ordering and style fixes while here. MFC after: 3 weeks Modified: head/usr.bin/localedef/collate.c Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Wed Sep 14 16:34:52 2016 (r305812) +++ head/usr.bin/localedef/collate.c Wed Sep 14 16:47:17 2016 (r305813) @@ -1204,7 +1204,7 @@ dump_collate(void) subst_t *temp; RB_COUNT(temp, substs, &substs[i], n); collinfo.subst_count[i] = n; - if ((st = calloc(sizeof (collate_subst_t) * n, 1)) == NULL) { + if ((st = calloc(n, sizeof(collate_subst_t))) == NULL) { fprintf(stderr, "out of memory"); return; } @@ -1233,7 +1233,7 @@ dump_collate(void) */ RB_NUMNODES(collelem_t, elem_by_expand, &elem_by_expand, collinfo.chain_count); - chain = calloc(sizeof (collate_chain_t), collinfo.chain_count); + chain = calloc(collinfo.chain_count, sizeof(collate_chain_t)); if (chain == NULL) { fprintf(stderr, "out of memory"); return; @@ -1253,7 +1253,7 @@ dump_collate(void) * Large (> UCHAR_MAX) character priorities */ RB_NUMNODES(collchar_t, collchars, &collchars, n); - large = calloc(n, sizeof (collate_large_t)); + large = calloc(n, sizeof(collate_large_t)); if (large == NULL) { fprintf(stderr, "out of memory"); return; From owner-svn-src-head@freebsd.org Wed Sep 14 17:28:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0F3BAC49CD; Wed, 14 Sep 2016 17:28:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 83D3C1A48; Wed, 14 Sep 2016 17:27:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 667D2783A75; Thu, 15 Sep 2016 03:08:01 +1000 (AEST) Date: Thu, 15 Sep 2016 03:08:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305811 - head/sys/amd64/amd64 In-Reply-To: <201609141608.u8EG8O9H001240@repo.freebsd.org> Message-ID: <20160915030636.S2324@besplex.bde.org> References: <201609141608.u8EG8O9H001240@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.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=fyqRzDaQBy3XwA4F9WMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 17:28:00 -0000 On Wed, 14 Sep 2016, Bjoern A. Zeeb wrote: > Log: > Try to fix LINT builds after r305807. Seems to be a simple s&r error > I missed while reading through the 1st time as well. Thanks. The fix looks right. > Modified: > head/sys/amd64/amd64/trap.c > > Modified: head/sys/amd64/amd64/trap.c > ============================================================================== > --- head/sys/amd64/amd64/trap.c Wed Sep 14 14:48:00 2016 (r305810) > +++ head/sys/amd64/amd64/trap.c Wed Sep 14 16:08:23 2016 (r305811) > @@ -934,7 +934,7 @@ amd64_syscall(struct thread *td, int tra > ksiginfo_t ksi; > > #ifdef DIAGNOSTIC > - if (!TRAPF_USERMODE(frame)) { > + if (!TRAPF_USERMODE(td->td_frame)) { > panic("syscall"); > /* NOT REACHED */ > } Bruce From owner-svn-src-head@freebsd.org Wed Sep 14 17:34:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2D6AC4C0F; Wed, 14 Sep 2016 17:34:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id ED7DD1F51; Wed, 14 Sep 2016 17:34:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 373C6D46825; Thu, 15 Sep 2016 03:11:23 +1000 (AEST) Date: Thu, 15 Sep 2016 03:11:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305807 - in head/sys: amd64/amd64 i386/i386 x86/include In-Reply-To: <439B0258-5FEB-4136-BF30-72A0B6E0AEDD@lists.zabbadoz.net> Message-ID: <20160915030828.C2324@besplex.bde.org> References: <201609141257.u8ECveAs020350@repo.freebsd.org> <439B0258-5FEB-4136-BF30-72A0B6E0AEDD@lists.zabbadoz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=NDyNz_EZ-ucPDKsh1gkA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 17:34:47 -0000 On Wed, 14 Sep 2016, Bjoern A. Zeeb wrote: > On 14 Sep 2016, at 12:57, Bruce Evans wrote: > >> Author: bde >> Date: Wed Sep 14 12:57:40 2016 >> New Revision: 305807 >> URL: https://svnweb.freebsd.org/changeset/base/305807 >> >> Log: >> >> Modified: >> head/sys/amd64/amd64/trap.c > > breaks all amd64 LINT* kernels: > > /scratch/tmp/bz/head.svn/sys/amd64/amd64/trap.c:937:22: error: use of > undeclared identifier 'frame'; did you mean 'free'? > if (!TRAPF_USERMODE(frame)) { > ^~~~~ > free Oops. I see you fixed it. Thanks. Bruce From owner-svn-src-head@freebsd.org Wed Sep 14 17:43:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19CE8AC4F12; Wed, 14 Sep 2016 17:43:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE3271410; Wed, 14 Sep 2016 17:43:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EHhXNa038841; Wed, 14 Sep 2016 17:43:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EHhX7R038840; Wed, 14 Sep 2016 17:43:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201609141743.u8EHhX7R038840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 14 Sep 2016 17:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305814 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 17:43:34 -0000 Author: manu Date: Wed Sep 14 17:43:32 2016 New Revision: 305814 URL: https://svnweb.freebsd.org/changeset/base/305814 Log: ufsread: Do not cast struct direct from void * This cause alignment problem on ARM (and possibly other archs), instead copy it. MFC after: 1 week Modified: head/sys/boot/common/ufsread.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Wed Sep 14 16:47:17 2016 (r305813) +++ head/sys/boot/common/ufsread.c Wed Sep 14 17:43:32 2016 (r305814) @@ -97,21 +97,21 @@ static __inline uint8_t fsfind(const char *name, ufs_ino_t * ino) { static char buf[DEV_BSIZE]; - struct direct *d; + static struct direct d; char *s; ssize_t n; fs_off = 0; while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) for (s = buf; s < buf + DEV_BSIZE;) { - d = (void *)s; + memcpy(&d, s, sizeof(struct direct)); if (ls) - printf("%s ", d->d_name); - else if (!strcmp(name, d->d_name)) { - *ino = d->d_ino; - return d->d_type; + printf("%s ", d.d_name); + else if (!strcmp(name, d.d_name)) { + *ino = d.d_ino; + return d.d_type; } - s += d->d_reclen; + s += d.d_reclen; } if (n != -1 && ls) printf("\n"); From owner-svn-src-head@freebsd.org Wed Sep 14 18:14:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58F4FBD5900; Wed, 14 Sep 2016 18:14:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3DB13AC; Wed, 14 Sep 2016 18:14:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 32309139B; Wed, 14 Sep 2016 18:14:18 +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 EEDC922837; Wed, 14 Sep 2016 18:14:17 +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 q7B21QvfP6Tn; Wed, 14 Sep 2016 18:14:14 +0000 (UTC) Subject: Re: svn commit: r305634 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5F26C22832 To: "Simon J. Gerraty" References: <201609090121.u891LZOO023156@repo.freebsd.org> <76524.1473467847@kaos.jnpr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 14 Sep 2016 11:14:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <76524.1473467847@kaos.jnpr.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 18:14:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd Content-Type: multipart/mixed; boundary="bVD9fPoNnEJC8xwlVnlM5BhIFiJ5rvKXi"; protected-headers="v1" From: Bryan Drewery To: "Simon J. Gerraty" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r305634 - head/share/mk References: <201609090121.u891LZOO023156@repo.freebsd.org> <76524.1473467847@kaos.jnpr.net> In-Reply-To: <76524.1473467847@kaos.jnpr.net> --bVD9fPoNnEJC8xwlVnlM5BhIFiJ5rvKXi Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/9/16 5:37 PM, Simon J. Gerraty wrote: > Bryan Drewery wrote: >=20 >>> +# some targets involve old pre-built targets >>> +# ignore mtime of shell >>> +# and mtime of makefiles does not matter in meta mode >>> +.MAKE.META.IGNORE_PATHS +=3D \ >>> + ${MAKEFILE} \ >>> + ${SHELL} \ >>> + ${SYS_MK_DIR} >> >> I think it could be problematic to ignore *.mk changes. The build >=20 > If you're not concerned with build optimization, > this can be disabled - but pretty much any sub-make for which there is = a > .meta file will be out-of-date by any changed to *.mk >=20 >> commands may stay the same, but targets could grow new dependencies. = If >> those dependencies are already "met" then meta mode won't reconsider t= hem. >=20 > I'm not sure how easy it is to accomplish that situation. Can you at least wrap it in something like .if !defined(META_CONSIDER_MK_FILES) ? > =20 >> Consider: >> Build 1: >> bar: >> touch dep >> touch bar >> >> foo: >> touch foo >> >> all: bar foo >> >> In the first build, all generates dep, bar and foo. >> >> Then the code is changed to: >> >> bar: >> touch bar >> >> dep: >> touch notmade >> touch dep >> >> foo: dep >> touch foo >> >> all: foo bar >> >> Now in the second build, all finds bar command changes and rebuilds, >> finds foo command is the same and that dep is already satisfied from t= he >> last build. So 'notmade' is never made. >=20 > Actually given you have missing-meta=3Dyes > target dep would be remade, either because there is no .meta file, or > because its commands changed.=20 > Thus notmade should be. >=20 Good point. --=20 Regards, Bryan Drewery --bVD9fPoNnEJC8xwlVnlM5BhIFiJ5rvKXi-- --Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJX2ZN2AAoJEDXXcbtuRpfP2IkH+QHLT895o/vN5jAs67lE4P2L bXf6PASmfNX2YearLKwHbJ9jAdSSYbazYJ/fBVKaktNZHlD3vMl9ae8uvnNHukmD qvHKzWl7JwDXI9FBapgPOwexTuFDOqYdp8hmsfmngX6rXR/1bo3h0uUfXmO40SQK 5+5ugrjDCG4ENGRAtL9U0Um3mXC9z09FZ28GHzs8Sb6AFEfWXYAqVWWy75bFeXpE v4wum0kjP1HRtnpfj6/7ky1cdWz/JA2YNw9Bu8DZRke5Ay40jvVTPRelW08s6H1l llWPing4OAP7SKYzka5DTz2IqfKA1VDmzsFWPYqJloyPlnUjOzz1FfE+0303qFo= =DIW8 -----END PGP SIGNATURE----- --Mw2OUWH4Fveo5N2C5XJRvQf5jMKMn65Rd-- From owner-svn-src-head@freebsd.org Wed Sep 14 18:22:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9DB8BD5A96; Wed, 14 Sep 2016 18:22:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id A2DFA18FF; Wed, 14 Sep 2016 18:22:13 +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 u8EIMCQT051869; Wed, 14 Sep 2016 18:22:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EIMC9u051868; Wed, 14 Sep 2016 18:22:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609141822.u8EIMC9u051868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 14 Sep 2016 18:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305815 - head/usr.bin/vtfontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 18:22:14 -0000 Author: emaste Date: Wed Sep 14 18:22:12 2016 New Revision: 305815 URL: https://svnweb.freebsd.org/changeset/base/305815 Log: vtfontcvt: remove superfluous newlines in errx messages Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Wed Sep 14 17:43:32 2016 (r305814) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Wed Sep 14 18:22:12 2016 (r305815) @@ -122,7 +122,7 @@ add_mapping(struct glyph *gl, unsigned i ml = &maps[map_idx]; if (TAILQ_LAST(ml, mapping_list) != NULL && TAILQ_LAST(ml, mapping_list)->m_char >= c) - errx(1, "Bad ordering at character %u\n", c); + errx(1, "Bad ordering at character %u", c); TAILQ_INSERT_TAIL(ml, mp, m_list); map_count[map_idx]++; @@ -143,7 +143,7 @@ dedup_mapping(unsigned int map_idx) while (mp_normal->m_char < mp_bold->m_char) mp_normal = TAILQ_NEXT(mp_normal, m_list); if (mp_bold->m_char != mp_normal->m_char) - errx(1, "Character %u not in normal font!\n", + errx(1, "Character %u not in normal font!", mp_bold->m_char); if (mp_bold->m_glyph != mp_normal->m_glyph) continue; @@ -218,7 +218,7 @@ parse_bitmap_line(uint8_t *left, uint8_t unsigned int i, subline; if (dwidth != width && dwidth != width * 2) - errx(1, "Bitmap with unsupported width %u!\n", dwidth); + errx(1, "Bitmap with unsupported width %u!", dwidth); /* Move pixel data right to simplify splitting double characters. */ line >>= (howmany(dwidth, 8) * 8) - dwidth; @@ -235,7 +235,7 @@ parse_bitmap_line(uint8_t *left, uint8_t *p++ = subline >> 8; *p = subline; } else { - errx(1, "Unsupported wbytes %u!\n", wbytes); + errx(1, "Unsupported wbytes %u!", wbytes); } line >>= width; @@ -267,7 +267,7 @@ parse_bdf(FILE *fp, unsigned int map_idx (ln[6] == ' ' || ln[6] == '\0')) { for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) - errx(1, "Unexpected EOF!\n"); + errx(1, "Unexpected EOF!"); ln[length - 1] = '\0'; sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, From owner-svn-src-head@freebsd.org Wed Sep 14 19:37:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61FD8BDA682; Wed, 14 Sep 2016 19:37:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id E71561629; Wed, 14 Sep 2016 19:37:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id D94EA783F9D; Thu, 15 Sep 2016 05:37:20 +1000 (AEST) Date: Thu, 15 Sep 2016 05:37:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Emmanuel Vadot cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common In-Reply-To: <201609141743.u8EHhX7R038840@repo.freebsd.org> Message-ID: <20160915042715.N2557@besplex.bde.org> References: <201609141743.u8EHhX7R038840@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.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=FKimkyEhhJgGH9YI0qIA:9 a=CZZ8iAWKxe_cZat7:21 a=K80So2YOsUCu8inb:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 19:37:23 -0000 On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > Log: > ufsread: Do not cast struct direct from void * > This cause alignment problem on ARM (and possibly other archs), instead copy it. > > MFC after: 1 week > > Modified: > head/sys/boot/common/ufsread.c > > Modified: head/sys/boot/common/ufsread.c > ============================================================================== > --- head/sys/boot/common/ufsread.c Wed Sep 14 16:47:17 2016 (r305813) > +++ head/sys/boot/common/ufsread.c Wed Sep 14 17:43:32 2016 (r305814) > @@ -97,21 +97,21 @@ static __inline uint8_t > fsfind(const char *name, ufs_ino_t * ino) > { > static char buf[DEV_BSIZE]; > - struct direct *d; > + static struct direct d; > char *s; > ssize_t n; This looks like a good pessimization for space. boot2 on i386 has to fit in 8192 bytes and has a negative number to spare (features are already left out). With auto buffers, and also builtin memcpy, the compiler can optimize the memcpy to nothing on arches with no alignment, and should do this with -Os. I think -ffreestanding in boot programs kills the builtin, and this is almost intentional since compilers have poor support for -Os so the inline memcpy is sometimes larger unless it is null. > > fs_off = 0; > while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) > for (s = buf; s < buf + DEV_BSIZE;) { > - d = (void *)s; > + memcpy(&d, s, sizeof(struct direct)); > if (ls) > - printf("%s ", d->d_name); > - else if (!strcmp(name, d->d_name)) { > - *ino = d->d_ino; > - return d->d_type; > + printf("%s ", d.d_name); > + else if (!strcmp(name, d.d_name)) { > + *ino = d.d_ino; > + return d.d_type; > } > - s += d->d_reclen; > + s += d.d_reclen; > } > if (n != -1 && ls) > printf("\n"); The static buffer in the old code also looks like a pessimization for space. It doesn't seem to be needed to preserver or return results. Compilers don't seem to be smart enough to see this and optimize it to auto or vice versa. Testing shows that the static buffer is space optimization for gcc and a space pessimization for clang: X #include X #include X X int X foo(void) X { X static char buf[101]; X static int buf1[3]; X X read(0, buf, sizeof(buf)); X memcpy(buf1, &buf[2], sizeof(buf1)); X return (buf[0] + buf1[0]); X } 2 static buffers give the best pessimizations for clang -Os -m32. Even with -Os, clang prefers to use large instructions to reduce the number of instructions. The static buffers give largest instructions, and also prevent optimizing away the memcpy(). With auto buf1, it takes -ffreestanding to kill the optimization of memcpy() and with that optimization the size is reduced by almost a factor of 2. With auto buf too, other pessimizations are applied to give a size reduction of just 1 byte. gcc-4.2.1 never inlines the memcpy(), but it does the other pessimizations less well to give an in-between size. Aproximate sizes on i386: 65 bytes for clang with statics, 49 for gcc, 33 for clang with autos and builtins, 28 for tweaked output for clang with static buf, auto buf1 and builtins (null memcpy). Probably the static buf is an intentional optimization for gcc. Compilers do too good a job of generating large code for large stack offsets. In my test code, the offsets are about 101 which is less than 128 so it takes only 2 bytes. DEV_BSIZE is 512 so it needs 5-byte offsets from the usual pessimizations for the base pointer (these are to point %ebp at the top of the variables and put all the scalar variables below the buffer so that the offsets are largest). But clang also does good pessimizations for offsets from the static buffer: pushl $foo.buf # 5 bytes movsbl foo.buf, %eax # 7 bytes addl foo.buf+2, %eax # 6 bytes Actually optimizing for space: movl $foo.buf,%ebx # 5 bytes pushl %ebx # 1 byte movsbl (%ebx), %eax # 3 bytes addl 2(%ebx), %eax # 3 bytes Bruce From owner-svn-src-head@freebsd.org Wed Sep 14 20:10:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072A2BDA5B2; Wed, 14 Sep 2016 20:10:01 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 275EF1F89; Wed, 14 Sep 2016 20:09:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 81334550; Wed, 14 Sep 2016 22:09:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=p2w31a+LjzY7HQcRYyWnfAikEG0=; b=LCefPu3S4FGLHoFjit/jnfNVRo6d HAjsSz5KYxkCTDmEJg24ywGdOHbg7QpbQhcgP2CGucY3zkg/miMN/yvZsaRV49/m E1kzMESW/WK4FLzfwhKiGQRVqw7shQeb4moozGClYoPzs8h2C9yZ2hw26YE/4tiy Z7PNsp+BEX38WuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=GqfNYLH/RZZPcAvu6gu1EdJm90oRMqNpT6cQeg/uKD0/+ByNhOSvwqZB tJAiXnLLO4r+qsYgsjN782tTrH306jl0R40Xu2zsOakb9/Gl6OkW723ypqBx6vDG noxuCneukCVNkN8rsYRyAjnstlNrAeD7X4TKWYivE001xn7UjOg= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 107ae606 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 14 Sep 2016 22:09:50 +0200 (CEST) Date: Wed, 14 Sep 2016 22:09:49 +0200 From: Emmanuel Vadot To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common Message-Id: <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> In-Reply-To: <20160915042715.N2557@besplex.bde.org> References: <201609141743.u8EHhX7R038840@repo.freebsd.org> <20160915042715.N2557@besplex.bde.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 20:10:01 -0000 Hi Bruce, On Thu, 15 Sep 2016 05:37:19 +1000 (EST) Bruce Evans wrote: > On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > > > Log: > > ufsread: Do not cast struct direct from void * > > This cause alignment problem on ARM (and possibly other archs), instead copy it. > > > > MFC after: 1 week > > > > Modified: > > head/sys/boot/common/ufsread.c > > > > Modified: head/sys/boot/common/ufsread.c > > ============================================================================== > > --- head/sys/boot/common/ufsread.c Wed Sep 14 16:47:17 2016 (r305813) > > +++ head/sys/boot/common/ufsread.c Wed Sep 14 17:43:32 2016 (r305814) > > @@ -97,21 +97,21 @@ static __inline uint8_t > > fsfind(const char *name, ufs_ino_t * ino) > > { > > static char buf[DEV_BSIZE]; > > - struct direct *d; > > + static struct direct d; > > char *s; > > ssize_t n; > > This looks like a good pessimization for space. boot2 on i386 has to > fit in 8192 bytes and has a negative number to spare (features are > already left out). Do you have any suggestion on making the code better ? This was the last patch for having EFI working on ARMv6 and this is something that I want to be enabled by default at some point. > > With auto buffers, and also builtin memcpy, the compiler can optimize > the memcpy to nothing on arches with no alignment, and should do this > with -Os. I think -ffreestanding in boot programs kills the builtin, > and this is almost intentional since compilers have poor support for > -Os so the inline memcpy is sometimes larger unless it is null. > > > > > fs_off = 0; > > while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) > > for (s = buf; s < buf + DEV_BSIZE;) { > > - d = (void *)s; > > + memcpy(&d, s, sizeof(struct direct)); > > if (ls) > > - printf("%s ", d->d_name); > > - else if (!strcmp(name, d->d_name)) { > > - *ino = d->d_ino; > > - return d->d_type; > > + printf("%s ", d.d_name); > > + else if (!strcmp(name, d.d_name)) { > > + *ino = d.d_ino; > > + return d.d_type; > > } > > - s += d->d_reclen; > > + s += d.d_reclen; > > } > > if (n != -1 && ls) > > printf("\n"); > > The static buffer in the old code also looks like a pessimization for > space. It doesn't seem to be needed to preserver or return results. > Compilers don't seem to be smart enough to see this and optimize it > to auto or vice versa. > > Testing shows that the static buffer is space optimization for gcc > and a space pessimization for clang: > > X #include > X #include > X > X int > X foo(void) > X { > X static char buf[101]; > X static int buf1[3]; > X > X read(0, buf, sizeof(buf)); > X memcpy(buf1, &buf[2], sizeof(buf1)); > X return (buf[0] + buf1[0]); > X } > > 2 static buffers give the best pessimizations for clang -Os -m32. > Even with -Os, clang prefers to use large instructions to reduce the > number of instructions. The static buffers give largest instructions, > and also prevent optimizing away the memcpy(). With auto buf1, it > takes -ffreestanding to kill the optimization of memcpy() and with > that optimization the size is reduced by almost a factor of 2. With > auto buf too, other pessimizations are applied to give a size reduction > of just 1 byte. gcc-4.2.1 never inlines the memcpy(), but it does > the other pessimizations less well to give an in-between size. > > Aproximate sizes on i386: 65 bytes for clang with statics, 49 for gcc, > 33 for clang with autos and builtins, 28 for tweaked output for clang > with static buf, auto buf1 and builtins (null memcpy). > > Probably the static buf is an intentional optimization for gcc. > Compilers do too good a job of generating large code for large stack > offsets. In my test code, the offsets are about 101 which is less than > 128 so it takes only 2 bytes. DEV_BSIZE is 512 so it needs 5-byte > offsets from the usual pessimizations for the base pointer (these > are to point %ebp at the top of the variables and put all the scalar > variables below the buffer so that the offsets are largest). But > clang also does good pessimizations for offsets from the static buffer: > > pushl $foo.buf # 5 bytes > movsbl foo.buf, %eax # 7 bytes > addl foo.buf+2, %eax # 6 bytes > > Actually optimizing for space: > > movl $foo.buf,%ebx # 5 bytes > pushl %ebx # 1 byte > movsbl (%ebx), %eax # 3 bytes > addl 2(%ebx), %eax # 3 bytes > > Bruce Cheers, -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed Sep 14 20:51:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A11BDB564; Wed, 14 Sep 2016 20:51:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 5E5E5197C; Wed, 14 Sep 2016 20:51:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 02361784089; Thu, 15 Sep 2016 06:51:46 +1000 (AEST) Date: Thu, 15 Sep 2016 06:51:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Emmanuel Vadot cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305814 - head/sys/boot/common In-Reply-To: <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.com> Message-ID: <20160915063308.G2902@besplex.bde.org> References: <201609141743.u8EHhX7R038840@repo.freebsd.org> <20160915042715.N2557@besplex.bde.org> <20160914220949.bfbd8562ec180ab690b84b60@bidouilliste.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.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=iHnWpXaEffL-ftcl-ccA:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 20:51:49 -0000 On Wed, 14 Sep 2016, Emmanuel Vadot wrote: > Bruce Evans wrote: > >> On Wed, 14 Sep 2016, Emmanuel Vadot wrote: >> >>> Log: >>> ufsread: Do not cast struct direct from void * >>> This cause alignment problem on ARM (and possibly other archs), instead copy it. >>> ... >> >> This looks like a good pessimization for space. boot2 on i386 has to >> fit in 8192 bytes and has a negative number to spare (features are >> already left out). > > Do you have any suggestion on making the code better ? > This was the last patch for having EFI working on ARMv6 and this is > something that I want to be enabled by default at some point. At least copy to a local variable. Ifdefs for the space-constrained && non-strict-alignment arches work of course, but shouldn't be needed. You will have to investigate the -ffreestanding and builtin situation. -ffreestanding is set in 24 sub-Makefiles instead of correctly in 1 Makefile.inc. I think it applies to all of boot/i386. boot code almost never recovers from this using __builtin_*. Beware that some builtins just call an extern function which might not exist in boot code. Even memcpy barely exists in small boot2's. Some compilers have buggy -ffreestanding and call memcpy() for struct copying, so it is preferred to bcopy() in boot code. Bruce From owner-svn-src-head@freebsd.org Wed Sep 14 20:55:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE5C1BDB780; Wed, 14 Sep 2016 20:55:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91ED71E01; Wed, 14 Sep 2016 20:55:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EKt3nD012230; Wed, 14 Sep 2016 20:55:03 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EKt388012229; Wed, 14 Sep 2016 20:55:03 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609142055.u8EKt388012229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 14 Sep 2016 20:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305817 - in head/contrib/libarchive: libarchive libarchive_fe tar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 20:55:05 -0000 Author: mm Date: Wed Sep 14 20:55:03 2016 New Revision: 305817 URL: https://svnweb.freebsd.org/changeset/base/305817 Log: Remove mergeinfo from contrib/libarchive subdirs Modified: Directory Properties: head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/libarchive_fe/ (props changed) head/contrib/libarchive/tar/ (props changed) From owner-svn-src-head@freebsd.org Wed Sep 14 21:01:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E5E8BDB933; Wed, 14 Sep 2016 21:01:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 251151200; Wed, 14 Sep 2016 21:01:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8EL12n3013179; Wed, 14 Sep 2016 21:01:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8EL12Qv013178; Wed, 14 Sep 2016 21:01:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609142101.u8EL12Qv013178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 14 Sep 2016 21:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305818 - head/contrib/libarchive/cpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 21:01:03 -0000 Author: mm Date: Wed Sep 14 21:01:02 2016 New Revision: 305818 URL: https://svnweb.freebsd.org/changeset/base/305818 Log: Remove mergeinfo from contrib/libarchive/cpio Modified: Directory Properties: head/contrib/libarchive/cpio/ (props changed) From owner-svn-src-head@freebsd.org Wed Sep 14 21:15:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB52B9626F; Wed, 14 Sep 2016 21:15:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD4E1F92; Wed, 14 Sep 2016 21:15:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8ELF2vC019811; Wed, 14 Sep 2016 21:15:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ELF1t1019804; Wed, 14 Sep 2016 21:15:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609142115.u8ELF1t1019804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 14 Sep 2016 21:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305819 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 21:15:03 -0000 Author: mm Date: Wed Sep 14 21:15:01 2016 New Revision: 305819 URL: https://svnweb.freebsd.org/changeset/base/305819 Log: MFV r305816: Sync libarchive with vendor including important security fixes. Issues fixed (FreeBSD): PR #778: ACL error handling Issue #745: Symlink check prefix optimization is too aggressive Issue #746: Hard links with data can evade sandboxing restrictions This update fixes the vulnerability #3 and vulnerability #4 as reported in "non-cryptanalytic attacks against FreeBSD update components". https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Fix for vulnerability #2 has already been merged in r304989. MFC after: 1 week Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Modified: head/contrib/libarchive/libarchive/archive_platform.h head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c head/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_platform.h Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_platform.h Wed Sep 14 21:15:01 2016 (r305819) @@ -159,6 +159,15 @@ #define CAN_RESTORE_METADATA_FD #endif +/* + * glibc 2.24 deprecates readdir_r + */ +#if defined(HAVE_READDIR_R) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) +#define USE_READDIR_R 1 +#else +#undef USE_READDIR_R +#endif + /* Set up defaults for internal error codes. */ #ifndef ARCHIVE_ERRNO_FILE_FORMAT #if HAVE_EFTYPE Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Sep 14 21:15:01 2016 (r305819) @@ -411,9 +411,7 @@ setup_acls(struct archive_read_disk *a, { const char *accpath; acl_t acl; -#if HAVE_ACL_IS_TRIVIAL_NP int r; -#endif accpath = archive_entry_sourcepath(entry); if (accpath == NULL) @@ -473,9 +471,13 @@ setup_acls(struct archive_read_disk *a, } #endif if (acl != NULL) { - translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); acl_free(acl); - return (ARCHIVE_OK); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate NFSv4 ACLs: %s", accpath); + } + return (r); } #endif /* ACL_TYPE_NFS4 */ @@ -506,19 +508,30 @@ setup_acls(struct archive_read_disk *a, #endif if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); acl = NULL; + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate access ACLs: %s", accpath); + return (r); + } } /* Only directories can have default ACLs. */ if (S_ISDIR(archive_entry_mode(entry))) { acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); acl_free(acl); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate default ACLs: %s", + accpath); + return (r); + } } } return (ARCHIVE_OK); @@ -574,19 +587,23 @@ translate_acl(struct archive_read_disk * #ifdef ACL_TYPE_NFS4 acl_entry_type_t acl_type; acl_flagset_t acl_flagset; - int brand, r; + int brand; #endif acl_entry_t acl_entry; acl_permset_t acl_permset; int i, entry_acl_type; - int s, ae_id, ae_tag, ae_perm; + int r, s, ae_id, ae_tag, ae_perm; const char *ae_name; #ifdef ACL_TYPE_NFS4 // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 // Make sure the "brand" on this ACL is consistent // with the default_entry_acl_type bits provided. - acl_get_brand_np(acl, &brand); + if (acl_get_brand_np(acl, &brand) != 0) { + archive_set_error(&a->archive, errno, + "Failed to read ACL brand"); + return (ARCHIVE_WARN); + } switch (brand) { case ACL_BRAND_POSIX: switch (default_entry_acl_type) { @@ -594,31 +611,43 @@ translate_acl(struct archive_read_disk * case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for POSIX.1e ACL"); + return (ARCHIVE_WARN); } break; case ACL_BRAND_NFS4: if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for NFSv4 ACL"); + return (ARCHIVE_WARN); } break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Unknown ACL brand"); + return (ARCHIVE_WARN); break; } #endif s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get first ACL entry"); + return (ARCHIVE_WARN); + } while (s == 1) { ae_id = -1; ae_name = NULL; ae_perm = 0; - acl_get_tag_type(acl_entry, &acl_tag); + if (acl_get_tag_type(acl_entry, &acl_tag) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL tag type"); + return (ARCHIVE_WARN); + } switch (acl_tag) { case ACL_USER: ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry); @@ -653,13 +682,18 @@ translate_acl(struct archive_read_disk * continue; } - // XXX acl type maps to allow/deny/audit/YYYY bits - // XXX acl_get_entry_type_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs + // XXX acl_type maps to allow/deny/audit/YYYY bits entry_acl_type = default_entry_acl_type; #ifdef ACL_TYPE_NFS4 - r = acl_get_entry_type_np(acl_entry, &acl_type); - if (r == 0) { + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_entry_type_np() falis with non-NFSv4 ACLs + */ + if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) { + archive_set_error(&a->archive, errno, "Failed " + "to get ACL type from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } switch (acl_type) { case ACL_ENTRY_TYPE_ALLOW: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; @@ -673,32 +707,53 @@ translate_acl(struct archive_read_disk * case ACL_ENTRY_TYPE_ALARM: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; break; + default: + archive_set_error(&a->archive, errno, + "Invalid NFSv4 ACL entry type"); + return (ARCHIVE_WARN); } - } - /* - * Libarchive stores "flag" (NFSv4 inheritance bits) - * in the ae_perm bitmap. - */ - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { + /* + * Libarchive stores "flag" (NFSv4 inheritance bits) + * in the ae_perm bitmap. + * + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get flagset from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) + r = acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check flag in a NFSv4 " + "ACL flagset"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_inherit_map[i].archive_inherit; } } #endif - acl_get_permset(acl_entry, &acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL permission set"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { /* * acl_get_perm() is spelled differently on different * platforms; see above. */ - if (ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm)) + r = ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check permission in an ACL permission set"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_perm_map[i].archive_perm; } @@ -707,6 +762,11 @@ translate_acl(struct archive_read_disk * ae_id, ae_name); s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get next ACL entry"); + return (ARCHIVE_WARN); + } } return (ARCHIVE_OK); } Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Wed Sep 14 21:15:01 2016 (r305819) @@ -165,7 +165,7 @@ struct filesystem { int synthetic; int remote; int noatime; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t name_max; #endif long incr_xfer_size; @@ -200,7 +200,7 @@ struct tree { DIR *d; #define INVALID_DIR_HANDLE NULL struct dirent *de; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) struct dirent *dirent; size_t dirent_allocated; #endif @@ -1592,7 +1592,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ #if defined(HAVE_STRUCT_STATFS_F_NAMEMAX) t->current_filesystem->name_max = sfs.f_namemax; @@ -1615,7 +1615,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; #endif -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -1817,7 +1817,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namelen; #endif @@ -1901,7 +1901,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namemax; #endif @@ -1918,7 +1918,7 @@ static int setup_current_filesystem(struct archive_read_disk *a) { struct tree *t = a->tree; -#if defined(_PC_NAME_MAX) && defined(HAVE_READDIR_R) +#if defined(_PC_NAME_MAX) && defined(USE_READDIR_R) long nm; #endif t->current_filesystem->synthetic = -1;/* Not supported */ @@ -1930,7 +1930,7 @@ setup_current_filesystem(struct archive_ t->current_filesystem->min_xfer_size = -1; t->current_filesystem->incr_xfer_size = -1; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ # if defined(_PC_NAME_MAX) if (tree_current_is_symblic_link_target(t)) { @@ -1958,7 +1958,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; # endif /* _PC_NAME_MAX */ -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -2366,7 +2366,7 @@ tree_dir_next_posix(struct tree *t) size_t namelen; if (t->d == NULL) { -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t dirent_size; #endif @@ -2387,7 +2387,7 @@ tree_dir_next_posix(struct tree *t) t->visit_type = r != 0 ? r : TREE_ERROR_DIR; return (t->visit_type); } -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) dirent_size = offsetof(struct dirent, d_name) + t->filesystem_table[t->current->filesystem_id].name_max + 1; if (t->dirent == NULL || t->dirent_allocated < dirent_size) { @@ -2404,11 +2404,11 @@ tree_dir_next_posix(struct tree *t) } t->dirent_allocated = dirent_size; } -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ } for (;;) { errno = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) r = readdir_r(t->d, t->dirent, &t->de); #ifdef _AIX /* Note: According to the man page, return value 9 indicates @@ -2660,7 +2660,7 @@ tree_free(struct tree *t) if (t == NULL) return; archive_string_free(&t->path); -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) free(t->dirent); #endif free(t->sparse_list); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Wed Sep 14 21:15:01 2016 (r305819) @@ -136,6 +136,7 @@ struct tar { int64_t entry_padding; int64_t entry_bytes_unconsumed; int64_t realsize; + int sparse_allowed; struct sparse_block *sparse_list; struct sparse_block *sparse_last; int64_t sparse_offset; @@ -1271,6 +1272,14 @@ header_common(struct archive_read *a, st * sparse information in the extended area. */ /* FALLTHROUGH */ + case '0': + /* + * Enable sparse file "read" support only for regular + * files and explicit GNU sparse files. However, we + * don't allow non-standard file types to be sparse. + */ + tar->sparse_allowed = 1; + /* FALLTHROUGH */ default: /* Regular file and non-standard types */ /* * Per POSIX: non-recognized types should always be @@ -1730,6 +1739,14 @@ pax_attribute(struct archive_read *a, st #endif switch (key[0]) { case 'G': + /* Reject GNU.sparse.* headers on non-regular files. */ + if (strncmp(key, "GNU.sparse", 10) == 0 && + !tar->sparse_allowed) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Non-regular file cannot be sparse"); + return (ARCHIVE_FATAL); + } + /* GNU "0.0" sparse pax format. */ if (strcmp(key, "GNU.sparse.numblocks") == 0) { tar->sparse_offset = -1; Modified: head/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_acl.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_write_disk_acl.c Wed Sep 14 21:15:01 2016 (r305819) @@ -153,9 +153,19 @@ set_acl(struct archive *a, int fd, const if (entries == 0) return (ARCHIVE_OK); acl = acl_init(entries); + if (acl == (acl_t)NULL) { + archive_set_error(a, errno, + "Failed to initialize ACL working storage"); + return (ARCHIVE_FAILED); + } while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { - acl_create_entry(&acl, &acl_entry); + if (acl_create_entry(&acl, &acl_entry) != 0) { + archive_set_error(a, errno, + "Failed to create a new ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } switch (ae_tag) { case ARCHIVE_ENTRY_ACL_USER: @@ -186,53 +196,96 @@ set_acl(struct archive *a, int fd, const break; #endif default: - /* XXX */ - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; } #ifdef ACL_TYPE_NFS4 + r = 0; switch (ae_type) { case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); break; case ARCHIVE_ENTRY_ACL_TYPE_DENY: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); break; case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); break; case ARCHIVE_ENTRY_ACL_TYPE_ALARM: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); break; case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: // These don't translate directly into the system ACL. break; default: - // XXX error handling here. - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (r != 0) { + archive_set_error(a, errno, + "Failed to set ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; } #endif - acl_get_permset(acl_entry, &acl_permset); - acl_clear_perms(acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to get ACL permission set"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_perms(acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to clear ACL permissions"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { if (ae_permset & acl_perm_map[i].archive_perm) - acl_add_perm(acl_permset, - acl_perm_map[i].platform_perm); + if (acl_add_perm(acl_permset, + acl_perm_map[i].platform_perm) != 0) { + archive_set_error(a, errno, + "Failed to add ACL permission"); + ret = ARCHIVE_FAILED; + goto exit_free; + } } #ifdef ACL_TYPE_NFS4 - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { - acl_clear_flags_np(acl_flagset); + if (acl_type == ACL_TYPE_NFS4) { + /* + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to get flagset from an NFSv4 ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_flags_np(acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to clear flags from an NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + if (ae_permset & acl_inherit_map[i].archive_inherit) { + if (acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit) != 0) { + archive_set_error(a, errno, + "Failed to add flag to NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } } } #endif @@ -262,6 +315,7 @@ set_acl(struct archive *a, int fd, const ret = ARCHIVE_WARN; } #endif +exit_free: acl_free(acl); return (ret); } Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Sep 14 21:01:02 2016 (r305818) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Sep 14 21:15:01 2016 (r305819) @@ -140,7 +140,17 @@ __FBSDID("$FreeBSD$"); #define O_BINARY 0 #endif #ifndef O_CLOEXEC -#define O_CLOEXEC 0 +#define O_CLOEXEC 0 +#endif + +/* Ignore non-int O_NOFOLLOW constant. */ +/* gnulib's fcntl.h does this on AIX, but it seems practical everywhere */ +#if defined O_NOFOLLOW && !(INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) +#undef O_NOFOLLOW +#endif + +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 0 #endif struct fixup_entry { @@ -326,12 +336,14 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) +static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); #if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *ad); #endif +static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); @@ -2014,6 +2026,10 @@ create_filesystem_object(struct archive_ const char *linkname; mode_t final_mode, mode; int r; + /* these for check_symlinks_fsobj */ + char *linkname_copy; /* non-const copy of linkname */ + struct archive_string error_string; + int error_number; /* We identify hard/symlinks according to the link names. */ /* Since link(2) and symlink(2) don't handle modes, we're done here. */ @@ -2022,6 +2038,27 @@ create_filesystem_object(struct archive_ #if !HAVE_LINK return (EPERM); #else + archive_string_init(&error_string); + linkname_copy = strdup(linkname); + if (linkname_copy == NULL) { + return (EPERM); + } + /* TODO: consider using the cleaned-up path as the link target? */ + r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + free(linkname_copy); r = link(linkname, a->name) ? errno : 0; /* * New cpio and pax formats allow hardlink entries @@ -2040,7 +2077,7 @@ create_filesystem_object(struct archive_ a->deferred = 0; } else if (r == 0 && a->filesize > 0) { a->fd = open(a->name, - O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC); + O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW); __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; @@ -2351,126 +2388,233 @@ current_fixup(struct archive_write_disk return (a->current_fixup); } -/* TODO: Make this work. */ -/* - * TODO: The deep-directory support bypasses this; disable deep directory - * support if we're doing symlink checks. - */ /* * TODO: Someday, integrate this with the deep dir support; they both * scan the path and both can be optimized by comparing against other * recent paths. */ /* TODO: Extend this to support symlinks on Windows Vista and later. */ + +/* + * Checks the given path to see if any elements along it are symlinks. Returns + * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. + */ static int -check_symlinks(struct archive_write_disk *a) +check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ - (void)a; /* UNUSED */ + (void)path; /* UNUSED */ + (void)error_number; /* UNUSED */ + (void)error_string; /* UNUSED */ + (void)flags; /* UNUSED */ return (ARCHIVE_OK); #else - char *pn; + int res = ARCHIVE_OK; + char *tail; + char *head; + int last; char c; int r; struct stat st; + int restore_pwd; + + /* Nothing to do here if name is empty */ + if(path[0] == '\0') + return (ARCHIVE_OK); /* * Guard against symlink tricks. Reject any archive entry whose * destination would be altered by a symlink. - */ - /* Whatever we checked last time doesn't need to be re-checked. */ - pn = a->name; - if (archive_strlen(&(a->path_safe)) > 0) { - char *p = a->path_safe.s; - while ((*pn != '\0') && (*p == *pn)) - ++p, ++pn; - } + * + * Walk the filename in chunks separated by '/'. For each segment: + * - if it doesn't exist, continue + * - if it's symlink, abort or remove it + * - if it's a directory and it's not the last chunk, cd into it + * As we go: + * head points to the current (relative) path + * tail points to the temporary \0 terminating the segment we're currently examining + * c holds what used to be in *tail + * last is 1 if this is the last tail + */ + restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(restore_pwd); + if (restore_pwd < 0) + return (ARCHIVE_FATAL); + head = path; + tail = path; + last = 0; + /* TODO: reintroduce a safe cache here? */ /* Skip the root directory if the path is absolute. */ - if(pn == a->name && pn[0] == '/') - ++pn; - c = pn[0]; - /* Keep going until we've checked the entire name. */ - while (pn[0] != '\0' && (pn[0] != '/' || pn[1] != '\0')) { + if(tail == path && tail[0] == '/') + ++tail; + /* Keep going until we've checked the entire name. + * head, tail, path all alias the same string, which is + * temporarily zeroed at tail, so be careful restoring the + * stashed (c=tail[0]) for error messages. + * Exiting the loop with break is okay; continue is not. + */ + while (!last) { + /* Skip the separator we just consumed, plus any adjacent ones */ + while (*tail == '/') + ++tail; /* Skip the next path element. */ - while (*pn != '\0' && *pn != '/') - ++pn; - c = pn[0]; - pn[0] = '\0'; + while (*tail != '\0' && *tail != '/') + ++tail; + /* is this the last path component? */ + last = (tail[0] == '\0') || (tail[0] == '/' && tail[1] == '\0'); + /* temporarily truncate the string here */ + c = tail[0]; + tail[0] = '\0'; /* Check that we haven't hit a symlink. */ - r = lstat(a->name, &st); + r = lstat(head, &st); if (r != 0) { + tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ if (errno == ENOENT) { break; } else { - /* Note: This effectively disables deep directory + /* Treat any other error as fatal - best to be paranoid here + * Note: This effectively disables deep directory * support when security checks are enabled. * Otherwise, very long pathnames that trigger * an error here could evade the sandbox. * TODO: We could do better, but it would probably * require merging the symlink checks with the * deep-directory editing. */ - return (ARCHIVE_FAILED); + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not stat %s", + path); + res = ARCHIVE_FAILED; + break; + } + } else if (S_ISDIR(st.st_mode)) { + if (!last) { + if (chdir(head) != 0) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not chdir %s", + path); + res = (ARCHIVE_FATAL); + break; + } + /* Our view is now from inside this dir: */ + head = tail + 1; } } else if (S_ISLNK(st.st_mode)) { - if (c == '\0') { + if (last) { /* * Last element is symlink; remove it * so we can overwrite it with the * item being extracted. */ - if (unlink(a->name)) { - archive_set_error(&a->archive, errno, - "Could not remove symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head)) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not remove symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; /* * Even if we did remove it, a warning * is in order. The warning is silly, * though, if we're just replacing one * symlink with another symlink. */ - if (!S_ISLNK(a->mode)) { - archive_set_error(&a->archive, 0, - "Removing symlink %s", - a->name); + tail[0] = c; + /* FIXME: not sure how important this is to restore + if (!S_ISLNK(path)) { + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Removing symlink %s", + path); } + */ /* Symlink gone. No more problem! */ - pn[0] = c; - return (0); - } else if (a->flags & ARCHIVE_EXTRACT_UNLINK) { + res = ARCHIVE_OK; + break; + } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(a->name) != 0) { - archive_set_error(&a->archive, 0, - "Cannot remove intervening symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head) != 0) { + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot remove intervening symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; + tail[0] = c; } else { - archive_set_error(&a->archive, 0, - "Cannot extract through symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot extract through symlink %s", + path); + res = ARCHIVE_FAILED; + break; } } - pn[0] = c; - if (pn[0] != '\0') - pn++; /* Advance to the next segment. */ - } - pn[0] = c; - /* We've checked and/or cleaned the whole path, so remember it. */ - archive_strcpy(&a->path_safe, a->name); - return (ARCHIVE_OK); + /* be sure to always maintain this */ + tail[0] = c; + if (tail[0] != '\0') + tail++; /* Advance to the next segment. */ + } + /* Catches loop exits via break */ + tail[0] = c; +#ifdef HAVE_FCHDIR + /* If we changed directory above, restore it here. */ + if (restore_pwd >= 0) { + r = fchdir(restore_pwd); + if (r != 0) { + if(error_number) *error_number = errno; + if(error_string) + archive_string_sprintf(error_string, + "chdir() failure"); + } + close(restore_pwd); + restore_pwd = -1; + if (r != 0) { + res = (ARCHIVE_FATAL); + } + } +#endif + /* TODO: reintroduce a safe cache here? */ + return res; #endif } +/* + * Check a->name for symlinks, returning ARCHIVE_OK if its clean, otherwise + * calls archive_set_error and returns ARCHIVE_{FATAL,FAILED} + */ +static int +check_symlinks(struct archive_write_disk *a) +{ + struct archive_string error_string; + int error_number; + int rc; + archive_string_init(&error_string); + rc = check_symlinks_fsobj(a->name, &error_number, &error_string, a->flags); + if (rc != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + } + archive_string_free(&error_string); + a->pst = NULL; /* to be safe */ + return rc; +} + + #if defined(__CYGWIN__) /* * 1. Convert a path separator from '\' to '/' . @@ -2544,15 +2688,17 @@ cleanup_pathname_win(struct archive_writ * is set) if the path is absolute. */ static int -cleanup_pathname(struct archive_write_disk *a) +cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { char *dest, *src; char separator = '\0'; - dest = src = a->name; + dest = src = path; if (*src == '\0') { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid empty pathname"); + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Invalid empty pathname"); return (ARCHIVE_FAILED); } @@ -2561,9 +2707,11 @@ cleanup_pathname(struct archive_write_di #endif /* Skip leading '/'. */ if (*src == '/') { - if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Path is absolute"); + if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Path is absolute"); return (ARCHIVE_FAILED); } @@ -2590,10 +2738,11 @@ cleanup_pathname(struct archive_write_di } else if (src[1] == '.') { if (src[2] == '/' || src[2] == '\0') { /* Conditionally warn about '..' */ - if (a->flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Path contains '..'"); + if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Sep 14 23:24:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560D1BDA11B; Wed, 14 Sep 2016 23:24:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 28CD71693; Wed, 14 Sep 2016 23:24:24 +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 u8ENONo9068729; Wed, 14 Sep 2016 23:24:23 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8ENONYG068728; Wed, 14 Sep 2016 23:24:23 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609142324.u8ENONYG068728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 14 Sep 2016 23:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305820 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 23:24:24 -0000 Author: jhibbits Date: Wed Sep 14 23:24:23 2016 New Revision: 305820 URL: https://svnweb.freebsd.org/changeset/base/305820 Log: Only define db_show_spr if DDB is enabled. PR: 212667 Reported by: Kenneth Salerno Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Wed Sep 14 21:15:01 2016 (r305819) +++ head/sys/powerpc/powerpc/machdep.c Wed Sep 14 23:24:23 2016 (r305820) @@ -527,6 +527,7 @@ spinlock_exit(void) */ extern register_t get_spr(int); +#ifdef DDB DB_SHOW_COMMAND(spr, db_show_spr) { register_t spr; @@ -546,3 +547,4 @@ DB_SHOW_COMMAND(spr, db_show_spr) db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno, (unsigned long)spr); } +#endif From owner-svn-src-head@freebsd.org Thu Sep 15 00:24:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72A9FBDB484; Thu, 15 Sep 2016 00:24:50 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AFC313D9; Thu, 15 Sep 2016 00:24:49 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id kKSpbQ2vngdalkKSqbRr0B; Wed, 14 Sep 2016 18:24:25 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=_Da3-AaO94K6rK72rs4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 48E5D150D; Wed, 14 Sep 2016 17:23:39 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u8F0NcMu021150; Wed, 14 Sep 2016 17:23:38 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201609150023.u8F0NcMu021150@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Pedro Giffuni cc: Baptiste Daroussin , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305787 - in head/usr.sbin/amd: amd amq fixmount fsinfo hlfsd include libamu mk-amd-map pawd scripts wire-test In-Reply-To: Message from Pedro Giffuni of "Wed, 14 Sep 2016 08:37:37 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 14 Sep 2016 17:23:38 -0700 X-CMAE-Envelope: MS4wfN1m6t6j08jCrkDzrHhHlJap0S8AdSrCuAqYEFbefRptQXsmxY8TJzp05qL1L8QTPVeMcRi08JhtVwH2AQfIjH0xQjZ7o/VW1XnUwVjgiMuK1VQwZJYE QgLvkMg5GuKQhVlqN8nICNYB9HF8YW05SzVQEe89NxNaLI6n2K6Bs5L+zcs4BL5rN6Yv9rUHOoNcXtYrfuj/+wyNwW5c/IvSYSFyxX2J99QYnS5GE/+jk73G UUgKo83W89buhJBHC2arTPVDqkzUA+gB5vBNme2t+NRhRtphiCz1bVWBv7V0U9vYCntMKSp8yhg48vnCED9d26pjKLEpz4czZSpT2Ta0yHk= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 00:24:50 -0000 In message , Pedro Giffuni wr ites: > Hello; > > > On 14/09/2016 00:00, Baptiste Daroussin wrote: > > On Wed, Sep 14, 2016 at 01:47:01AM +0000, Cy Schubert wrote: > >> Author: cy > >> Date: Wed Sep 14 01:47:01 2016 > >> New Revision: 305787 > >> URL: https://svnweb.freebsd.org/changeset/base/305787 > >> > >> Log: > >> Switch from .CURDIR to the simpler, more legible SRCTOP. > >> > >> Suggested by: emaste > >> X-MFC-with: upcoming amd upgrade > >> > > I thought the plans was more to deprecated and remove amd at some points gi > ven > > we now have autofs/automountd? Am I missing something? > > We haven't discussed deprecation, although it's not off the table. > > From what I read about amd, it gets along with autofs well. > It appears some sysadmins may be used to amd and just removing it may > violate POLA. True. > > It may be that the port/pkg is sufficient but before removing we should > update it to match what the port has. Agreed. I'm working on the update bit. It's mostly done. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Sep 15 01:55:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC67BDB521; Thu, 15 Sep 2016 01:55:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3E7AD12AD; Thu, 15 Sep 2016 01:55:19 +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 u8F1tICV029631; Thu, 15 Sep 2016 01:55:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F1tI7j029630; Thu, 15 Sep 2016 01:55:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609150155.u8F1tI7j029630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 01:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305821 - head/usr.bin/login X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 01:55:19 -0000 Author: emaste Date: Thu Sep 15 01:55:18 2016 New Revision: 305821 URL: https://svnweb.freebsd.org/changeset/base/305821 Log: login: clean up errx strings errx() prefixes the error string with argv[0] so including "login: " in the string is redundant. Also remove a superfluous newline. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/login/login_audit.c Modified: head/usr.bin/login/login_audit.c ============================================================================== --- head/usr.bin/login/login_audit.c Wed Sep 14 23:24:23 2016 (r305820) +++ head/usr.bin/login/login_audit.c Thu Sep 15 01:55:18 2016 (r305821) @@ -73,14 +73,14 @@ au_login_success(void) if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { if (errno == ENOSYS) return; - errx(1, "login: Could not determine audit condition"); + errx(1, "Could not determine audit condition"); } if (au_cond == AUC_NOAUDIT) return; /* Compute and set the user's preselection mask. */ if (au_user_mask(pwd->pw_name, &aumask) == -1) - errx(1, "login: Could not set audit mask\n"); + errx(1, "Could not set audit mask"); /* Set the audit info for the user. */ auinfo.ai_auid = uid; @@ -88,22 +88,22 @@ au_login_success(void) bcopy(&tid, &auinfo.ai_termid, sizeof(auinfo.ai_termid)); bcopy(&aumask, &auinfo.ai_mask, sizeof(auinfo.ai_mask)); if (setaudit(&auinfo) != 0) - err(1, "login: setaudit failed"); + err(1, "setaudit failed"); if ((aufd = au_open()) == -1) - errx(1,"login: Audit Error: au_open() failed"); + errx(1, "Audit Error: au_open() failed"); if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, pid, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); au_write(aufd, tok); if ((tok = au_to_return32(0, 0)) == NULL) - errx(1, "login: Audit Error: au_to_return32() failed"); + errx(1, "Audit Error: au_to_return32() failed"); au_write(aufd, tok); if (au_close(aufd, 1, AUE_login) == -1) - errx(1, "login: Audit Record was not committed."); + errx(1, "Audit Record was not committed."); } /* @@ -124,13 +124,13 @@ au_login_fail(const char *errmsg, int na if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { if (errno == ENOSYS) return; - errx(1, "login: Could not determine audit condition"); + errx(1, "Could not determine audit condition"); } if (au_cond == AUC_NOAUDIT) return; if ((aufd = au_open()) == -1) - errx(1, "login: Audit Error: au_open() failed"); + errx(1, "Audit Error: au_open() failed"); if (na) { /* @@ -139,28 +139,28 @@ au_login_fail(const char *errmsg, int na */ if ((tok = au_to_subject32(-1, geteuid(), getegid(), -1, -1, pid, -1, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); } else { /* We know the subject -- so use its value instead. */ uid = pwd->pw_uid; gid = pwd->pw_gid; if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, pid, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); } au_write(aufd, tok); /* Include the error message. */ if ((tok = au_to_text(errmsg)) == NULL) - errx(1, "login: Audit Error: au_to_text() failed"); + errx(1, "Audit Error: au_to_text() failed"); au_write(aufd, tok); if ((tok = au_to_return32(1, errno)) == NULL) - errx(1, "login: Audit Error: au_to_return32() failed"); + errx(1, "Audit Error: au_to_return32() failed"); au_write(aufd, tok); if (au_close(aufd, 1, AUE_login) == -1) - errx(1, "login: Audit Error: au_close() was not committed"); + errx(1, "Audit Error: au_close() was not committed"); } /* @@ -181,24 +181,24 @@ audit_logout(void) if (auditon(A_GETCOND, &au_cond, sizeof(int)) < 0) { if (errno == ENOSYS) return; - errx(1, "login: Could not determine audit condition"); + errx(1, "Could not determine audit condition"); } if (au_cond == AUC_NOAUDIT) return; if ((aufd = au_open()) == -1) - errx(1, "login: Audit Error: au_open() failed"); + errx(1, "Audit Error: au_open() failed"); /* The subject that is created (euid, egid of the current process). */ if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, pid, &tid)) == NULL) - errx(1, "login: Audit Error: au_to_subject32() failed"); + errx(1, "Audit Error: au_to_subject32() failed"); au_write(aufd, tok); if ((tok = au_to_return32(0, 0)) == NULL) - errx(1, "login: Audit Error: au_to_return32() failed"); + errx(1, "Audit Error: au_to_return32() failed"); au_write(aufd, tok); if (au_close(aufd, 1, AUE_logout) == -1) - errx(1, "login: Audit Record was not committed."); + errx(1, "Audit Record was not committed."); } From owner-svn-src-head@freebsd.org Thu Sep 15 01:58:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D8C5BDB5DC; Thu, 15 Sep 2016 01:58:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3B95114BB; Thu, 15 Sep 2016 01:58:13 +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 u8F1wCKt029761; Thu, 15 Sep 2016 01:58:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F1wCvL029760; Thu, 15 Sep 2016 01:58:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609150158.u8F1wCvL029760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 01:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305822 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 01:58:13 -0000 Author: emaste Date: Thu Sep 15 01:58:12 2016 New Revision: 305822 URL: https://svnweb.freebsd.org/changeset/base/305822 Log: bspatch: use #define for header size instead of magic number Reviewed by: allanjude, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7861 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 15 01:55:18 2016 (r305821) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 15 01:58:12 2016 (r305822) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,6 +53,7 @@ __FBSDID("$FreeBSD$"); #ifndef O_BINARY #define O_BINARY 0 #endif +#define HEADER_SIZE 32 static char *newfile; static int dirfd = -1; @@ -101,12 +103,11 @@ int main(int argc, char *argv[]) int newfd, oldfd; off_t oldsize, newsize; off_t bzctrllen, bzdatalen; - u_char header[32], buf[8]; + u_char header[HEADER_SIZE], buf[8]; u_char *old, *new; off_t oldpos, newpos; off_t ctrl[3]; - off_t lenread; - off_t i; + off_t i, lenread, offset; #ifdef HAVE_CAPSICUM cap_rights_t rights_dir, rights_ro, rights_wr; #endif @@ -181,7 +182,7 @@ int main(int argc, char *argv[]) */ /* Read header */ - if (fread(header, 1, 32, f) < 32) { + if (fread(header, 1, HEADER_SIZE, f) < HEADER_SIZE) { if (feof(f)) errx(1, "Corrupt patch"); err(1, "fread(%s)", argv[3]); @@ -195,27 +196,27 @@ int main(int argc, char *argv[]) bzctrllen = offtin(header + 8); bzdatalen = offtin(header + 16); newsize = offtin(header + 24); - if (bzctrllen < 0 || bzctrllen > OFF_MAX - 32 || - bzdatalen < 0 || bzctrllen + 32 > OFF_MAX - bzdatalen || + if (bzctrllen < 0 || bzctrllen > OFF_MAX - HEADER_SIZE || + bzdatalen < 0 || bzctrllen + HEADER_SIZE > OFF_MAX - bzdatalen || newsize < 0 || newsize > SSIZE_MAX) errx(1, "Corrupt patch"); /* Close patch file and re-open it via libbzip2 at the right places */ if (fclose(f)) err(1, "fclose(%s)", argv[3]); - if (fseeko(cpf, 32, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)32); + offset = HEADER_SIZE; + if (fseeko(cpf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - if (fseeko(dpf, 32 + bzctrllen, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)(32 + bzctrllen)); + offset += bzctrllen; + if (fseeko(dpf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET)) - err(1, "fseeko(%s, %lld)", argv[3], - (long long)(32 + bzctrllen + bzdatalen)); + offset += bzdatalen; + if (fseeko(epf, offset, SEEK_SET)) + err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); From owner-svn-src-head@freebsd.org Thu Sep 15 02:48:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34B2EBDB53A; Thu, 15 Sep 2016 02:48:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id 05F121AF1; Thu, 15 Sep 2016 02:48: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 u8F2muPP048400; Thu, 15 Sep 2016 02:48:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F2murT048399; Thu, 15 Sep 2016 02:48:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609150248.u8F2murT048399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 02:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305823 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 02:48:57 -0000 Author: emaste Date: Thu Sep 15 02:48:56 2016 New Revision: 305823 URL: https://svnweb.freebsd.org/changeset/base/305823 Log: sdiff: improve errx string errx() appends a newline so \n is superfluous. Also switch to lower case with no period for consistency with other errx strings. Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Thu Sep 15 01:58:12 2016 (r305822) +++ head/usr.bin/sdiff/sdiff.c Thu Sep 15 02:48:56 2016 (r305823) @@ -488,7 +488,7 @@ binexec(char *diffprog, char *f1, char * execv(diffprog, args); /* If execv() fails, sdiff's execution will continue below. */ - errx(1, "Could not execute diff process.\n"); + errx(1, "could not execute diff process"); } /* From owner-svn-src-head@freebsd.org Thu Sep 15 05:07:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B52F2BDB886; Thu, 15 Sep 2016 05:07:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 635E311AC; Thu, 15 Sep 2016 05:07:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id A0D407826A9; Thu, 15 Sep 2016 15:07:53 +1000 (AEST) Date: Thu, 15 Sep 2016 15:07:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305821 - head/usr.bin/login In-Reply-To: <201609150155.u8F1tI7j029630@repo.freebsd.org> Message-ID: <20160915144746.X806@besplex.bde.org> References: <201609150155.u8F1tI7j029630@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.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=YKd6FehL3BivA6oiOWAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 05:07:57 -0000 On Thu, 15 Sep 2016, Ed Maste wrote: > Log: > login: clean up errx strings > > errx() prefixes the error string with argv[0] so including "login: " > in the string is redundant. Also remove a superfluous newline. The strings still have plenty of dirt: > Modified: head/usr.bin/login/login_audit.c > ============================================================================== > --- head/usr.bin/login/login_audit.c Wed Sep 14 23:24:23 2016 (r305820) > +++ head/usr.bin/login/login_audit.c Thu Sep 15 01:55:18 2016 (r305821) > @@ -73,14 +73,14 @@ au_login_success(void) > if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { > if (errno == ENOSYS) > return; > - errx(1, "login: Could not determine audit condition"); > + errx(1, "Could not determine audit condition"); Capitalization. Error messages are conventionally not capitalized (but strerror() strings break this). This file does this in many more places, but not all. > @@ -88,22 +88,22 @@ au_login_success(void) > bcopy(&tid, &auinfo.ai_termid, sizeof(auinfo.ai_termid)); > bcopy(&aumask, &auinfo.ai_mask, sizeof(auinfo.ai_mask)); > if (setaudit(&auinfo) != 0) > - err(1, "login: setaudit failed"); > + err(1, "setaudit failed"); Example of normal style for an error message. Should possibly indicate that it was a specific function/syscall that failed by marking up the function with "()". > > if ((aufd = au_open()) == -1) > - errx(1,"login: Audit Error: au_open() failed"); > + errx(1, "Audit Error: au_open() failed"); This marks up the function and adds the doubly Capitalized spam "Audit Error: ". Who would have thought that an error message is for an error? "Audit " is not as redundant as that, but is not used in all of the messages. Since this uses errx() and not err(), a different style is justified, but it is probably wrong to not use strerror() when a function/syscall name is printed. The "failed" part of the message is nondescript. > > if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, gid, pid, > pid, &tid)) == NULL) > - errx(1, "login: Audit Error: au_to_subject32() failed"); > + errx(1, "Audit Error: au_to_subject32() failed"); > au_write(aufd, tok); > > if ((tok = au_to_return32(0, 0)) == NULL) > - errx(1, "login: Audit Error: au_to_return32() failed"); > + errx(1, "Audit Error: au_to_return32() failed"); > au_write(aufd, tok); Spam continues. The function name is a bit too long to print. > > if (au_close(aufd, 1, AUE_login) == -1) > - errx(1, "login: Audit Record was not committed."); > + errx(1, "Audit Record was not committed."); > } Now "Audit Record" is useful because the function name is not printed. Not printing the function name is a different and perhaps better style. I usually print the function name when I don't want to think about a better discription. Error messages are conventionally not capitalized, and most in this file are not. but this one is. > > /* > @@ -124,13 +124,13 @@ au_login_fail(const char *errmsg, int na > if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { > if (errno == ENOSYS) > return; > - errx(1, "login: Could not determine audit condition"); > + errx(1, "Could not determine audit condition"); > } Back to only 1 capitialization error. > if (au_cond == AUC_NOAUDIT) > return; > > if ((aufd = au_open()) == -1) > - errx(1, "login: Audit Error: au_open() failed"); > + errx(1, "Audit Error: au_open() failed"); Back to spam. > > if (na) { > /* > @@ -139,28 +139,28 @@ au_login_fail(const char *errmsg, int na > */ > if ((tok = au_to_subject32(-1, geteuid(), getegid(), -1, -1, > pid, -1, &tid)) == NULL) > - errx(1, "login: Audit Error: au_to_subject32() failed"); > + errx(1, "Audit Error: au_to_subject32() failed"); > } else { > /* We know the subject -- so use its value instead. */ > uid = pwd->pw_uid; > gid = pwd->pw_gid; > if ((tok = au_to_subject32(uid, geteuid(), getegid(), uid, > gid, pid, pid, &tid)) == NULL) > - errx(1, "login: Audit Error: au_to_subject32() failed"); > + errx(1, "Audit Error: au_to_subject32() failed"); > ... The general style reduces to "error: xxx failed [duh]" with careful use of errx() instead of err() to prevent leakage of useful information. Bruce From owner-svn-src-head@freebsd.org Thu Sep 15 07:41:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB766BDAFC8; Thu, 15 Sep 2016 07:41:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E761C47; Thu, 15 Sep 2016 07:41:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8F7foJR059166; Thu, 15 Sep 2016 07:41:50 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F7fmcM059138; Thu, 15 Sep 2016 07:41:48 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201609150741.u8F7fmcM059138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 15 Sep 2016 07:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 07:41:51 -0000 Author: kevlo Date: Thu Sep 15 07:41:48 2016 New Revision: 305824 URL: https://svnweb.freebsd.org/changeset/base/305824 Log: Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D7878 Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_compat.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/kern/uipc_socket.c head/sys/net/if_arcsubr.c head/sys/net/if_fddisubr.c head/sys/net/if_iso88025subr.c head/sys/net/raw_usrreq.c head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_output.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/icmp6.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_output.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/keysock.c head/sys/sys/mbuf.h Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 15 07:41:48 2016 (r305824) @@ -3226,7 +3226,7 @@ filterdone: fdp = fin->fin_dif; if ((fdp != NULL) && (fdp->fd_ptr != NULL) && (fdp->fd_ptr != (void *)-1)) { - mc = M_COPY(fin->fin_m); + mc = M_COPYM(fin->fin_m); if (mc != NULL) ipf_fastroute(mc, &mc, fin, fdp); } Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Sep 15 07:41:48 2016 (r305824) @@ -211,7 +211,7 @@ struct ether_addr { # define MSGDSIZE(m) mbufchainlen(m) # define M_LEN(m) (m)->m_len # define M_ADJ(m,x) m_adj(m, x) -# define M_COPY(x) m_copy((x), 0, M_COPYALL) +# define M_COPYM(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) # define M_DUP(m) m_dup(m, M_NOWAIT) # define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } typedef struct mbuf mb_t; @@ -366,7 +366,7 @@ typedef struct mb_s { # define MSGDSIZE(m) msgdsize(m) # define M_LEN(m) (m)->mb_len # define M_ADJ(m,x) (m)->mb_len += x -# define M_COPY(m) dupmbt(m) +# define M_COPYM(m) dupmbt(m) # define M_DUP(m) dupmbt(m) # define GETKTIME(x) gettimeofday((struct timeval *)(x), NULL) # define MTOD(m, t) ((t)(m)->mb_data) Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Sep 15 07:41:48 2016 (r305824) @@ -920,7 +920,7 @@ ipf_fastroute(m0, mpp, fin, fdp) mhip->ip_off |= IP_MF; mhip->ip_len = htons((u_short)(len + mhlen)); *mnext = m; - m->m_next = m_copy(m0, off, len); + m->m_next = m_copym(m0, off, len, M_NOWAIT); if (m->m_next == 0) { error = ENOBUFS; /* ??? */ goto sendorfree; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/kern/uipc_socket.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1640,7 +1640,8 @@ dontblock: do { if (flags & MSG_PEEK) { if (controlp != NULL) { - *controlp = m_copy(m, 0, m->m_len); + *controlp = m_copym(m, 0, m->m_len, + M_NOWAIT); controlp = &(*controlp)->m_next; } m = m->m_next; Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/if_arcsubr.c Thu Sep 15 07:41:48 2016 (r305824) @@ -225,7 +225,7 @@ arc_output(struct ifnet *ifp, struct mbu if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { - struct mbuf *n = m_copy(m, 0, (int)M_COPYALL); + struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); (void) if_simloop(ifp, n, dst->sa_family, ARC_HDRLEN); } else if (ah->arc_dhost == ah->arc_shost) { Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/if_fddisubr.c Thu Sep 15 07:41:48 2016 (r305824) @@ -275,7 +275,7 @@ fddi_output(struct ifnet *ifp, struct mb if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); (void) if_simloop(ifp, n, dst->sa_family, FDDI_HDR_LEN); } else if (bcmp(fh->fddi_dhost, fh->fddi_shost, Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/if_iso88025subr.c Thu Sep 15 07:41:48 2016 (r305824) @@ -364,7 +364,7 @@ iso88025_output(struct ifnet *ifp, struc if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) { if ((m->m_flags & M_BCAST) || (loop_copy > 0)) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); (void) if_simloop(ifp, n, dst->sa_family, ISO88025_HDR_LEN); } else if (bcmp(th->iso88025_dhost, th->iso88025_shost, Modified: head/sys/net/raw_usrreq.c ============================================================================== --- head/sys/net/raw_usrreq.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/net/raw_usrreq.c Thu Sep 15 07:41:48 2016 (r305824) @@ -95,7 +95,7 @@ raw_input_ext(struct mbuf *m0, struct so continue; if (last) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n) { if (sbappendaddr(&last->so_rcv, src, n, (struct mbuf *)0) == 0) Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/ip_input.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1000,7 +1000,7 @@ ip_forward(struct mbuf *m, int srcrt) * because unnecessary, or because rate limited), so we are * really we are wasting a lot of work here. * - * We don't use m_copy() because it might return a reference + * We don't use m_copym() because it might return a reference * to a shared cluster. Both this function and ip_output() * assume exclusive access to the IP header in `m', so any * data in a cluster may change before we reach icmp_error(). Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/ip_mroute.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1344,7 +1344,7 @@ X_ip_mforward(struct ip *ip, struct ifne goto fail; /* Make a copy of the header to send to the user level process */ - mm = m_copy(mb0, 0, hlen); + mm = m_copym(mb0, 0, hlen, M_NOWAIT); if (mm == NULL) goto fail1; @@ -1542,7 +1542,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET }; struct igmpmsg *im; int hlen = ip->ip_hl << 2; - struct mbuf *mm = m_copy(m, 0, hlen); + struct mbuf *mm = m_copym(m, 0, hlen, M_NOWAIT); if (mm && (!M_WRITABLE(mm) || mm->m_len < hlen)) mm = m_pullup(mm, hlen); @@ -2734,9 +2734,9 @@ pim_input(struct mbuf **mp, int *offp, i * actions (e.g., send back PIM_REGISTER_STOP). * XXX: here m->m_data points to the outer IP header. */ - mcp = m_copy(m, 0, iphlen + PIM_REG_MINLEN); + mcp = m_copym(m, 0, iphlen + PIM_REG_MINLEN, M_NOWAIT); if (mcp == NULL) { - CTR1(KTR_IPMF, "%s: m_copy() failed", __func__); + CTR1(KTR_IPMF, "%s: m_copym() failed", __func__); m_freem(m); return (IPPROTO_DONE); } Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/raw_ip.c Thu Sep 15 07:41:48 2016 (r305824) @@ -322,7 +322,7 @@ rip_input(struct mbuf **mp, int *offp, i if (last != NULL) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n != NULL) (void) rip_append(last, ip, n, &ripsrc); /* XXX count dropped packet */ @@ -400,7 +400,7 @@ rip_input(struct mbuf **mp, int *offp, i if (last != NULL) { struct mbuf *n; - n = m_copy(m, 0, (int)M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n != NULL) (void) rip_append(last, ip, n, &ripsrc); /* XXX count dropped packet */ Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/tcp_output.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1049,7 +1049,7 @@ send: mtod(m, caddr_t) + hdrlen); m->m_len += len; } else { - m->m_next = m_copy(mb, moff, (int)len); + m->m_next = m_copym(mb, moff, len, M_NOWAIT); if (m->m_next == NULL) { SOCKBUF_UNLOCK(&so->so_snd); (void) m_free(m); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet/udp_usrreq.c Thu Sep 15 07:41:48 2016 (r305824) @@ -597,7 +597,8 @@ udp_input(struct mbuf **mp, int *offp, i if (last != NULL) { struct mbuf *n; - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != + NULL) { UDP_PROBE(receive, NULL, last, ip, last, uh); if (udp_append(last, ip, n, iphlen, Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/icmp6.c Thu Sep 15 07:41:48 2016 (r305824) @@ -554,7 +554,7 @@ icmp6_input(struct mbuf **mp, int *offp, icmp6_ifstat_inc(ifp, ifs6_in_echo); if (code != 0) goto badcode; - if ((n = m_copy(m, 0, M_COPYALL)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* Give up remote */ break; } @@ -651,7 +651,7 @@ icmp6_input(struct mbuf **mp, int *offp, IP6_EXTHDR_CHECK(m, off, sizeof(struct icmp6_nodeinfo), IPPROTO_DONE); #endif - n = m_copy(m, 0, M_COPYALL); + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n) n = ni6_input(n, off); /* XXX meaningless if n == NULL */ @@ -2039,7 +2039,7 @@ icmp6_rip6_input(struct mbuf **mp, int o } } if (n != NULL || - (n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { + (n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { if (last->inp_flags & INP_CONTROLOPTS) ip6_savecontrol(last, n, &opts); /* strip intermediate headers */ Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/ip6_forward.c Thu Sep 15 07:41:48 2016 (r305824) @@ -166,7 +166,8 @@ ip6_forward(struct mbuf *m, int srcrt) * It is important to save it before IPsec processing as IPsec * processing may modify the mbuf. */ - mcopy = m_copy(m, 0, imin(m->m_pkthdr.len, ICMPV6_PLD_MAXLEN)); + mcopy = m_copym(m, 0, imin(m->m_pkthdr.len, ICMPV6_PLD_MAXLEN), + M_NOWAIT); #ifdef IPSEC /* get a security policy for this packet */ Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/ip6_mroute.c Thu Sep 15 07:41:48 2016 (r305824) @@ -1145,7 +1145,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru MFC6_UNLOCK(); return (ENOBUFS); } - mb0 = m_copy(m, 0, M_COPYALL); + mb0 = m_copym(m, 0, M_COPYALL, M_NOWAIT); /* * Pullup packet header if needed before storing it, * as other references may modify it in the meantime. @@ -1185,7 +1185,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru * Make a copy of the header to send to the user * level process */ - mm = m_copy(mb0, 0, sizeof(struct ip6_hdr)); + mm = m_copym(mb0, 0, sizeof(struct ip6_hdr), M_NOWAIT); if (mm == NULL) { free(rte, M_MRTABLE6); m_freem(mb0); @@ -1417,7 +1417,8 @@ ip6_mdq(struct mbuf *m, struct ifnet *if struct omrt6msg *oim; #endif - mm = m_copy(m, 0, sizeof(struct ip6_hdr)); + mm = m_copym(m, 0, sizeof(struct ip6_hdr), + M_NOWAIT); if (mm && (!M_WRITABLE(mm) || mm->m_len < sizeof(struct ip6_hdr))) @@ -1547,7 +1548,7 @@ phyint_send(struct ip6_hdr *ip6, struct * the IPv6 header is actually copied, not just referenced, * so that ip6_output() only scribbles on the copy. */ - mb_copy = m_copy(m, 0, M_COPYALL); + mb_copy = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (mb_copy && (!M_WRITABLE(mb_copy) || mb_copy->m_len < sizeof(struct ip6_hdr))) mb_copy = m_pullup(mb_copy, sizeof(struct ip6_hdr)); @@ -1651,7 +1652,7 @@ register_send(struct ip6_hdr *ip6, struc mm->m_data += max_linkhdr; mm->m_len = sizeof(struct ip6_hdr); - if ((mm->m_next = m_copy(m, 0, M_COPYALL)) == NULL) { + if ((mm->m_next = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { m_freem(mm); return (ENOBUFS); } @@ -1870,7 +1871,7 @@ pim6_input(struct mbuf **mp, int *offp, /* * make a copy of the whole header to pass to the daemon later. */ - mcp = m_copy(m, 0, off + PIM6_REG_MINLEN); + mcp = m_copym(m, 0, off + PIM6_REG_MINLEN, M_NOWAIT); if (mcp == NULL) { MRT6_DLOG(DEBUG_ANY | DEBUG_ERR, "pim register: " "could not copy register head"); Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/ip6_output.c Thu Sep 15 07:41:48 2016 (r305824) @@ -259,7 +259,7 @@ ip6_fragment(struct ifnet *ifp, struct m ip6f->ip6f_offlg |= IP6F_MORE_FRAG; mhip6->ip6_plen = htons((u_short)(mtu + hlen + sizeof(*ip6f) - sizeof(struct ip6_hdr))); - if ((m_frgpart = m_copy(m0, off, mtu)) == NULL) { + if ((m_frgpart = m_copym(m0, off, mtu, M_NOWAIT)) == NULL) { IP6STAT_INC(ip6s_odropped); return (ENOBUFS); } @@ -3003,7 +3003,7 @@ ip6_mloopback(struct ifnet *ifp, struct struct mbuf *copym; struct ip6_hdr *ip6; - copym = m_copy(m, 0, M_COPYALL); + copym = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (copym == NULL) return; Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/raw_ip6.c Thu Sep 15 07:41:48 2016 (r305824) @@ -256,7 +256,7 @@ rip6_input(struct mbuf **mp, int *offp, } } if (last != NULL) { - struct mbuf *n = m_copy(m, 0, (int)M_COPYALL); + struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); #ifdef IPSEC /* Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netinet6/udp6_usrreq.c Thu Sep 15 07:41:48 2016 (r305824) @@ -366,7 +366,8 @@ udp6_input(struct mbuf **mp, int *offp, if (last != NULL) { struct mbuf *n; - if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != + NULL) { INP_RLOCK(last); UDP_PROBE(receive, NULL, last, ip6, last, uh); Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/netipsec/keysock.c Thu Sep 15 07:41:48 2016 (r305824) @@ -301,7 +301,7 @@ key_sendup_mbuf(struct socket *so, struc * (based on pf_key@inner.net message on 14 Oct 1998) */ if (((struct keycb *)rp)->kp_promisc) { - if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { (void)key_sendup0(rp, n, 1); n = NULL; } @@ -331,7 +331,7 @@ key_sendup_mbuf(struct socket *so, struc if (!sendup) continue; - if ((n = m_copy(m, 0, (int)M_COPYALL)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { m_freem(m); PFKEYSTAT_INC(in_nomem); mtx_unlock(&rawcb_mtx); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Sep 15 02:48:56 2016 (r305823) +++ head/sys/sys/mbuf.h Thu Sep 15 07:41:48 2016 (r305824) @@ -979,9 +979,6 @@ m_align(struct mbuf *m, int len) /* Length to m_copy to copy all. */ #define M_COPYALL 1000000000 -/* Compatibility with 4.3. */ -#define m_copy(m, o, l) m_copym((m), (o), (l), M_NOWAIT) - extern int max_datalen; /* MHLEN - max_hdr */ extern int max_hdr; /* Largest link + protocol header */ extern int max_linkhdr; /* Largest link-level header */ From owner-svn-src-head@freebsd.org Thu Sep 15 07:58:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A91BDB532; Thu, 15 Sep 2016 07:58:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE4C1381; Thu, 15 Sep 2016 07:58:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x241.google.com with SMTP id pp5so1820583pac.2; Thu, 15 Sep 2016 00:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=JLoxVRWf+AYe2bCw5taUlPFDvZNf5X+jrPbJ90p/uRQ=; b=Bsi7/UiWhFyAWSUIIZ85/RkdrUJ7Y2VZ0AJOWQDX9vyJ7E3yXbBaH9TO4/Xqu/e0y3 we2i/W300wSir9RY8PirHZ68o5mjOwECkiy+sc7MOpXVDzu0ovmmPUZn1h9VPiCE7RSp fTAIxGN4JRKeja/14K2jGI5oEatCde98l4i5iqBWlbAvLeNAe93AZNdZmN3/mghd484O OOeBV8QtuCGUjtEfS0d4Rsx7jNSFi1+QsApYJmdflXBK+CkMtf1e6sCHy7PlxhPMibUK YL0uWK6aObkwFplakcPr0Q7iKCQOYgwm2lu2/PYe+ZA/VrhNRsJTehmP/iIu+Xy4Cku7 /sag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=JLoxVRWf+AYe2bCw5taUlPFDvZNf5X+jrPbJ90p/uRQ=; b=Lo9d2PFZVvNtHnBoszo6GdtwCITTPmYB8lLTIwaeg0uM4qTWuNsgA+PiiNZPfcruIY gVrLcUyKDTHcSXJZNS7DjLA/WerRG8lnCOZ59HK5s3gJzGsvXUGrP0iufQ2OwNXySsNE Xv8BElEuLpKH/174conUCefNWyLBeIIznd8WpNNrqD0lOHtjh+h22Z49pykI91VHpePz 6+t+uDvKLzpnGXtLZB40fQ1i5+U1+tHETWe90aKNtP68XkjqMiKEGoj18EfovRJGhYux 1rG0LcgvFCVmdzdhV2iKVHaGECoVFrDUDUgnkTI6uFDrayFXKOEhrARndpEria/ja84f K9lA== X-Gm-Message-State: AE9vXwO50JVxdIfZ7dQb9CPKsw9vOpy4Dx8XW473V8vbpnT4aHjgSYOY19/lehItekmtJw== X-Received: by 10.66.131.48 with SMTP id oj16mr12244021pab.126.1473926314535; Thu, 15 Sep 2016 00:58:34 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id ve9sm2901633pac.12.2016.09.15.00.58.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 00:58:33 -0700 (PDT) Subject: Re: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201609150741.u8F7fmcM059138@repo.freebsd.org> Date: Thu, 15 Sep 2016 00:58:33 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> References: <201609150741.u8F7fmcM059138@repo.freebsd.org> To: Kevin Lo X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 07:58:35 -0000 --Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 15, 2016, at 00:41, Kevin Lo wrote: >=20 > Author: kevlo > Date: Thu Sep 15 07:41:48 2016 > New Revision: 305824 > URL: https://svnweb.freebsd.org/changeset/base/305824 >=20 > Log: > Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. >=20 > Reviewed by: gnn > Differential Revision: https://reviews.freebsd.org/D7878 >=20 > Modified: > head/sys/contrib/ipfilter/netinet/fil.c > head/sys/contrib/ipfilter/netinet/ip_compat.h > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > head/sys/kern/uipc_socket.c > head/sys/net/if_arcsubr.c > head/sys/net/if_fddisubr.c > head/sys/net/if_iso88025subr.c > head/sys/net/raw_usrreq.c > head/sys/netinet/ip_input.c > head/sys/netinet/ip_mroute.c > head/sys/netinet/raw_ip.c > head/sys/netinet/tcp_output.c > head/sys/netinet/udp_usrreq.c > head/sys/netinet6/icmp6.c > head/sys/netinet6/ip6_forward.c > head/sys/netinet6/ip6_mroute.c > head/sys/netinet6/ip6_output.c > head/sys/netinet6/raw_ip6.c > head/sys/netinet6/udp6_usrreq.c > head/sys/netipsec/keysock.c > head/sys/sys/mbuf.h Bump __FreeBSD_version for the change (just in case something=E2=80=99s = using the #define elsewhere)? Thanks! -Ngie --Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJX2lSqAAoJEPWDqSZpMIYVaa8QAMhuiL4uauFoOOHNqcQTAe0d wvyrPM0VQST8CMoPizMPsYmV4fbglVLEOIPOu4xUYnJ+NJLyRew0A9nkOah/+DJ7 /WpD4dRCcBKI3DIcBm88FcL4/hkH+Q8O4Ps5TWVqp5ibR96XWwz0TiSWq5ke01Tw nK67uo1rUuQq6jFi2H1fsiMXj9EcVl2bKgoQARu3sZi3iIPmceeQd5GC6mHVSbT6 N/D1PuCmx4cBm/YXAJSO/OmkfWyui9Ru1QILvMuMyvzKwuOWb1bSPUFZbZlXb/TK t8NQmH9Aj+BdTjkFNBqxIw85e2Aj+dSH+cVps2hDu0IgZkTkXqBspNtxgdxzj2hi rWSdeUeX3/fOQoHK4QRxqQ15mzP7Ms+LmA7DptSKC6b7l95+qYGmut/7ekgm5MVc Q5bWbOgKfsaTMKBMu7iq4wp7IFtz2PEozven9hi04FVfgtvXI6NrkJM5pa2BbUCu rK6ukL4/JyGsO30ZlDvYrRxlg0IzDsRgKvsyGDZzA38BN5NnaNgPRCHHDTIlIcam PzgLif18/g1lZWvmTUWLIubQry4PDmNUn5JrbvMNkpf2e0cCW0Eij/LMFV6bQE0R IbQV0UuiJWni+fBH/ruJgSxDTgiUO3gdYyGuE5WT49HFlUMIhE8j6w5tddvm4KFC h583qEsej8Grg/sP6xjR =11OA -----END PGP SIGNATURE----- --Apple-Mail=_445FC735-3460-4547-AD1F-C0F1E62C395E-- From owner-svn-src-head@freebsd.org Thu Sep 15 08:30:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12C8FBDC248; Thu, 15 Sep 2016 08:30: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 mx1.freebsd.org (Postfix) with ESMTPS id D7E4D1698; Thu, 15 Sep 2016 08:30: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 u8F8UmSj076058; Thu, 15 Sep 2016 08:30:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8F8UmxS076057; Thu, 15 Sep 2016 08:30:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609150830.u8F8UmxS076057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 15 Sep 2016 08:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305827 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 08:30:49 -0000 Author: np Date: Thu Sep 15 08:30:47 2016 New Revision: 305827 URL: https://svnweb.freebsd.org/changeset/base/305827 Log: cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields to use in tx work requests. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Sep 15 08:26:59 2016 (r305826) +++ head/sys/dev/cxgbe/t4_sge.c Thu Sep 15 08:30:47 2016 (r305827) @@ -3253,8 +3253,9 @@ alloc_nm_txq(struct vi_info *vi, struct nm_txq->nid = idx; nm_txq->iqidx = iqidx; nm_txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) | - V_TXPKT_VF(vi->viid)); + V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(G_FW_VIID_PFN(vi->viid)) | + V_TXPKT_VF(G_FW_VIID_VIN(vi->viid)) | + V_TXPKT_VF_VLD(G_FW_VIID_VIVLD(vi->viid))); snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, @@ -3620,8 +3621,10 @@ alloc_txq(struct vi_info *vi, struct sge V_TXPKT_INTF(pi->tx_chan)); else txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) | - V_TXPKT_VF(vi->viid)); + V_TXPKT_INTF(pi->tx_chan) | + V_TXPKT_PF(G_FW_VIID_PFN(vi->viid)) | + V_TXPKT_VF(G_FW_VIID_VIN(vi->viid)) | + V_TXPKT_VF_VLD(G_FW_VIID_VIVLD(vi->viid))); txq->tc_idx = -1; txq->sdesc = malloc(eq->sidx * sizeof(struct tx_sdesc), M_CXGBE, M_ZERO | M_WAITOK); From owner-svn-src-head@freebsd.org Thu Sep 15 13:16:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2707BBDB284; Thu, 15 Sep 2016 13:16:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id C7D85946; Thu, 15 Sep 2016 13:16:27 +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 u8FDGRBI085034; Thu, 15 Sep 2016 13:16:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FDGL5c084975; Thu, 15 Sep 2016 13:16:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609151316.u8FDGL5c084975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Sep 2016 13:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305832 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 13:16:28 -0000 Author: emaste Date: Thu Sep 15 13:16:20 2016 New Revision: 305832 URL: https://svnweb.freebsd.org/changeset/base/305832 Log: Renumber license clauses in sys/kern to avoid skipping #3 Modified: head/sys/kern/kern_acct.c head/sys/kern/kern_clock.c head/sys/kern/kern_cons.c head/sys/kern/kern_descrip.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_ktrace.c head/sys/kern/kern_lockf.c head/sys/kern/kern_malloc.c head/sys/kern/kern_mib.c head/sys/kern/kern_proc.c head/sys/kern/kern_prot.c head/sys/kern/kern_resource.c head/sys/kern/kern_sendfile.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_sig.c head/sys/kern/kern_synch.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_time.c head/sys/kern/kern_timeout.c head/sys/kern/kern_xxx.c head/sys/kern/sched_4bsd.c head/sys/kern/subr_autoconf.c head/sys/kern/subr_blist.c head/sys/kern/subr_clock.c head/sys/kern/subr_hash.c head/sys/kern/subr_log.c head/sys/kern/subr_mchain.c head/sys/kern/subr_param.c head/sys/kern/subr_pcpu.c head/sys/kern/subr_prf.c head/sys/kern/subr_prof.c head/sys/kern/subr_rtc.c head/sys/kern/subr_scanf.c head/sys/kern/subr_uio.c head/sys/kern/sys_generic.c head/sys/kern/sys_socket.c head/sys/kern/tty_compat.c head/sys/kern/tty_info.c head/sys/kern/uipc_domain.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_mbuf2.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_default.c head/sys/kern/vfs_export.c head/sys/kern/vfs_init.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_mountroot.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_acct.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_clock.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_cons.c ============================================================================== --- head/sys/kern/kern_cons.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_cons.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_descrip.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_exit.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_fork.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_ktrace.c Thu Sep 15 13:16:20 2016 (r305832) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_lockf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -39,7 +39,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_malloc.c Thu Sep 15 13:16:20 2016 (r305832) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_mib.c Thu Sep 15 13:16:20 2016 (r305832) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_proc.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_prot.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_resource.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_sendfile.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_shutdown.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_sig.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_synch.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_sysctl.c Thu Sep 15 13:16:20 2016 (r305832) @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_time.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_timeout.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/kern_xxx.c ============================================================================== --- head/sys/kern/kern_xxx.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/kern_xxx.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/sched_4bsd.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_autoconf.c ============================================================================== --- head/sys/kern/subr_autoconf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_autoconf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -14,7 +14,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_blist.c Thu Sep 15 13:16:20 2016 (r305832) @@ -8,7 +8,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_clock.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_hash.c ============================================================================== --- head/sys/kern/subr_hash.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_hash.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_log.c ============================================================================== --- head/sys/kern/subr_log.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_log.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_mchain.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the author nor the names of any co-contributors + * 3. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_param.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_pcpu.c Thu Sep 15 13:16:20 2016 (r305832) @@ -14,7 +14,7 @@ * 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. - * 4. Neither the name of the author nor the names of any co-contributors + * 3. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_prf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_prof.c ============================================================================== --- head/sys/kern/subr_prof.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_prof.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_rtc.c Thu Sep 15 13:16:20 2016 (r305832) @@ -20,7 +20,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_scanf.c ============================================================================== --- head/sys/kern/subr_scanf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_scanf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/subr_uio.c Thu Sep 15 13:16:20 2016 (r305832) @@ -20,7 +20,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/sys_generic.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/sys_socket.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/tty_compat.c ============================================================================== --- head/sys/kern/tty_compat.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/tty_compat.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/tty_info.c Thu Sep 15 13:16:20 2016 (r305832) @@ -23,7 +23,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_domain.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_mbuf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_mbuf2.c Thu Sep 15 13:16:20 2016 (r305832) @@ -41,7 +41,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_sockbuf.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_socket.c Thu Sep 15 13:16:20 2016 (r305832) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_syscalls.c Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/uipc_usrreq.c Thu Sep 15 13:16:20 2016 (r305832) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_cache.c Thu Sep 15 13:16:20 2016 (r305832) @@ -13,7 +13,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_cluster.c Thu Sep 15 13:16:20 2016 (r305832) @@ -12,7 +12,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_default.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_export.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_init.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_lookup.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_mount.c Thu Sep 15 13:16:20 2016 (r305832) @@ -17,7 +17,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_mountroot.c Thu Sep 15 13:16:20 2016 (r305832) @@ -18,7 +18,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_subr.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_syscalls.c Thu Sep 15 13:16:20 2016 (r305832) @@ -15,7 +15,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vfs_vnops.c Thu Sep 15 13:16:20 2016 (r305832) @@ -21,7 +21,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 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. * Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Thu Sep 15 08:38:53 2016 (r305831) +++ head/sys/kern/vnode_if.src Thu Sep 15 13:16:20 2016 (r305832) @@ -10,7 +10,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 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. # From owner-svn-src-head@freebsd.org Thu Sep 15 13:40:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDAD4BDBB0B; Thu, 15 Sep 2016 13:40:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0C3FFF9; Thu, 15 Sep 2016 13:40:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FDea9V092760; Thu, 15 Sep 2016 13:40:36 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FDea0k092759; Thu, 15 Sep 2016 13:40:36 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201609151340.u8FDea0k092759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 15 Sep 2016 13:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305833 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 13:40:38 -0000 Author: kevlo Date: Thu Sep 15 13:40:36 2016 New Revision: 305833 URL: https://svnweb.freebsd.org/changeset/base/305833 Log: Bump __FreeBSD_version for r305824. Suggested by: ngie Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Sep 15 13:16:20 2016 (r305832) +++ head/sys/sys/param.h Thu Sep 15 13:40:36 2016 (r305833) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200007 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200008 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Sep 15 13:46:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB6C8BDBE8E; Thu, 15 Sep 2016 13:46:35 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC25957; Thu, 15 Sep 2016 13:46:34 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.15.2/8.15.2) with ESMTPS id u8FDkIki009007 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Sep 2016 21:46:19 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.15.2/8.15.2/Submit) id u8FDkILK009006; Thu, 15 Sep 2016 21:46:18 +0800 (CST) (envelope-from kevlo) Date: Thu, 15 Sep 2016 21:46:18 +0800 From: Kevin Lo To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys Message-ID: <20160915134618.GA8952@ns.kevlo.org> References: <201609150741.u8F7fmcM059138@repo.freebsd.org> <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 13:46:36 -0000 On Thu, Sep 15, 2016 at 12:58:33AM -0700, Ngie Cooper (yaneurabeya) wrote: > > > On Sep 15, 2016, at 00:41, Kevin Lo wrote: > > > > Author: kevlo > > Date: Thu Sep 15 07:41:48 2016 > > New Revision: 305824 > > URL: https://svnweb.freebsd.org/changeset/base/305824 > > > > Log: > > Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. > > > > Reviewed by: gnn > > Differential Revision: https://reviews.freebsd.org/D7878 > > > > Modified: > > head/sys/contrib/ipfilter/netinet/fil.c > > head/sys/contrib/ipfilter/netinet/ip_compat.h > > head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c > > head/sys/kern/uipc_socket.c > > head/sys/net/if_arcsubr.c > > head/sys/net/if_fddisubr.c > > head/sys/net/if_iso88025subr.c > > head/sys/net/raw_usrreq.c > > head/sys/netinet/ip_input.c > > head/sys/netinet/ip_mroute.c > > head/sys/netinet/raw_ip.c > > head/sys/netinet/tcp_output.c > > head/sys/netinet/udp_usrreq.c > > head/sys/netinet6/icmp6.c > > head/sys/netinet6/ip6_forward.c > > head/sys/netinet6/ip6_mroute.c > > head/sys/netinet6/ip6_output.c > > head/sys/netinet6/raw_ip6.c > > head/sys/netinet6/udp6_usrreq.c > > head/sys/netipsec/keysock.c > > head/sys/sys/mbuf.h > > Bump __FreeBSD_version for the change (just in case something’s using the #define elsewhere)? Bumped(r305833), thanks. > Thanks! > -Ngie From owner-svn-src-head@freebsd.org Thu Sep 15 13:57:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92BF8BDB244; Thu, 15 Sep 2016 13:57:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 628371FD; Thu, 15 Sep 2016 13:57:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FDvbsQ000199; Thu, 15 Sep 2016 13:57:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FDvb4r000198; Thu, 15 Sep 2016 13:57:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201609151357.u8FDvb4r000198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 15 Sep 2016 13:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305834 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 13:57:38 -0000 Author: trasz Date: Thu Sep 15 13:57:37 2016 New Revision: 305834 URL: https://svnweb.freebsd.org/changeset/base/305834 Log: Change the getnewvnode(9) tag for nullfs from "null" to "nullfs". It's more consistent, and besides, the "null" alone looks weird. MFC after: 1 month Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Thu Sep 15 13:40:36 2016 (r305833) +++ head/sys/fs/nullfs/null_subr.c Thu Sep 15 13:57:37 2016 (r305834) @@ -238,7 +238,7 @@ null_nodeget(mp, lowervp, vpp) */ xp = malloc(sizeof(struct null_node), M_NULLFSNODE, M_WAITOK); - error = getnewvnode("null", mp, &null_vnodeops, &vp); + error = getnewvnode("nullfs", mp, &null_vnodeops, &vp); if (error) { vput(lowervp); free(xp, M_NULLFSNODE); From owner-svn-src-head@freebsd.org Thu Sep 15 17:05:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84715BDA921; Thu, 15 Sep 2016 17:05:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id 486EBD48; Thu, 15 Sep 2016 17:05:56 +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 u8FH5tuV073646; Thu, 15 Sep 2016 17:05:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FH5sKY073637; Thu, 15 Sep 2016 17:05:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609151705.u8FH5sKY073637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 15 Sep 2016 17:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305836 - in head/sys: amd64/amd64 amd64/include compat/linprocfs i386/include x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 17:05:56 -0000 Author: jhb Date: Thu Sep 15 17:05:54 2016 New Revision: 305836 URL: https://svnweb.freebsd.org/changeset/base/305836 Log: Remove 'cpu' and 'cpu_class' on amd64. The 'cpu' and 'cpu_class' variables were always set to the same value on amd64 and are legacy holdovers from i386. Remove them entirely on amd64. Reviewed by: imp, kib (older version) Differential Revision: https://reviews.freebsd.org/D7888 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/cputypes.h head/sys/compat/linprocfs/linprocfs.c head/sys/i386/include/cputypes.h head/sys/i386/include/md_var.h head/sys/x86/include/cputypes.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/amd64/amd64/machdep.c Thu Sep 15 17:05:54 2016 (r305836) @@ -269,7 +269,6 @@ cpu_startup(dummy) */ startrtclock(); printcpuinfo(); - panicifcpuunsupported(); /* * Display physical memory if SMBIOS reports reasonable amount. Modified: head/sys/amd64/include/cputypes.h ============================================================================== --- head/sys/amd64/include/cputypes.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/amd64/include/cputypes.h Thu Sep 15 17:05:54 2016 (r305836) @@ -1,48 +1,6 @@ /*- - * Copyright (c) 1993 Christopher G. Demetriou - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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. - * - * $FreeBSD$ + * This file is in the public domain. */ - -#ifndef _MACHINE_CPUTYPES_H_ -#define _MACHINE_CPUTYPES_H_ +/* $FreeBSD$ */ #include - -/* - * Classes of processor. - */ -#define CPUCLASS_X86 0 /* X86 */ -#define CPUCLASS_K8 1 /* K8 AMD64 class */ - -/* - * Kinds of processor. - */ -#define CPU_X86 0 /* Intel */ -#define CPU_CLAWHAMMER 1 /* AMD Clawhammer */ -#define CPU_SLEDGEHAMMER 2 /* AMD Sledgehammer */ - -#endif /* !_MACHINE_CPUTYPES_H_ */ Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/compat/linprocfs/linprocfs.c Thu Sep 15 17:05:54 2016 (r305836) @@ -218,7 +218,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) char model[128]; uint64_t freq; size_t size; - int class, fqmhz, fqkhz; + int fqmhz, fqkhz; int i; /* @@ -235,33 +235,6 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "3dnowext", "3dnow" }; - switch (cpu_class) { -#ifdef __i386__ - case CPUCLASS_286: - class = 2; - break; - case CPUCLASS_386: - class = 3; - break; - case CPUCLASS_486: - class = 4; - break; - case CPUCLASS_586: - class = 5; - break; - case CPUCLASS_686: - class = 6; - break; - default: - class = 0; - break; -#else /* __amd64__ */ - default: - class = 15; - break; -#endif - } - hw_model[0] = CTL_HW; hw_model[1] = HW_MODEL; model[0] = '\0'; @@ -286,7 +259,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) #ifdef __i386__ switch (cpu_vendor_id) { case CPU_VENDOR_AMD: - if (class < 6) + if (cpu_class < CPUCLASS_686) flags[16] = "fcmov"; break; case CPU_VENDOR_CYRIX: Modified: head/sys/i386/include/cputypes.h ============================================================================== --- head/sys/i386/include/cputypes.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/i386/include/cputypes.h Thu Sep 15 17:05:54 2016 (r305836) @@ -63,4 +63,9 @@ #define CPU_P4 16 /* Intel Pentium 4 */ #define CPU_GEODE1100 17 /* NS Geode SC1100 */ +#ifndef LOCORE +extern int cpu; +extern int cpu_class; +#endif + #endif /* !_MACHINE_CPUTYPES_H_ */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/i386/include/md_var.h Thu Sep 15 17:05:54 2016 (r305836) @@ -65,6 +65,7 @@ void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); vm_paddr_t kvtop(void *addr); +void panicifcpuunsupported(void); void ppro_reenable_apic(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); union savefpu *get_pcb_user_save_td(struct thread *td); Modified: head/sys/x86/include/cputypes.h ============================================================================== --- head/sys/x86/include/cputypes.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/x86/include/cputypes.h Thu Sep 15 17:05:54 2016 (r305836) @@ -46,9 +46,4 @@ #define CPU_VENDOR_RISE 0xdead2bad /* Rise */ #define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT -#ifndef LOCORE -extern int cpu; -extern int cpu_class; -#endif - #endif /* !_X86_CPUTYPES_H_ */ Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/x86/include/x86_var.h Thu Sep 15 17:05:54 2016 (r305836) @@ -107,7 +107,6 @@ bool fix_cpuid(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); int is_physical_memory(vm_paddr_t addr); int isa_nmi(int cd); -void panicifcpuunsupported(void); void pagecopy(void *from, void *to); void printcpuinfo(void); int user_dbreg_trap(void); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Thu Sep 15 15:32:40 2016 (r305835) +++ head/sys/x86/x86/identcpu.c Thu Sep 15 17:05:54 2016 (r305836) @@ -87,8 +87,10 @@ static void print_svm_info(void); static void print_via_padlock_info(void); static void print_vmx_info(void); +#ifdef __i386__ int cpu; /* Are we 386, 386sx, 486, etc? */ int cpu_class; +#endif u_int cpu_feature; /* Feature flags */ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ @@ -184,13 +186,11 @@ static const char *cpu_brandtable[MAX_BR NULL, "Intel Pentium 4" }; -#endif static struct { char *cpu_name; int cpu_class; } cpus[] = { -#ifdef __i386__ { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ { "i386DX", CPUCLASS_386 }, /* CPU_386 */ @@ -208,11 +208,8 @@ static struct { { "Pentium II", CPUCLASS_686 }, /* CPU_PII */ { "Pentium III", CPUCLASS_686 }, /* CPU_PIII */ { "Pentium 4", CPUCLASS_686 }, /* CPU_P4 */ -#else - { "Clawhammer", CPUCLASS_K8 }, /* CPU_CLAWHAMMER */ - { "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */ -#endif }; +#endif static struct { char *vendor; @@ -242,9 +239,13 @@ printcpuinfo(void) u_int regs[4], i; char *brand; - cpu_class = cpus[cpu].cpu_class; printf("CPU: "); +#ifdef __i386__ + cpu_class = cpus[cpu].cpu_class; strncpy(cpu_model, cpus[cpu].cpu_name, sizeof (cpu_model)); +#else + strncpy(cpu_model, "Hammer", sizeof (cpu_model)); +#endif /* Check for extended CPUID information and a processor name. */ if (cpu_exthigh >= 0x80000004) { @@ -697,8 +698,8 @@ printcpuinfo(void) (intmax_t)(tsc_freq + 4999) / 1000000, (u_int)((tsc_freq + 4999) / 10000) % 100); } - switch(cpu_class) { #ifdef __i386__ + switch(cpu_class) { case CPUCLASS_286: printf("286"); break; @@ -720,14 +721,12 @@ printcpuinfo(void) printf("686"); break; #endif -#else - case CPUCLASS_K8: - printf("K8"); - break; -#endif default: printf("Unknown"); /* will panic below... */ } +#else + printf("K8"); +#endif printf("-class CPU)\n"); if (*cpu_vendor) printf(" Origin=\"%s\"", cpu_vendor); @@ -1051,28 +1050,22 @@ printcpuinfo(void) print_hypervisor_info(); } +#ifdef __i386__ void panicifcpuunsupported(void) { -#ifdef __i386__ #if !defined(lint) #if !defined(I486_CPU) && !defined(I586_CPU) && !defined(I686_CPU) #error This kernel is not configured for one of the supported CPUs #endif #else /* lint */ #endif /* lint */ -#else /* __amd64__ */ -#ifndef HAMMER -#error "You need to specify a cpu type" -#endif -#endif /* * Now that we have told the user what they have, * let them know if that machine type isn't configured. */ switch (cpu_class) { -#ifdef __i386__ case CPUCLASS_286: /* a 286 should not make it this far, anyway */ case CPUCLASS_386: #if !defined(I486_CPU) @@ -1084,19 +1077,12 @@ panicifcpuunsupported(void) #if !defined(I686_CPU) case CPUCLASS_686: #endif -#else /* __amd64__ */ - case CPUCLASS_X86: -#ifndef HAMMER - case CPUCLASS_K8: -#endif -#endif panic("CPU class not configured"); default: break; } } -#ifdef __i386__ static volatile u_int trap_by_rdmsr; /* @@ -1580,9 +1566,6 @@ identify_cpu(void) return; } } -#else - /* XXX */ - cpu = CPU_CLAWHAMMER; #endif } From owner-svn-src-head@freebsd.org Thu Sep 15 17:24:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4187BBDAEFE; Thu, 15 Sep 2016 17:24:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id 04D44CA7; Thu, 15 Sep 2016 17:24:24 +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 u8FHOORM081374; Thu, 15 Sep 2016 17:24:24 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHONFq081367; Thu, 15 Sep 2016 17:24:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609151724.u8FHONFq081367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 15 Sep 2016 17:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305840 - in head/sys: amd64/amd64 amd64/include ddb i386/i386 i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 17:24:25 -0000 Author: bde Date: Thu Sep 15 17:24:23 2016 New Revision: 305840 URL: https://svnweb.freebsd.org/changeset/base/305840 Log: Abort single stepping in ddb if the trap is not for single-stepping. This is not very easy to do, since ddb didn't know when traps are for single-stepping. It more or less assumed that traps are either breakpoints or single-step, but even for x86 this became inadequate with the release of the i386 in ~1986, and FreeBSD passes it other trap types for NMIs and panics. On x86, teach ddb when a trap is for single stepping using the %dr6 register. Unknown traps are now treated almost the same as breakpoints instead of as the same as single-steps. Previously, the classification of breakpoints was almost correct and everything else was unknown so had to be treated as a single-step. Now the classification of single- steps is precise, the classification of breakpoints is almost correct (as before) and everything else is unknown and treated like a breakpoint. This fixes: - breakpoints not set by ddb, including the main one in kdb_enter(), were treated as single-steps and not stopped on when stepping (except for the usual, simple case of a step with residual count 1). As special cases, kdb_enter() didn't stop for fatal traps or panics - similarly for "hardware breakpoints". Use a new MD macro IS_SSTEP_TRAP(type, code) to code to classify single-steps. This is excessively complicated for bug-for-bug and backwards compatibilty. Design errors apparently started in Mach in ~1990 or perhaps in the FreeBSD interface in ~1993. Common trap types like single steps should have a unique MI code (like the TRAP* codes for user SIGTRAP) so that debuggers don't need macros like IS_SSTEP_TRAP() to decode them. But 'type' is actually an ambiguous MD trap number, and code was always 0 (now it is (int)%dr6 on x86). So it was impossible to determine the trap type from the args. Global variables had to be used. There is already a classification macro db_pc_is_single_step(), but this just gets in the way. It is only used to recover from bugs in IS_BREAKPOINT_TRAP(). On some arches, IS_BREAKPOINT_TRAP() just duplicates the ambiguity in 'type' and misclassifies single-steps as breakpoints. It defaults to 'false', which is the opposite of what is needed for bug-for-bug compatibility. When this is cleaned up, MI classification bits should be passed in 'code'. This could be done now for positive-logic bits, since 'code' was always 0, but some negative logic is needed for compatibility so a simple MI classificition is not usable yet. After reading %dr6, clear the single-step bit in it so that the type of the next debugger trap can be decoded. This is a little ddb-specific. ddb doesn't understand the need to clear this bit and doing it before calling kdb is easiest. gdb would need to reverse this to support hardware breakpoints, but it just doesn't support them now since gdbstub doesn't support %dr*. Fix a bug involving %dr6: when emulating a single-step trap for vm86, set the bit for it in %dr6. Userland debuggers need this. ddb now needs this for vm86 bios calls. The bit gets copied to 'code' then cleared again. Fix related style bugs: - when clearing bits for hardware breakpoints in %dr6, spell the mask as ~0xf on both amd64 and i386 to get the correct number of bits using sign extension and not need a comment about using the wrong mask on amd64 (amd64 traps for invalid results but clearing the reserved top bits didn't trap since they are 0). - rewrite my old wrong comments about using %dr6 for ddb watchpoints. Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/include/db_machdep.h head/sys/ddb/db_run.c head/sys/i386/i386/trap.c head/sys/i386/include/db_machdep.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/amd64/amd64/trap.c Thu Sep 15 17:24:23 2016 (r305840) @@ -176,6 +176,7 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; + register_t dr6; int i = 0, ucode = 0, code; u_int type; register_t addr = 0; @@ -540,8 +541,7 @@ trap(struct trapframe *frame) * Reset breakpoint bits because the * processor doesn't */ - /* XXX check upper bits here */ - load_dr6(rdr6() & 0xfffffff0); + load_dr6(rdr6() & ~0xf); goto out; } /* @@ -553,7 +553,10 @@ trap(struct trapframe *frame) * Otherwise, debugger traps "can't happen". */ #ifdef KDB - if (kdb_trap(type, 0, frame)) + /* XXX %dr6 is not quite reentrant. */ + dr6 = rdr6(); + load_dr6(dr6 & ~0x4000); + if (kdb_trap(type, dr6, frame)) goto out; #endif break; Modified: head/sys/amd64/include/db_machdep.h ============================================================================== --- head/sys/amd64/include/db_machdep.h Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/amd64/include/db_machdep.h Thu Sep 15 17:24:23 2016 (r305840) @@ -56,12 +56,16 @@ do { \ #define db_clear_single_step kdb_cpu_clear_singlestep #define db_set_single_step kdb_cpu_set_singlestep -#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) /* - * Watchpoints are not supported. The debug exception type is in %dr6 - * and not yet in the args to this macro. + * The debug exception type is copied from %dr6 to 'code' and used to + * disambiguate single step traps. Watchpoints have no special support. + * Our hardware breakpoints are not well integrated with ddb and are too + * different from watchpoints. ddb treats them as unknown traps with + * unknown addresses and doesn't turn them off while it is running. */ -#define IS_WATCHPOINT_TRAP(type, code) 0 +#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) +#define IS_SSTEP_TRAP(type, code) ((type) == T_TRCTRAP && (code) & 0x4000) +#define IS_WATCHPOINT_TRAP(type, code) 0 #define I_CALL 0xe8 #define I_CALLI 0xff Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/ddb/db_run.c Thu Sep 15 17:24:23 2016 (r305840) @@ -57,6 +57,7 @@ static int db_run_mode; #define STEP_INVISIBLE 5 #define STEP_COUNT 6 +static bool db_sstep_multiple; static bool db_sstep_print; static int db_loop_count; static int db_call_depth; @@ -133,7 +134,25 @@ db_stop_at_pc(int type, int code, bool * #endif } - *is_breakpoint = false; + *is_breakpoint = false; /* might be a breakpoint, but not ours */ + + /* + * If stepping, then abort if the trap type is unexpected. + * Breakpoints owned by us are expected and were handled above. + * Single-steps are expected and are handled below. All others + * are unexpected. + * + * If the MD layer doesn't tell us when it is stepping, use the + * bad historical default that all unexepected traps. + */ +#ifndef IS_SSTEP_TRAP +#define IS_SSTEP_TRAP(type, code) true +#endif + if (db_run_mode != STEP_CONTINUE && !IS_SSTEP_TRAP(type, code)) { + printf("Stepping aborted\n"); + db_run_mode = STEP_NONE; + return (true); + } if (db_run_mode == STEP_INVISIBLE) { db_run_mode = STEP_CONTINUE; @@ -194,6 +213,7 @@ db_restart_at_pc(bool watchpt) db_addr_t pc = PC_REGS(); if ((db_run_mode == STEP_COUNT) || + ((db_run_mode == STEP_ONCE) && db_sstep_multiple) || (db_run_mode == STEP_RETURN) || (db_run_mode == STEP_CALLT)) { /* @@ -321,6 +341,7 @@ db_single_step_cmd(db_expr_t addr, bool db_run_mode = STEP_ONCE; db_loop_count = count; + db_sstep_multiple = (count != 1); db_sstep_print = print; db_inst_count = 0; db_load_count = 0; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/i386/i386/trap.c Thu Sep 15 17:24:23 2016 (r305840) @@ -189,6 +189,7 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; + register_t dr6; int i = 0, ucode = 0, code; u_int type; register_t addr = 0; @@ -362,6 +363,7 @@ user_trctrap_out: i = vm86_emulate((struct vm86frame *)frame); if (i == SIGTRAP) { type = T_TRCTRAP; + load_dr6(rdr6() | 0x4000); goto user_trctrap_out; } if (i == 0) @@ -572,6 +574,7 @@ user_trctrap_out: i = vm86_emulate((struct vm86frame *)frame); if (i == SIGTRAP) { type = T_TRCTRAP; + load_dr6(rdr6() | 0x4000); goto kernel_trctrap; } if (i != 0) @@ -696,7 +699,7 @@ kernel_trctrap: * Reset breakpoint bits because the * processor doesn't */ - load_dr6(rdr6() & 0xfffffff0); + load_dr6(rdr6() & ~0xf); goto out; } /* @@ -708,7 +711,10 @@ kernel_trctrap: * Otherwise, debugger traps "can't happen". */ #ifdef KDB - if (kdb_trap(type, 0, frame)) + /* XXX %dr6 is not quite reentrant. */ + dr6 = rdr6(); + load_dr6(dr6 & ~0x4000); + if (kdb_trap(type, dr6, frame)) goto out; #endif break; Modified: head/sys/i386/include/db_machdep.h ============================================================================== --- head/sys/i386/include/db_machdep.h Thu Sep 15 17:24:11 2016 (r305839) +++ head/sys/i386/include/db_machdep.h Thu Sep 15 17:24:23 2016 (r305840) @@ -59,12 +59,16 @@ do { \ #define db_clear_single_step kdb_cpu_clear_singlestep #define db_set_single_step kdb_cpu_set_singlestep -#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) /* - * Watchpoints are not supported. The debug exception type is in %dr6 - * and not yet in the args to this macro. + * The debug exception type is copied from %dr6 to 'code' and used to + * disambiguate single step traps. Watchpoints have no special support. + * Our hardware breakpoints are not well integrated with ddb and are too + * different from watchpoints. ddb treats them as unknown traps with + * unknown addresses and doesn't turn them off while it is running. */ -#define IS_WATCHPOINT_TRAP(type, code) 0 +#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT) +#define IS_SSTEP_TRAP(type, code) ((type) == T_TRCTRAP && (code) & 0x4000) +#define IS_WATCHPOINT_TRAP(type, code) 0 #define I_CALL 0xe8 #define I_CALLI 0xff From owner-svn-src-head@freebsd.org Thu Sep 15 17:24:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2F02BDAF80; Thu, 15 Sep 2016 17:24:40 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59AE9E88; Thu, 15 Sep 2016 17:24:40 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8FHOdef081431; Thu, 15 Sep 2016 17:24:39 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHOd0h081430; Thu, 15 Sep 2016 17:24:39 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609151724.u8FHOd0h081430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 15 Sep 2016 17:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305841 - head/bin/cat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 17:24:40 -0000 Author: ache Date: Thu Sep 15 17:24:39 2016 New Revision: 305841 URL: https://svnweb.freebsd.org/changeset/base/305841 Log: Implement multibyte encoding support for -v with fallback MFC after: 7 days Modified: head/bin/cat/cat.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Thu Sep 15 17:24:23 2016 (r305840) +++ head/bin/cat/cat.c Thu Sep 15 17:24:39 2016 (r305841) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static int bflag, eflag, lflag, nflag, sflag, tflag, vflag; static int rval; @@ -207,6 +209,7 @@ static void cook_cat(FILE *fp) { int ch, gobble, line, prev; + wint_t wch; /* Reset EOF condition on stdin. */ if (fp == stdin && feof(stdin)) @@ -239,18 +242,40 @@ cook_cat(FILE *fp) continue; } } else if (vflag) { - if (!isascii(ch) && !isprint(ch)) { + (void)ungetc(ch, fp); + /* + * Our getwc(3) doesn't change file position + * on error. + */ + if ((wch = getwc(fp)) == WEOF) { + if (ferror(fp) && errno == EILSEQ) { + clearerr(fp); + /* Resync attempt. */ + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + if ((ch = getc(fp)) == EOF) + break; + wch = ch; + goto ilseq; + } else + break; + } + if (!iswascii(wch) && !iswprint(wch)) { +ilseq: if (putchar('M') == EOF || putchar('-') == EOF) break; - ch = toascii(ch); + wch = toascii(wch); } - if (iscntrl(ch)) { - if (putchar('^') == EOF || - putchar(ch == '\177' ? '?' : - ch | 0100) == EOF) + if (iswcntrl(wch)) { + ch = toascii(wch); + ch = (ch == '\177') ? '?' : (ch | 0100); + if (putchar('^') == EOF || putchar(ch) == EOF) break; continue; } + if (putwchar(wch) == WEOF) + break; + ch = -1; + continue; } if (putchar(ch) == EOF) break; From owner-svn-src-head@freebsd.org Thu Sep 15 17:25:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5E10BDB0EF; Thu, 15 Sep 2016 17:25:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7E515221; Thu, 15 Sep 2016 17:25:54 +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 u8FHPrHg081577; Thu, 15 Sep 2016 17:25:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FHPqFH081568; Thu, 15 Sep 2016 17:25:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201609151725.u8FHPqFH081568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Sep 2016 17:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305843 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 17:25:54 -0000 Author: brooks Date: Thu Sep 15 17:25:52 2016 New Revision: 305843 URL: https://svnweb.freebsd.org/changeset/base/305843 Log: The TLS offset is a property of the process ABI. Move to a per-proc TLS offset rather than incorrectly keying off the presense of freebsd32 compability in the kernel. Reviewed by: adrian, sbruno Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7843 Modified: head/sys/mips/include/proc.h head/sys/mips/mips/cpu.c head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/genassym.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/swtch.S head/sys/mips/mips/sys_machdep.c head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/include/proc.h Thu Sep 15 17:25:52 2016 (r305843) @@ -62,6 +62,7 @@ struct mdthread { int md_pc_count; /* performance counter */ int md_pc_spill; /* performance counter spill */ void *md_tls; + size_t md_tls_tcb_offset; /* TCB offset */ #ifdef CPU_CNMIPS struct octeon_cop2_state *md_cop2; /* kernel context */ struct octeon_cop2_state *md_ucop2; /* userland context */ Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/cpu.c Thu Sep 15 17:25:52 2016 (r305843) @@ -71,13 +71,12 @@ struct mips_cpuinfo cpuinfo; # define _LOAD_T0_MDTLS_A1 \ _ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) -# if defined(COMPAT_FREEBSD32) -# define _ADDIU_V0_T0_TLS_OFFSET \ - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE32)) -# else -# define _ADDIU_V0_T0_TLS_OFFSET \ - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) -# endif /* ! COMPAT_FREEBSD32 */ +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ + _ENCODE_INSN(OP_LD, A1, T1, 0, \ + offsetof(struct thread, td_md.md_tls_tcb_offset)) + +# define _ADDU_V0_T0_T1 \ + _ENCODE_INSN(0, T0, T1, V0, OP_DADDU) # define _MTC0_V0_USERLOCAL \ _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) @@ -86,8 +85,14 @@ struct mips_cpuinfo cpuinfo; # define _LOAD_T0_MDTLS_A1 \ _ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) -# define _ADDIU_V0_T0_TLS_OFFSET \ - _ENCODE_INSN(OP_ADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) + +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ + _ENCODE_INSN(OP_LW, A1, T1, 0, \ + offsetof(struct thread, td_md.md_tls_tcb_offset)) + +# define _ADDU_V0_T0_T1 \ + _ENCODE_INSN(0, T0, T1, V0, OP_ADDU) + # define _MTC0_V0_USERLOCAL \ _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) @@ -111,8 +116,9 @@ remove_userlocal_code(uint32_t *cpu_swit if (instructp[0] == _JR_RA) panic("%s: Unable to patch cpu_switch().", __func__); if (instructp[0] == _LOAD_T0_MDTLS_A1 && - instructp[1] == _ADDIU_V0_T0_TLS_OFFSET && - instructp[2] == _MTC0_V0_USERLOCAL) { + instructp[1] == _LOAD_T0_MDTLS_TCV_OFFSET_A1 && + instructp[2] == _ADDU_V0_T0_T1 && + instructp[3] == _MTC0_V0_USERLOCAL) { instructp[0] = _JR_RA; instructp[1] = _NOP; break; Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -138,6 +139,8 @@ freebsd32_exec_setregs(struct thread *td * Clear extended address space bit for userland. */ td->td_frame->sr &= ~MIPS_SR_UX; + + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; } int Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/genassym.c Thu Sep 15 17:25:52 2016 (r305843) @@ -74,12 +74,7 @@ ASSYM(TD_FLAGS, offsetof(struct thread, ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags)); ASSYM(TD_MDTLS, offsetof(struct thread, td_md.md_tls)); - -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE32)); -#else -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE)); -#endif +ASSYM(TD_MDTLS_TCB_OFFSET, offsetof(struct thread, td_md.md_tls_tcb_offset)); ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero)); ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context)); Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -466,6 +467,8 @@ exec_setregs(struct thread *td, struct i if (PCPU_GET(fpcurthread) == td) PCPU_SET(fpcurthread, (struct thread *)0); td->td_md.md_ss_addr = 0; + + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; } int Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/swtch.S Thu Sep 15 17:25:52 2016 (r305843) @@ -385,7 +385,8 @@ sw2: * remove_userlocal_code() in cpu.c. */ PTR_L t0, TD_MDTLS(a1) # Get TLS pointer - PTR_ADDIU v0, t0, TLS_TCB_OFFSET # Add TLS/TCB offset + PTR_L t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset + PTR_ADDU v0, t0, t1 MTC0 v0, MIPS_COP_0_USERLOCAL, 2 # write it to ULR for rdhwr j ra Modified: head/sys/mips/mips/sys_machdep.c ============================================================================== --- head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -69,13 +69,8 @@ sysarch(struct thread *td, struct sysarc * rdhwr trap() instruction handler. */ if (cpuinfo.userlocal_reg == true) { -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) mips_wr_userlocal((unsigned long)(uap->parms + - TLS_TP_OFFSET + TLS_TCB_SIZE32)); -#else - mips_wr_userlocal((unsigned long)(uap->parms + - TLS_TP_OFFSET + TLS_TCB_SIZE)); -#endif + td->td_md.md_tls_tcb_offset)); } return (0); case MIPS_GET_TLS: Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/trap.c Thu Sep 15 17:25:52 2016 (r305843) @@ -909,12 +909,7 @@ dofault: if (inst.RType.rd == 29) { frame_regs = &(trapframe->zero); frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE32; - else -#endif - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE; + frame_regs[inst.RType.rt] += td->td_md.md_tls_tcb_offset; trapframe->pc += sizeof(int); goto out; } Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) +++ head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) @@ -154,6 +154,7 @@ cpu_fork(register struct thread *td1,reg */ td2->td_md.md_tls = td1->td_md.md_tls; + td2->td_md.md_tls_tcb_offset = td1->td_md.md_tls_tcb_offset; td2->td_md.md_saved_intr = MIPS_SR_INT_IE; td2->td_md.md_spinlock_count = 1; #ifdef CPU_CNMIPS @@ -494,15 +495,16 @@ int cpu_set_user_tls(struct thread *td, void *tls_base) { - td->td_md.md_tls = (char*)tls_base; - if (td == curthread && cpuinfo.userlocal_reg == true) { #if defined(__mips_n64) && defined(COMPAT_FREEBSD32) - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + - TLS_TCB_SIZE32); -#else - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + - TLS_TCB_SIZE); + if (td->td_proc && SV_PROC_FLAG(td->td_proc, SV_ILP32)) + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; + else #endif + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; + td->td_md.md_tls = (char*)tls_base; + if (td == curthread && cpuinfo.userlocal_reg == true) { + mips_wr_userlocal((unsigned long)tls_base + + td->td_md.md_tls_tcb_offset); } return (0); From owner-svn-src-head@freebsd.org Thu Sep 15 18:30:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADFB7BDC67D; Thu, 15 Sep 2016 18:30:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7E20EAD4; Thu, 15 Sep 2016 18:30:54 +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 u8FIUrYA005298; Thu, 15 Sep 2016 18:30:53 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FIUrCW005297; Thu, 15 Sep 2016 18:30:53 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609151830.u8FIUrCW005297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 15 Sep 2016 18:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305849 - head/sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 18:30:54 -0000 Author: bde Date: Thu Sep 15 18:30:53 2016 New Revision: 305849 URL: https://svnweb.freebsd.org/changeset/base/305849 Log: Decode some REX prefixes in inst_call(). This makes the 'next' and 'until' commands work in more cases. Modified: head/sys/amd64/include/db_machdep.h Modified: head/sys/amd64/include/db_machdep.h ============================================================================== --- head/sys/amd64/include/db_machdep.h Thu Sep 15 17:37:30 2016 (r305848) +++ head/sys/amd64/include/db_machdep.h Thu Sep 15 18:30:53 2016 (r305849) @@ -69,14 +69,15 @@ do { \ #define I_CALL 0xe8 #define I_CALLI 0xff +#define i_calli(ins) (((ins)&0xff) == I_CALLI && ((ins)&0x3800) == 0x1000) #define I_RET 0xc3 #define I_IRET 0xcf +#define i_rex(ins) (((ins) & 0xff) == 0x41 || ((ins) & 0xff) == 0x43) #define inst_trap_return(ins) (((ins)&0xff) == I_IRET) #define inst_return(ins) (((ins)&0xff) == I_RET) -#define inst_call(ins) (((ins)&0xff) == I_CALL || \ - (((ins)&0xff) == I_CALLI && \ - ((ins)&0x3800) == 0x1000)) +#define inst_call(ins) (((ins)&0xff) == I_CALL || i_calli(ins) || \ + (i_calli((ins) >> 8) && i_rex(ins))) #define inst_load(ins) 0 #define inst_store(ins) 0 From owner-svn-src-head@freebsd.org Thu Sep 15 19:05:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6C89BDCDB7; Thu, 15 Sep 2016 19:05:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B63C8DC0; Thu, 15 Sep 2016 19:05:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id cm16so18504644pac.0; Thu, 15 Sep 2016 12:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tATAhrrS3GQLVeoxFfU7gwsdhXKKPqVf1R/lSXruB1M=; b=lmhUYMHQ0XbQMdPP45snsg1+JQQwwnwj9i4noAUfp0QzhgSmUtnfMaspRuiK17nKYb uDXBg4eaGq0WRuuWImbhH73i1qWBtU2gj1T5elUnwtUzoRBR9lKtEnZXuf+MXaLNa73l D6QZtls43XIt1pvAkuEKMP+GuoMRAEphpdvgacqBPcpXtFfhFkR46eaIWgRfdt3yTLrj gI/A800oo+Q4hAPxMfBA7mGZXJOugP56mORSF3d0M2SXqFJiiLz+cnvNpOZOecsj+fum 3x4UUAy86FIgZTOlBYf447rp+tE4XpKSRQQpJcpjIhYEArpl5gZNXHyzDmypnEDt3Oh9 ZwSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tATAhrrS3GQLVeoxFfU7gwsdhXKKPqVf1R/lSXruB1M=; b=kgBeutiXeGw/jz272HlHlS40PpfmXOuJXabpn5M+st2tElk1e0MZ3GbLoNxd/K5Kov JM82FLfHWpebvRfgiNofaM5HeXNS2EKEigThZ029YzhUQFnVlMl+YpwiIH3SRXWeS09u IaT9M0T62wMjG+ymNwGCIntGWw/saVv81q2FPBijEqkoS9JNOfXU+3LxrUi5Og8HraNI eB7/D/a4N0yRmXZaahmtSaMp4f2SiFr0SvDvihI1ibwlwob17Wqg7Ypy+wtQNMmmtlWp 9gyqOiw8qb9tOGiGSbottRcUZB72cDKW0tKeHMKLFD4KYtXw4X8bKD+6pr20PFQ5F1ou QQzg== X-Gm-Message-State: AE9vXwPdja1MVxhFmbOHMIWbv+BiAoLWgbvJqH2iPuuDFALRFFzS1cb/3Nq6aqlaTYbCWw== X-Received: by 10.66.157.103 with SMTP id wl7mr17221550pab.116.1473966320439; Thu, 15 Sep 2016 12:05:20 -0700 (PDT) Received: from ?IPv6:2607:fb90:80b2:18a4:14c8:2538:e637:10f? ([2607:fb90:80b2:18a4:14c8:2538:e637:10f]) by smtp.gmail.com with ESMTPSA id s89sm46814592pfi.83.2016.09.15.12.05.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 12:05:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r305824 - in head/sys: contrib/ipfilter/netinet kern net netinet netinet6 netipsec sys From: Ngie Cooper X-Mailer: iPhone Mail (13G36) In-Reply-To: <20160915134618.GA8952@ns.kevlo.org> Date: Thu, 15 Sep 2016 12:05:16 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <25658DD6-6FC9-48F1-B7D0-59A929FB43BE@gmail.com> References: <201609150741.u8F7fmcM059138@repo.freebsd.org> <325364AF-58AC-4C30-8EFF-4B793E18779D@gmail.com> <20160915134618.GA8952@ns.kevlo.org> To: Kevin Lo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 19:05:22 -0000 > On Sep 15, 2016, at 06:46, Kevin Lo wrote: ... > Bumped(r305833), thanks. Thanks :)! -Ngie From owner-svn-src-head@freebsd.org Thu Sep 15 22:27:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC859BDCEE0; Thu, 15 Sep 2016 22:27: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 mx1.freebsd.org (Postfix) with ESMTPS id 807AB22B; Thu, 15 Sep 2016 22:27: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 u8FMR06Y095925; Thu, 15 Sep 2016 22:27:00 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FMR0B7095924; Thu, 15 Sep 2016 22:27:00 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201609152227.u8FMR0B7095924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 15 Sep 2016 22:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305850 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 22:27:01 -0000 Author: avos Date: Thu Sep 15 22:27:00 2016 New Revision: 305850 URL: https://svnweb.freebsd.org/changeset/base/305850 Log: net80211: allow to override SWCRYPT/SWMIC bits in the driver Add IEEE80211_KEY_SWCRYPT / IEEE80211_KEY_SWMIC bits to the IEEE80211_KEY_DEVICE mask - as a result, those bits will be preserved during group key handshake. A driver can override them in iv_key_alloc() for some keys in case when hardware crypto support is not possible. As an example: - multi-vap without multicast key search support; - IBSS RSN for devices w/ fixed storage for group keys; Tested with RTL8188EU (AP, sw crypto) and RTL8821AU (STA, sw crypto for group keys + hw crypto for pairwise keys) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D7901 Modified: head/sys/net80211/ieee80211_crypto.h Modified: head/sys/net80211/ieee80211_crypto.h ============================================================================== --- head/sys/net80211/ieee80211_crypto.h Thu Sep 15 18:30:53 2016 (r305849) +++ head/sys/net80211/ieee80211_crypto.h Thu Sep 15 22:27:00 2016 (r305850) @@ -101,13 +101,15 @@ struct ieee80211_key { #define IEEE80211_KEY_COMMON /* common flags passed in by apps */\ (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP | \ IEEE80211_KEY_NOREPLAY) -#define IEEE80211_KEY_DEVICE /* flags owned by device driver */\ - (IEEE80211_KEY_DEVKEY|IEEE80211_KEY_CIPHER0|IEEE80211_KEY_CIPHER1) #define IEEE80211_KEY_SWCRYPT \ (IEEE80211_KEY_SWENCRYPT | IEEE80211_KEY_SWDECRYPT) #define IEEE80211_KEY_SWMIC (IEEE80211_KEY_SWENMIC | IEEE80211_KEY_SWDEMIC) +#define IEEE80211_KEY_DEVICE /* flags owned by device driver */\ + (IEEE80211_KEY_DEVKEY|IEEE80211_KEY_CIPHER0|IEEE80211_KEY_CIPHER1| \ + IEEE80211_KEY_SWCRYPT|IEEE80211_KEY_SWMIC) + #define IEEE80211_KEY_BITS \ "\20\1XMIT\2RECV\3GROUP\4SWENCRYPT\5SWDECRYPT\6SWENMIC\7SWDEMIC" \ "\10DEVKEY\11CIPHER0\12CIPHER1" From owner-svn-src-head@freebsd.org Thu Sep 15 22:31:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05F8DBDC0F3; Thu, 15 Sep 2016 22:31:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id CB625846; Thu, 15 Sep 2016 22:31:50 +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 u8FMVoik096733; Thu, 15 Sep 2016 22:31:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8FMVnk4096731; Thu, 15 Sep 2016 22:31:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609152231.u8FMVnk4096731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 15 Sep 2016 22:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305851 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 22:31:51 -0000 Author: np Date: Thu Sep 15 22:31:49 2016 New Revision: 305851 URL: https://svnweb.freebsd.org/changeset/base/305851 Log: Whitespace nits. Modified: head/sys/dev/cxgbe/t4_iov.c head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Thu Sep 15 22:27:00 2016 (r305850) +++ head/sys/dev/cxgbe/t4_iov.c Thu Sep 15 22:31:49 2016 (r305851) @@ -97,7 +97,7 @@ static int t4iov_attach_child(device_t d static int t4iov_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -114,7 +114,7 @@ t4iov_probe(device_t dev) static int t5iov_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Thu Sep 15 22:27:00 2016 (r305850) +++ head/sys/dev/cxgbe/t4_vf.c Thu Sep 15 22:31:49 2016 (r305851) @@ -124,7 +124,7 @@ static struct cdevsw t4vf_cdevsw = { static int t4vf_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -140,7 +140,7 @@ t4vf_probe(device_t dev) static int t5vf_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -653,7 +653,7 @@ t4vf_attach(device_t dev) pi->vi[0].dev = pi->dev; device_set_softc(pi->dev, pi); } - + /* * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ From owner-svn-src-head@freebsd.org Fri Sep 16 00:08:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A42F6BDC611; Fri, 16 Sep 2016 00:08:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7606474C; Fri, 16 Sep 2016 00:08:39 +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 u8G08cb5033167; Fri, 16 Sep 2016 00:08:38 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G08bWr033156; Fri, 16 Sep 2016 00:08:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609160008.u8G08bWr033156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 16 Sep 2016 00:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305852 - in head/sys: dev/cxgbe dev/cxgbe/firmware modules/cxgbe modules/cxgbe/if_cc modules/cxgbe/if_ccv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 00:08:39 -0000 Author: np Date: Fri Sep 16 00:08:37 2016 New Revision: 305852 URL: https://svnweb.freebsd.org/changeset/base/305852 Log: cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will come up as 't6nex' nexus devices with 'cc' ports hanging off them. The T6 firmware and configuration files will be added as soon as they are released. For now the driver will try to work with whatever firmware and configuration is on the card's flash. Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/if_cc.c (contents, props changed) head/sys/dev/cxgbe/if_ccv.c (contents, props changed) head/sys/modules/cxgbe/if_cc/ head/sys/modules/cxgbe/if_cc/Makefile (contents, props changed) head/sys/modules/cxgbe/if_ccv/ head/sys/modules/cxgbe/if_ccv/Makefile (contents, props changed) Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_iov.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_tracer.c head/sys/dev/cxgbe/t4_vf.c head/sys/modules/cxgbe/Makefile Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/adapter.h Fri Sep 16 00:08:37 2016 (r305852) @@ -752,10 +752,20 @@ struct sge { struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; }; +struct devnames { + const char *nexus_name; + const char *ifnet_name; + const char *vi_ifnet_name; + const char *pf03_drv_name; + const char *vf_nexus_name; + const char *vf_ifnet_name; +}; + struct adapter { SLIST_ENTRY(adapter) link; device_t dev; struct cdev *cdev; + const struct devnames *names; /* PCIe register resources */ int regs_rid; @@ -1117,6 +1127,7 @@ int t4_os_pci_restore_state(struct adapt void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); +void t4_init_devnames(struct adapter *); void t4_add_adapter(struct adapter *); int t4_detach_common(device_t); int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Fri Sep 16 00:08:37 2016 (r305852) @@ -9215,6 +9215,11 @@ enum { T5FW_VERSION_MINOR = 0x05, T5FW_VERSION_MICRO = 0x25, T5FW_VERSION_BUILD = 0x00, + + T6FW_VERSION_MAJOR = 0x00, + T6FW_VERSION_MINOR = 0x00, + T6FW_VERSION_MICRO = 0x00, + T6FW_VERSION_BUILD = 0x00, }; enum { Added: head/sys/dev/cxgbe/if_cc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/if_cc.c Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * 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 + +static int +mod_event(module_t mod, int cmd, void *arg) +{ + + return (0); +} +static moduledata_t if_cc_mod = {"if_cc", mod_event}; +DECLARE_MODULE(if_cc, if_cc_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(if_cc, 1); +MODULE_DEPEND(if_cc, cc, 1, 1, 1); Added: head/sys/dev/cxgbe/if_ccv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/if_ccv.c Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * 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 + +static int +mod_event(module_t mod, int cmd, void *arg) +{ + + return (0); +} +static moduledata_t if_ccv_mod = {"if_ccv", mod_event}; +DECLARE_MODULE(if_ccv, if_ccv_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(if_ccv, 1); +MODULE_DEPEND(if_ccv, ccv, 1, 1, 1); Modified: head/sys/dev/cxgbe/t4_iov.c ============================================================================== --- head/sys/dev/cxgbe/t4_iov.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_iov.c Fri Sep 16 00:08:37 2016 (r305852) @@ -90,6 +90,12 @@ struct { {0x500f, "Chelsio Amsterdam"}, {0x5013, "Chelsio T580-CHR"}, #endif +}, t6iov_pciids[] = { + {0x6001, "Chelsio T6225-CR"}, /* 2 x 10/25G */ + {0x6002, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ + {0x6007, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */ + {0x6008, "Chelsio T62100-SO-CR"}, /* 2 x 40/50/100G, nomem */ + {0x600d, "Chelsio T62100-CR"}, /* 2 x 40/50/100G */ }; static int t4iov_attach_child(device_t dev); @@ -129,6 +135,23 @@ t5iov_probe(device_t dev) } static int +t6iov_probe(device_t dev) +{ + uint16_t d; + size_t i; + + d = pci_get_device(dev); + for (i = 0; i < nitems(t6iov_pciids); i++) { + if (d == t6iov_pciids[i].device) { + device_set_desc(dev, t6iov_pciids[i].desc); + device_quiet(dev); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + +static int t4iov_attach(device_t dev) { struct t4iov_softc *sc; @@ -288,10 +311,36 @@ static driver_t t5iov_driver = { sizeof(struct t4iov_softc) }; -static devclass_t t4iov_devclass, t5iov_devclass; +static device_method_t t6iov_methods[] = { + DEVMETHOD(device_probe, t6iov_probe), + DEVMETHOD(device_attach, t4iov_attach), + DEVMETHOD(device_detach, t4iov_detach), + +#ifdef PCI_IOV + DEVMETHOD(pci_iov_init, t4iov_iov_init), + DEVMETHOD(pci_iov_uninit, t4iov_iov_uninit), + DEVMETHOD(pci_iov_add_vf, t4iov_add_vf), +#endif + + DEVMETHOD(t4_attach_child, t4iov_attach_child), + DEVMETHOD(t4_detach_child, t4iov_detach_child), + + DEVMETHOD_END +}; + +static driver_t t6iov_driver = { + "t6iov", + t6iov_methods, + sizeof(struct t4iov_softc) +}; + +static devclass_t t4iov_devclass, t5iov_devclass, t6iov_devclass; DRIVER_MODULE(t4iov, pci, t4iov_driver, t4iov_devclass, 0, 0); MODULE_VERSION(t4iov, 1); DRIVER_MODULE(t5iov, pci, t5iov_driver, t5iov_devclass, 0, 0); MODULE_VERSION(t5iov, 1); + +DRIVER_MODULE(t6iov, pci, t6iov_driver, t6iov_devclass, 0, 0); +MODULE_VERSION(t6iov, 1); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_main.c Fri Sep 16 00:08:37 2016 (r305852) @@ -174,6 +174,39 @@ static driver_t vcxl_driver = { sizeof(struct vi_info) }; +/* T6 bus driver interface */ +static int t6_probe(device_t); +static device_method_t t6_methods[] = { + DEVMETHOD(device_probe, t6_probe), + DEVMETHOD(device_attach, t4_attach), + DEVMETHOD(device_detach, t4_detach), + + DEVMETHOD(t4_is_main_ready, t4_ready), + DEVMETHOD(t4_read_port_device, t4_read_port_device), + + DEVMETHOD_END +}; +static driver_t t6_driver = { + "t6nex", + t6_methods, + sizeof(struct adapter) +}; + + +/* T6 port (cc) interface */ +static driver_t cc_driver = { + "cc", + cxgbe_methods, + sizeof(struct port_info) +}; + +/* T6 VI (vcc) interface */ +static driver_t vcc_driver = { + "vcc", + vcxgbe_methods, + sizeof(struct vi_info) +}; + /* ifnet + media interface */ static void cxgbe_init(void *); static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t); @@ -567,6 +600,13 @@ struct { {0x540f, "Chelsio Amsterdam"}, {0x5413, "Chelsio T580-CHR"}, #endif +}, t6_pciids[] = { + {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ + {0x6401, "Chelsio T6225-CR"}, /* 2 x 10/25G */ + {0x6402, "Chelsio T6225-SO-CR"}, /* 2 x 10/25G, nomem */ + {0x6407, "Chelsio T62100-LP-CR"}, /* 2 x 40/50/100G */ + {0x6408, "Chelsio T62100-SO-CR"}, /* 2 x 40/50/100G, nomem */ + {0x640d, "Chelsio T62100-CR"}, /* 2 x 40/50/100G */ }; #ifdef TCP_OFFLOAD @@ -629,6 +669,26 @@ t5_probe(device_t dev) return (ENXIO); } +static int +t6_probe(device_t dev) +{ + int i; + uint16_t v = pci_get_vendor(dev); + uint16_t d = pci_get_device(dev); + + if (v != PCI_VENDOR_ID_CHELSIO) + return (ENXIO); + + for (i = 0; i < nitems(t6_pciids); i++) { + if (d == t6_pciids[i].device) { + device_set_desc(dev, t6_pciids[i].desc); + return (BUS_PROBE_DEFAULT); + } + } + + return (ENXIO); +} + static void t5_attribute_workaround(device_t dev) { @@ -656,6 +716,45 @@ t5_attribute_workaround(device_t dev) device_get_nameunit(root_port)); } +static const struct devnames devnames[] = { + { + .nexus_name = "t4nex", + .ifnet_name = "cxgbe", + .vi_ifnet_name = "vcxgbe", + .pf03_drv_name = "t4iov", + .vf_nexus_name = "t4vf", + .vf_ifnet_name = "cxgbev" + }, { + .nexus_name = "t5nex", + .ifnet_name = "cxl", + .vi_ifnet_name = "vcxl", + .pf03_drv_name = "t5iov", + .vf_nexus_name = "t5vf", + .vf_ifnet_name = "cxlv" + }, { + .nexus_name = "t6nex", + .ifnet_name = "cc", + .vi_ifnet_name = "vcc", + .pf03_drv_name = "t6iov", + .vf_nexus_name = "t6vf", + .vf_ifnet_name = "ccv" + } +}; + +void +t4_init_devnames(struct adapter *sc) +{ + int id; + + id = chip_id(sc); + if (id >= CHELSIO_T4 && id - CHELSIO_T4 < nitems(devnames)) + sc->names = &devnames[id - CHELSIO_T4]; + else { + device_printf(sc->dev, "chip id %d is not supported.\n", id); + sc->names = NULL; + } +} + static int t4_attach(device_t dev) { @@ -733,6 +832,12 @@ t4_attach(device_t dev) goto done; } + t4_init_devnames(sc); + if (sc->names == NULL) { + rc = ENOTSUP; + goto done; /* error message displayed already */ + } + /* * Do this really early, with the memory windows set up even before the * character device. The userland tool's register i/o and mem read @@ -872,7 +977,7 @@ t4_attach(device_t dev) pi->linkdnrc = -1; - pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbe" : "cxl", -1); + pi->dev = device_add_child(dev, sc->names->ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -1355,6 +1460,7 @@ static int cxgbe_attach(device_t dev) { struct port_info *pi = device_get_softc(dev); + struct adapter *sc = pi->adapter; struct vi_info *vi; int i, rc; @@ -1367,8 +1473,7 @@ cxgbe_attach(device_t dev) for_each_vi(pi, i, vi) { if (i == 0) continue; - vi->dev = device_add_child(dev, is_t4(pi->adapter) ? - "vcxgbe" : "vcxl", -1); + vi->dev = device_add_child(dev, sc->names->vi_ifnet_name, -1); if (vi->dev == NULL) { device_printf(dev, "failed to add VI %d\n", i); continue; @@ -2686,6 +2791,22 @@ struct fw_info { .intfver_fcoepdu = FW_INTFVER(T5, FCOEPDU), .intfver_fcoe = FW_INTFVER(T5, FCOE), }, + }, { + .chip = CHELSIO_T6, + .kld_name = "t6fw_cfg", + .fw_mod_name = "t6fw", + .fw_hdr = { + .chip = FW_HDR_CHIP_T6, + .fw_ver = htobe32_const(FW_VERSION(T6)), + .intfver_nic = FW_INTFVER(T6, NIC), + .intfver_vnic = FW_INTFVER(T6, VNIC), + .intfver_ofld = FW_INTFVER(T6, OFLD), + .intfver_ri = FW_INTFVER(T6, RI), + .intfver_iscsipdu = FW_INTFVER(T6, ISCSIPDU), + .intfver_iscsi = FW_INTFVER(T6, ISCSI), + .intfver_fcoepdu = FW_INTFVER(T6, FCOEPDU), + .intfver_fcoe = FW_INTFVER(T6, FCOE), + }, } }; @@ -9646,9 +9767,9 @@ done_unload: return (rc); } -static devclass_t t4_devclass, t5_devclass; -static devclass_t cxgbe_devclass, cxl_devclass; -static devclass_t vcxgbe_devclass, vcxl_devclass; +static devclass_t t4_devclass, t5_devclass, t6_devclass; +static devclass_t cxgbe_devclass, cxl_devclass, cc_devclass; +static devclass_t vcxgbe_devclass, vcxl_devclass, vcc_devclass; DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, mod_event, 0); MODULE_VERSION(t4nex, 1); @@ -9657,7 +9778,6 @@ MODULE_DEPEND(t4nex, firmware, 1, 1, 1); MODULE_DEPEND(t4nex, netmap, 1, 1, 1); #endif /* DEV_NETMAP */ - DRIVER_MODULE(t5nex, pci, t5_driver, t5_devclass, mod_event, 0); MODULE_VERSION(t5nex, 1); MODULE_DEPEND(t5nex, firmware, 1, 1, 1); @@ -9665,14 +9785,27 @@ MODULE_DEPEND(t5nex, firmware, 1, 1, 1); MODULE_DEPEND(t5nex, netmap, 1, 1, 1); #endif /* DEV_NETMAP */ +DRIVER_MODULE(t6nex, pci, t6_driver, t6_devclass, mod_event, 0); +MODULE_VERSION(t6nex, 1); +MODULE_DEPEND(t6nex, firmware, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(t6nex, netmap, 1, 1, 1); +#endif /* DEV_NETMAP */ + DRIVER_MODULE(cxgbe, t4nex, cxgbe_driver, cxgbe_devclass, 0, 0); MODULE_VERSION(cxgbe, 1); DRIVER_MODULE(cxl, t5nex, cxl_driver, cxl_devclass, 0, 0); MODULE_VERSION(cxl, 1); +DRIVER_MODULE(cc, t6nex, cc_driver, cc_devclass, 0, 0); +MODULE_VERSION(cc, 1); + DRIVER_MODULE(vcxgbe, cxgbe, vcxgbe_driver, vcxgbe_devclass, 0, 0); MODULE_VERSION(vcxgbe, 1); DRIVER_MODULE(vcxl, cxl, vcxl_driver, vcxl_devclass, 0, 0); MODULE_VERSION(vcxl, 1); + +DRIVER_MODULE(vcc, cc, vcc_driver, vcc_devclass, 0, 0); +MODULE_VERSION(vcc, 1); Modified: head/sys/dev/cxgbe/t4_tracer.c ============================================================================== --- head/sys/dev/cxgbe/t4_tracer.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_tracer.c Fri Sep 16 00:08:37 2016 (r305852) @@ -124,7 +124,8 @@ t4_cloner_match(struct if_clone *ifc, co { if (strncmp(name, "t4nex", 5) != 0 && - strncmp(name, "t5nex", 5) != 0) + strncmp(name, "t5nex", 5) != 0 && + strncmp(name, "t6nex", 5) != 0) return (0); if (name[5] < '0' || name[5] > '9') return (0); Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/dev/cxgbe/t4_vf.c Fri Sep 16 00:08:37 2016 (r305852) @@ -111,6 +111,12 @@ struct { {0x580f, "Chelsio Amsterdam VF"}, {0x5813, "Chelsio T580-CHR VF"}, #endif +}, t6vf_pciids[] = { + {0x6801, "Chelsio T6225-CR VF"}, /* 2 x 10/25G */ + {0x6802, "Chelsio T6225-SO-CR VF"}, /* 2 x 10/25G, nomem */ + {0x6807, "Chelsio T62100-LP-CR VF"}, /* 2 x 40/50/100G */ + {0x6808, "Chelsio T62100-SO-CR VF"}, /* 2 x 40/50/100G, nomem */ + {0x680d, "Chelsio T62100-CR VF"}, /* 2 x 40/50/100G */ }; static d_ioctl_t t4vf_ioctl; @@ -153,6 +159,22 @@ t5vf_probe(device_t dev) return (ENXIO); } +static int +t6vf_probe(device_t dev) +{ + uint16_t d; + size_t i; + + d = pci_get_device(dev); + for (i = 0; i < nitems(t6vf_pciids); i++) { + if (d == t6vf_pciids[i].device) { + device_set_desc(dev, t6vf_pciids[i].desc); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + #define FW_PARAM_DEV(param) \ (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | \ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param)) @@ -498,6 +520,12 @@ t4vf_attach(device_t dev) if (rc != 0) goto done; + t4_init_devnames(sc); + if (sc->names == NULL) { + rc = ENOTSUP; + goto done; /* error message displayed already */ + } + /* * Leave the 'pf' and 'mbox' values as zero. This ensures * that various firmware messages do not set the fields which @@ -642,8 +670,7 @@ t4vf_attach(device_t dev) pi->linkdnrc = -1; - pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbev" : "cxlv", - -1); + pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -920,6 +947,20 @@ static driver_t t5vf_driver = { sizeof(struct adapter) }; +static device_method_t t6vf_methods[] = { + DEVMETHOD(device_probe, t6vf_probe), + DEVMETHOD(device_attach, t4vf_attach), + DEVMETHOD(device_detach, t4_detach_common), + + DEVMETHOD_END +}; + +static driver_t t6vf_driver = { + "t6vf", + t6vf_methods, + sizeof(struct adapter) +}; + static driver_t cxgbev_driver = { "cxgbev", cxgbe_methods, @@ -932,8 +973,14 @@ static driver_t cxlv_driver = { sizeof(struct port_info) }; -static devclass_t t4vf_devclass, t5vf_devclass; -static devclass_t cxgbev_devclass, cxlv_devclass; +static driver_t ccv_driver = { + "ccv", + cxgbe_methods, + sizeof(struct port_info) +}; + +static devclass_t t4vf_devclass, t5vf_devclass, t6vf_devclass; +static devclass_t cxgbev_devclass, cxlv_devclass, ccv_devclass; DRIVER_MODULE(t4vf, pci, t4vf_driver, t4vf_devclass, 0, 0); MODULE_VERSION(t4vf, 1); @@ -943,8 +990,15 @@ DRIVER_MODULE(t5vf, pci, t5vf_driver, t5 MODULE_VERSION(t5vf, 1); MODULE_DEPEND(t5vf, t5nex, 1, 1, 1); +DRIVER_MODULE(t6vf, pci, t6vf_driver, t6vf_devclass, 0, 0); +MODULE_VERSION(t6vf, 1); +MODULE_DEPEND(t6vf, t6nex, 1, 1, 1); + DRIVER_MODULE(cxgbev, t4vf, cxgbev_driver, cxgbev_devclass, 0, 0); MODULE_VERSION(cxgbev, 1); DRIVER_MODULE(cxlv, t5vf, cxlv_driver, cxlv_devclass, 0, 0); MODULE_VERSION(cxlv, 1); + +DRIVER_MODULE(ccv, t6vf, ccv_driver, ccv_devclass, 0, 0); +MODULE_VERSION(ccv, 1); Modified: head/sys/modules/cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/Makefile Thu Sep 15 22:31:49 2016 (r305851) +++ head/sys/modules/cxgbe/Makefile Fri Sep 16 00:08:37 2016 (r305852) @@ -7,8 +7,10 @@ SYSDIR?=${.CURDIR}/../.. SUBDIR= if_cxgbe SUBDIR+= if_cxl +SUBDIR+= if_cc SUBDIR+= if_cxgbev SUBDIR+= if_cxlv +SUBDIR+= if_ccv SUBDIR+= t4_firmware SUBDIR+= t5_firmware SUBDIR+= ${_tom} Added: head/sys/modules/cxgbe/if_cc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cxgbe/if_cc/Makefile Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,11 @@ +# +# $FreeBSD$ +# + +CXGBE= ${.CURDIR}/../../../dev/cxgbe +.PATH: ${CXGBE} + +KMOD= if_cc +SRCS= if_cc.c + +.include Added: head/sys/modules/cxgbe/if_ccv/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cxgbe/if_ccv/Makefile Fri Sep 16 00:08:37 2016 (r305852) @@ -0,0 +1,11 @@ +# +# $FreeBSD$ +# + +CXGBE= ${.CURDIR}/../../../dev/cxgbe +.PATH: ${CXGBE} + +KMOD= if_ccv +SRCS= if_ccv.c + +.include From owner-svn-src-head@freebsd.org Fri Sep 16 01:38:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 712B4BDCA44; Fri, 16 Sep 2016 01:38:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2011AE81; Fri, 16 Sep 2016 01:38:24 +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 u8G1cN43066653; Fri, 16 Sep 2016 01:38:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G1cNsi066650; Fri, 16 Sep 2016 01:38:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609160138.u8G1cNsi066650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Sep 2016 01:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305854 - in head/sys/boot/efi/loader/arch: amd64 arm64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 01:38:24 -0000 Author: emaste Date: Fri Sep 16 01:38:22 2016 New Revision: 305854 URL: https://svnweb.freebsd.org/changeset/base/305854 Log: Use arch-specific .text padding fill value in EFI loaders The fill pattern was previously an ia64 instruction sequence. Presumably ia64's linker script was copied as a starting point. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 head/sys/boot/efi/loader/arch/i386/ldscript.i386 Modified: head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Sep 16 00:14:26 2016 (r305853) +++ head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Sep 16 01:38:22 2016 (r305854) @@ -19,7 +19,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) Modified: head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Sep 16 00:14:26 2016 (r305853) +++ head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Sep 16 01:38:22 2016 (r305854) @@ -15,7 +15,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xD4200000 . = ALIGN(16); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) Modified: head/sys/boot/efi/loader/arch/i386/ldscript.i386 ============================================================================== --- head/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Sep 16 00:14:26 2016 (r305853) +++ head/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Sep 16 01:38:22 2016 (r305854) @@ -14,7 +14,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.plt) - } =0x00300000010070000002000001000400 + } =0xCC . = ALIGN(4096); .data : { *(.rodata .rodata.* .gnu.linkonce.r.*) From owner-svn-src-head@freebsd.org Fri Sep 16 02:31:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA6F4BDC6AC; Fri, 16 Sep 2016 02:31:22 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0110.outbound.protection.outlook.com [104.47.32.110]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60577369; Fri, 16 Sep 2016 02:31:21 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Wr4fqcUj6bUNd+HFX+M/r66eDtWWOdeun0Le5rIy66g=; b=WoVmUJ+/ezgSOO49BDcVi0HW4D0Jk8662K/vDAjg9Dyrz5lomUtUGEtigAdnF44J+8mIAp0nlPoGvJEUlTm/I9O0SgWgk27Ge9y/SI9GbSAvBH1M4x0MoS6D3sDrhhu6Viiw+BGCyaTASwXr5siP2ErXtct6YR2v4KWOZHZzuCE= Received: from CY1PR05CA0011.namprd05.prod.outlook.com (10.166.186.149) by BLUPR0501MB977.namprd05.prod.outlook.com (10.141.254.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.6; Fri, 16 Sep 2016 02:31:19 +0000 Received: from BL2FFO11FD057.protection.gbl (2a01:111:f400:7c09::111) by CY1PR05CA0011.outlook.office365.com (2a01:111:e400:c5a4::21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.639.2 via Frontend Transport; Fri, 16 Sep 2016 02:31:19 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.18) by BL2FFO11FD057.mail.protection.outlook.com (10.173.161.125) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 02:31:19 +0000 Received: from p-mailhub01.juniper.net (10.160.2.17) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 15 Sep 2016 19:31:07 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id u8G2V6PM006019; Thu, 15 Sep 2016 19:31:06 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 22DD638551E; Thu, 15 Sep 2016 19:31:06 -0700 (PDT) To: Bryan Drewery CC: , , , Subject: Re: svn commit: r305634 - head/share/mk In-Reply-To: References: <201609090121.u891LZOO023156@repo.freebsd.org> <76524.1473467847@kaos.jnpr.net> Comments: In-reply-to: Bryan Drewery message dated "Wed, 14 Sep 2016 11:14:13 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8254.1473993065.1@kaos.jnpr.net> Date: Thu, 15 Sep 2016 19:31:05 -0700 Message-ID: <8255.1473993065@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.18; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(199003)(24454002)(189002)(377454003)(105596002)(69596002)(586003)(76176999)(4001430100002)(68736007)(93886004)(106466001)(23726003)(50986999)(8676002)(81166006)(7126002)(11100500001)(86362001)(50226002)(53416004)(117636001)(2950100001)(97756001)(626004)(5660300001)(107886002)(8936002)(4326007)(81156014)(305945005)(76506005)(50466002)(7846002)(97736004)(450100001)(19580405001)(9686002)(189998001)(46406003)(47776003)(7696004)(110136003)(77096005)(2906002)(92566002)(19580395003)(356003)(2810700001)(87936001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR0501MB977; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD057; 1:SvUgufYSsilcOZoMXS3uIByO6603ZZNZm7LjInvnoiUj/G8PJHQMZ1oFthx8yZY3C2sLEX8cMPyUpxQEqQkmoC3+3ki1dWHBEK9xoVc3T2JGwN8nchOW0wX3qqAERxE2XfjAkJsOSxwtNlZv2zXq2xfbu0T2rLL3IOqNdXOGQpV3UskNBLWFh1g/B4ARWPV36khXZqCd8mojdfebCk8AA2t6TgdCHtADYYV9nclXONL9iLPrn+DKGJ9qHSC+MPJ8ll7HlXR9A+KKEysEyAwZVkY6wHgKH5UQyyb2aujDeEF8A0wbEMvUmJX4ISERPsQ6rm5Ieo+WTBUfEK3niB/4r+RCT7Ju1C/pV9XRtIGtqbbfoVB9Efeql4MZJ6+ZtrBWjTM6R51Ya5obEYkBlta6Q2t53T/yxoGqFt+PQY2uHnHt6zAdYht/UWym+2FjThyjmEGzlaTCvcecJRpDqA+lQdmdJ71MHJdLnfN2keSZL8OiPzB0UiqtgKLEmPnrbIAaxkVCB97Ul56QKZlZwohsh6jcYBWpzszCGMiCFEqRW/4= X-MS-Office365-Filtering-Correlation-Id: 57a4a4dc-1fff-423a-56c2-08d3ddd98ab0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 2:dpOiCeae8Dh7TZJO3btbNgeWUW4voAAeZvo4RNZqJB+1+FI+v9GTkFm5IqEHmaw2wwBadVPOkcvdQtDnhbXaiXro77ZZPxFTjXlrg873BZ+mq7PbTT+ZQvD+4q5wASjjaJgQI4ZLvTQdmKkcstrbDYCbUZtVctDGWChH5CMguHRFd7JgoiuJYHMqWV8jfxLr; 3:p0ZoVwU6V5aawmHxIHAkgMgidr3+tL4XRipNYY3Qac4dAzdadPMBpN3JPVoZekmS9T7f8UoR3yhHj4VN8E8sHWw5zlAMP+bOYy7hOF9dsmyBm7i76ql/Voepor/Ze7uQY+AZNGTexXLjHqixoJEAzTX3LAMgjtdeSpvg/kyhlX0m5mzRUlmb0TchJwl6HZU9NgdCgias8zVK2UIUCu46NkoA2HxfRzgSWE8S3l6sJPM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB977; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 25:pCgkgD3GYOX2IWJQbMVkSi4/2uybBp/0fTf+drkv27oKJf755OWYD0qjwh7VNHAOGHH0DQ0rPM90LjMBUtIjIElYwqMs8tHlCn8GIDdaiB4nVb19BTByXAzBdbm6ECLdw1Tyyyy1/RQPdPaBMr6TllZ3Bb3jGivHGCe0aaPUAK17FvW/Fpa0h4AFYc6n6ViJPLYrGW3pZiF/+wCy8uJVbpohXEhUAz5uP26Tw7xGjoiq7OHsMenD9TfONzQTPyjzCjjASqr7mmHeIpwF4/ZftEt9uEhAv9HuYj12x3NzBBewxWFTazue6QmtYl2X7QXcc5//d9qgCuCtXI89IqRgy9Xe8BzPFImNfKxiFH+wK6hQu4+XZz5tobGPJjalHCAWIFlkq2eosLctzfbbZZ6ISHd0FHjMonYKi7gU+sLg+pMDDFBSl07tPxgvaHCM/q3LKqqltbrqG6INdUDS2Ti/9iBaOSs/mzquLp2Tg/vM8mNok4P04HwnePNqd5TGEpDQicx/0UZfmHCJQpcBB+AmwZ6d8VbrCTvBy9vI2ouVjCZ79EQPoD9e+TNrhJXnwuzWgIZ1aHrgAthwmmR3Bmnm3ZvogJQn+nBGNZGi5UAyJuk/FRvBo74y8etX8ARPqqYq2PEvCk4IkwEzrbuUgpdvYWm3EE3+vy/kyumLeKPjVcp+ky3bSHYhr0wTRmKgjV4vZs6S0b4VMmvlEpt/qyv5EY4KKG5J+9iQoOiUHQigX3CczPPAgIoP0gAJey02MmCA X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 31:Y/dkq5rcXsHzygLBjv2/h0BYIUmH7oSXx/Jz+6ZYmr/yVO4+YuRpdUpD2ReimsBAMi+AWd0mcpMU7OlUDf9jV68Oy7zhU1AJPFDwxPOZd6jZ+bDL0s4x949jnSrYbpKS1/EoFQ1S8/YTsZ4vtMZq1iPFWMsptkMe/gQz27kcb+nMulRpuv4YWPzFLsRwRvHGytoavgqFxKFz6pagJergLU3c/KW/B08N8i5TjF/Lsxk=; 20:MVOXszmsAdo5+mDfKOvze7+q+Tt3/rMkRliyd1ZYAe+cteYa9xZA0wpmOMH66VByvvvy1hwMQdqE3W2FZs7iwpZhVpMG6Kkml5StB5npW7mO2dIorbP2rvdi8QxIrq6i55EueyvKGP5ISpLwlvcsiWpFmje1XmhUiQlVkHP99MMZ9UKMLnYUcOoZ/3eOvNq6thyROSXlILUVp3y0u1mnRwqcsLkeCpu3ze961oOapfQDlx/KXkGMjvlFGlkSJaDDZu+/pQJ7heqOuBWXjUFdm8CHFiRsNhTdF13ytj0Ftiv9/pNzQvif4H8tEXocqhPHXRyRykxjuQgoosFMC9rR/yCih/jt3FKg8+w+cN7EONppYKiVfsXT9Wj3JdLvoQzgrSUtHuuUMvNJmW/LPZm6TJBxV/cvzFTsCDZYDltv3tlp4aqSOaFPYVEAR2Rb4JYUeswCbPca8rSLDEikGVkQOD6pQ0Y94+Ow0kdFKMVoiJDvRx/tosmP/FuK2OH33OvH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13017025)(8121501046)(5005006)(13015025)(13023025)(13024025)(13018025)(10201501046)(3002001)(6055026); SRVR:BLUPR0501MB977; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0501MB977; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 4:NrVOa8fEcJ7QwGVHajfbgONrO4I9VwYJjuJ5zMFH0Z/PbbSnFRxTzzXUl2i3jwebEkCYInL9WjnflQpQ41+ZXu4mtWyk84VRqBRZf49gNrH0u/grLjxPLo7L+FQHfr+2mEwdTO0t21jv2nR+Ge80ksr8Z7kpIhm3+ODVUA9hEIUoOfAWj1AIJuWjfN+Q59kBRkxOUSpdD/esTXnfLSsJ2FfpiUiK7/8mIYS6Ycf92cO9tLPLwqI5s/BBuGMbYN/wlCS29+7rr7nnLdHGgRRXcPDjL8CrKRzRfr2L1e5U7lkcr/pdMgHIRaE65L0+jnGXle61eAsebzQqW7kxdtGLdWsKruMxlaVwbBdXwkw71MElcyiAOv7i+bcIzYPpae30sojEQuBlgQgeFpET/TO3TfaVTkJ4yOkGYN0KjvqdqM5zWNQosWmsr5/4jGBx8OFqESSgQA6rQQyoV+qSUGSQy5HrQcVjs5lstoVu7j3omQtSSUs0vxhUPTnmQJiKcmg7 X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0501MB977; 23:wP/cQotLYQovcaDI0REVBmeUf1LR5HlnoIvIebR8?= =?us-ascii?Q?O1ORT7PrjNNK4Z8haKrh9zZ+8I2c1HuAt8Zw9/6WF++RK8lZmn47l16ErqG2?= =?us-ascii?Q?72ht38mAdpvoltu9AkxY8t/aqT+9LNnuYUHT/LyxcKYJ0+QcyvPr/ObTJpx0?= =?us-ascii?Q?jPMkkA2harqxLISH4hoMj/Fnuoct8pahPBW7zqtgTYXevTlTk8f7B/RU3IPK?= =?us-ascii?Q?1Y0Tlbt4O2VOiNgLdYljAjPJ499GustvpB4WjvEc6gkatYOqHNVAFCk77Fai?= =?us-ascii?Q?p5R5ha0kNbNJy/zBeGZ6BPlprivJ9tPwu5Ti6ng2AiVIGNfUgzTHtqbYoLJK?= =?us-ascii?Q?nGWTdI3+wz2nFssCwgtPSmFSKUxk/SvfoEDw+inDL8YDHQyfdvXqHYu6jdnS?= =?us-ascii?Q?uaEJwBgbbFdNhagvSyH4lkxNz93VBfUCPPAWnAwKbW2KkcPVvRHTlEyK5z9b?= =?us-ascii?Q?SgotXiNrTK2OmiGdhxG1exd01T/qwGazW1Il6Dwh+h/JL1/DJebHNs889iUm?= =?us-ascii?Q?CPA/YCJc0OLG5v+/AvQKLsFbfrOeaZ2+e7W8iXQTjQewYUe0wflsoJsXSo//?= =?us-ascii?Q?xT5g6NMXC9kj827egNBvlMT8mPzfMjxskNqXvPrtUCAyQrXzw0mmV029CqiC?= =?us-ascii?Q?8SvRxihewYyyCb1i6hAusbmaV4Awzvu1TAcUd0sEdELT4hgkwtx/8nf86I75?= =?us-ascii?Q?U71IAS77MK+FTwMslP6B6idj19xbg6AjJg+7HEU9zlIucwxm8H5ZzeBiIG59?= =?us-ascii?Q?lbgey3lKLQinmSOGxvASAfrNt97ho1b1UR+WgNKamaLMmsMPkEf8wTWfEwDe?= =?us-ascii?Q?/CpvuBeShWbJ9uNr+L8ksWakmODwy9yessfektzVUShSrMJKqMxzxlkevTJ+?= =?us-ascii?Q?qO3TFy3XisoQpMYfjdVLLMcBLQsCPfeY+/f+vweJ7bfseAY2NjmO5Q5QYNA9?= =?us-ascii?Q?l3vdeH08+2GcgwDdznbaNCLxhcF7q26OHAwptOFjCynmfdIsRk7Xm45tCU4k?= =?us-ascii?Q?B94BE1pQ+UAgmk/uhanbueYKdHRPiyvDO4BMALFvrLH7Syb5gceahqZeK0Tv?= =?us-ascii?Q?7o2I+E5EKFWDab2S32Q2ah1vG/Q0Rig6K5QVrwmT0b+0xiyxxRO8tu0FEWkE?= =?us-ascii?Q?d7VjtHtpplbKAJE/5XHp0iH6fj+G5i46jt8rCg4HAAKPZyD6of70PFuyFmgW?= =?us-ascii?Q?AvOujB6rglWj5k29oRM3uNpUmP4mrLSgTdjo4+TEcnM2oAMsNapud7eQj5QI?= =?us-ascii?Q?qBFGPb+ENywrlhRKEcCe1CUS4x2jyKz6EN5kPKRIjdJ+MeaWVaXmNbArdqgw?= =?us-ascii?Q?Fg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB977; 6:014MTQ1zNM8IW9cSbOfheH8BMLBjEhbXxWOpVRdA/+rm0Kp9E3f0oZzO2iR7ulmFKHgHVXY0d64+fO4nulHhxgmAsAzjMv8m7ORFijOPXqD63jbP8GOMN1YOMWrmwI+OgMTxjfpcTYWysYfURIxgKl3s28gJ/bq8jpmElH0joELvEdDoLj58AYBKkO8Miy1eAlnHmw0Soj7Nuukp7nkErkBpBpHNPsxiAgnvTYXaWpjaksNoSv4dhADNOaqSfJrlvLn02Ksbg+eJptmH7YHv9BtnjQLvR/CqohuJe8VT6bS5EGjU53BVRwCi55VTJ2l8yk6tnCro+3ysM71wix8KDA==; 5:7le6In0KkLW4OMHK/vxeAHWMXNxopyZYCVSpBu+ohNxAywDJvepLbHpHqOzrJ0OwY4osnNHT5kwblu/pTRsev9/RkayIkS8uAg4mQufg4bYl81tQtJX3HQ8Sa3rzfbNJY0tygBGKP8XFwTyN0elRyw==; 24:8YY5o+cjxIWynVKHLdUrQQwP44EwlIZBvyw1ejouBcy9RLiFeLlL6uavSCbSpxJl9A4+tnNeN+ZgVz5bK5LVsC9/V8WDlhDJ5rAXMhyf5zA=; 7:l/J9rqEWdi4zNiSps0uYsL9w/ZUkt0v0OqP1P0THoi2R4J3kXHjd6LMLvruqc3WBwUBroOkJsVsUg5KfvJ0BwKMwV4d/2cmazWAnOS3Qd5DrVbJ29OjAvlAmoS3bielGI2YMBaJVgQrJ2SZQib/UtWEaQHUa6An1srTJQxw7cunkgRwrf8oSvdPkduHyv8ZAPkbOWsvirwF+t+TkkzBP9FCiiWQIQbSANoUA7RtO9aWnTAc7k3FSCT9Sya/Acshw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 02:31:19.0237 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB977 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 02:31:22 -0000 Bryan Drewery wrote: > On 9/9/16 5:37 PM, Simon J. Gerraty wrote: > > Bryan Drewery wrote: > > > >>> +# some targets involve old pre-built targets > >>> +# ignore mtime of shell > >>> +# and mtime of makefiles does not matter in meta mode > >>> +.MAKE.META.IGNORE_PATHS += \ > >>> + ${MAKEFILE} \ > >>> + ${SHELL} \ > >>> + ${SYS_MK_DIR} > >> > >> I think it could be problematic to ignore *.mk changes. The build > Can you at least wrap it in something like .if > !defined(META_CONSIDER_MK_FILES) ? How about META_IGNORE_MAKEFILES ? Could even be an option ie. -DWITHOUT_META_IGNORE_MAKEFILES to disable? From owner-svn-src-head@freebsd.org Fri Sep 16 03:04:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77CCBDCE06; Fri, 16 Sep 2016 03:04:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E3CD1560; Fri, 16 Sep 2016 03:04:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G34mAF000816; Fri, 16 Sep 2016 03:04:48 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G34mOm000815; Fri, 16 Sep 2016 03:04:48 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201609160304.u8G34mOm000815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 16 Sep 2016 03:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305855 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 03:04:49 -0000 Author: marcel Date: Fri Sep 16 03:04:48 2016 New Revision: 305855 URL: https://svnweb.freebsd.org/changeset/base/305855 Log: When MAKEOBJDIRPREFIX points to a case-insensitive file system, the build can break when different source files create the same object files (case-insensitivity speaking). This is the case for _Exit.c and _exit.s. Compile _Exit.c as C99_Exit.c Reviewed by: sjg@ MFC after: completion Sponsored by: Bracket Computing Differential Revision: https://reviews.freebsd.org/D7893 Modified: head/lib/libc/stdlib/Makefile.inc Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Fri Sep 16 01:38:22 2016 (r305854) +++ head/lib/libc/stdlib/Makefile.inc Fri Sep 16 03:04:48 2016 (r305855) @@ -4,7 +4,7 @@ # machine-independent stdlib sources .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib -MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ +MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \ hsearch_r.c imaxabs.c imaxdiv.c \ @@ -16,6 +16,13 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c +# Work around an issue on case-insensitive file systems. +# libc has both _Exit.c and _exit.s and they both yield +# _exit.o (case insensitively speaking). +CLEANFILES+=C99_Exit.c +C99_Exit.c: ${LIBC_SRCTOP}/stdlib/_Exit.c .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} + SYM_MAPS+= ${LIBC_SRCTOP}/stdlib/Symbol.map # machine-dependent stdlib sources From owner-svn-src-head@freebsd.org Fri Sep 16 03:36:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF90EBDB43B; Fri, 16 Sep 2016 03:36:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 662191FA3; Fri, 16 Sep 2016 03:36:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G3ahPg012244; Fri, 16 Sep 2016 03:36:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G3ahxC012243; Fri, 16 Sep 2016 03:36:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201609160336.u8G3ahxC012243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Sep 2016 03:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305856 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 03:36:44 -0000 Author: mjg Date: Fri Sep 16 03:36:43 2016 New Revision: 305856 URL: https://svnweb.freebsd.org/changeset/base/305856 Log: linprocfs: garbage collect meminfo fields not present in linux In particular memshared not only does not exist in linux, it was extremely expensive to calculate. Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Sep 16 03:04:48 2016 (r305855) +++ head/sys/compat/linprocfs/linprocfs.c Fri Sep 16 03:36:43 2016 (r305856) @@ -144,12 +144,10 @@ linprocfs_domeminfo(PFS_FILL_ARGS) unsigned long memtotal; /* total memory in bytes */ unsigned long memused; /* used memory in bytes */ unsigned long memfree; /* free memory in bytes */ - unsigned long memshared; /* shared memory ??? */ unsigned long buffers, cached; /* buffer / cache memory ??? */ unsigned long long swaptotal; /* total swap space in bytes */ unsigned long long swapused; /* used swap space in bytes */ unsigned long long swapfree; /* free swap space in bytes */ - vm_object_t object; int i, j; memtotal = physmem * PAGE_SIZE; @@ -169,13 +167,6 @@ linprocfs_domeminfo(PFS_FILL_ARGS) swaptotal = (unsigned long long)i * PAGE_SIZE; swapused = (unsigned long long)j * PAGE_SIZE; swapfree = swaptotal - swapused; - memshared = 0; - mtx_lock(&vm_object_list_mtx); - TAILQ_FOREACH(object, &vm_object_list, object_list) - if (object->shadow_count > 1) - memshared += object->resident_page_count; - mtx_unlock(&vm_object_list_mtx); - memshared *= PAGE_SIZE; /* * We'd love to be able to write: * @@ -188,21 +179,14 @@ linprocfs_domeminfo(PFS_FILL_ARGS) cached = vm_cnt.v_cache_count * PAGE_SIZE; sbuf_printf(sb, - " total: used: free: shared: buffers: cached:\n" - "Mem: %lu %lu %lu %lu %lu %lu\n" - "Swap: %llu %llu %llu\n" "MemTotal: %9lu kB\n" "MemFree: %9lu kB\n" - "MemShared:%9lu kB\n" "Buffers: %9lu kB\n" "Cached: %9lu kB\n" "SwapTotal:%9llu kB\n" "SwapFree: %9llu kB\n", - memtotal, memused, memfree, memshared, buffers, cached, - swaptotal, swapused, swapfree, - B2K(memtotal), B2K(memfree), - B2K(memshared), B2K(buffers), B2K(cached), - B2K(swaptotal), B2K(swapfree)); + B2K(memtotal), B2K(memfree), B2K(buffers), + B2K(cached), B2K(swaptotal), B2K(swapfree)); return (0); } From owner-svn-src-head@freebsd.org Fri Sep 16 04:08:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A656BDBB48; Fri, 16 Sep 2016 04:08:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF80CDCA; Fri, 16 Sep 2016 04:08:35 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G48Z8c023562; Fri, 16 Sep 2016 04:08:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G48ZKL023561; Fri, 16 Sep 2016 04:08:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160408.u8G48ZKL023561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305857 - head/sbin/rcorder X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:08:36 -0000 Author: allanjude Date: Fri Sep 16 04:08:34 2016 New Revision: 305857 URL: https://svnweb.freebsd.org/changeset/base/305857 Log: sbin/rcorder/rcorder.8: Amend HISTORY rcorder appeared in FreeBSD 5.0. Address issues raised by igor. PR: 212547 Submitted by: Sevan Janiyan Modified: head/sbin/rcorder/rcorder.8 Modified: head/sbin/rcorder/rcorder.8 ============================================================================== --- head/sbin/rcorder/rcorder.8 Fri Sep 16 03:36:43 2016 (r305856) +++ head/sbin/rcorder/rcorder.8 Fri Sep 16 04:08:34 2016 (r305857) @@ -1,7 +1,7 @@ .\" $NetBSD: rcorder.8,v 1.3 2000/07/17 14:16:22 mrg Exp $ .\" .\" Copyright (c) 1998 -.\" Perry E. Metzger. All rights reserved. +.\" Perry E. Metzger. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2011 +.Dd September 10, 2016 .Dt RCORDER 8 .Os .Sh NAME @@ -160,8 +160,11 @@ processing the stated file. .Sh HISTORY The .Nm -utility first appeared in +utility appeared in .Nx 1.5 . +.Nm +utility first appeared in +.Fx 5.0 . .Sh AUTHORS .An -nosplit Written by @@ -172,7 +175,7 @@ and The .Dq Li REQUIRE keyword is misleading: -It doesn't describe which daemons have to be running before a script +It does not describe which daemons have to be running before a script will be started. It describes which scripts must be placed before it in the dependency ordering. From owner-svn-src-head@freebsd.org Fri Sep 16 04:11:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73262BDBD0A; Fri, 16 Sep 2016 04:11:05 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41AD012A; Fri, 16 Sep 2016 04:11:05 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4B4Yb023739; Fri, 16 Sep 2016 04:11:04 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4B4RU023738; Fri, 16 Sep 2016 04:11:04 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160411.u8G4B4RU023738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305858 - head/sbin/reboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:11:05 -0000 Author: allanjude Date: Fri Sep 16 04:11:04 2016 New Revision: 305858 URL: https://svnweb.freebsd.org/changeset/base/305858 Log: sbin/reboot/reboot.8: Amend HISTORY A standalone reboot utility showed up in 4.0BSD, in AT&T UNIX init has a case for reboot and is present in the version shipped with V5 either way, current entry is incorrect. PR: 212548 Submitted by: Sevan Janiyan Modified: head/sbin/reboot/reboot.8 Modified: head/sbin/reboot/reboot.8 ============================================================================== --- head/sbin/reboot/reboot.8 Fri Sep 16 04:08:34 2016 (r305857) +++ head/sbin/reboot/reboot.8 Fri Sep 16 04:11:04 2016 (r305858) @@ -28,7 +28,7 @@ .\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd Dec 12, 2015 +.Dd September 10, 2016 .Dt REBOOT 8 .Os .Sh NAME @@ -165,4 +165,4 @@ reboot -r A .Nm utility appeared in -.At v6 . +.Bx 4.0 . From owner-svn-src-head@freebsd.org Fri Sep 16 04:12:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E78DBBDBF1C; Fri, 16 Sep 2016 04:12:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2497670; Fri, 16 Sep 2016 04:12:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4CWZF027290; Fri, 16 Sep 2016 04:12:32 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4CWMx027289; Fri, 16 Sep 2016 04:12:32 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160412.u8G4CWMx027289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305859 - head/sbin/umount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:12:34 -0000 Author: allanjude Date: Fri Sep 16 04:12:32 2016 New Revision: 305859 URL: https://svnweb.freebsd.org/changeset/base/305859 Log: sbin/umount/umount.8: Amend HISTORY umount first appeared in V1, confirmed using TUHS archive http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1 PR: 212554 Submitted by: Sevan Janiyan Modified: head/sbin/umount/umount.8 Modified: head/sbin/umount/umount.8 ============================================================================== --- head/sbin/umount/umount.8 Fri Sep 16 04:11:04 2016 (r305858) +++ head/sbin/umount/umount.8 Fri Sep 16 04:12:32 2016 (r305859) @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd July 7, 2016 +.Dd September 10, 2016 .Dt UMOUNT 8 .Os .Sh NAME @@ -158,4 +158,4 @@ file system table A .Nm utility appeared in -.At v6 . +.At v1 . From owner-svn-src-head@freebsd.org Fri Sep 16 04:22:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74042BDC478; Fri, 16 Sep 2016 04:22:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4F433C9D; Fri, 16 Sep 2016 04:22:22 +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 u8G4MLGi031063; Fri, 16 Sep 2016 04:22:21 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4MLN0031061; Fri, 16 Sep 2016 04:22:21 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201609160422.u8G4MLN0031061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 16 Sep 2016 04:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305860 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:22:22 -0000 Author: araujo Date: Fri Sep 16 04:22:21 2016 New Revision: 305860 URL: https://svnweb.freebsd.org/changeset/base/305860 Log: Add an option called "random" that combined with "ether" can generate a random MAC address for an Ethernet interface. PR: 211984 Submitted by: pi@ Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock Approved by: wblock (manpages) Modified: head/sbin/ifconfig/af_link.c head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/af_link.c ============================================================================== --- head/sbin/ifconfig/af_link.c Fri Sep 16 04:12:32 2016 (r305859) +++ head/sbin/ifconfig/af_link.c Fri Sep 16 04:22:21 2016 (r305860) @@ -90,13 +90,23 @@ link_getaddr(const char *addr, int which if (which != ADDR) errx(1, "can't set link-level netmask or broadcast"); - if ((temp = malloc(strlen(addr) + 2)) == NULL) - errx(1, "malloc failed"); - temp[0] = ':'; - strcpy(temp + 1, addr); - sdl.sdl_len = sizeof(sdl); - link_addr(temp, &sdl); - free(temp); + if (!strcmp(addr, "random")) { + sdl.sdl_len = sizeof(sdl); + sdl.sdl_alen = ETHER_ADDR_LEN; + sdl.sdl_nlen = 0; + sdl.sdl_family = AF_LINK; + arc4random_buf(&sdl.sdl_data, ETHER_ADDR_LEN); + /* Non-multicast and claim it is a hardware address */ + sdl.sdl_data[0] &= 0xfc; + } else { + if ((temp = malloc(strlen(addr) + 2)) == NULL) + errx(1, "malloc failed"); + temp[0] = ':'; + strcpy(temp + 1, addr); + sdl.sdl_len = sizeof(sdl); + link_addr(temp, &sdl); + free(temp); + } if (sdl.sdl_alen > sizeof(sa->sa_data)) errx(1, "malformed link-level address"); sa->sa_family = AF_LINK; Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:12:32 2016 (r305859) +++ head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:22:21 2016 (r305860) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 8, 2016 +.Dd September 17, 2016 .Dt IFCONFIG 8 .Os .Sh NAME @@ -145,6 +145,12 @@ is specified as a series of colon-separa This can be used to, for example, set a new MAC address on an Ethernet interface, though the mechanism used is not Ethernet specific. +Use the +.Pq Dq random +keyword to set a randomly generated MAC address. +A randomly-generated MAC address might be the same as one already in use +in the network. +Such duplications are extremely unlikely. If the interface is already up when this option is used, it will be briefly brought down and then brought back up again in order to ensure that the receive @@ -254,7 +260,7 @@ Display subnet masks in dotted quad nota .br 255.255.0.0 or 255.255.255.192 .It Sy hex -Display subnet masks in hexidecimal, for example: +Display subnet masks in hexadecimal, for example: .br 0xffff0000 or 0xffffffc0 .El @@ -2615,13 +2621,13 @@ and .Cm vlandev must both be set at the same time. .It Cm vlanpcp Ar priority_code_point -Priority code point +Priority code point .Pq Dv PCP is an 3-bit field which refers to the IEEE 802.1p class of service and maps to the frame priority level. .Pp Values in order of priority are: -.Cm 1 +.Cm 1 .Pq Dv Background (lowest) , .Cm 0 .Pq Dv Best effort (default) , @@ -2759,7 +2765,7 @@ interface to send the frame directly to broadcasting the frame to the multicast group. This is the default. .It Fl vxlanlearn -The forwarding table is not populated by recevied packets. +The forwarding table is not populated by received packets. .It Cm vxlanflush Delete all dynamically-learned addresses from the forwarding table. .It Cm vxlanflushall From owner-svn-src-head@freebsd.org Fri Sep 16 04:28:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B032BDC547; Fri, 16 Sep 2016 04:28:34 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9AA0F43; Fri, 16 Sep 2016 04:28:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G4SXLC031459; Fri, 16 Sep 2016 04:28:33 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4SV2F031448; Fri, 16 Sep 2016 04:28:31 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201609160428.u8G4SV2F031448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 16 Sep 2016 04:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305861 - in head/sbin: geom/class/multipath ggate/ggatec ggate/ggated ggate/ggatel hastctl hastd iscontrol mdmfs mount_nfs nandfs nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:28:34 -0000 Author: allanjude Date: Fri Sep 16 04:28:31 2016 New Revision: 305861 URL: https://svnweb.freebsd.org/changeset/base/305861 Log: Add missing history sections to a number of storage related man pages gmultipath.8: Add HISTORY Adjust sentences with bad phrases picked up by igor ggatec.8: Add HISTORY ggated.8: Add HISTORY ggatel.8: Add HISTORY Seperate out sentence as advised by igor. hastctl.8: Add HISTORY hastd.8: Add HISTORY Fix sentence highlighted by igor. iscontrol.8: Add HISTORY mdmfs.8: Add HISTORY Address issues raised by igor mount_nfs.8: Add HISTORY Not sure where mount_nfs first showed up, but the verison used in the BSD's originates from 4.4BSD according to CSRG archive. Though commercial offerings from Sun and others covers older systems, eg https://groups.google.com/forum/#!topic/net.unix-wizards/lMe7aQikqJI nandfs.8: Add HISTORY Adjust sentence in description to address bad phrase highlighted by igor. nvmecontrol.8: Add HISTORY PR: 212491 PR: 212498 PR: 212499 PR: 212500 PR: 212501 PR: 212502 PR: 212505 PR: 212508 PR: 212540 PR: 212543 PR: 212546 Submitted by: Sevan Janiyan Modified: head/sbin/geom/class/multipath/gmultipath.8 head/sbin/ggate/ggatec/ggatec.8 head/sbin/ggate/ggated/ggated.8 head/sbin/ggate/ggatel/ggatel.8 head/sbin/hastctl/hastctl.8 head/sbin/hastd/hastd.8 head/sbin/iscontrol/iscontrol.8 head/sbin/mdmfs/mdmfs.8 head/sbin/mount_nfs/mount_nfs.8 head/sbin/nandfs/nandfs.8 head/sbin/nvmecontrol/nvmecontrol.8 Modified: head/sbin/geom/class/multipath/gmultipath.8 ============================================================================== --- head/sbin/geom/class/multipath/gmultipath.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/geom/class/multipath/gmultipath.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 18, 2015 +.Dd September 8, 2016 .Dt GMULTIPATH 8 .Os .Sh NAME @@ -255,12 +255,11 @@ When this occurs, that path is marked FA in a list is selected as active and the failed I/O reissued. In Active/Active mode all paths not marked FAIL may handle I/O at the same time. Requests are distributed between paths to equalize load. -For capable devices it allows to utilize the bandwidth of all paths. +For capable devices it allows the utilisation of the bandwidth available on all paths. In Active/Read mode all paths not marked FAIL may handle reads at the same time, but unlike in Active/Active mode only one path handles write requests at any -point in time. -It allows to closer follow the original write request order if the layer above -needs it for data consistency (not waiting for requisite write completion +point in time; closely following the original write request order if the layer +above needs it for data consistency (not waiting for requisite write completion before sending dependent write). .Pp When new devices are added to the system the @@ -368,6 +367,11 @@ geom_multipath_load="YES" .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.0 .Sh AUTHORS .An Matthew Jacob Aq Mt mjacob@FreeBSD.org .An Alexander Motin Aq Mt mav@FreeBSD.org Modified: head/sbin/ggate/ggatec/ggatec.8 ============================================================================== --- head/sbin/ggate/ggatec/ggatec.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/ggate/ggatec/ggatec.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2016 +.Dd September 8, 2016 .Dt GGATEC 8 .Os .Sh NAME @@ -173,6 +173,11 @@ client# mount_cd9660 /dev/ggate0 /cdrom .Xr ggated 8 , .Xr ggatel 8 , .Xr mount_cd9660 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.3 . .Sh AUTHORS The .Nm Modified: head/sbin/ggate/ggated/ggated.8 ============================================================================== --- head/sbin/ggate/ggated/ggated.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/ggate/ggated/ggated.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2016 +.Dd September 8, 2016 .Dt GGATED 8 .Os .Sh NAME @@ -116,6 +116,11 @@ Export CD-ROM device and a file: .Xr geom 4 , .Xr ggatec 8 , .Xr ggatel 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.3 . .Sh AUTHORS The .Nm Modified: head/sbin/ggate/ggatel/ggatel.8 ============================================================================== --- head/sbin/ggate/ggatel/ggatel.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/ggate/ggatel/ggatel.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2015 +.Dd September 8, 2016 .Dt GGATEL 8 .Os .Sh NAME @@ -80,7 +80,8 @@ List providers. .It Cm rescue Take over a previously created provider and handle pending and future -requests. This is useful if the initial +requests. +This is useful if the initial .Nm process died. To prevent data loss, the given path must lead to the @@ -151,6 +152,11 @@ ggatel destroy -u 5 .Xr ggated 8 , .Xr mount 8 , .Xr newfs 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.3 . .Sh AUTHORS The .Nm Modified: head/sbin/hastctl/hastctl.8 ============================================================================== --- head/sbin/hastctl/hastctl.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/hastctl/hastctl.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2013 +.Dd September 8, 2016 .Dt HASTCTL 8 .Os .Sh NAME @@ -220,6 +220,11 @@ nodeB# application_start .Xr hastd 8 , .Xr mount 8 , .Xr newfs 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 8.1 . .Sh AUTHORS The .Nm Modified: head/sbin/hastd/hastd.8 ============================================================================== --- head/sbin/hastd/hastd.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/hastd/hastd.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 1, 2010 +.Dd September 8, 2016 .Dt HASTD 8 .Os .Sh NAME @@ -44,8 +44,8 @@ The daemon is responsible for managing highly available GEOM providers. .Pp .Nm -allows to transparently store data on two physically separated machines -connected over the TCP/IP network. +allows the transpaent storage of data on two physically separated machines +connected over a TCP/IP network. Only one machine (cluster node) can actively use storage provided by .Nm . This machine is called primary. @@ -224,6 +224,11 @@ nodeA# mount -o noatime /dev/hast/shared .Xr mount 8 , .Xr newfs 8 , .Xr g_bio 9 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 8.1 . .Sh AUTHORS The .Nm Modified: head/sbin/iscontrol/iscontrol.8 ============================================================================== --- head/sbin/iscontrol/iscontrol.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/iscontrol/iscontrol.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 9, 2014 +.Dd September 9, 2016 .Dt ISCONTROL 8 .Os .Sh NAME @@ -125,7 +125,11 @@ whatever options are specified, and star .Xr iscsictl 8 .Sh STANDARDS RFC 3720 -.\"Sh HISTORY +.Sh HISTORY +The +.Nm +utility appeared in +Fx 7.0 . .Sh BUGS .Nm should probably load the iscsi_initiator module if needed. Modified: head/sbin/mdmfs/mdmfs.8 ============================================================================== --- head/sbin/mdmfs/mdmfs.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/mdmfs/mdmfs.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2016 +.Dd September 9, 2016 .Dt MDMFS 8 .Os .Sh NAME @@ -127,7 +127,8 @@ to try to detach the unit before attachi .It Fl d Ar max-extent-size The file system may choose to store large files using extents. This parameter specifies the largest extent size that may be -used. It is presently limited to its default value which is 16 +used. +It is presently limited to its default value which is 16 times the file system blocksize. .It Fl E Ar path-mdconfig Use @@ -311,8 +312,8 @@ option is passed to .Xr mount 8 as .Fl t . -See the programs that the options are passed to for more information -on their semantics. +For information on semantics, refer to the documentation of the programs +that the options are passed to. .Sh EXAMPLES Create and mount a 32 megabyte swap-backed file system on .Pa /tmp : @@ -394,5 +395,10 @@ was given on the command line. .Xr mdconfig 8 , .Xr mount 8 , .Xr newfs 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 5.0 . .Sh AUTHORS .An Dima Dorfman Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/mount_nfs/mount_nfs.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd October 30, 2014 +.Dd September 10, 2016 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -183,8 +183,8 @@ for positive name cache entries. If this is set to 0 it disables positive name caching for the mount point. .It Cm negnametimeo Ns = Ns Aq Ar value Override the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds) -for negative name cache entries. If this is set to 0 it disables negative -name caching for the mount point. +for negative name cache entries. +If this is set to 0 it disables negative name caching for the mount point. .It Cm nfsv2 Use the NFS Version 2 protocol (the default is to try version 3 first then version 2). @@ -262,7 +262,7 @@ such that the dirty byte range becomes a that are dirty. This reduces the number of writes significantly for software builds. -The merging of byte ranges isn't done if the file has been file +The merging of byte ranges is not done if the file has been file locked, since most applications modifying a file from multiple clients will use file locking. As such, this option could result in a corrupted file for the @@ -271,8 +271,9 @@ clients concurrently without using file .It Cm principal For the RPCSEC_GSS security flavors, such as krb5, krb5i and krb5p, this option sets the name of the host based principal name expected -by the server. This option overrides the default, which will be -``nfs@'' and should normally be sufficient. +by the server. +This option overrides the default, which will be ``nfs@'' +and should normally be sufficient. .It Cm noresvport Do .Em not @@ -515,6 +516,11 @@ Same as .Xr nfsd 8 , .Xr nfsiod 8 , .Xr showmount 8 +.Sh HISTORY +A version of the +.Nm +utility appeared in +.Bx 4.4 . .Sh BUGS Since nfsv4 performs open/lock operations that have their ordering strictly enforced by the server, the options Modified: head/sbin/nandfs/nandfs.8 ============================================================================== --- head/sbin/nandfs/nandfs.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/nandfs/nandfs.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2012 +.Dd September 10, 2016 .Dt NANDFS 8 .Os .Sh NAME @@ -48,7 +48,7 @@ .Sh DESCRIPTION The .Nm -utility allows to manage snapshots of a mounted NAND FS. +utility allows the management of snapshots on a mounted NAND FS. .Sh EXAMPLES Create a snapshot of filesystem mounted on .Em /nand . @@ -69,6 +69,11 @@ Remove snapshot 1 of filesystem mounted .Bd -literal -offset 2n .Li # Ic nandfs rmsnap 1 /nand .Ed +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 10.0 . .Sh AUTHORS This utility and manual page were written by .An Mateusz Guzik . Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Fri Sep 16 04:22:21 2016 (r305860) +++ head/sbin/nvmecontrol/nvmecontrol.8 Fri Sep 16 04:28:31 2016 (r305861) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 26, 2013 +.Dd September 10, 2016 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -94,9 +94,9 @@ Display an hexadecimal dump of the nvme0 .Pp .Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1 .Pp -Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each -thread will issue a single 512 byte read command. Results are printed to -stdout when 30 seconds expires. +Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. +Each thread will issue a single 512 byte read command. +Results are printed to stdout when 30 seconds expires. .Pp .Dl nvmecontrol reset nvme0 .Pp @@ -137,6 +137,11 @@ Set the current power mode. .Dl nvmecontrol power nvme0 .Pp Get the current power mode. +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 9.2 . .Sh AUTHORS .An -nosplit .Nm From owner-svn-src-head@freebsd.org Fri Sep 16 04:29:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6859FBDC616; Fri, 16 Sep 2016 04:29:09 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 160C71E1; Fri, 16 Sep 2016 04:29:09 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22b.google.com with SMTP id u82so75624865ywc.2; Thu, 15 Sep 2016 21:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lGutiF2CrFCN7aeqxzDNnm4yTTbO9VEp6P5h0k1nhQE=; b=WeZKTy7A9x6nx3VOY4hRnVdmXuUWn9Ft7Q8sre3dOmgSv4rM1+DWEHimW8cmi82n7Q zfK7In8y4SzFq3bMA8iZJMusXsXH/LW/TVsPyvHoX3LIR8jtPZyV5vSsOW8+703GC3Yy u529Og3hMkBohxf6FvqIxiRsXtfPah6Np5HgPrMkGfIndNlIgRfTT+BmCPkxV9Lx4Hqd 7CT1f01HiRwMlGj2CTFSwptPNzukewxHLNi7KAA4zzhczMERuhGvkj3HPqfZSuWCVdIC Kld6EcFO+GuKRU0Hh2nlMORFNwvOpf0YvzWKiMyoSDIXwveLcTh1dRGMbutyhf1Q+qhJ ol0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=lGutiF2CrFCN7aeqxzDNnm4yTTbO9VEp6P5h0k1nhQE=; b=TFCPAe2JAzQxfOWPTl546u0VtAq3QQc6NJkRW4Cu7ZzjqtEr5EVPVuUMqwxnyoBaXI UDHBFYW1wFiM15wt7JQVWVLQEUm0p77czvrz0XjUcMWCbfrYecNB3JSoDEyPIhY2l5rN LRuporvbzvNG7r3odpWA5BocjhY65+YOg//F0pqnhagPEm/WPbwyXOl5Zjhigyr+jZMB I4YVtNPnOBx6i7jk2r3eCWkm0UXAG1EDlWXA/Z9ZHIAhsdgKIm1fl6o6zll3qTfkyfUh 56yMy3q3P3ayETlzOmnhy0lH3r1G/sHDCSCfGO15AGHf/lzRobWytKm3FzP/JoL0glEn wCrg== X-Gm-Message-State: AE9vXwOa2sTyXrUcsOai+xhox7xaXMMi4clVccLdoVulPvFeaIl7E2m3hGPp6Ljq7UM4Iatx3XYgFROx+HXLEQ== X-Received: by 10.13.198.194 with SMTP id i185mr11802644ywd.132.1474000148175; Thu, 15 Sep 2016 21:29:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.56.130 with HTTP; Thu, 15 Sep 2016 21:29:07 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <201609160422.u8G4MLN0031061@repo.freebsd.org> References: <201609160422.u8G4MLN0031061@repo.freebsd.org> From: Marcelo Araujo Date: Fri, 16 Sep 2016 12:29:07 +0800 Message-ID: Subject: Re: svn commit: r305860 - head/sbin/ifconfig To: Marcelo Araujo Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:29:09 -0000 Ooops! Forgot to add the review link: https://reviews.freebsd.org/D7615 Best, 2016-09-16 12:22 GMT+08:00 Marcelo Araujo : > Author: araujo > Date: Fri Sep 16 04:22:21 2016 > New Revision: 305860 > URL: https://svnweb.freebsd.org/changeset/base/305860 > > Log: > Add an option called "random" that combined with "ether" can generate a > random MAC address for an Ethernet interface. > > PR: 211984 > Submitted by: pi@ > Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock > Approved by: wblock (manpages) > > Modified: > head/sbin/ifconfig/af_link.c > head/sbin/ifconfig/ifconfig.8 > > Modified: head/sbin/ifconfig/af_link.c > ============================================================ > ================== > --- head/sbin/ifconfig/af_link.c Fri Sep 16 04:12:32 2016 > (r305859) > +++ head/sbin/ifconfig/af_link.c Fri Sep 16 04:22:21 2016 > (r305860) > @@ -90,13 +90,23 @@ link_getaddr(const char *addr, int which > > if (which != ADDR) > errx(1, "can't set link-level netmask or broadcast"); > - if ((temp = malloc(strlen(addr) + 2)) == NULL) > - errx(1, "malloc failed"); > - temp[0] = ':'; > - strcpy(temp + 1, addr); > - sdl.sdl_len = sizeof(sdl); > - link_addr(temp, &sdl); > - free(temp); > + if (!strcmp(addr, "random")) { > + sdl.sdl_len = sizeof(sdl); > + sdl.sdl_alen = ETHER_ADDR_LEN; > + sdl.sdl_nlen = 0; > + sdl.sdl_family = AF_LINK; > + arc4random_buf(&sdl.sdl_data, ETHER_ADDR_LEN); > + /* Non-multicast and claim it is a hardware address */ > + sdl.sdl_data[0] &= 0xfc; > + } else { > + if ((temp = malloc(strlen(addr) + 2)) == NULL) > + errx(1, "malloc failed"); > + temp[0] = ':'; > + strcpy(temp + 1, addr); > + sdl.sdl_len = sizeof(sdl); > + link_addr(temp, &sdl); > + free(temp); > + } > if (sdl.sdl_alen > sizeof(sa->sa_data)) > errx(1, "malformed link-level address"); > sa->sa_family = AF_LINK; > > Modified: head/sbin/ifconfig/ifconfig.8 > ============================================================ > ================== > --- head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:12:32 2016 > (r305859) > +++ head/sbin/ifconfig/ifconfig.8 Fri Sep 16 04:22:21 2016 > (r305860) > @@ -28,7 +28,7 @@ > .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 > .\" $FreeBSD$ > .\" > -.Dd June 8, 2016 > +.Dd September 17, 2016 > .Dt IFCONFIG 8 > .Os > .Sh NAME > @@ -145,6 +145,12 @@ is specified as a series of colon-separa > This can be used to, for example, > set a new MAC address on an Ethernet interface, though the > mechanism used is not Ethernet specific. > +Use the > +.Pq Dq random > +keyword to set a randomly generated MAC address. > +A randomly-generated MAC address might be the same as one already in use > +in the network. > +Such duplications are extremely unlikely. > If the interface is already > up when this option is used, it will be briefly brought down and > then brought back up again in order to ensure that the receive > @@ -254,7 +260,7 @@ Display subnet masks in dotted quad nota > .br > 255.255.0.0 or 255.255.255.192 > .It Sy hex > -Display subnet masks in hexidecimal, for example: > +Display subnet masks in hexadecimal, for example: > .br > 0xffff0000 or 0xffffffc0 > .El > @@ -2615,13 +2621,13 @@ and > .Cm vlandev > must both be set at the same time. > .It Cm vlanpcp Ar priority_code_point > -Priority code point > +Priority code point > .Pq Dv PCP > is an 3-bit field which refers to the IEEE 802.1p > class of service and maps to the frame priority level. > .Pp > Values in order of priority are: > -.Cm 1 > +.Cm 1 > .Pq Dv Background (lowest) , > .Cm 0 > .Pq Dv Best effort (default) , > @@ -2759,7 +2765,7 @@ interface to send the frame directly to > broadcasting the frame to the multicast group. > This is the default. > .It Fl vxlanlearn > -The forwarding table is not populated by recevied packets. > +The forwarding table is not populated by received packets. > .It Cm vxlanflush > Delete all dynamically-learned addresses from the forwarding table. > .It Cm vxlanflushall > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Fri Sep 16 04:58:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AA70BDC0A8; Fri, 16 Sep 2016 04:58:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id D2D3D8D0; Fri, 16 Sep 2016 04:58:38 +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 u8G4wcRg042652; Fri, 16 Sep 2016 04:58:38 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G4wb8U042650; Fri, 16 Sep 2016 04:58:37 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609160458.u8G4wb8U042650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 16 Sep 2016 04:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305862 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 04:58:39 -0000 Author: bde Date: Fri Sep 16 04:58:37 2016 New Revision: 305862 URL: https://svnweb.freebsd.org/changeset/base/305862 Log: (1) Ifdef the new dr6 variable for KDB. While here, avoid using the old variable 'code' and remove it in trap(). ('code' was meant for holding things like %dr6, but is too small to hold %dr6 on amd64 and was reduced to an obfuscation of tf_err, with early truncation on amd64.) Submitted by: Michael Butler (imb@...) Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Sep 16 04:28:31 2016 (r305861) +++ head/sys/amd64/amd64/trap.c Fri Sep 16 04:58:37 2016 (r305862) @@ -176,8 +176,10 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; +#ifdef KDB register_t dr6; - int i = 0, ucode = 0, code; +#endif + int i = 0, ucode = 0; u_int type; register_t addr = 0; ksiginfo_t ksi; @@ -259,8 +261,6 @@ trap(struct trapframe *frame) } } - code = frame->tf_err; - if (TRAPF_USERMODE(frame)) { /* user trap */ @@ -378,7 +378,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton @@ -564,7 +564,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Sep 16 04:28:31 2016 (r305861) +++ head/sys/i386/i386/trap.c Fri Sep 16 04:58:37 2016 (r305862) @@ -189,8 +189,10 @@ trap(struct trapframe *frame) #endif struct thread *td = curthread; struct proc *p = td->td_proc; +#ifdef KDB register_t dr6; - int i = 0, ucode = 0, code; +#endif + int i = 0, ucode = 0; u_int type; register_t addr = 0; vm_offset_t eva; @@ -293,7 +295,6 @@ trap(struct trapframe *frame) } } eva = 0; - code = frame->tf_err; if (type == T_PAGEFLT) { /* * For some Cyrix CPUs, %cr2 is clobbered by @@ -467,7 +468,7 @@ user_trctrap_out: goto userout; #else /* !POWERFAIL_NMI */ /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton @@ -730,7 +731,7 @@ kernel_trctrap: goto out; #else /* !POWERFAIL_NMI */ /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) { + if (isa_nmi(frame->tf_err) == 0) { #ifdef KDB /* * NMI can be hooked up to a pushbutton From owner-svn-src-head@freebsd.org Fri Sep 16 05:33:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 477D9BDCBB7; Fri, 16 Sep 2016 05:33:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1A4A6C52; Fri, 16 Sep 2016 05:33:09 +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 u8G5X8Cl057324; Fri, 16 Sep 2016 05:33:08 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G5X80j057323; Fri, 16 Sep 2016 05:33:08 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201609160533.u8G5X80j057323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 16 Sep 2016 05:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305863 - head/sbin/natd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 05:33:09 -0000 Author: araujo Date: Fri Sep 16 05:33:08 2016 New Revision: 305863 URL: https://svnweb.freebsd.org/changeset/base/305863 Log: Invert calloc(3) argument order. Reviewed by: ed. MFC after: 4 weeks. Differential Revision: https://reviews.freebsd.org/D7902 Modified: head/sbin/natd/natd.c Modified: head/sbin/natd/natd.c ============================================================================== --- head/sbin/natd/natd.c Fri Sep 16 04:58:37 2016 (r305862) +++ head/sbin/natd/natd.c Fri Sep 16 05:33:08 2016 (r305863) @@ -2006,7 +2006,7 @@ NewInstance(const char *name) } } ninstance++; - ip = calloc(sizeof *ip, 1); + ip = calloc(1, sizeof(*ip)); ip->name = strdup(name); ip->la = LibAliasInit (ip->la); ip->assignAliasAddr = 0; From owner-svn-src-head@freebsd.org Fri Sep 16 06:31:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED794BDB77B; Fri, 16 Sep 2016 06:31:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id B9B33666; Fri, 16 Sep 2016 06:31:11 +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 u8G6VALE076233; Fri, 16 Sep 2016 06:31:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G6VAwE076232; Fri, 16 Sep 2016 06:31:10 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609160631.u8G6VAwE076232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 16 Sep 2016 06:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305864 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 06:31:12 -0000 Author: bde Date: Fri Sep 16 06:31:10 2016 New Revision: 305864 URL: https://svnweb.freebsd.org/changeset/base/305864 Log: Statically initialize the run mode to the one that will become current on first entry. This fixes a spurious "Stepping aborted" message when the first entry is for a breakpoint. Don't reset to the run mode to STEP_NONE when stopping, and remove STEP_NONE. This mode was never really used, except transiently to mis-decide whether to print the message on first entry. Modified: head/sys/ddb/db_run.c Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Fri Sep 16 05:33:08 2016 (r305863) +++ head/sys/ddb/db_run.c Fri Sep 16 06:31:10 2016 (r305864) @@ -48,14 +48,13 @@ __FBSDID("$FreeBSD$"); #include #include -static int db_run_mode; -#define STEP_NONE 0 #define STEP_ONCE 1 #define STEP_RETURN 2 #define STEP_CALLT 3 #define STEP_CONTINUE 4 #define STEP_INVISIBLE 5 #define STEP_COUNT 6 +static int db_run_mode = STEP_CONTINUE; static bool db_sstep_multiple; static bool db_sstep_print; @@ -150,7 +149,6 @@ db_stop_at_pc(int type, int code, bool * #endif if (db_run_mode != STEP_CONTINUE && !IS_SSTEP_TRAP(type, code)) { printf("Stepping aborted\n"); - db_run_mode = STEP_NONE; return (true); } @@ -203,7 +201,6 @@ db_stop_at_pc(int type, int code, bool * return (false); /* continue */ } } - db_run_mode = STEP_NONE; return (true); } From owner-svn-src-head@freebsd.org Fri Sep 16 07:09:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 375BCBDC4C2; Fri, 16 Sep 2016 07:09:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id EB88BE1F; Fri, 16 Sep 2016 07:09:36 +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 u8G79aAH091772; Fri, 16 Sep 2016 07:09:36 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G79Z99091770; Fri, 16 Sep 2016 07:09:35 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609160709.u8G79Z99091770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 16 Sep 2016 07:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305865 - in head/sys: amd64/amd64 x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 07:09:37 -0000 Author: bde Date: Fri Sep 16 07:09:35 2016 New Revision: 305865 URL: https://svnweb.freebsd.org/changeset/base/305865 Log: Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the i386-only section, and fix a comment about the amd64 kernel trapframe not having stackregs. tf_rsp doesn't need decoding on amd64, but had an old clone of i386 code to do this in 1 place, and since the amd64 kernel trapframe does have stackregs, the result was an off-by-16 error for %rsp in an error message. Modified: head/sys/amd64/amd64/trap.c head/sys/x86/include/frame.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Sep 16 06:31:10 2016 (r305864) +++ head/sys/amd64/amd64/trap.c Fri Sep 16 07:09:35 2016 (r305865) @@ -776,7 +776,6 @@ trap_fatal(frame, eva) { int code, ss; u_int type; - long esp; struct soft_segment_descriptor softseg; char *msg; @@ -807,14 +806,8 @@ trap_fatal(frame, eva) } printf("instruction pointer = 0x%lx:0x%lx\n", frame->tf_cs & 0xffff, frame->tf_rip); - if (TF_HAS_STACKREGS(frame)) { - ss = frame->tf_ss & 0xffff; - esp = frame->tf_rsp; - } else { - ss = GSEL(GDATA_SEL, SEL_KPL); - esp = (long)&frame->tf_rsp; - } - printf("stack pointer = 0x%x:0x%lx\n", ss, esp); + ss = frame->tf_ss & 0xffff; + printf("stack pointer = 0x%x:0x%lx\n", ss, frame->tf_rsp); printf("frame pointer = 0x%x:0x%lx\n", ss, frame->tf_rbp); printf("code segment = base 0x%lx, limit 0x%lx, type 0x%x\n", softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type); Modified: head/sys/x86/include/frame.h ============================================================================== --- head/sys/x86/include/frame.h Fri Sep 16 06:31:10 2016 (r305864) +++ head/sys/x86/include/frame.h Fri Sep 16 07:09:35 2016 (r305865) @@ -98,6 +98,15 @@ struct trapframe_vm86 { int tf_vm86_fs; int tf_vm86_gs; }; + +/* + * This alias for the MI TRAPF_USERMODE() should be used when we don't + * care about user mode itself, but need to know if a frame has stack + * registers. The difference is only logical, but on i386 the logic + * for using TRAPF_USERMODE() is complicated by sometimes treating vm86 + * bioscall mode (which is a special ring 3 user mode) as kernel mode. + */ +#define TF_HAS_STACKREGS(tf) TRAPF_USERMODE(tf) #endif /* __i386__ */ #ifdef __amd64__ @@ -136,7 +145,7 @@ struct trapframe { register_t tf_rip; register_t tf_cs; register_t tf_rflags; - /* below only when crossing rings (user to kernel) */ + /* the amd64 frame always has the stack registers */ register_t tf_rsp; register_t tf_ss; }; @@ -146,13 +155,4 @@ struct trapframe { #define TF_HASFPXSTATE 0x4 #endif /* __amd64__ */ -/* - * This alias for the MI TRAPF_USERMODE() should be used when we don't - * care about user mode itself, but need to know if a frame has stack - * registers. The difference is only logical, but on i386 the logic - * for using TRAPF_USERMODE() is complicated by sometimes treating vm86 - * bioscall mode (which is a special ring 3 user mode) as kernel mode. - */ -#define TF_HAS_STACKREGS(tf) TRAPF_USERMODE(tf) - #endif /* _MACHINE_FRAME_H_ */ From owner-svn-src-head@freebsd.org Fri Sep 16 11:28:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B26DDBDD5C4; Fri, 16 Sep 2016 11:28:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 513C5146F; Fri, 16 Sep 2016 11:28:18 +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 u8GBSHs5089814; Fri, 16 Sep 2016 11:28:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBSGii089801; Fri, 16 Sep 2016 11:28:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161128.u8GBSGii089801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305867 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:28:18 -0000 Author: hselasky Date: Fri Sep 16 11:28:16 2016 New Revision: 305867 URL: https://svnweb.freebsd.org/changeset/base/305867 Log: Update the MLX5 core module: - Add new firmware commands and update existing ones. - Add more firmware related structures and update existing ones. - Some minor fixes, like adding missing \n to some prints. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/cq.h head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/flow_table.h head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_cq.c head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c head/sys/dev/mlx5/mlx5_core/mlx5_fw.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_core/mlx5_mr.c head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_core/mlx5_qp.c head/sys/dev/mlx5/mlx5_core/mlx5_srq.c head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c head/sys/dev/mlx5/mlx5_core/mlx5_uar.c head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/mlx5_core/transobj.h head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/qp.h head/sys/dev/mlx5/vport.h Modified: head/sys/dev/mlx5/cq.h ============================================================================== --- head/sys/dev/mlx5/cq.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/cq.h Fri Sep 16 11:28:16 2016 (r305867) @@ -49,6 +49,8 @@ struct mlx5_core_cq { unsigned arm_sn; struct mlx5_rsc_debug *dbg; int pid; + int reset_notify_added; + struct list_head reset_notify; }; Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/device.h Fri Sep 16 11:28:16 2016 (r305867) @@ -57,6 +57,7 @@ #define MLX5_FLD_SZ_BYTES(typ, fld) (__mlx5_bit_sz(typ, fld) / 8) #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32) +#define MLX5_ST_SZ_QW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 64) #define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8) #define MLX5_UN_SZ_DW(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 32) #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8) @@ -112,6 +113,10 @@ enum { }; enum { + MLX5_CQ_FLAGS_OI = 2, +}; + +enum { MLX5_STAT_RATE_OFFSET = 5, }; @@ -129,6 +134,10 @@ enum { }; enum { + MLX5_MKEY_INBOX_PG_ACCESS = 1 << 31 +}; + +enum { MLX5_PERM_LOCAL_READ = 1 << 2, MLX5_PERM_LOCAL_WRITE = 1 << 3, MLX5_PERM_REMOTE_READ = 1 << 4, @@ -184,6 +193,25 @@ enum { }; enum { + MLX5_UMR_TRANSLATION_OFFSET_EN = (1 << 4), + + MLX5_UMR_CHECK_NOT_FREE = (1 << 5), + MLX5_UMR_CHECK_FREE = (2 << 5), + + MLX5_UMR_INLINE = (1 << 7), +}; + +#define MLX5_UMR_MTT_ALIGNMENT 0x40 +#define MLX5_UMR_MTT_MASK (MLX5_UMR_MTT_ALIGNMENT - 1) +#define MLX5_UMR_MTT_MIN_CHUNK_SIZE MLX5_UMR_MTT_ALIGNMENT + +enum { + MLX5_EVENT_QUEUE_TYPE_QP = 0, + MLX5_EVENT_QUEUE_TYPE_RQ = 1, + MLX5_EVENT_QUEUE_TYPE_SQ = 2, +}; + +enum { MLX5_PORT_CHANGE_SUBTYPE_DOWN = 1, MLX5_PORT_CHANGE_SUBTYPE_ACTIVE = 4, MLX5_PORT_CHANGE_SUBTYPE_INITIALIZED = 5, @@ -194,19 +222,28 @@ enum { }; enum { + MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX = 1, + MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE, + MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE, + MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE, + MLX5_MAX_INLINE_RECEIVE_SIZE = 64 +}; + +enum { MLX5_DEV_CAP_FLAG_XRC = 1LL << 3, MLX5_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, MLX5_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9, MLX5_DEV_CAP_FLAG_APM = 1LL << 17, - MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, MLX5_DEV_CAP_FLAG_SCQE_BRK_MOD = 1LL << 21, MLX5_DEV_CAP_FLAG_BLOCK_MCAST = 1LL << 23, MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29, MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30, + MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 33, MLX5_DEV_CAP_FLAG_ROCE = 1LL << 34, MLX5_DEV_CAP_FLAG_DCT = 1LL << 37, MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40, MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 3LL << 46, + MLX5_DEV_CAP_FLAG_DRAIN_SIGERR = 1LL << 48, }; enum { @@ -263,6 +300,7 @@ enum { MLX5_OPCODE_UMR = 0x25, + MLX5_OPCODE_SIGNATURE_CANCELED = (1 << 15), }; enum { @@ -299,6 +337,18 @@ struct mlx5_outbox_hdr { __be32 syndrome; }; +struct mlx5_cmd_set_dc_cnak_mbox_in { + struct mlx5_inbox_hdr hdr; + u8 enable; + u8 reserved[47]; + __be64 pa; +}; + +struct mlx5_cmd_set_dc_cnak_mbox_out { + struct mlx5_outbox_hdr hdr; + u8 rsvd[8]; +}; + struct mlx5_cmd_layout { u8 type; u8 rsvd0[3]; @@ -339,9 +389,12 @@ struct mlx5_init_seg { __be32 rsvd1[120]; __be32 initializing; struct mlx5_health_buffer health; - __be32 rsvd2[884]; + __be32 rsvd2[880]; + __be32 internal_timer_h; + __be32 internal_timer_l; + __be32 rsvd3[2]; __be32 health_counter; - __be32 rsvd3[1019]; + __be32 rsvd4[1019]; __be64 ieee1588_clk; __be32 ieee1588_clk_type; __be32 clr_intx; @@ -420,6 +473,7 @@ enum { MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST = 0x4, MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, + MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, }; struct mlx5_eqe_port_module_event { @@ -832,6 +886,10 @@ struct mlx5_query_eq_mbox_out { struct mlx5_eq_context ctx; }; +enum { + MLX5_MKEY_STATUS_FREE = 1 << 6, +}; + struct mlx5_mkey_seg { /* This is a two bit field occupying bits 31-30. * bit 31 is always 0, @@ -868,7 +926,7 @@ struct mlx5_query_special_ctxs_mbox_out struct mlx5_create_mkey_mbox_in { struct mlx5_inbox_hdr hdr; __be32 input_mkey_index; - u8 rsvd0[4]; + __be32 flags; struct mlx5_mkey_seg seg; u8 rsvd1[16]; __be32 xlat_oct_act_size; @@ -971,6 +1029,17 @@ struct mlx5_destroy_psv_out { u8 rsvd[8]; }; +static inline int mlx5_host_is_le(void) +{ +#if defined(__LITTLE_ENDIAN) + return 1; +#elif defined(__BIG_ENDIAN) + return 0; +#else +#error Host endianness not defined +#endif +} + #define MLX5_CMD_OP_MAX 0x939 enum { @@ -1008,6 +1077,8 @@ enum { MLX5_FLOW_TABLE_TYPE_EGRESS_ACL = 2, MLX5_FLOW_TABLE_TYPE_INGRESS_ACL = 3, MLX5_FLOW_TABLE_TYPE_ESWITCH = 4, + MLX5_FLOW_TABLE_TYPE_SNIFFER_RX = 5, + MLX5_FLOW_TABLE_TYPE_SNIFFER_TX = 6, }; enum { @@ -1062,6 +1133,10 @@ enum mlx5_cap_type { MLX5_CAP_FLOW_TABLE, MLX5_CAP_ESWITCH_FLOW_TABLE, MLX5_CAP_ESWITCH, + MLX5_CAP_SNAPSHOT, + MLX5_CAP_VECTOR_CALC, + MLX5_CAP_QOS, + MLX5_CAP_DEBUG, /* NUM OF CAP Types */ MLX5_CAP_NUM }; @@ -1107,21 +1182,23 @@ enum mlx5_cap_type { MLX5_GET(flow_table_eswitch_cap, \ mdev->hca_caps_max[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) -#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE(dev, \ - flow_table_properties_esw_acl_egress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL_MAX(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ - flow_table_properties_esw_acl_egress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE(dev, \ - flow_table_properties_esw_acl_ingress.cap) - -#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL_MAX(mdev, cap) \ - MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ - flow_table_properties_esw_acl_ingress.cap) +#define MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_nic_esw_fdb.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_FDB_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_nic_esw_fdb.cap) + +#define MLX5_CAP_ESW_EGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_EGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_INGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, flow_table_properties_esw_acl_ingress.cap) + +#define MLX5_CAP_ESW_INGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_esw_acl_ingress.cap) #define MLX5_CAP_ESW(mdev, cap) \ MLX5_GET(e_switch_cap, \ @@ -1137,6 +1214,38 @@ enum mlx5_cap_type { #define MLX5_CAP_ODP_MAX(mdev, cap)\ MLX5_GET(odp_cap, mdev->hca_caps_max[MLX5_CAP_ODP], cap) +#define MLX5_CAP_SNAPSHOT(mdev, cap) \ + MLX5_GET(snapshot_cap, \ + mdev->hca_caps_cur[MLX5_CAP_SNAPSHOT], cap) + +#define MLX5_CAP_SNAPSHOT_MAX(mdev, cap) \ + MLX5_GET(snapshot_cap, \ + mdev->hca_caps_max[MLX5_CAP_SNAPSHOT], cap) + +#define MLX5_CAP_EOIB_OFFLOADS(mdev, cap) \ + MLX5_GET(per_protocol_networking_offload_caps,\ + mdev->hca_caps_cur[MLX5_CAP_EOIB_OFFLOADS], cap) + +#define MLX5_CAP_EOIB_OFFLOADS_MAX(mdev, cap) \ + MLX5_GET(per_protocol_networking_offload_caps,\ + mdev->hca_caps_max[MLX5_CAP_EOIB_OFFLOADS], cap) + +#define MLX5_CAP_DEBUG(mdev, cap) \ + MLX5_GET(debug_cap, \ + mdev->hca_caps_cur[MLX5_CAP_DEBUG], cap) + +#define MLX5_CAP_DEBUG_MAX(mdev, cap) \ + MLX5_GET(debug_cap, \ + mdev->hca_caps_max[MLX5_CAP_DEBUG], cap) + +#define MLX5_CAP_QOS(mdev, cap) \ + MLX5_GET(qos_cap,\ + mdev->hca_caps_cur[MLX5_CAP_QOS], cap) + +#define MLX5_CAP_QOS_MAX(mdev, cap) \ + MLX5_GET(qos_cap,\ + mdev->hca_caps_max[MLX5_CAP_QOS], cap) + enum { MLX5_CMD_STAT_OK = 0x0, MLX5_CMD_STAT_INT_ERR = 0x1, @@ -1168,6 +1277,22 @@ enum { }; enum { + MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP = 0x0, + MLX5_PCIE_LANE_COUNTERS_GROUP = 0x1, + MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP = 0x2, +}; + +enum { + MLX5_NUM_UUARS_PER_PAGE = MLX5_NON_FP_BF_REGS_PER_PAGE, + MLX5_DEF_TOT_UUARS = 8 * MLX5_NUM_UUARS_PER_PAGE, +}; + +enum { + NUM_DRIVER_UARS = 4, + NUM_LOW_LAT_UUARS = 4, +}; + +enum { MLX5_CAP_PORT_TYPE_IB = 0x0, MLX5_CAP_PORT_TYPE_ETH = 0x1, }; @@ -1252,4 +1377,7 @@ static inline int mlx5_get_cqe_format(co return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; } +/* 8 regular priorities + 1 for multicast */ +#define MLX5_NUM_BYPASS_FTS 9 + #endif /* MLX5_DEVICE_H */ Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/driver.h Fri Sep 16 11:28:16 2016 (r305867) @@ -42,16 +42,15 @@ #include #include +#define MLX5_QCOUNTER_SETS_NETDEV 64 + enum { MLX5_BOARD_ID_LEN = 64, MLX5_MAX_NAME_LEN = 16, }; enum { - /* one minute for the sake of bringup. Generally, commands must always - * complete and we may need to increase this timeout value - */ - MLX5_CMD_TIMEOUT_MSEC = 7200 * 1000, + MLX5_CMD_TIMEOUT_MSEC = 8 * 60 * 1000, MLX5_CMD_WQ_MAX_NAME = 32, }; @@ -85,20 +84,44 @@ enum { }; enum { - MLX5_ATOMIC_MODE_IB_COMP = 1 << 16, - MLX5_ATOMIC_MODE_CX = 2 << 16, - MLX5_ATOMIC_MODE_8B = 3 << 16, - MLX5_ATOMIC_MODE_16B = 4 << 16, - MLX5_ATOMIC_MODE_32B = 5 << 16, - MLX5_ATOMIC_MODE_64B = 6 << 16, - MLX5_ATOMIC_MODE_128B = 7 << 16, - MLX5_ATOMIC_MODE_256B = 8 << 16, + MLX5_ATOMIC_MODE_OFF = 16, + MLX5_ATOMIC_MODE_NONE = 0 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_IB_COMP = 1 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_CX = 2 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_8B = 3 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_16B = 4 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_32B = 5 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_64B = 6 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_128B = 7 << MLX5_ATOMIC_MODE_OFF, + MLX5_ATOMIC_MODE_256B = 8 << MLX5_ATOMIC_MODE_OFF, +}; + +enum { + MLX5_ATOMIC_MODE_DCT_OFF = 20, + MLX5_ATOMIC_MODE_DCT_NONE = 0 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_IB_COMP = 1 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_CX = 2 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_8B = 3 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_16B = 4 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_32B = 5 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_64B = 6 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_128B = 7 << MLX5_ATOMIC_MODE_DCT_OFF, + MLX5_ATOMIC_MODE_DCT_256B = 8 << MLX5_ATOMIC_MODE_DCT_OFF, +}; + +enum { + MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0, + MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1, + MLX5_ATOMIC_OPS_MASKED_CMP_SWAP = 1 << 2, + MLX5_ATOMIC_OPS_MASKED_FETCH_ADD = 1 << 3, }; enum { MLX5_REG_QETCR = 0x4005, MLX5_REG_QPDP = 0x4007, MLX5_REG_QTCT = 0x400A, + MLX5_REG_DCBX_PARAM = 0x4020, + MLX5_REG_DCBX_APP = 0x4021, MLX5_REG_PCAP = 0x5001, MLX5_REG_PMTU = 0x5003, MLX5_REG_PTYS = 0x5004, @@ -116,6 +139,7 @@ enum { MLX5_REG_NODE_DESC = 0x6001, MLX5_REG_HOST_ENDIANNESS = 0x7004, MLX5_REG_MCIA = 0x9014, + MLX5_REG_MPCNT = 0x9051, }; enum dbg_rsc_type { @@ -124,6 +148,12 @@ enum dbg_rsc_type { MLX5_DBG_RSC_CQ, }; +enum { + MLX5_INTERFACE_PROTOCOL_IB = 0, + MLX5_INTERFACE_PROTOCOL_ETH = 1, + MLX5_INTERFACE_NUMBER = 2, +}; + struct mlx5_field_desc { struct dentry *dent; int i; @@ -147,6 +177,10 @@ enum mlx5_dev_event { MLX5_DEV_EVENT_GUID_CHANGE, MLX5_DEV_EVENT_CLIENT_REREG, MLX5_DEV_EVENT_VPORT_CHANGE, + MLX5_DEV_EVENT_ERROR_STATE_DCBX, + MLX5_DEV_EVENT_REMOTE_CONFIG_CHANGE, + MLX5_DEV_EVENT_LOCAL_OPER_CHANGE, + MLX5_DEV_EVENT_REMOTE_CONFIG_APPLICATION_PRIORITY_CHANGE, }; enum mlx5_port_status { @@ -375,9 +409,12 @@ struct mlx5_core_mr { }; enum mlx5_res_type { - MLX5_RES_QP, - MLX5_RES_SRQ, - MLX5_RES_XSRQ, + MLX5_RES_QP = MLX5_EVENT_QUEUE_TYPE_QP, + MLX5_RES_RQ = MLX5_EVENT_QUEUE_TYPE_RQ, + MLX5_RES_SQ = MLX5_EVENT_QUEUE_TYPE_SQ, + MLX5_RES_SRQ = 3, + MLX5_RES_XSRQ = 4, + MLX5_RES_DCT = 5, }; struct mlx5_core_rsc_common { @@ -413,8 +450,6 @@ struct mlx5_eq_table { struct mlx5_uar { u32 index; - struct list_head bf_list; - unsigned free_bf_bmap; void __iomem *bf_map; void __iomem *map; }; @@ -461,7 +496,7 @@ struct mlx5_srq_table { struct mlx5_mr_table { /* protect radix tree */ - rwlock_t lock; + spinlock_t lock; struct radix_tree_root tree; }; @@ -483,7 +518,7 @@ struct mlx5_priv { struct workqueue_struct *pg_wq; struct rb_root page_root; int fw_pages; - int reg_pages; + atomic_t reg_pages; struct list_head free_list; struct mlx5_core_health health; @@ -521,6 +556,12 @@ struct mlx5_priv { struct list_head dev_list; struct list_head ctx_list; spinlock_t ctx_lock; + unsigned long pci_dev_data; +}; + +enum mlx5_device_state { + MLX5_DEVICE_STATE_UP, + MLX5_DEVICE_STATE_INTERNAL_ERROR, }; struct mlx5_special_contexts { @@ -535,6 +576,7 @@ struct mlx5_core_dev { u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; struct mlx5_init_seg __iomem *iseg; + enum mlx5_device_state state; void (*event) (struct mlx5_core_dev *dev, enum mlx5_dev_event event, unsigned long param); @@ -544,6 +586,7 @@ struct mlx5_core_dev { u32 issi; struct mlx5_special_contexts special_contexts; unsigned int module_status[MLX5_MAX_PORTS]; + u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; }; enum { @@ -573,6 +616,8 @@ struct mlx5_net_counters { }; struct mlx5_ptys_reg { + u8 an_dis_admin; + u8 an_dis_ap; u8 local_port; u8 proto_mask; u32 eth_proto_cap; @@ -620,6 +665,15 @@ enum { MLX5_DB_PER_PAGE = PAGE_SIZE / L1_CACHE_BYTES, }; +struct mlx5_core_dct { + struct mlx5_core_rsc_common common; /* must be first */ + void (*event)(struct mlx5_core_dct *, int); + int dctn; + struct completion drained; + struct mlx5_rsc_debug *dbg; + int pid; +}; + enum { MLX5_COMP_EQ_SIZE = 1024, }; @@ -725,9 +779,14 @@ static inline void *mlx5_vzalloc(unsigne return rtn; } -static inline u32 mlx5_base_mkey(const u32 key) +static inline void *mlx5_vmalloc(unsigned long size) { - return key & 0xffffff00u; + void *rtn; + + rtn = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); + if (!rtn) + rtn = vmalloc(size); + return rtn; } int mlx5_cmd_init(struct mlx5_core_dev *dev); @@ -809,6 +868,8 @@ int mlx5_stop_eqs(struct mlx5_core_dev * int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, int *irqn); int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); +int mlx5_core_set_dc_cnak_trace(struct mlx5_core_dev *dev, int enable, + u64 addr); int mlx5_qp_debugfs_init(struct mlx5_core_dev *dev); void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev); @@ -816,11 +877,16 @@ int mlx5_core_access_reg(struct mlx5_cor int size_in, void *data_out, int size_out, u16 reg_num, int arg, int write); +void mlx5_toggle_port_link(struct mlx5_core_dev *dev); int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps); int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, int ptys_size, int proto_mask); int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev, u32 *proto_cap, int proto_mask); +int mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask, + u8 *an_disable_cap, u8 *an_disable_status); +int mlx5_set_port_autoneg(struct mlx5_core_dev *dev, bool disable, + u32 eth_proto_admin, int proto_mask); int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev, u32 *proto_admin, int proto_mask); int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, @@ -828,10 +894,14 @@ int mlx5_set_port_proto(struct mlx5_core int mlx5_set_port_status(struct mlx5_core_dev *dev, enum mlx5_port_status status); int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status); +int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, + enum mlx5_port_status *status); int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port, u32 rx_pause, u32 tx_pause); int mlx5_query_port_pause(struct mlx5_core_dev *dev, u32 port, u32 *rx_pause, u32 *tx_pause); +int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx); +int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx); int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu); int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu); @@ -884,6 +954,9 @@ int mlx5_modify_port_cong_params(struct void *in, int in_size); int mlx5_query_port_cong_statistics(struct mlx5_core_dev *mdev, int clear, void *out, int out_size); +int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size); +int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, + u16 sample_index, void *out, int out_size); static inline u32 mlx5_mkey_to_idx(u32 mkey) { return mkey >> 8; @@ -905,12 +978,7 @@ enum { }; enum { - MAX_MR_CACHE_ENTRIES = 16, -}; - -enum { - MLX5_INTERFACE_PROTOCOL_IB = 0, - MLX5_INTERFACE_PROTOCOL_ETH = 1, + MAX_MR_CACHE_ENTRIES = 15, }; struct mlx5_interface { @@ -936,6 +1004,14 @@ struct mlx5_profile { } mr_cache[MAX_MR_CACHE_ENTRIES]; }; +enum { + MLX5_PCI_DEV_IS_VF = 1 << 0, +}; + +static inline int mlx5_core_is_pf(struct mlx5_core_dev *dev) +{ + return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF); +} #define MLX5_EEPROM_MAX_BYTES 32 #define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff Modified: head/sys/dev/mlx5/flow_table.h ============================================================================== --- head/sys/dev/mlx5/flow_table.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/flow_table.h Fri Sep 16 11:28:16 2016 (r305867) @@ -30,6 +30,9 @@ #include +#define MLX5_SET_FLOW_TABLE_ROOT_OPMOD_SET 0x0 +#define MLX5_SET_FLOW_TABLE_ROOT_OPMOD_RESET 0x1 + struct mlx5_flow_table_group { u8 log_sz; u8 match_criteria_enable; @@ -44,7 +47,10 @@ void mlx5_destroy_flow_table(void *flow_ int mlx5_add_flow_table_entry(void *flow_table, u8 match_criteria_enable, void *match_criteria, void *flow_context, u32 *flow_index); -void mlx5_del_flow_table_entry(void *flow_table, u32 flow_index); +int mlx5_del_flow_table_entry(void *flow_table, u32 flow_index); u32 mlx5_get_flow_table_id(void *flow_table); +int mlx5_set_flow_table_root(struct mlx5_core_dev *mdev, u16 op_mod, + u8 vport_num, u8 table_type, u32 table_id, + u32 underlay_qpn); #endif /* MLX5_FLOW_TABLE_H */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Sep 16 11:28:16 2016 (r305867) @@ -121,7 +121,7 @@ static int alloc_ent(struct mlx5_cmd *cm clear_bit(ret, &cmd->bitmask); spin_unlock_irqrestore(&cmd->alloc_lock, flags); - return ret < cmd->max_reg_cmds ? ret : -ENOMEM; + return ret < cmd->max_reg_cmds ? ret : -1; } static void free_ent(struct mlx5_cmd *cmd, int idx) @@ -396,6 +396,9 @@ const char *mlx5_command_str(int command case MLX5_CMD_OP_CREATE_DCT: return "CREATE_DCT"; + case MLX5_CMD_OP_SET_DC_CNAK_TRACE: + return "SET_DC_CNAK_TRACE"; + case MLX5_CMD_OP_DESTROY_DCT: return "DESTROY_DCT"; @@ -639,6 +642,12 @@ const char *mlx5_command_str(int command case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: return "DELETE_FLOW_TABLE_ENTRY"; + case MLX5_CMD_OP_SET_DIAGNOSTICS: + return "MLX5_CMD_OP_SET_DIAGNOSTICS"; + + case MLX5_CMD_OP_QUERY_DIAGNOSTICS: + return "MLX5_CMD_OP_QUERY_DIAGNOSTICS"; + default: return "unknown command opcode"; } } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Fri Sep 16 11:28:16 2016 (r305867) @@ -64,6 +64,8 @@ enum { MLX5_CMD_TIME, /* print command execution time */ }; +struct mlx5_core_dev; + int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Sep 16 11:28:16 2016 (r305867) @@ -187,10 +187,12 @@ int mlx5_core_destroy_cq(struct mlx5_cor in.cqn = cpu_to_be32(cq->cqn); err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); if (err) - return err; + goto out; - if (out.hdr.status) - return mlx5_cmd_status_to_err(&out.hdr); + if (out.hdr.status) { + err = mlx5_cmd_status_to_err(&out.hdr); + goto out; + } synchronize_irq(cq->irqn); @@ -198,7 +200,9 @@ int mlx5_core_destroy_cq(struct mlx5_cor complete(&cq->free); wait_for_completion(&cq->free); - return 0; +out: + + return err; } EXPORT_SYMBOL(mlx5_core_destroy_cq); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Sep 16 11:28:16 2016 (r305867) @@ -155,6 +155,8 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_PAGE_REQUEST"; case MLX5_EVENT_TYPE_NIC_VPORT_CHANGE: return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE"; + case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: + return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT"; default: return "Unrecognized event"; } @@ -181,6 +183,21 @@ static enum mlx5_dev_event port_subtype_ return -1; } +static enum mlx5_dev_event dcbx_subevent(u8 subtype) +{ + switch (subtype) { + case MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX: + return MLX5_DEV_EVENT_ERROR_STATE_DCBX; + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE: + return MLX5_DEV_EVENT_REMOTE_CONFIG_CHANGE; + case MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE: + return MLX5_DEV_EVENT_LOCAL_OPER_CHANGE; + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE: + return MLX5_DEV_EVENT_REMOTE_CONFIG_APPLICATION_PRIORITY_CHANGE; + } + return -1; +} + static void eq_update_ci(struct mlx5_eq *eq, int arm) { __be32 __iomem *addr = eq->doorbell + (arm ? 0 : 2); @@ -259,6 +276,26 @@ static int mlx5_eq_int(struct mlx5_core_ port, eqe->sub_type); } break; + + case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: + port = (eqe->data.port.port >> 4) & 0xf; + switch (eqe->sub_type) { + case MLX5_DCBX_EVENT_SUBTYPE_ERROR_STATE_DCBX: + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_CHANGE: + case MLX5_DCBX_EVENT_SUBTYPE_LOCAL_OPER_CHANGE: + case MLX5_DCBX_EVENT_SUBTYPE_REMOTE_CONFIG_APP_PRIORITY_CHANGE: + if (dev->event) + dev->event(dev, + dcbx_subevent(eqe->sub_type), + 0); + break; + default: + mlx5_core_warn(dev, + "dcbx event with unrecognized subtype: port %d, sub_type %d\n", + port, eqe->sub_type); + } + break; + case MLX5_EVENT_TYPE_CQ_ERROR: cqn = be32_to_cpu(eqe->data.cq_err.cqn) & 0xffffff; mlx5_core_warn(dev, "CQ error on CQN 0x%x, syndrom 0x%x\n", @@ -476,6 +513,10 @@ int mlx5_start_eqs(struct mlx5_core_dev async_event_mask |= (1ull << MLX5_EVENT_TYPE_NIC_VPORT_CHANGE); + if (MLX5_CAP_GEN(dev, dcbx)) + async_event_mask |= (1ull << + MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT); + err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); @@ -573,6 +614,8 @@ static const char *mlx5_port_module_even return "Unknown identifier"; case MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE: return "High Temperature"; + case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: + return "Cable is shorted"; default: return "Unknown error type"; @@ -605,19 +648,19 @@ static void mlx5_port_module_event(struc switch (module_status) { case MLX5_MODULE_STATUS_PLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged\n", module_num); break; case MLX5_MODULE_STATUS_UNPLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: unplugged", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: unplugged\n", module_num); break; case MLX5_MODULE_STATUS_ERROR: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s", module_num, mlx5_port_module_event_error_type_to_string(error_type)); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s\n", module_num, mlx5_port_module_event_error_type_to_string(error_type)); break; default: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status", module_num); + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status\n", module_num); } /* store module status */ if (module_num < MLX5_MAX_PORTS) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Fri Sep 16 11:28:16 2016 (r305867) @@ -96,10 +96,10 @@ static int mlx5_vacl_table_allow_vlan(vo MLX5_SET(flow_context, flow_context, action, MLX5_FLOW_CONTEXT_ACTION_ALLOW); in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); - MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_value, outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, in_match_value, outer_headers.first_vid, vlan); - MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, in_match_criteria, outer_headers.first_vid, 0xfff); if (acl_table->spoofchk_enabled) { @@ -255,8 +255,8 @@ static int mlx5_vacl_table_apply_untagge /* Apply new untagged rule */ MLX5_SET(flow_context, flow_context, action, new_action); in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); - MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 0); - MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_value, outer_headers.cvlan_tag, 0); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.cvlan_tag, 1); if (acl_table->spoofchk_enabled) { smac = MLX5_ADDR_OF(fte_match_param, in_match_value, @@ -549,7 +549,7 @@ static int mlx5_vacl_table_create_ft(voi MLX5_MATCH_OUTER_HEADERS; MLX5_SET(fte_match_param, g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx].match_criteria, - outer_headers.vlan_tag, 1); + outer_headers.cvlan_tag, 1); if (spoofchk) { smac = MLX5_ADDR_OF(fte_match_param, g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx] @@ -564,7 +564,7 @@ static int mlx5_vacl_table_create_ft(voi MLX5_MATCH_OUTER_HEADERS; MLX5_SET(fte_match_param, g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, - outer_headers.vlan_tag, 1); + outer_headers.cvlan_tag, 1); MLX5_SET(fte_match_param, g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, outer_headers.first_vid, 0xfff); @@ -627,10 +627,10 @@ void *mlx5_vacl_table_create(struct mlx5 struct mlx5_vacl_table *acl_table; int err = 0; - if (is_egress && !MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, ft_support)) + if (is_egress && !MLX5_CAP_ESW_EGRESS_ACL(dev, ft_support)) return NULL; - if (!is_egress && !MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, ft_support)) + if (!is_egress && !MLX5_CAP_ESW_INGRESS_ACL(dev, ft_support)) return NULL; acl_table = kzalloc(sizeof(*acl_table), GFP_KERNEL); @@ -640,9 +640,9 @@ void *mlx5_vacl_table_create(struct mlx5 acl_table->acl_type = is_egress ? MLX5_FLOW_TABLE_TYPE_EGRESS_ACL : MLX5_FLOW_TABLE_TYPE_INGRESS_ACL; acl_table->max_ft_size = (is_egress ? - MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, + MLX5_CAP_ESW_EGRESS_ACL(dev, log_max_ft_size) : - MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, + MLX5_CAP_ESW_INGRESS_ACL(dev, log_max_ft_size)); acl_table->dev = dev; acl_table->vport = vport; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Fri Sep 16 11:28:16 2016 (r305867) @@ -87,7 +87,7 @@ static int mlx5_set_flow_entry_cmd(struc return err; } -static void mlx5_del_flow_entry_cmd(struct mlx5_flow_table *ft, u32 flow_index) +static int mlx5_del_flow_entry_cmd(struct mlx5_flow_table *ft, u32 flow_index) { u32 in[MLX5_ST_SZ_DW(delete_fte_in)]; u32 out[MLX5_ST_SZ_DW(delete_fte_out)]; @@ -103,7 +103,8 @@ static void mlx5_del_flow_entry_cmd(stru MLX5_SET_DFTEI(in, flow_index, flow_index); MLX5_SET_DFTEI(in, opcode, MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY); - mlx5_cmd_exec_check_status(ft->dev, in, sizeof(in), out, sizeof(out)); + return mlx5_cmd_exec_check_status(ft->dev, in, sizeof(in), out, + sizeof(out)); } static void mlx5_destroy_flow_group_cmd(struct mlx5_flow_table *ft, int i) @@ -343,12 +344,15 @@ int mlx5_add_flow_table_entry(void *flow } EXPORT_SYMBOL(mlx5_add_flow_table_entry); -void mlx5_del_flow_table_entry(void *flow_table, u32 flow_index) +int mlx5_del_flow_table_entry(void *flow_table, u32 flow_index) { struct mlx5_flow_table *ft = flow_table; + int ret; - mlx5_del_flow_entry_cmd(ft, flow_index); - mlx5_free_flow_index(ft, flow_index); + ret = mlx5_del_flow_entry_cmd(ft, flow_index); + if (!ret) + mlx5_free_flow_index(ft, flow_index); + return ret; } EXPORT_SYMBOL(mlx5_del_flow_table_entry); @@ -430,3 +434,46 @@ u32 mlx5_get_flow_table_id(void *flow_ta return ft->id; } EXPORT_SYMBOL(mlx5_get_flow_table_id); + +int mlx5_set_flow_table_root(struct mlx5_core_dev *mdev, u16 op_mod, + u8 vport_num, u8 table_type, u32 table_id, + u32 underlay_qpn) +{ + u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)]; + u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)]; + int err; + int is_group_manager; + + is_group_manager = MLX5_CAP_GEN(mdev, vport_group_manager); + + memset(in, 0, sizeof(in)); + + MLX5_SET(set_flow_table_root_in, in, op_mod, op_mod); + MLX5_SET(set_flow_table_root_in, in, table_type, table_type); + MLX5_SET(set_flow_table_root_in, in, underlay_qpn, underlay_qpn); + if (op_mod == MLX5_SET_FLOW_TABLE_ROOT_OPMOD_SET) + MLX5_SET(set_flow_table_root_in, in, table_id, table_id); + + MLX5_SET(set_flow_table_root_in, in, opcode, + MLX5_CMD_OP_SET_FLOW_TABLE_ROOT); + + if (vport_num) { + if (is_group_manager) { + MLX5_SET(set_flow_table_root_in, in, other_vport, + 1); + MLX5_SET(set_flow_table_root_in, in, vport_number, + vport_num); + } else { + return -EPERM; + } + } + + memset(out, 0, sizeof(out)); + err = mlx5_cmd_exec_check_status(mdev, in, sizeof(in), out, + sizeof(out)); + if (err) + return err; + + return 0; +} +EXPORT_SYMBOL(mlx5_set_flow_table_root); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 16 10:04:28 2016 (r305866) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Fri Sep 16 11:28:16 2016 (r305867) @@ -201,6 +201,50 @@ int mlx5_query_hca_caps(struct mlx5_core return err; } + if (MLX5_CAP_GEN(dev, snapshot)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_SNAPSHOT, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + err = mlx5_core_get_caps(dev, MLX5_CAP_SNAPSHOT, + HCA_CAP_OPMOD_GET_MAX); + if (err) + return err; + } + + if (MLX5_CAP_GEN(dev, ipoib_enhanced_offloads)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_EOIB_OFFLOADS, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + err = mlx5_core_get_caps(dev, MLX5_CAP_EOIB_OFFLOADS, + HCA_CAP_OPMOD_GET_MAX); + if (err) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Sep 16 11:35:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51CB2BDD7E9; Fri, 16 Sep 2016 11:35:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 103D41B84; Fri, 16 Sep 2016 11:35:46 +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 u8GBZkV6093625; Fri, 16 Sep 2016 11:35:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBZjps093621; Fri, 16 Sep 2016 11:35:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161135.u8GBZjps093621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305868 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:35:47 -0000 Author: hselasky Date: Fri Sep 16 11:35:45 2016 New Revision: 305868 URL: https://svnweb.freebsd.org/changeset/base/305868 Log: mlx5en: Separate the sendqueue from using the mlx5e_channel structure. This change allows for reusing the transmit path for so called rate limited senqueues. While at it optimise some pointer lookups in the fast path. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:35:45 2016 (r305868) @@ -433,9 +433,9 @@ struct mlx5e_cq { /* data path - accessed per HW polling */ struct mlx5_core_cq mcq; - struct mlx5e_channel *channel; /* control */ + struct mlx5e_priv *priv; struct mlx5_wq_ctrl wq_ctrl; } __aligned(MLX5E_CACHELINE_SIZE); @@ -515,6 +515,7 @@ struct mlx5e_sq { struct mlx5_wq_cyc wq; void __iomem *uar_map; void __iomem *uar_bf_map; + struct ifnet *ifp; u32 sqn; u32 bf_buf_size; struct device *pdev; @@ -523,7 +524,7 @@ struct mlx5e_sq { /* control path */ struct mlx5_wq_ctrl wq_ctrl; struct mlx5_uar uar; - struct mlx5e_channel *channel; + struct mlx5e_priv *priv; int tc; unsigned int queue_state; } __aligned(MLX5E_CACHELINE_SIZE); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:35:45 2016 (r305868) @@ -982,7 +982,8 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->pdev = c->pdev; sq->mkey_be = c->mkey_be; - sq->channel = c; + sq->ifp = priv->ifp; + sq->priv = priv; sq->tc = tc; sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, @@ -1039,15 +1040,12 @@ done: static void mlx5e_destroy_sq(struct mlx5e_sq *sq) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - /* destroy all sysctl nodes */ sysctl_ctx_free(&sq->stats.ctx); mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); - mlx5_unmap_free_uar(priv->mdev, &sq->uar); + mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); taskqueue_drain(sq->sq_tq, &sq->sq_task); taskqueue_free(sq->sq_tq); buf_ring_free(sq->br, M_MLX5EN); @@ -1056,10 +1054,6 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) static int mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - void *in; void *sqc; void *wq; @@ -1077,8 +1071,8 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str memcpy(sqc, param->sqc, sizeof(param->sqc)); - MLX5_SET(sqc, sqc, tis_num_0, priv->tisn[sq->tc]); - MLX5_SET(sqc, sqc, cqn, c->sq[sq->tc].cq.mcq.cqn); + MLX5_SET(sqc, sqc, tis_num_0, sq->priv->tisn[sq->tc]); + MLX5_SET(sqc, sqc, cqn, sq->cq.mcq.cqn); MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); MLX5_SET(sqc, sqc, tis_lst_sz, 1); MLX5_SET(sqc, sqc, flush_in_error_en, 1); @@ -1092,7 +1086,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str mlx5_fill_page_array(&sq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(wq, wq, pas)); - err = mlx5_core_create_sq(mdev, in, inlen, &sq->sqn); + err = mlx5_core_create_sq(sq->priv->mdev, in, inlen, &sq->sqn); kvfree(in); @@ -1102,10 +1096,6 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str static int mlx5e_modify_sq(struct mlx5e_sq *sq, int curr_state, int next_state) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - void *in; void *sqc; int inlen; @@ -1122,7 +1112,7 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int MLX5_SET(modify_sq_in, in, sq_state, curr_state); MLX5_SET(sqc, sqc, state, next_state); - err = mlx5_core_modify_sq(mdev, in, inlen); + err = mlx5_core_modify_sq(sq->priv->mdev, in, inlen); kvfree(in); @@ -1132,11 +1122,8 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int static void mlx5e_disable_sq(struct mlx5e_sq *sq) { - struct mlx5e_channel *c = sq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - mlx5_core_destroy_sq(mdev, sq->sqn); + mlx5_core_destroy_sq(sq->priv->mdev, sq->sqn); } static int @@ -1302,7 +1289,7 @@ mlx5e_create_cq(struct mlx5e_channel *c, cqe->op_own = 0xf1; } - cq->channel = c; + cq->priv = priv; return (0); } @@ -1317,9 +1304,6 @@ static int mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, u8 moderation_mode) { - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_core_cq *mcq = &cq->mcq; void *in; void *cqc; @@ -1341,7 +1325,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str mlx5_fill_page_array(&cq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(create_cq_in, in, pas)); - mlx5_vector2eqn(mdev, param->eq_ix, &eqn, &irqn_not_used); + mlx5_vector2eqn(cq->priv->mdev, param->eq_ix, &eqn, &irqn_not_used); MLX5_SET(cqc, cqc, cq_period_mode, moderation_mode); MLX5_SET(cqc, cqc, c_eqn, eqn); @@ -1350,7 +1334,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str PAGE_SHIFT); MLX5_SET64(cqc, cqc, dbr_addr, cq->wq_ctrl.db.dma); - err = mlx5_core_create_cq(mdev, mcq, in, inlen); + err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen); kvfree(in); @@ -1365,11 +1349,8 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str static void mlx5e_disable_cq(struct mlx5e_cq *cq) { - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_core_dev *mdev = priv->mdev; - mlx5_core_destroy_cq(mdev, &cq->mcq); + mlx5_core_destroy_cq(cq->priv->mdev, &cq->mcq); } static int Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:35:45 2016 (r305868) @@ -233,7 +233,7 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc /* Setup local variables */ pi = sq->pc & sq->wq.sz_m1; wqe = mlx5_wq_cyc_get_wqe(&sq->wq, pi); - ifp = sq->channel->ifp; + ifp = sq->ifp; memset(wqe, 0, sizeof(*wqe)); @@ -534,7 +534,7 @@ void mlx5e_tx_que(void *context, int pending) { struct mlx5e_sq *sq = context; - struct ifnet *ifp = sq->channel->ifp; + struct ifnet *ifp = sq->ifp; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { mtx_lock(&sq->lock); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 16 11:28:16 2016 (r305867) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Fri Sep 16 11:35:45 2016 (r305868) @@ -47,10 +47,7 @@ void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, int event) { struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq); - struct mlx5e_channel *c = cq->channel; - struct mlx5e_priv *priv = c->priv; - struct ifnet *ifp = priv->ifp; - if_printf(ifp, "%s: cqn=0x%.6x event=0x%.2x\n", + if_printf(cq->priv->ifp, "%s: cqn=0x%.6x event=0x%.2x\n", __func__, mcq->cqn, event); } From owner-svn-src-head@freebsd.org Fri Sep 16 11:37:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4CC4BDD868; Fri, 16 Sep 2016 11:37:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8DB871D33; Fri, 16 Sep 2016 11:37:36 +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 u8GBbZCv093755; Fri, 16 Sep 2016 11:37:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBbZFL093754; Fri, 16 Sep 2016 11:37:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161137.u8GBbZFL093754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305869 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:37:36 -0000 Author: hselasky Date: Fri Sep 16 11:37:35 2016 New Revision: 305869 URL: https://svnweb.freebsd.org/changeset/base/305869 Log: mlx5en: Minor completion queue control path code refactor. Move setting of CQ moderation mode together with the other CQ moderation parameters. Pass completion event vector as a separate argument to mlx5e_open_cq(), because its value is different for each call. Pass mlx5e_priv pointer instead of mlx5e_channel pointer so that code can be used by rate limiting sendqueues. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:35:45 2016 (r305868) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:37:35 2016 (r305869) @@ -47,7 +47,6 @@ struct mlx5e_sq_param { struct mlx5e_cq_param { u32 cqc [MLX5_ST_SZ_DW(cqc)]; struct mlx5_wq_param wq; - u16 eq_ix; }; struct mlx5e_channel_param { @@ -1248,12 +1247,12 @@ mlx5e_close_sq_wait(struct mlx5e_sq *sq) } static int -mlx5e_create_cq(struct mlx5e_channel *c, +mlx5e_create_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, - mlx5e_cq_comp_t *comp) + mlx5e_cq_comp_t *comp, + int eq_ix) { - struct mlx5e_priv *priv = c->priv; struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_core_cq *mcq = &cq->mcq; int eqn_not_used; @@ -1263,21 +1262,20 @@ mlx5e_create_cq(struct mlx5e_channel *c, param->wq.buf_numa_node = 0; param->wq.db_numa_node = 0; - param->eq_ix = c->ix; err = mlx5_cqwq_create(mdev, ¶m->wq, param->cqc, &cq->wq, &cq->wq_ctrl); if (err) return (err); - mlx5_vector2eqn(mdev, param->eq_ix, &eqn_not_used, &irqn); + mlx5_vector2eqn(mdev, eq_ix, &eqn_not_used, &irqn); mcq->cqe_sz = 64; mcq->set_ci_db = cq->wq_ctrl.db.db; mcq->arm_db = cq->wq_ctrl.db.db + 1; *mcq->set_ci_db = 0; *mcq->arm_db = 0; - mcq->vector = param->eq_ix; + mcq->vector = eq_ix; mcq->comp = comp; mcq->event = mlx5e_cq_error_event; mcq->irqn = irqn; @@ -1301,8 +1299,7 @@ mlx5e_destroy_cq(struct mlx5e_cq *cq) } static int -mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, - u8 moderation_mode) +mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, int eq_ix) { struct mlx5_core_cq *mcq = &cq->mcq; void *in; @@ -1325,9 +1322,8 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, str mlx5_fill_page_array(&cq->wq_ctrl.buf, (__be64 *) MLX5_ADDR_OF(create_cq_in, in, pas)); - mlx5_vector2eqn(cq->priv->mdev, param->eq_ix, &eqn, &irqn_not_used); + mlx5_vector2eqn(cq->priv->mdev, eq_ix, &eqn, &irqn_not_used); - MLX5_SET(cqc, cqc, cq_period_mode, moderation_mode); MLX5_SET(cqc, cqc, c_eqn, eqn); MLX5_SET(cqc, cqc, uar_page, mcq->uar->index); MLX5_SET(cqc, cqc, log_page_size, cq->wq_ctrl.buf.page_shift - @@ -1354,19 +1350,19 @@ mlx5e_disable_cq(struct mlx5e_cq *cq) } static int -mlx5e_open_cq(struct mlx5e_channel *c, +mlx5e_open_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, mlx5e_cq_comp_t *comp, - u8 moderation_mode) + int eq_ix) { int err; - err = mlx5e_create_cq(c, param, cq, comp); + err = mlx5e_create_cq(priv, param, cq, comp, eq_ix); if (err) return (err); - err = mlx5e_enable_cq(cq, param, moderation_mode); + err = mlx5e_enable_cq(cq, param, eq_ix); if (err) goto err_destroy_cq; @@ -1389,25 +1385,13 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, struct mlx5e_channel_param *cparam) { - u8 tx_moderation_mode; int err; int tc; - switch (c->priv->params.tx_cq_moderation_mode) { - case 0: - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - default: - if (MLX5_CAP_GEN(c->priv->mdev, cq_period_start_from_cqe)) - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; - else - tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - } for (tc = 0; tc < c->num_tc; tc++) { /* open completion queue */ - err = mlx5e_open_cq(c, &cparam->tx_cq, &c->sq[tc].cq, - &mlx5e_tx_cq_comp, tx_moderation_mode); + err = mlx5e_open_cq(c->priv, &cparam->tx_cq, &c->sq[tc].cq, + &mlx5e_tx_cq_comp, c->ix); if (err) goto err_close_tx_cqs; } @@ -1503,7 +1487,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr struct mlx5e_channel *volatile *cp) { struct mlx5e_channel *c; - u8 rx_moderation_mode; int err; c = malloc(sizeof(*c), M_MLX5EN, M_WAITOK | M_ZERO); @@ -1526,21 +1509,9 @@ mlx5e_open_channel(struct mlx5e_priv *pr if (err) goto err_free; - switch (priv->params.rx_cq_moderation_mode) { - case 0: - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - default: - if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; - else - rx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; - break; - } - /* open receive completion queue */ - err = mlx5e_open_cq(c, &cparam->rx_cq, &c->rq.cq, - &mlx5e_rx_cq_comp, rx_moderation_mode); + err = mlx5e_open_cq(c->priv, &cparam->rx_cq, &c->rq.cq, + &mlx5e_rx_cq_comp, c->ix); if (err) goto err_close_tx_cqs; @@ -1670,6 +1641,18 @@ mlx5e_build_rx_cq_param(struct mlx5e_pri MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); + switch (priv->params.rx_cq_moderation_mode) { + case 0: + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + default: + if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); + else + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + } + mlx5e_build_common_cq_param(priv, param); } @@ -1683,6 +1666,18 @@ mlx5e_build_tx_cq_param(struct mlx5e_pri MLX5_SET(cqc, cqc, cq_period, priv->params.tx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.tx_cq_moderation_pkts); + switch (priv->params.tx_cq_moderation_mode) { + case 0: + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + default: + if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); + else + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + } + mlx5e_build_common_cq_param(priv, param); } From owner-svn-src-head@freebsd.org Fri Sep 16 11:39:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD350BDD929; Fri, 16 Sep 2016 11:39:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id 672711ED6; Fri, 16 Sep 2016 11:39:16 +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 u8GBdFdV093875; Fri, 16 Sep 2016 11:39:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBdFax093873; Fri, 16 Sep 2016 11:39:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161139.u8GBdFax093873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305870 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:39:16 -0000 Author: hselasky Date: Fri Sep 16 11:39:15 2016 New Revision: 305870 URL: https://svnweb.freebsd.org/changeset/base/305870 Log: mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global. Make some functions and structures global to allow for code reuse when creating rate limiting sendqueues. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:37:35 2016 (r305869) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:39:15 2016 (r305870) @@ -352,6 +352,21 @@ struct mlx5e_stats { struct mlx5e_port_stats_debug port_stats_debug; }; +struct mlx5e_rq_param { + u32 rqc [MLX5_ST_SZ_DW(rqc)]; + struct mlx5_wq_param wq; +}; + +struct mlx5e_sq_param { + u32 sqc [MLX5_ST_SZ_DW(sqc)]; + struct mlx5_wq_param wq; +}; + +struct mlx5e_cq_param { + u32 cqc [MLX5_ST_SZ_DW(cqc)]; + struct mlx5_wq_param wq; +}; + struct mlx5e_params { u8 log_sq_size; u8 log_rq_size; @@ -794,5 +809,8 @@ void mlx5e_create_stats(struct sysctl_ct void mlx5e_send_nop(struct mlx5e_sq *, u32); void mlx5e_sq_cev_timeout(void *); int mlx5e_refresh_channel_params(struct mlx5e_priv *); +int mlx5e_open_cq(struct mlx5e_priv *, struct mlx5e_cq_param *, + struct mlx5e_cq *, mlx5e_cq_comp_t *, int eq_ix); +void mlx5e_close_cq(struct mlx5e_cq *); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:37:35 2016 (r305869) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:39:15 2016 (r305870) @@ -34,21 +34,6 @@ char mlx5e_version[] = "Mellanox Ethernet driver" " (" ETH_DRIVER_VERSION ")"; -struct mlx5e_rq_param { - u32 rqc [MLX5_ST_SZ_DW(rqc)]; - struct mlx5_wq_param wq; -}; - -struct mlx5e_sq_param { - u32 sqc [MLX5_ST_SZ_DW(sqc)]; - struct mlx5_wq_param wq; -}; - -struct mlx5e_cq_param { - u32 cqc [MLX5_ST_SZ_DW(cqc)]; - struct mlx5_wq_param wq; -}; - struct mlx5e_channel_param { struct mlx5e_rq_param rq; struct mlx5e_sq_param sq; @@ -1349,7 +1334,7 @@ mlx5e_disable_cq(struct mlx5e_cq *cq) mlx5_core_destroy_cq(cq->priv->mdev, &cq->mcq); } -static int +int mlx5e_open_cq(struct mlx5e_priv *priv, struct mlx5e_cq_param *param, struct mlx5e_cq *cq, @@ -1374,7 +1359,7 @@ err_destroy_cq: return (err); } -static void +void mlx5e_close_cq(struct mlx5e_cq *cq) { mlx5e_disable_cq(cq); From owner-svn-src-head@freebsd.org Fri Sep 16 11:40:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A34DBDD98F; Fri, 16 Sep 2016 11:40:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id B6F37FE; Fri, 16 Sep 2016 11:40:46 +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 u8GBejNK094653; Fri, 16 Sep 2016 11:40:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBejLG094651; Fri, 16 Sep 2016 11:40:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161140.u8GBejLG094651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305871 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:40:47 -0000 Author: hselasky Date: Fri Sep 16 11:40:45 2016 New Revision: 305871 URL: https://svnweb.freebsd.org/changeset/base/305871 Log: mlx5en: Optimise away duplicate UAR pointers. This change also reduces the size of the mlx5e_sq structure so that the last queue_state element will fit into the previous cacheline and then the mlx5e_sq structure becomes one cacheline less for amd64. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:39:15 2016 (r305870) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:40:45 2016 (r305871) @@ -528,8 +528,7 @@ struct mlx5e_sq { /* read only */ struct mlx5_wq_cyc wq; - void __iomem *uar_map; - void __iomem *uar_bf_map; + struct mlx5_uar uar; struct ifnet *ifp; u32 sqn; u32 bf_buf_size; @@ -538,7 +537,6 @@ struct mlx5e_sq { /* control path */ struct mlx5_wq_ctrl wq_ctrl; - struct mlx5_uar uar; struct mlx5e_priv *priv; int tc; unsigned int queue_state; @@ -780,13 +778,13 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, wmb(); if (bf_sz) { - __iowrite64_copy(sq->uar_bf_map + ofst, wqe, bf_sz); + __iowrite64_copy(sq->uar.bf_map + ofst, wqe, bf_sz); /* flush the write-combining mapped buffer */ wmb(); } else { - mlx5_write64(wqe, sq->uar_map + ofst, NULL); + mlx5_write64(wqe, sq->uar.map + ofst, NULL); } sq->bf_offset ^= sq->bf_buf_size; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:39:15 2016 (r305870) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:40:45 2016 (r305871) @@ -956,8 +956,6 @@ mlx5e_create_sq(struct mlx5e_channel *c, goto err_unmap_free_uar; sq->wq.db = &sq->wq.db[MLX5_SND_DBR]; - sq->uar_map = sq->uar.map; - sq->uar_bf_map = sq->uar.bf_map; sq->bf_buf_size = (1 << MLX5_CAP_GEN(mdev, log_bf_reg_size)) / 2; err = mlx5e_alloc_sq_db(sq); From owner-svn-src-head@freebsd.org Fri Sep 16 11:45:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71898BDDB30; Fri, 16 Sep 2016 11:45:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 42425803; Fri, 16 Sep 2016 11:45:36 +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 u8GBjZA1097473; Fri, 16 Sep 2016 11:45:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBjZQG097471; Fri, 16 Sep 2016 11:45:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161145.u8GBjZQG097471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305872 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:45:36 -0000 Author: hselasky Date: Fri Sep 16 11:45:35 2016 New Revision: 305872 URL: https://svnweb.freebsd.org/changeset/base/305872 Log: mlx5en: Properly declare doorbell lock for 32-bit CPUs. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:40:45 2016 (r305871) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:45:35 2016 (r305872) @@ -662,6 +662,7 @@ struct mlx5e_priv { struct work_struct update_stats_work; struct work_struct update_carrier_work; struct work_struct set_rx_mode_work; + MLX5_DECLARE_DOORBELL_LOCK(doorbell_lock) struct mlx5_core_dev *mdev; struct ifnet *ifp; @@ -784,7 +785,8 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, wmb(); } else { - mlx5_write64(wqe, sq->uar.map + ofst, NULL); + mlx5_write64(wqe, sq->uar.map + ofst, + MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock)); } sq->bf_offset ^= sq->bf_buf_size; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:40:45 2016 (r305871) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:45:35 2016 (r305872) @@ -2753,6 +2753,7 @@ mlx5e_priv_mtx_init(struct mlx5e_priv *p mtx_init(&priv->async_events_mtx, "mlx5async", MTX_NETWORK_LOCK, MTX_DEF); sx_init(&priv->state_lock, "mlx5state"); callout_init_mtx(&priv->watchdog, &priv->async_events_mtx, 0); + MLX5_INIT_DOORBELL_LOCK(&priv->doorbell_lock); } static void From owner-svn-src-head@freebsd.org Fri Sep 16 11:47:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 849D8BDDB9D; Fri, 16 Sep 2016 11:47:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id 60AB299B; Fri, 16 Sep 2016 11:47:17 +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 u8GBlGgD097570; Fri, 16 Sep 2016 11:47:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBlGUJ097568; Fri, 16 Sep 2016 11:47:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161147.u8GBlGUJ097568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305873 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:47:17 -0000 Author: hselasky Date: Fri Sep 16 11:47:16 2016 New Revision: 305873 URL: https://svnweb.freebsd.org/changeset/base/305873 Log: mlx5en: Factor out common sendqueue code for use with rate limiting SQs. Try to reuse code to setup sendqueues when possible by making some static functions global. Further split the mlx5e_close_sq_wait() function to separate out reusable parts. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:45:35 2016 (r305872) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:47:16 2016 (r305873) @@ -812,5 +812,11 @@ int mlx5e_refresh_channel_params(struct int mlx5e_open_cq(struct mlx5e_priv *, struct mlx5e_cq_param *, struct mlx5e_cq *, mlx5e_cq_comp_t *, int eq_ix); void mlx5e_close_cq(struct mlx5e_cq *); +void mlx5e_free_sq_db(struct mlx5e_sq *); +int mlx5e_alloc_sq_db(struct mlx5e_sq *); +int mlx5e_enable_sq(struct mlx5e_sq *, struct mlx5e_sq_param *, int tis_num); +int mlx5e_modify_sq(struct mlx5e_sq *, int curr_state, int next_state); +void mlx5e_disable_sq(struct mlx5e_sq *); +void mlx5e_drain_sq(struct mlx5e_sq *); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:45:35 2016 (r305872) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:47:16 2016 (r305873) @@ -873,7 +873,7 @@ mlx5e_close_rq_wait(struct mlx5e_rq *rq) mlx5e_destroy_rq(rq); } -static void +void mlx5e_free_sq_db(struct mlx5e_sq *sq) { int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); @@ -884,7 +884,7 @@ mlx5e_free_sq_db(struct mlx5e_sq *sq) free(sq->mbuf, M_MLX5EN); } -static int +int mlx5e_alloc_sq_db(struct mlx5e_sq *sq) { int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); @@ -1033,8 +1033,9 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) buf_ring_free(sq->br, M_MLX5EN); } -static int -mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param) +int +mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param, + int tis_num) { void *in; void *sqc; @@ -1053,7 +1054,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str memcpy(sqc, param->sqc, sizeof(param->sqc)); - MLX5_SET(sqc, sqc, tis_num_0, sq->priv->tisn[sq->tc]); + MLX5_SET(sqc, sqc, tis_num_0, tis_num); MLX5_SET(sqc, sqc, cqn, sq->cq.mcq.cqn); MLX5_SET(sqc, sqc, state, MLX5_SQC_STATE_RST); MLX5_SET(sqc, sqc, tis_lst_sz, 1); @@ -1075,7 +1076,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, str return (err); } -static int +int mlx5e_modify_sq(struct mlx5e_sq *sq, int curr_state, int next_state) { void *in; @@ -1101,7 +1102,7 @@ mlx5e_modify_sq(struct mlx5e_sq *sq, int return (err); } -static void +void mlx5e_disable_sq(struct mlx5e_sq *sq) { @@ -1120,7 +1121,7 @@ mlx5e_open_sq(struct mlx5e_channel *c, if (err) return (err); - err = mlx5e_enable_sq(sq, param); + err = mlx5e_enable_sq(sq, param, c->priv->tisn[tc]); if (err) goto err_destroy_sq; @@ -1196,8 +1197,8 @@ mlx5e_sq_cev_timeout(void *arg) callout_reset_curcpu(&sq->cev_callout, hz, mlx5e_sq_cev_timeout, sq); } -static void -mlx5e_close_sq_wait(struct mlx5e_sq *sq) +void +mlx5e_drain_sq(struct mlx5e_sq *sq) { mtx_lock(&sq->lock); @@ -1224,7 +1225,13 @@ mlx5e_close_sq_wait(struct mlx5e_sq *sq) mtx_lock(&sq->lock); } mtx_unlock(&sq->lock); +} + +static void +mlx5e_close_sq_wait(struct mlx5e_sq *sq) +{ + mlx5e_drain_sq(sq); mlx5e_disable_sq(sq); mlx5e_destroy_sq(sq); } From owner-svn-src-head@freebsd.org Fri Sep 16 11:51:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC17ABDDCB9; Fri, 16 Sep 2016 11:51:32 +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 mx1.freebsd.org (Postfix) with ESMTPS id 88E4AC9F; Fri, 16 Sep 2016 11:51:32 +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 u8GBpVL0099953; Fri, 16 Sep 2016 11:51:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBpV02099952; Fri, 16 Sep 2016 11:51:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161151.u8GBpV02099952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305874 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:51:33 -0000 Author: hselasky Date: Fri Sep 16 11:51:31 2016 New Revision: 305874 URL: https://svnweb.freebsd.org/changeset/base/305874 Log: mlx5en: Allow setting the software MTU size below 1500 bytes The hardware MTU size can't be set to a value less than 1500 bytes due to side-band management support. Allow setting the software MTU size below 1500 bytes, thus creating a mismatch between hardware and software MTU sizes. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:47:16 2016 (r305873) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:51:31 2016 (r305874) @@ -2173,7 +2173,6 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp int hw_mtu; int err; - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); if (err) { if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", @@ -2181,19 +2180,20 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp return (err); } err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); - if (!err) { - ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu); - - if (ifp->if_mtu != sw_mtu) { - if_printf(ifp, "Port MTU %d is different than " - "ifp mtu %d\n", sw_mtu, (int)ifp->if_mtu); - } - } else { + if (err) { if_printf(ifp, "Query port MTU, after setting new " "MTU value, failed\n"); - ifp->if_mtu = sw_mtu; + } else if (MLX5E_HW2SW_MTU(hw_mtu) < sw_mtu) { + err = -E2BIG, + if_printf(ifp, "Port MTU %d is smaller than " + "ifp mtu %d\n", hw_mtu, sw_mtu); + } else if (MLX5E_HW2SW_MTU(hw_mtu) > sw_mtu) { + err = -EINVAL; + if_printf(ifp, "Port MTU %d is bigger than " + "ifp mtu %d\n", hw_mtu, sw_mtu); } - return (0); + ifp->if_mtu = sw_mtu; + return (err); } int From owner-svn-src-head@freebsd.org Fri Sep 16 11:53:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 146D0BDDD4C; Fri, 16 Sep 2016 11:53:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id D6545EE4; Fri, 16 Sep 2016 11:53:54 +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 u8GBrsVo001439; Fri, 16 Sep 2016 11:53:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBrsul001438; Fri, 16 Sep 2016 11:53:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161153.u8GBrsul001438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305875 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:53:55 -0000 Author: hselasky Date: Fri Sep 16 11:53:53 2016 New Revision: 305875 URL: https://svnweb.freebsd.org/changeset/base/305875 Log: mlx5en: Verify port type is ethernet before creating network device Else the mlx5en driver might attach to infiniband ports. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:51:31 2016 (r305874) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:53:53 2016 (r305875) @@ -2654,6 +2654,9 @@ mlx5e_check_required_hca_cap(struct mlx5 /* TODO: add more must-to-have features */ + if (MLX5_CAP_GEN(mdev, port_type) != MLX5_CAP_PORT_TYPE_ETH) + return (-ENODEV); + return (0); } From owner-svn-src-head@freebsd.org Fri Sep 16 11:55:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E94BDDE13; Fri, 16 Sep 2016 11:55:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7FA48146; Fri, 16 Sep 2016 11:55:39 +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 u8GBtc09001569; Fri, 16 Sep 2016 11:55:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBtcKw001567; Fri, 16 Sep 2016 11:55:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161155.u8GBtcKw001567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305876 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:55:39 -0000 Author: hselasky Date: Fri Sep 16 11:55:38 2016 New Revision: 305876 URL: https://svnweb.freebsd.org/changeset/base/305876 Log: mlx5en: Remove unused pdev pointer. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:53:53 2016 (r305875) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Sep 16 11:55:38 2016 (r305876) @@ -467,7 +467,6 @@ struct mlx5e_rq { bus_dma_tag_t dma_tag; u32 wqe_sz; struct mlx5e_rq_mbuf *mbuf; - struct device *pdev; struct ifnet *ifp; struct mlx5e_rq_stats stats; struct mlx5e_cq cq; @@ -532,7 +531,6 @@ struct mlx5e_sq { struct ifnet *ifp; u32 sqn; u32 bf_buf_size; - struct device *pdev; u32 mkey_be; /* control path */ @@ -553,7 +551,6 @@ struct mlx5e_channel { /* data path */ struct mlx5e_rq rq; struct mlx5e_sq sq[MLX5E_MAX_TX_NUM_TC]; - struct device *pdev; struct ifnet *ifp; u32 mkey_be; u8 num_tc; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:53:53 2016 (r305875) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Sep 16 11:55:38 2016 (r305876) @@ -674,7 +674,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, wqe->data.byte_count = cpu_to_be32(byte_count | MLX5_HW_START_PADDING); } - rq->pdev = c->pdev; rq->ifp = c->ifp; rq->channel = c; rq->ix = c->ix; @@ -962,7 +961,6 @@ mlx5e_create_sq(struct mlx5e_channel *c, if (err) goto err_sq_wq_destroy; - sq->pdev = c->pdev; sq->mkey_be = c->mkey_be; sq->ifp = priv->ifp; sq->priv = priv; @@ -1486,7 +1484,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr c->priv = priv; c->ix = ix; c->cpu = 0; - c->pdev = &priv->mdev->pdev->dev; c->ifp = priv->ifp; c->mkey_be = cpu_to_be32(priv->mr.key); c->num_tc = priv->num_tc; From owner-svn-src-head@freebsd.org Fri Sep 16 11:57:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A32BDDF78; Fri, 16 Sep 2016 11:57:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id 94D96694; Fri, 16 Sep 2016 11:57:49 +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 u8GBvmYx001681; Fri, 16 Sep 2016 11:57:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GBvmnb001680; Fri, 16 Sep 2016 11:57:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201609161157.u8GBvmnb001680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Sep 2016 11:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305877 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 11:57:49 -0000 Author: hselasky Date: Fri Sep 16 11:57:48 2016 New Revision: 305877 URL: https://svnweb.freebsd.org/changeset/base/305877 Log: mlx5en: Fix duplicate mbuf free-by-code. When mlx5e_sq_xmit() returns an error code and the mbuf pointer is set, we should not free the mbuf, because the caller will keep the mbuf in the drbr. Make sure the mbuf pointer is correctly set upon function exit. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:55:38 2016 (r305876) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Sep 16 11:57:48 2016 (r305877) @@ -224,10 +224,8 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc /* Send one multi NOP message instead of many */ mlx5e_send_nop(sq, (pi + 1) * MLX5_SEND_WQEBB_NUM_DS); pi = ((~sq->pc) & sq->wq.sz_m1); - if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) { - m_freem(mb); + if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) return (ENOMEM); - } } /* Setup local variables */ @@ -338,10 +336,8 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struc mb, segs, &nsegs, BUS_DMA_NOWAIT); } /* Catch errors */ - if (err != 0) { + if (err != 0) goto tx_drop; - } - *mbp = mb; for (x = 0; x != nsegs; x++) { if (segs[x].ds_len == 0) @@ -374,6 +370,7 @@ skip_dma: bus_dmamap_sync(sq->dma_tag, sq->mbuf[pi].dma_map, BUS_DMASYNC_PREWRITE); sq->stats.packets++; + *mbp = NULL; /* safety clear */ return (0); tx_drop: From owner-svn-src-head@freebsd.org Fri Sep 16 14:23:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73F43BDCFA8; Fri, 16 Sep 2016 14:23:17 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 442A5FE5; Fri, 16 Sep 2016 14:23:17 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8GENGep057868; Fri, 16 Sep 2016 14:23:16 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GENGjv057867; Fri, 16 Sep 2016 14:23:16 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201609161423.u8GENGjv057867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 16 Sep 2016 14:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305887 - head/usr.bin/seq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 14:23:17 -0000 Author: wblock (doc committer) Date: Fri Sep 16 14:23:16 2016 New Revision: 305887 URL: https://svnweb.freebsd.org/changeset/base/305887 Log: Update history. Patch supplied by Sevan Janiyan . PR: 181390 Submitted by: ksmakoto@dd.iij4u.or.jp MFC after: 1 week Modified: head/usr.bin/seq/seq.1 Modified: head/usr.bin/seq/seq.1 ============================================================================== --- head/usr.bin/seq/seq.1 Fri Sep 16 13:00:55 2016 (r305886) +++ head/usr.bin/seq/seq.1 Fri Sep 16 14:23:16 2016 (r305887) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2013 +.Dd August 12, 2016 .Dt SEQ 1 .Os .Sh NAME @@ -156,13 +156,13 @@ the default conversion is changed to .Sh HISTORY The .Nm -command first appeared in -.Tn "Plan 9 from Bell Labs" . +command first appeared in Version\~8 +.At . A .Nm command appeared in .Nx 3.0 , -and ported to +and was ported to .Fx 9.0 . This command was based on the command of the same name in .Tn "Plan 9 from Bell Labs" @@ -180,9 +180,4 @@ option does not handle the transition fr to exponent representation very well. The .Nm -command is not bug for bug compatible with the -.Tn "Plan 9 from Bell Labs" -or -.Tn GNU -versions of -.Nm . +command is not bug for bug compatible with other implementations. From owner-svn-src-head@freebsd.org Fri Sep 16 22:51:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FFECBDDFB0; Fri, 16 Sep 2016 22:51:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2495E11B9; Fri, 16 Sep 2016 22:51:39 +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 u8GMpcej052757; Fri, 16 Sep 2016 22:51:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8GMpccg052742; Fri, 16 Sep 2016 22:51:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201609162251.u8GMpccg052742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 16 Sep 2016 22:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305894 - head/sys/boot/powerpc/boot1.chrp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 22:51:39 -0000 Author: jhibbits Date: Fri Sep 16 22:51:37 2016 New Revision: 305894 URL: https://svnweb.freebsd.org/changeset/base/305894 Log: Increase the boot1 file size on the HFS boot image. The boot1.elf is too fat for 30k, it's not 32k on powerpc64, and 34k on powerpc. Without this, boot1 will fail with odd behaviors. MFC after: 1 day Modified: head/sys/boot/powerpc/boot1.chrp/Makefile.hfs head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Modified: head/sys/boot/powerpc/boot1.chrp/Makefile.hfs ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile.hfs Fri Sep 16 21:14:11 2016 (r305893) +++ head/sys/boot/powerpc/boot1.chrp/Makefile.hfs Fri Sep 16 22:51:37 2016 (r305894) @@ -1,4 +1,4 @@ # This file autogenerated by generate-hfs.sh - DO NOT EDIT # $FreeBSD$ -BOOTINFO_OFFSET=0x58 +BOOTINFO_OFFSET=0x9c BOOT1_OFFSET=0x1c Modified: head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Fri Sep 16 21:14:11 2016 (r305893) +++ head/sys/boot/powerpc/boot1.chrp/generate-hfs.sh Fri Sep 16 22:51:37 2016 (r305894) @@ -15,7 +15,7 @@ HFS_SIZE=1600 #Size in 512-byte blocks of the produced image CHRPBOOT_SIZE=2k -BOOT1_SIZE=30k +BOOT1_SIZE=64k # Generate 800K HFS image OUTPUT_FILE=hfs.tmpl Modified: head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Fri Sep 16 21:14:11 2016 (r305893) +++ head/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu Fri Sep 16 22:51:37 2016 (r305894) @@ -2,17 +2,17 @@ HFS template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 hfs.tmpl.bz2 -M0EIH.3%!62936?(HJX\``"]_]?___O)20>!4M2$>0#MUW$1$``$!$``"2!`( -M4EG``>G*VV3"22334_2(/*>ID,@``:#U&"-#(!IZ0`)$HIY0>B-#(/4T```& -M@R:`&@``<:,F1A&(!A-!@$T&@9,FC)D,(#!4E-*--31ZAB!DT!ID:#$81HT& -M@9-!Z::C:E=SZCC1((92M^1Q@3&>="[<2FD((A[AT#`[('#?MSV(S,>HOI'#2,"EJ0PU5).T`PX,54O,RTW8-",N1`R>?SL"+?Q51[H]# -MJ1C5"]BDBF1UJ!Y`J$WTC]QAFZ%Q21$J,I&0,0?9?DPU!Z>$9.380JJCO$Q8 -MXZTX)GQCCGNC%G1BIDBHTK#J9N0,M[85QC:.'>]#,GPRAALU*=)2`$ND22<. --VK/^+N2*<*$AY%%7'@`` +M0EIH.3%!629365^MV6L``"]__O___M)20>!0O2$>0#MUW$!$``%%$``@``!` +M!`!R2<`![@H2"2A2-Z)-HC]4`:`-``T:&@&@#0/TTH<`PC":8A@$`R`&$:9, +MF$8"&AP#",)IB&`0#(`81IDR81@(:")0HT*>4,:0TT`:!ZC0/*/4/1&@;4>H +M&@RYG-FL-,\=C91FTSS@99`O+OA;*$ZN3-&UF`W@#SP:;MVF_EN,-]P$ZN2B +M=";7YHA7VT!#<@,B`H*?S#?Q;CUJ8H8+9:E)+4"L7'CL5&D.IO4;H98%^4@[ +M9`*L&1``5*0#A(EB8BH`S'1O^N +M)Y6'!#N:*:JYTEX\:%'"?.G$FCP8TM_0/ND`^IG3[ +M.QUEDP&P>3+Z442Q!:S.A1>00]'X'D%)UX9QZ>$Q?(808QB-4%9BBTL"L(BB +MEJ*'HH820Q$'%G':JF.:>$U4H`0S`:GSZM-C5BNX(2&$B"J*45`"4FEZ__%W +))%.%"07ZW9:P ` end From owner-svn-src-head@freebsd.org Sat Sep 17 05:02:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10B5DBDEFD0; Sat, 17 Sep 2016 05:02:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9FBAD31; Sat, 17 Sep 2016 05:02:01 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-vk0-x235.google.com with SMTP id 192so55179780vkl.0; Fri, 16 Sep 2016 22:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=s7bZwXpkM/5RAvOl1YIvbibj5LylwWSbTe6uxd/2Ixo=; b=lwUMBJozB4Bcy7dsG4UwQLo18s1o/JEelQZ3bgVMkzm0hUhNY9Ai/nInF+muQGCHoO ZaFarfwALjxYJC/AcuGOH4kcuJBE+sDCFKkJiGJSLD/YtwWsCjvTHeb2rHwLwVhgxX4D //Ha8md3jmL7229vmlqJhXclAOECUHmJmj7jPZY+kbtO/PFU9pk4PXSUez9bevz3LTdJ 8SkaZkGismkQmB4xpE8ga1cDNDYSbsbxdOIMtRUJvA8CsgzAwmon+olpBb4Rm6Y+sENE PGK2esXL9wa4DPkAf2RpoAF/GurKxcBiUaXkBvwkfFx2yB4CKm2VOmDe586R5OdTOHPx xEkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=s7bZwXpkM/5RAvOl1YIvbibj5LylwWSbTe6uxd/2Ixo=; b=ZI2V8ykbLYwu30TLyaGAkvVjmdWKtqc1/KG6AT1Tf1odQOrP74PvyXXcKJjC0gYz/j gNzJ6Mwmkean/rCxZQu8QxGmJ/gsDxCbSAAJmFD6YoGTW33tMB6KdJPZBDFkzQdJzcc+ iHExD7oJaiZxyhVyA8c8NJx0InfYdrgSOrulnq/avkErt4st09S+oGzfucPucvB/souN P0vbpa96gjoUWTsWtwKBpGm4qnkY2jwu24/Vn/LdNkyCKD6Qqeiiu1bqTSt+HVVjpvm7 KiNco3rvh09HcZgFLjX8FJjcudqNL+pGuraH9399mFJIus7zbHNtfgGOebun/cduGaPV nK7A== X-Gm-Message-State: AE9vXwNiuUhI1wH5AStQhhi2kAijeLN5aTeXDPpFgJhQwKB1mJXXA5JBHMxVh96ZP2xraAq38uxRJJfthkrJdQ== X-Received: by 10.31.61.215 with SMTP id k206mr7015111vka.5.1474088520674; Fri, 16 Sep 2016 22:02:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.114.129 with HTTP; Fri, 16 Sep 2016 22:01:59 -0700 (PDT) Received: by 10.103.114.129 with HTTP; Fri, 16 Sep 2016 22:01:59 -0700 (PDT) In-Reply-To: <201609162251.u8GMpccg052742@repo.freebsd.org> References: <201609162251.u8GMpccg052742@repo.freebsd.org> From: Justin Hibbits Date: Sat, 17 Sep 2016 00:01:59 -0500 Message-ID: Subject: Re: svn commit: r305894 - head/sys/boot/powerpc/boot1.chrp To: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 05:02:02 -0000 On Sep 16, 2016 17:51, "Justin Hibbits" wrote: > > Author: jhibbits > Date: Fri Sep 16 22:51:37 2016 > New Revision: 305894 > URL: https://svnweb.freebsd.org/changeset/base/305894 > > Log: > Increase the boot1 file size on the HFS boot image. > > The boot1.elf is too fat for 30k, it's not 32k on powerpc64, and 34k on powerpc. > Without this, boot1 will fail with odd behaviors. Oops, as was pointed out to me privately, s/not/now/ obviously. - Justin From owner-svn-src-head@freebsd.org Sat Sep 17 05:44:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A82CBDDC34; Sat, 17 Sep 2016 05:44:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433ABC4; Sat, 17 Sep 2016 05:44:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8H5iv63008486; Sat, 17 Sep 2016 05:44:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8H5ivB1008484; Sat, 17 Sep 2016 05:44:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201609170544.u8H5ivB1008484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 17 Sep 2016 05:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305895 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 05:44:58 -0000 Author: adrian Date: Sat Sep 17 05:44:57 2016 New Revision: 305895 URL: https://svnweb.freebsd.org/changeset/base/305895 Log: [net80211] add a HT method to populate HTCAP based on IBSS requirements. IBSS negotiation is a subset of the STA/AP negotiation. We always have a current channel, so base the HT capabilities on the current channel. This is then put into IBSS probe requests to inform peers of our 11n capabilities. Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ht.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Fri Sep 16 22:51:37 2016 (r305894) +++ head/sys/net80211/ieee80211_ht.c Sat Sep 17 05:44:57 2016 (r305895) @@ -2846,6 +2846,96 @@ ieee80211_add_htcap(uint8_t *frm, struct } /* + * Non-associated probe request - add HT capabilities based on + * the current channel configuration. + */ +static uint8_t * +ieee80211_add_htcap_body_ch(uint8_t *frm, struct ieee80211vap *vap, + struct ieee80211_channel *c) +{ +#define ADDSHORT(frm, v) do { \ + frm[0] = (v) & 0xff; \ + frm[1] = (v) >> 8; \ + frm += 2; \ +} while (0) + struct ieee80211com *ic = vap->iv_ic; + uint16_t caps, extcaps; + int rxmax, density; + + /* HT capabilities */ + caps = vap->iv_htcaps & 0xffff; + + /* + * We don't use this in STA mode; only in IBSS mode. + * So in IBSS mode we base our HTCAP flags on the + * given channel. + */ + + /* override 20/40 use based on current channel */ + if (IEEE80211_IS_CHAN_HT40(c)) + caps |= IEEE80211_HTCAP_CHWIDTH40; + else + caps &= ~IEEE80211_HTCAP_CHWIDTH40; + + /* Use the currently configured values */ + rxmax = vap->iv_ampdu_rxmax; + density = vap->iv_ampdu_density; + + /* adjust short GI based on channel and config */ + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) == 0) + caps &= ~IEEE80211_HTCAP_SHORTGI20; + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 || + (caps & IEEE80211_HTCAP_CHWIDTH40) == 0) + caps &= ~IEEE80211_HTCAP_SHORTGI40; + ADDSHORT(frm, caps); + + /* HT parameters */ + *frm = SM(rxmax, IEEE80211_HTCAP_MAXRXAMPDU) + | SM(density, IEEE80211_HTCAP_MPDUDENSITY) + ; + frm++; + + /* pre-zero remainder of ie */ + memset(frm, 0, sizeof(struct ieee80211_ie_htcap) - + __offsetof(struct ieee80211_ie_htcap, hc_mcsset)); + + /* supported MCS set */ + /* + * XXX: For sta mode the rate set should be restricted based + * on the AP's capabilities, but ni_htrates isn't setup when + * we're called to form an AssocReq frame so for now we're + * restricted to the device capabilities. + */ + ieee80211_set_mcsset(ic, frm); + + frm += __offsetof(struct ieee80211_ie_htcap, hc_extcap) - + __offsetof(struct ieee80211_ie_htcap, hc_mcsset); + + /* HT extended capabilities */ + extcaps = vap->iv_htextcaps & 0xffff; + + ADDSHORT(frm, extcaps); + + frm += sizeof(struct ieee80211_ie_htcap) - + __offsetof(struct ieee80211_ie_htcap, hc_txbf); + + return frm; +#undef ADDSHORT +} + +/* + * Add 802.11n HT capabilities information element + */ +uint8_t * +ieee80211_add_htcap_ch(uint8_t *frm, struct ieee80211vap *vap, + struct ieee80211_channel *c) +{ + frm[0] = IEEE80211_ELEMID_HTCAP; + frm[1] = sizeof(struct ieee80211_ie_htcap) - 2; + return ieee80211_add_htcap_body_ch(frm + 2, vap, c); +} + +/* * Add Broadcom OUI wrapped standard HTCAP ie; this is * used for compatibility w/ pre-draft implementations. */ Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Fri Sep 16 22:51:37 2016 (r305894) +++ head/sys/net80211/ieee80211_ht.h Sat Sep 17 05:44:57 2016 (r305895) @@ -210,6 +210,8 @@ void ieee80211_ampdu_stop(struct ieee802 int ieee80211_send_bar(struct ieee80211_node *, struct ieee80211_tx_ampdu *, ieee80211_seq); uint8_t *ieee80211_add_htcap(uint8_t *, struct ieee80211_node *); +uint8_t *ieee80211_add_htcap_ch(uint8_t *, struct ieee80211vap *, + struct ieee80211_channel *); uint8_t *ieee80211_add_htcap_vendor(uint8_t *, struct ieee80211_node *); uint8_t *ieee80211_add_htinfo(uint8_t *, struct ieee80211_node *); uint8_t *ieee80211_add_htinfo_vendor(uint8_t *, struct ieee80211_node *); From owner-svn-src-head@freebsd.org Sat Sep 17 08:10:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B1DEBDE8C8; Sat, 17 Sep 2016 08:10:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D185D86C; Sat, 17 Sep 2016 08:10:02 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8H8A2vL060520; Sat, 17 Sep 2016 08:10:02 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8H8A2eQ060519; Sat, 17 Sep 2016 08:10:02 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201609170810.u8H8A2eQ060519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 17 Sep 2016 08:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305896 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 08:10:03 -0000 Author: dchagin Date: Sat Sep 17 08:10:01 2016 New Revision: 305896 URL: https://svnweb.freebsd.org/changeset/base/305896 Log: Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700 Submitted by: Erik Cederstrand Reported by: Erik Cederstrand MFC after: 1 week Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sat Sep 17 05:44:57 2016 (r305895) +++ head/sys/compat/linux/linux_ioctl.c Sat Sep 17 08:10:01 2016 (r305896) @@ -297,6 +297,15 @@ linux_ioctl_disk(struct thread *td, stru return (copyout(§orsize, (void *)args->arg, sizeof(sectorsize))); break; + case LINUX_BLKSSZGET: + error = fo_ioctl(fp, DIOCGSECTORSIZE, + (caddr_t)§orsize, td->td_ucred, td); + fdrop(fp, td); + if (error) + return (error); + return (copyout(§orsize, (void *)args->arg, + sizeof(sectorsize))); + break; } fdrop(fp, td); return (ENOIOCTL); From owner-svn-src-head@freebsd.org Sat Sep 17 11:43:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D06BDEFAE; Sat, 17 Sep 2016 11:43:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id B92E5C32; Sat, 17 Sep 2016 11:43:52 +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 u8HBhpe6046438; Sat, 17 Sep 2016 11:43:51 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HBhpNQ046437; Sat, 17 Sep 2016 11:43:51 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609171143.u8HBhpNQ046437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 17 Sep 2016 11:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305897 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 11:43:53 -0000 Author: bde Date: Sat Sep 17 11:43:51 2016 New Revision: 305897 URL: https://svnweb.freebsd.org/changeset/base/305897 Log: Silently ignore unexpected single-step traps (except for turning off single-stepping). Only do this on arches (only x86 so far) which classify single-step traps unambiguously. This allows other parts of the kernel to be intentionally and unintentionally sloppy about generating single-step traps. On x86, at least the following places were unintentionally sloppy: - all operations that context-switched [er]flags. Especially spinlock_enter()/exit() and cpu_switch(). When single-stepped, saving the flags leaves PSL_T set in the saved flags, so restoring gives a trap that is spurious if it occurs after single-step mode has been left. Switching contexts away from a low priority thread gives especially long-lived saved copies. - the vm86 emulation allows user mode to set PSL_T. This was correct until vm86 bios call mode was unintentionally given access to kdb handling its single-step traps. Now these places are intentionally sloppy, but unexpected debugger traps still cause panics if no debugger that handles the trap is attached when the trap is delivered. Modified: head/sys/ddb/db_run.c Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Sat Sep 17 08:10:01 2016 (r305896) +++ head/sys/ddb/db_run.c Sat Sep 17 11:43:51 2016 (r305897) @@ -136,21 +136,29 @@ db_stop_at_pc(int type, int code, bool * *is_breakpoint = false; /* might be a breakpoint, but not ours */ /* + * If not stepping, then silently ignore single-step traps + * (except for clearing the single-step-flag above). + * * If stepping, then abort if the trap type is unexpected. * Breakpoints owned by us are expected and were handled above. * Single-steps are expected and are handled below. All others * are unexpected. * - * If the MD layer doesn't tell us when it is stepping, use the - * bad historical default that all unexepected traps. + * Only do either of these if the MD layer claims to classify + * single-step traps unambiguously (by defining IS_SSTEP_TRAP). + * Otherwise, fall through to the bad historical behaviour + * given by turning unexpected traps into expected traps: if not + * stepping, then expect only breakpoints and stop, and if + * stepping, then expect only single-steps and step. */ -#ifndef IS_SSTEP_TRAP -#define IS_SSTEP_TRAP(type, code) true -#endif +#ifdef IS_SSTEP_TRAP + if (db_run_mode == STEP_CONTINUE && IS_SSTEP_TRAP(type, code)) + return (false); if (db_run_mode != STEP_CONTINUE && !IS_SSTEP_TRAP(type, code)) { printf("Stepping aborted\n"); return (true); } +#endif if (db_run_mode == STEP_INVISIBLE) { db_run_mode = STEP_CONTINUE; From owner-svn-src-head@freebsd.org Sat Sep 17 13:48:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87FFFBDCD43; Sat, 17 Sep 2016 13:48:02 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5867591; Sat, 17 Sep 2016 13:48:02 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HDm1on093025; Sat, 17 Sep 2016 13:48:01 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HDm1Yn093022; Sat, 17 Sep 2016 13:48:01 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201609171348.u8HDm1Yn093022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sat, 17 Sep 2016 13:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305898 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 13:48:02 -0000 Author: jceel Date: Sat Sep 17 13:48:01 2016 New Revision: 305898 URL: https://svnweb.freebsd.org/changeset/base/305898 Log: Add virtio-console support to bhyve. Adds virtio-console device support to bhyve, allowing to create bidirectional character streams between host and guest. Syntax: -s ,virtio-console,port1=/path/to/port1.sock,anotherport=... Maximum of 16 ports per device can be created. Every port is named and corresponds to an Unix domain socket created by bhyve. bhyve accepts at most one connection per port at a time. Limitations: - due to lack of destructors of in bhyve, sockets on the filesystem must be cleaned up manually after bhyve exits - there's no way to use "console port" feature, nor the console port resize as of now - emergency write is advertised, but no-op as of now Approved by: trasz MFC after: 1 month Relnotes: yes Sponsored by: iXsystems, Inc. Differential Revision: D7185 Added: head/usr.sbin/bhyve/pci_virtio_console.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Sat Sep 17 11:43:51 2016 (r305897) +++ head/usr.sbin/bhyve/Makefile Sat Sep 17 13:48:01 2016 (r305898) @@ -36,6 +36,7 @@ SRCS= \ pci_lpc.c \ pci_passthru.c \ pci_virtio_block.c \ + pci_virtio_console.c \ pci_virtio_net.c \ pci_virtio_rnd.c \ pci_uart.c \ Added: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_virtio_console.c Sat Sep 17 13:48:01 2016 (r305898) @@ -0,0 +1,631 @@ +/*- + * Copyright (c) 2016 iXsystems Inc. + * All rights reserved. + * + * This software was developed by Jakub Klama + * under sponsorship from iXsystems Inc. + * + * 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 + * in this position and unchanged. + * 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 +#include +#include +#include +#include +#include +#include + +#include "bhyverun.h" +#include "pci_emul.h" +#include "virtio.h" +#include "mevent.h" + +#define VTCON_RINGSZ 64 +#define VTCON_MAXPORTS 16 +#define VTCON_MAXQ (VTCON_MAXPORTS * 2 + 2) + +#define VTCON_DEVICE_READY 0 +#define VTCON_DEVICE_ADD 1 +#define VTCON_DEVICE_REMOVE 2 +#define VTCON_PORT_READY 3 +#define VTCON_CONSOLE_PORT 4 +#define VTCON_CONSOLE_RESIZE 5 +#define VTCON_PORT_OPEN 6 +#define VTCON_PORT_NAME 7 + +#define VTCON_F_SIZE 0 +#define VTCON_F_MULTIPORT 1 +#define VTCON_F_EMERG_WRITE 2 +#define VTCON_S_HOSTCAPS \ + (VTCON_F_SIZE | VTCON_F_MULTIPORT | VTCON_F_EMERG_WRITE) + +static int pci_vtcon_debug; +#define DPRINTF(params) if (pci_vtcon_debug) printf params +#define WPRINTF(params) printf params + +struct pci_vtcon_softc; +struct pci_vtcon_port; +struct pci_vtcon_config; +typedef void (pci_vtcon_cb_t)(struct pci_vtcon_port *, void *, struct iovec *, + int); + +struct pci_vtcon_port { + struct pci_vtcon_softc * vsp_sc; + int vsp_id; + const char * vsp_name; + bool vsp_enabled; + bool vsp_console; + bool vsp_rx_ready; + int vsp_rxq; + int vsp_txq; + void * vsp_arg; + pci_vtcon_cb_t * vsp_cb; +}; + +struct pci_vtcon_sock +{ + struct pci_vtcon_port * vss_port; + const char * vss_path; + struct mevent * vss_server_evp; + struct mevent * vss_conn_evp; + int vss_server_fd; + int vss_conn_fd; + bool vss_open; +}; + +struct pci_vtcon_softc { + struct virtio_softc vsc_vs; + struct vqueue_info vsc_queues[VTCON_MAXQ]; + pthread_mutex_t vsc_mtx; + uint64_t vsc_cfg; + uint64_t vsc_features; + char * vsc_rootdir; + int vsc_kq; + int vsc_nports; + struct pci_vtcon_port vsc_control_port; + struct pci_vtcon_port vsc_ports[VTCON_MAXPORTS]; + struct pci_vtcon_config *vsc_config; +}; + +struct pci_vtcon_config { + uint16_t cols; + uint16_t rows; + uint32_t max_nr_ports; + uint32_t emerg_wr; +} __attribute__((packed)); + +struct pci_vtcon_control { + uint32_t id; + uint16_t event; + uint16_t value; +} __attribute__((packed)); + +struct pci_vtcon_console_resize { + uint16_t cols; + uint16_t rows; +} __attribute__((packed)); + +static void pci_vtcon_reset(void *); +static void pci_vtcon_notify_rx(void *, struct vqueue_info *); +static void pci_vtcon_notify_tx(void *, struct vqueue_info *); +static int pci_vtcon_cfgread(void *, int, int, uint32_t *); +static int pci_vtcon_cfgwrite(void *, int, int, uint32_t); +static void pci_vtcon_neg_features(void *, uint64_t); +static void pci_vtcon_sock_accept(int, enum ev_type, void *); +static void pci_vtcon_sock_rx(int, enum ev_type, void *); +static void pci_vtcon_sock_tx(struct pci_vtcon_port *, void *, struct iovec *, + int); +static void pci_vtcon_control_send(struct pci_vtcon_softc *, + struct pci_vtcon_control *, const void *, size_t); +static void pci_vtcon_announce_port(struct pci_vtcon_port *); +static void pci_vtcon_open_port(struct pci_vtcon_port *, bool); + +static struct virtio_consts vtcon_vi_consts = { + "vtcon", /* our name */ + VTCON_MAXQ, /* we support VTCON_MAXQ virtqueues */ + sizeof(struct pci_vtcon_config), /* config reg size */ + pci_vtcon_reset, /* reset */ + NULL, /* device-wide qnotify */ + pci_vtcon_cfgread, /* read virtio config */ + pci_vtcon_cfgwrite, /* write virtio config */ + pci_vtcon_neg_features, /* apply negotiated features */ + VTCON_S_HOSTCAPS, /* our capabilities */ +}; + + +static void +pci_vtcon_reset(void *vsc) +{ + struct pci_vtcon_softc *sc; + + sc = vsc; + + DPRINTF(("vtcon: device reset requested!\n")); + vi_reset_dev(&sc->vsc_vs); +} + +static void +pci_vtcon_neg_features(void *vsc, uint64_t negotiated_features) +{ + struct pci_vtcon_softc *sc = vsc; + + sc->vsc_features = negotiated_features; +} + +static int +pci_vtcon_cfgread(void *vsc, int offset, int size, uint32_t *retval) +{ + struct pci_vtcon_softc *sc = vsc; + void *ptr; + + ptr = (uint8_t *)sc->vsc_config + offset; + memcpy(retval, ptr, size); + return (0); +} + +static int +pci_vtcon_cfgwrite(void *vsc, int offset, int size, uint32_t val) +{ + + return (0); +} + +static inline struct pci_vtcon_port * +pci_vtcon_vq_to_port(struct pci_vtcon_softc *sc, struct vqueue_info *vq) +{ + uint16_t num = vq->vq_num; + + if (num == 0 || num == 1) + return (&sc->vsc_ports[0]); + + if (num == 2 || num == 3) + return (&sc->vsc_control_port); + + return (&sc->vsc_ports[(num / 2) - 1]); +} + +static inline struct vqueue_info * +pci_vtcon_port_to_vq(struct pci_vtcon_port *port, bool tx_queue) +{ + int qnum; + + qnum = tx_queue ? port->vsp_txq : port->vsp_rxq; + return (&port->vsp_sc->vsc_queues[qnum]); +} + +static struct pci_vtcon_port * +pci_vtcon_port_add(struct pci_vtcon_softc *sc, const char *name, + pci_vtcon_cb_t *cb, void *arg) +{ + struct pci_vtcon_port *port; + + if (sc->vsc_nports == VTCON_MAXPORTS) { + errno = EBUSY; + return (NULL); + } + + port = &sc->vsc_ports[sc->vsc_nports++]; + port->vsp_id = sc->vsc_nports - 1; + port->vsp_sc = sc; + port->vsp_name = name; + port->vsp_cb = cb; + port->vsp_arg = arg; + + if (port->vsp_id == 0) { + /* port0 */ + port->vsp_txq = 0; + port->vsp_rxq = 1; + } else { + port->vsp_txq = sc->vsc_nports * 2; + port->vsp_rxq = port->vsp_txq + 1; + } + + port->vsp_enabled = true; + return (port); +} + +static int +pci_vtcon_sock_add(struct pci_vtcon_softc *sc, const char *name, + const char *path) +{ + struct pci_vtcon_sock *sock; + struct sockaddr_un sun; + int s = -1, fd = -1, error = 0; + + sock = calloc(1, sizeof(struct pci_vtcon_sock)); + if (sock == NULL) { + error = -1; + goto out; + } + + s = socket(AF_UNIX, SOCK_STREAM, 0); + if (s < 0) { + error = -1; + goto out; + } + + fd = open(dirname(path), O_RDONLY | O_DIRECTORY); + if (fd < 0) { + error = -1; + goto out; + } + + sun.sun_family = AF_UNIX; + sun.sun_len = sizeof(struct sockaddr_un); + strncpy(sun.sun_path, basename((char *)path), sizeof(sun.sun_path)); + + if (bindat(fd, s, (struct sockaddr *)&sun, sun.sun_len) < 0) { + error = -1; + goto out; + } + + if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) { + error = -1; + goto out; + } + + if (listen(s, 1) < 0) { + error = -1; + goto out; + } + + + sock->vss_port = pci_vtcon_port_add(sc, name, pci_vtcon_sock_tx, sock); + if (sock->vss_port == NULL) { + error = -1; + goto out; + } + + sock->vss_open = false; + sock->vss_conn_fd = -1; + sock->vss_server_fd = s; + sock->vss_server_evp = mevent_add(s, EVF_READ, pci_vtcon_sock_accept, + sock); + + if (sock->vss_server_evp == NULL) { + error = -1; + goto out; + } + +out: + if (fd != -1) + close(fd); + + if (error != 0 && s != -1) + close(s); + + return (error); +} + +static void +pci_vtcon_sock_accept(int fd __unused, enum ev_type t __unused, void *arg) +{ + struct pci_vtcon_sock *sock = (struct pci_vtcon_sock *)arg; + int s; + + s = accept(sock->vss_server_fd, NULL, NULL); + if (s < 0) + return; + + if (sock->vss_open) { + close(s); + return; + } + + sock->vss_open = true; + sock->vss_conn_fd = s; + sock->vss_conn_evp = mevent_add(s, EVF_READ, pci_vtcon_sock_rx, sock); + pci_vtcon_open_port(sock->vss_port, true); +} + +static void +pci_vtcon_sock_rx(int fd __unused, enum ev_type t __unused, void *arg) +{ + struct pci_vtcon_port *port; + struct pci_vtcon_sock *sock = (struct pci_vtcon_sock *)arg; + struct vqueue_info *vq; + struct iovec iov; + static char dummybuf[2048]; + int len, n; + uint16_t idx; + + port = sock->vss_port; + vq = pci_vtcon_port_to_vq(port, true); + + if (!sock->vss_open || !port->vsp_rx_ready) { + len = read(sock->vss_conn_fd, dummybuf, sizeof(dummybuf)); + if (len == 0) + goto close; + + return; + } + + if (!vq_has_descs(vq)) { + len = read(sock->vss_conn_fd, dummybuf, sizeof(dummybuf)); + vq_endchains(vq, 1); + if (len == 0) + goto close; + + return; + } + + do { + n = vq_getchain(vq, &idx, &iov, 1, NULL); + len = readv(sock->vss_conn_fd, &iov, n); + + if (len == 0 || (len < 0 && errno == EWOULDBLOCK)) { + vq_retchain(vq); + vq_endchains(vq, 0); + if (len == 0) + goto close; + + return; + } + + vq_relchain(vq, idx, len); + } while (vq_has_descs(vq)); + + vq_endchains(vq, 1); + +close: + mevent_delete_close(sock->vss_conn_evp); + sock->vss_conn_fd = -1; + sock->vss_open = false; +} + +static void +pci_vtcon_sock_tx(struct pci_vtcon_port *port, void *arg, struct iovec *iov, + int niov) +{ + struct pci_vtcon_sock *sock; + int ret; + + sock = (struct pci_vtcon_sock *)arg; + + if (sock->vss_conn_fd == -1) + return; + + ret = writev(sock->vss_conn_fd, iov, niov); + + if (ret < 0 && errno != EWOULDBLOCK) { + mevent_delete_close(sock->vss_conn_evp); + sock->vss_conn_fd = -1; + sock->vss_open = false; + } +} + +static void +pci_vtcon_control_tx(struct pci_vtcon_port *port, void *arg, struct iovec *iov, + int niov) +{ + struct pci_vtcon_softc *sc; + struct pci_vtcon_port *tmp; + struct pci_vtcon_control resp, *ctrl; + int i; + + assert(niov == 1); + + sc = port->vsp_sc; + ctrl = (struct pci_vtcon_control *)iov->iov_base; + + switch (ctrl->event) { + case VTCON_DEVICE_READY: + /* set port ready events for registered ports */ + for (i = 0; i < VTCON_MAXPORTS; i++) { + tmp = &sc->vsc_ports[i]; + if (tmp->vsp_enabled) + pci_vtcon_announce_port(tmp); + } + break; + + case VTCON_PORT_READY: + if (ctrl->id >= sc->vsc_nports) { + WPRINTF(("VTCON_PORT_READY event for unknown port %d\n", + ctrl->id)); + return; + } + + tmp = &sc->vsc_ports[ctrl->id]; + if (tmp->vsp_console) { + resp.event = VTCON_CONSOLE_PORT; + resp.id = ctrl->id; + resp.value = 1; + pci_vtcon_control_send(sc, &resp, NULL, 0); + } + break; + } +} + +static void +pci_vtcon_announce_port(struct pci_vtcon_port *port) +{ + struct pci_vtcon_control event; + + event.id = port->vsp_id; + event.event = VTCON_DEVICE_ADD; + event.value = 1; + pci_vtcon_control_send(port->vsp_sc, &event, NULL, 0); + + event.event = VTCON_PORT_NAME; + pci_vtcon_control_send(port->vsp_sc, &event, port->vsp_name, + strlen(port->vsp_name)); +} + +static void +pci_vtcon_open_port(struct pci_vtcon_port *port, bool open) +{ + struct pci_vtcon_control event; + + event.id = port->vsp_id; + event.event = VTCON_PORT_OPEN; + event.value = (int)open; + pci_vtcon_control_send(port->vsp_sc, &event, NULL, 0); +} + +static void +pci_vtcon_control_send(struct pci_vtcon_softc *sc, + struct pci_vtcon_control *ctrl, const void *payload, size_t len) +{ + struct vqueue_info *vq; + struct iovec iov; + uint16_t idx; + int n; + + vq = pci_vtcon_port_to_vq(&sc->vsc_control_port, true); + + if (!vq_has_descs(vq)) + return; + + n = vq_getchain(vq, &idx, &iov, 1, NULL); + + assert(n == 1); + + memcpy(iov.iov_base, ctrl, sizeof(struct pci_vtcon_control)); + if (payload != NULL && len > 0) + memcpy(iov.iov_base + sizeof(struct pci_vtcon_control), + payload, len); + + vq_relchain(vq, idx, sizeof(struct pci_vtcon_control) + len); + vq_endchains(vq, 1); +} + + +static void +pci_vtcon_notify_tx(void *vsc, struct vqueue_info *vq) +{ + struct pci_vtcon_softc *sc; + struct pci_vtcon_port *port; + struct iovec iov[1]; + uint16_t idx, n; + uint16_t flags[8]; + + sc = vsc; + port = pci_vtcon_vq_to_port(sc, vq); + + while (vq_has_descs(vq)) { + n = vq_getchain(vq, &idx, iov, 1, flags); + if (port != NULL) + port->vsp_cb(port, port->vsp_arg, iov, 1); + + /* + * Release this chain and handle more + */ + vq_relchain(vq, idx, 0); + } + vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ +} + +static void +pci_vtcon_notify_rx(void *vsc, struct vqueue_info *vq) +{ + struct pci_vtcon_softc *sc; + struct pci_vtcon_port *port; + + sc = vsc; + port = pci_vtcon_vq_to_port(sc, vq); + + if (!port->vsp_rx_ready) { + port->vsp_rx_ready = 1; + vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + } +} + +static int +pci_vtcon_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + struct pci_vtcon_softc *sc; + char *portname = NULL; + char *portpath = NULL; + char *opt; + int i; + + sc = calloc(1, sizeof(struct pci_vtcon_softc)); + sc->vsc_config = calloc(1, sizeof(struct pci_vtcon_config)); + sc->vsc_config->max_nr_ports = VTCON_MAXPORTS; + sc->vsc_config->cols = 80; + sc->vsc_config->rows = 25; + + vi_softc_linkup(&sc->vsc_vs, &vtcon_vi_consts, sc, pi, sc->vsc_queues); + sc->vsc_vs.vs_mtx = &sc->vsc_mtx; + + for (i = 0; i < VTCON_MAXQ; i++) { + sc->vsc_queues[i].vq_qsize = VTCON_RINGSZ; + sc->vsc_queues[i].vq_notify = i % 2 == 0 + ? pci_vtcon_notify_rx + : pci_vtcon_notify_tx; + } + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_CONSOLE); + pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_SIMPLECOMM); + pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_CONSOLE); + pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR); + + if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) + return (1); + vi_set_io_bar(&sc->vsc_vs, 0); + + /* create control port */ + sc->vsc_control_port.vsp_sc = sc; + sc->vsc_control_port.vsp_txq = 2; + sc->vsc_control_port.vsp_rxq = 3; + sc->vsc_control_port.vsp_cb = pci_vtcon_control_tx; + sc->vsc_control_port.vsp_enabled = true; + + while ((opt = strsep(&opts, ",")) != NULL) { + portname = strsep(&opt, "="); + portpath = strdup(opt); + + /* create port */ + if (pci_vtcon_sock_add(sc, portname, portpath) < 0) { + fprintf(stderr, "cannot create port %s: %s\n", + portname, strerror(errno)); + return (1); + } + } + + return (0); +} + +struct pci_devemu pci_de_vcon = { + .pe_emu = "virtio-console", + .pe_init = pci_vtcon_init, + .pe_barwrite = vi_pci_write, + .pe_barread = vi_pci_read +}; +PCI_EMUL_SET(pci_de_vcon); Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Sat Sep 17 11:43:51 2016 (r305897) +++ head/usr.sbin/bhyve/virtio.h Sat Sep 17 13:48:01 2016 (r305898) @@ -210,6 +210,7 @@ struct vring_used { #define VIRTIO_DEV_NET 0x1000 #define VIRTIO_DEV_BLOCK 0x1001 #define VIRTIO_DEV_RANDOM 0x1002 +#define VIRTIO_DEV_CONSOLE 0x1003 /* * PCI config space constants. From owner-svn-src-head@freebsd.org Sat Sep 17 14:00:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7749BDE008; Sat, 17 Sep 2016 14:00:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6822A921; Sat, 17 Sep 2016 14:00:53 +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 u8HE0qDl097245; Sat, 17 Sep 2016 14:00:52 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HE0qIU097241; Sat, 17 Sep 2016 14:00:52 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201609171400.u8HE0qIU097241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 17 Sep 2016 14:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305899 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 14:00:53 -0000 Author: bde Date: Sat Sep 17 14:00:52 2016 New Revision: 305899 URL: https://svnweb.freebsd.org/changeset/base/305899 Log: Remove all kernel uses of pcb_psl, but keep in in the struct to preserve the ABI and API for applications. It was removed in the port to amd64, but was remained as garbage giving a micro-pessimization and spurious single-step traps on i386. pcb_psl was intended to be used just to do a context switch of PSL_I, but this context switch was null in most or all versions, and mis-switching of PSL_T was done instead. Some history: - in 386BSD-0.0, cpu_switch() ran at splhigh() and splhigh() did too much interrupt disabling, so interrupts were hard-disabled across cpu_switch() and too many other places - in 386BSD-0.0-patchkit through FreeBSD-4 and FreeBSD-5 before SMPng, splhigh() did soft interrupt masking, and cpu_switch() was excessively cautious and did a cli at the start and a sti at the end to hard-disable interrupts across the switch - SMPng replaced the spl's and cli's by spinlocks (just sched_lock?), so interrupts were hard-disabled across cpu_switch() and too many other places again - initial attempts to fix this intended to restore some soft interrupt disabling, but to support variations in this cpu_switch() used pushfl/popfl into pcb_psl to avoid hard-coding the assumption that the initial and final states have PSL_I enabled. But the version with soft interrupt disabling wasn't used for long, or was never committed, (except I always used my different version of it for UP) so the pushfl/popl and pcb_psl to hold them have been doing less than nothing for about 14 years. Modified: head/sys/i386/i386/genassym.c head/sys/i386/i386/swtch.s head/sys/i386/i386/vm_machdep.c head/sys/i386/include/pcb.h Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/i386/genassym.c Sat Sep 17 14:00:52 2016 (r305899) @@ -143,7 +143,6 @@ ASSYM(PCB_DR2, offsetof(struct pcb, pcb_ ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3)); ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6)); ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7)); -ASSYM(PCB_PSL, offsetof(struct pcb, pcb_psl)); ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_EXT, offsetof(struct pcb, pcb_ext)); Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/i386/swtch.s Sat Sep 17 14:00:52 2016 (r305899) @@ -131,8 +131,6 @@ ENTRY(cpu_switch) movl %esi,PCB_ESI(%edx) movl %edi,PCB_EDI(%edx) mov %gs,PCB_GS(%edx) - pushfl /* PSL */ - popl PCB_PSL(%edx) /* Test if debug registers should be saved. */ testl $PCB_DBREGS,PCB_FLAGS(%edx) jz 1f /* no, skip over */ @@ -261,8 +259,6 @@ sw1: movl PCB_EDI(%edx),%edi movl PCB_EIP(%edx),%eax movl %eax,(%esp) - pushl PCB_PSL(%edx) - popfl movl %edx, PCPU(CURPCB) movl TD_TID(%ecx),%eax @@ -365,8 +361,6 @@ ENTRY(savectx) movl %esi,PCB_ESI(%ecx) movl %edi,PCB_EDI(%ecx) mov %gs,PCB_GS(%ecx) - pushfl - popl PCB_PSL(%ecx) movl %cr0,%eax movl %eax,PCB_CR0(%ecx) Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/i386/vm_machdep.c Sat Sep 17 14:00:52 2016 (r305899) @@ -273,7 +273,6 @@ cpu_fork(td1, p2, td2, flags) pcb2->pcb_esp = (int)td2->td_frame - sizeof(void *); pcb2->pcb_ebx = (int)td2; /* fork_trampoline argument */ pcb2->pcb_eip = (int)fork_trampoline; - pcb2->pcb_psl = PSL_KERNEL; /* ints disabled */ /*- * pcb2->pcb_dr*: cloned above. * pcb2->pcb_savefpu: cloned above. @@ -504,7 +503,6 @@ cpu_copy_thread(struct thread *td, struc pcb2->pcb_esp = (int)td->td_frame - sizeof(void *); /* trampoline arg */ pcb2->pcb_ebx = (int)td; /* trampoline arg */ pcb2->pcb_eip = (int)fork_trampoline; - pcb2->pcb_psl &= ~(PSL_I); /* interrupts must be disabled */ pcb2->pcb_gs = rgs(); /* * If we didn't copy the pcb, we'd need to do the following registers: Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Sat Sep 17 13:48:01 2016 (r305898) +++ head/sys/i386/include/pcb.h Sat Sep 17 14:00:52 2016 (r305899) @@ -89,7 +89,7 @@ struct pcb { caddr_t pcb_onfault; /* copyin/out fault recovery */ struct pcb_ext *pcb_ext; /* optional pcb extension */ - int pcb_psl; /* process status long */ + int pcb_waspsl; /* unused padding for ABI and API compat */ u_long pcb_vm86[2]; /* vm86bios scratch space */ union savefpu *pcb_save; From owner-svn-src-head@freebsd.org Sat Sep 17 14:23:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C399FBDE89E; Sat, 17 Sep 2016 14:23:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 8E578A41; Sat, 17 Sep 2016 14:23:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 5AF1BD468BB; Sun, 18 Sep 2016 00:23:27 +1000 (AEST) Date: Sun, 18 Sep 2016 00:23:26 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305899 - in head/sys/i386: i386 include In-Reply-To: <201609171400.u8HE0qIU097241@repo.freebsd.org> Message-ID: <20160918000646.S2446@besplex.bde.org> References: <201609171400.u8HE0qIU097241@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.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=HDxS4Cb_YJLcUxZtNZAA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 14:23:37 -0000 On Sat, 17 Sep 2016, Bruce Evans wrote: > Author: bde > Date: Sat Sep 17 14:00:52 2016 > New Revision: 305899 > URL: https://svnweb.freebsd.org/changeset/base/305899 > > Log: > Remove all kernel uses of pcb_psl, but keep in in the struct to > preserve the ABI and API for applications. It was removed in the port > to amd64, but was remained as garbage giving a micro-pessimization and > spurious single-step traps on i386. > ... Actually, I committed a version that breaks the API by renaming the variable. I will leave it like that. pcb_psl is not used anywhere in head/ports, so it is used in at most the externally-maintained part of a port or things like gdb scripts. Bruce From owner-svn-src-head@freebsd.org Sat Sep 17 16:03:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5F2ABDEF7D; Sat, 17 Sep 2016 16:03:34 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD303CC3; Sat, 17 Sep 2016 16:03:34 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HG3Xrt046517; Sat, 17 Sep 2016 16:03:33 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HG3XAY046516; Sat, 17 Sep 2016 16:03:33 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201609171603.u8HG3XAY046516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sat, 17 Sep 2016 16:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305900 - head/sys/dev/virtio/console X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 16:03:34 -0000 Author: jceel Date: Sat Sep 17 16:03:33 2016 New Revision: 305900 URL: https://svnweb.freebsd.org/changeset/base/305900 Log: Create aliases for named virtio-console ports. Make virtio_console(4) create `/dev/vtcon/` alias pointing to /dev/ttyVx.y upon receiving PORT_NAME (id = 7) event over the control queue. Approved by: trasz MFC after: 1 month Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D7182 Modified: head/sys/dev/virtio/console/virtio_console.c Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Sat Sep 17 14:00:52 2016 (r305899) +++ head/sys/dev/virtio/console/virtio_console.c Sat Sep 17 16:03:33 2016 (r305900) @@ -176,8 +176,10 @@ static void vtcon_ctrl_port_add_event(s static void vtcon_ctrl_port_remove_event(struct vtcon_softc *, int); static void vtcon_ctrl_port_console_event(struct vtcon_softc *, int); static void vtcon_ctrl_port_open_event(struct vtcon_softc *, int); +static void vtcon_ctrl_port_name_event(struct vtcon_softc *, int, + const char *, size_t); static void vtcon_ctrl_process_event(struct vtcon_softc *, - struct virtio_console_control *); + struct virtio_console_control *, void *, size_t); static void vtcon_ctrl_task_cb(void *, int); static void vtcon_ctrl_event_intr(void *); static void vtcon_ctrl_poll(struct vtcon_softc *, @@ -611,8 +613,10 @@ vtcon_ctrl_event_create(struct vtcon_sof struct virtio_console_control *control; int error; - control = malloc(sizeof(struct virtio_console_control), M_DEVBUF, - M_ZERO | M_NOWAIT); + control = malloc( + sizeof(struct virtio_console_control) + VTCON_BULK_BUFSZ, + M_DEVBUF, M_ZERO | M_NOWAIT); + if (control == NULL) return (ENOMEM); @@ -796,8 +800,29 @@ vtcon_ctrl_port_open_event(struct vtcon_ } static void +vtcon_ctrl_port_name_event(struct vtcon_softc *sc, int id, const char *name, + size_t len) +{ + device_t dev; + struct vtcon_softc_port *scport; + struct vtcon_port *port; + + dev = sc->vtcon_dev; + scport = &sc->vtcon_ports[id]; + + port = scport->vcsp_port; + if (port == NULL) { + device_printf(dev, "%s: name port %d, but does not exist\n", + __func__, id); + return; + } + + tty_makealias(port->vtcport_tty, "vtcon/%*s", (int)len, name); +} + +static void vtcon_ctrl_process_event(struct vtcon_softc *sc, - struct virtio_console_control *control) + struct virtio_console_control *control, void *payload, size_t plen) { device_t dev; int id; @@ -831,6 +856,9 @@ vtcon_ctrl_process_event(struct vtcon_so break; case VIRTIO_CONSOLE_PORT_NAME: + if (payload != NULL && plen > 0) + vtcon_ctrl_port_name_event(sc, id, + (const char *)payload, plen); break; } } @@ -842,6 +870,9 @@ vtcon_ctrl_task_cb(void *xsc, int pendin struct virtqueue *vq; struct virtio_console_control *control; int detached; + uint32_t len; + size_t plen; + void *payload; sc = xsc; vq = sc->vtcon_ctrl_rxvq; @@ -849,12 +880,20 @@ vtcon_ctrl_task_cb(void *xsc, int pendin VTCON_LOCK(sc); while ((detached = (sc->vtcon_flags & VTCON_FLAG_DETACHED)) == 0) { - control = virtqueue_dequeue(vq, NULL); + control = virtqueue_dequeue(vq, &len); + payload = NULL; + plen = 0; + if (control == NULL) break; + if (len > sizeof(control)) { + payload = (void *)(control + 1); + plen = len - sizeof(control); + } + VTCON_UNLOCK(sc); - vtcon_ctrl_process_event(sc, control); + vtcon_ctrl_process_event(sc, control, payload, plen); VTCON_LOCK(sc); vtcon_ctrl_event_requeue(sc, control); } From owner-svn-src-head@freebsd.org Sat Sep 17 16:47:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F4BBDEA16; Sat, 17 Sep 2016 16:47:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2543A1632; Sat, 17 Sep 2016 16:47:36 +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 u8HGlZd2061534; Sat, 17 Sep 2016 16:47:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HGlYEf061527; Sat, 17 Sep 2016 16:47:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609171647.u8HGlYEf061527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Sep 2016 16:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305902 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 16:47:36 -0000 Author: kib Date: Sat Sep 17 16:47:34 2016 New Revision: 305902 URL: https://svnweb.freebsd.org/changeset/base/305902 Log: Reduce size of ufs inode. Remove redunand i_dev and i_fs pointers, which are available as ip->i_ump->um_dev and ip->i_ump->um_fs, and reorder members by size to reduce padding. To compensate added derefences, the most often i_ump access to differentiate between UFS1 and UFS2 dinode layout is removed, by addition of the new i_flag IN_UFS2. Overall, this actually reduces the amount of memory dereferences. On 64bit machine, original struct inode size is 176, reduced to 152 bytes with the change. Tested by: pho (previous version) Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_rawread.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_acl.c head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufs_gjournal.c head/sys/ufs/ufs/ufs_inode.c head/sys/ufs/ufs/ufs_quota.c head/sys/ufs/ufs/ufs_vnops.c head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Sep 17 16:47:34 2016 (r305902) @@ -163,13 +163,13 @@ ffs_alloc(ip, lbn, bpref, size, flags, c #endif *bnp = 0; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; mtx_assert(UFS_MTX(ump), MA_OWNED); #ifdef INVARIANTS if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { printf("dev = %s, bsize = %ld, size = %d, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_bsize, size, + devtoname(ump->um_dev), (long)fs->fs_bsize, size, fs->fs_fsmnt); panic("ffs_alloc: bad size"); } @@ -260,9 +260,9 @@ ffs_realloccg(ip, lbprev, bprev, bpref, int64_t delta; vp = ITOV(ip); - fs = ip->i_fs; + ump = ITOUMP(ip); + fs = ump->um_fs; bp = NULL; - ump = ip->i_ump; gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; mtx_assert(UFS_MTX(ump), MA_OWNED); @@ -273,7 +273,7 @@ ffs_realloccg(ip, lbprev, bprev, bpref, (u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) { printf( "dev = %s, bsize = %ld, osize = %d, nsize = %d, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_bsize, osize, + devtoname(ump->um_dev), (long)fs->fs_bsize, osize, nsize, fs->fs_fsmnt); panic("ffs_realloccg: bad size"); } @@ -288,7 +288,7 @@ retry: } if (bprev == 0) { printf("dev = %s, bsize = %ld, bprev = %jd, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_bsize, (intmax_t)bprev, + devtoname(ump->um_dev), (long)fs->fs_bsize, (intmax_t)bprev, fs->fs_fsmnt); panic("ffs_realloccg: bad bprev"); } @@ -383,7 +383,7 @@ retry: break; default: printf("dev = %s, optim = %ld, fs = %s\n", - devtoname(ip->i_dev), (long)fs->fs_optim, fs->fs_fsmnt); + devtoname(ump->um_dev), (long)fs->fs_optim, fs->fs_fsmnt); panic("ffs_realloccg: bad optim"); /* NOTREACHED */ } @@ -391,7 +391,7 @@ retry: if (bno > 0) { bp->b_blkno = fsbtodb(fs, bno); if (!DOINGSOFTDEP(vp)) - ffs_blkfree(ump, fs, ip->i_devvp, bprev, (long)osize, + ffs_blkfree(ump, fs, ump->um_devvp, bprev, (long)osize, ip->i_number, vp->v_type, NULL); delta = btodb(nsize - osize); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); @@ -490,7 +490,7 @@ ffs_reallocblks(ap) * These devices are flash and therefore work less well with this * optimization. Also skip if reallocblks has been disabled globally. */ - ump = VTOI(ap->a_vp)->i_ump; + ump = ap->a_vp->v_mount->mnt_data; if (ump->um_candelete || doreallocblks == 0) return (ENOSPC); @@ -529,8 +529,8 @@ ffs_reallocblks_ufs1(ap) vp = ap->a_vp; ip = VTOI(vp); - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; /* * If we are not tracking block clusters or if we have less than 4% * free blocks left, then do not attempt to cluster. Running with @@ -727,7 +727,7 @@ ffs_reallocblks_ufs1(ap) #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { if (!DOINGSOFTDEP(vp)) - ffs_blkfree(ump, fs, ip->i_devvp, + ffs_blkfree(ump, fs, ump->um_devvp, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize, ip->i_number, vp->v_type, NULL); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); @@ -778,8 +778,8 @@ ffs_reallocblks_ufs2(ap) vp = ap->a_vp; ip = VTOI(vp); - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; /* * If we are not tracking block clusters or if we have less than 4% * free blocks left, then do not attempt to cluster. Running with @@ -975,7 +975,7 @@ ffs_reallocblks_ufs2(ap) #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { if (!DOINGSOFTDEP(vp)) - ffs_blkfree(ump, fs, ip->i_devvp, + ffs_blkfree(ump, fs, ump->um_devvp, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize, ip->i_number, vp->v_type, NULL); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); @@ -1040,8 +1040,8 @@ ffs_valloc(pvp, mode, cred, vpp) *vpp = NULL; pip = VTOI(pvp); - fs = pip->i_fs; - ump = pip->i_ump; + ump = ITOUMP(pip); + fs = ump->um_fs; UFS_LOCK(ump); reclaimed = 0; @@ -1114,10 +1114,12 @@ dup_alloc: ip->i_flag = 0; (*vpp)->v_vflag = 0; (*vpp)->v_type = VNON; - if (fs->fs_magic == FS_UFS2_MAGIC) + if (fs->fs_magic == FS_UFS2_MAGIC) { (*vpp)->v_op = &ffs_vnodeops2; - else + ip->i_flag |= IN_UFS2; + } else { (*vpp)->v_op = &ffs_vnodeops1; + } return (0); noinodes: if (reclaimed == 0) { @@ -1158,8 +1160,8 @@ ffs_dirpref(pip) u_int mincg, minndir; u_int maxcontigdirs; - mtx_assert(UFS_MTX(pip->i_ump), MA_OWNED); - fs = pip->i_fs; + mtx_assert(UFS_MTX(ITOUMP(pip)), MA_OWNED); + fs = ITOFS(pip); avgifree = fs->fs_cstotal.cs_nifree / fs->fs_ncg; avgbfree = fs->fs_cstotal.cs_nbfree / fs->fs_ncg; @@ -1307,8 +1309,8 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) ufs2_daddr_t pref; KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap")); - mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); - fs = ip->i_fs; + mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); + fs = ITOFS(ip); /* * Allocation of indirect blocks is indicated by passing negative * values in indx: -1 for single indirect, -2 for double indirect, @@ -1412,8 +1414,8 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) ufs2_daddr_t pref; KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap")); - mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); - fs = ip->i_fs; + mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); + fs = ITOFS(ip); /* * Allocation of indirect blocks is indicated by passing negative * values in indx: -1 for single indirect, -2 for double indirect, @@ -1526,12 +1528,12 @@ ffs_hashalloc(ip, cg, pref, size, rsize, ufs2_daddr_t result; u_int i, icg = cg; - mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); + mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED); #ifdef INVARIANTS if (ITOV(ip)->v_mount->mnt_kern_flag & MNTK_SUSPENDED) panic("ffs_hashalloc: allocation on suspended filesystem"); #endif - fs = ip->i_fs; + fs = ITOFS(ip); /* * 1: preferred cylinder group */ @@ -1589,8 +1591,8 @@ ffs_fragextend(ip, cg, bprev, osize, nsi int i, error; u_int8_t *blksfree; - ump = ip->i_ump; - fs = ip->i_fs; + ump = ITOUMP(ip); + fs = ump->um_fs; if (fs->fs_cs(fs, cg).cs_nffree < numfrags(fs, nsize - osize)) return (0); frags = numfrags(fs, nsize); @@ -1600,8 +1602,8 @@ ffs_fragextend(ip, cg, bprev, osize, nsi return (0); } UFS_UNLOCK(ump); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, NOCRED, &bp); if (error) goto fail; cgp = (struct cg *)bp->b_data; @@ -1673,13 +1675,13 @@ ffs_alloccg(ip, cg, bpref, size, rsize) int i, allocsiz, error, frags; u_int8_t *blksfree; - ump = ip->i_ump; - fs = ip->i_fs; + ump = ITOUMP(ip); + fs = ump->um_fs; if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize) return (0); UFS_UNLOCK(ump); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, NOCRED, &bp); if (error) goto fail; cgp = (struct cg *)bp->b_data; @@ -1775,8 +1777,8 @@ ffs_alloccgblk(ip, bp, bpref, size) u_int8_t *blksfree; int i, cgbpref; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; mtx_assert(UFS_MTX(ump), MA_OWNED); cgp = (struct cg *)bp->b_data; blksfree = cg_blksfree(cgp); @@ -1861,12 +1863,12 @@ ffs_clusteralloc(ip, cg, bpref, len) int32_t *lp; u_int8_t *blksfree; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; if (fs->fs_maxcluster[cg] < len) return (0); UFS_UNLOCK(ump); - if (bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, + if (bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NOCRED, &bp)) goto fail_lock; cgp = (struct cg *)bp->b_data; @@ -1965,8 +1967,8 @@ getinobuf(struct inode *ip, u_int cg, u_ { struct fs *fs; - fs = ip->i_fs; - return (getblk(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, + fs = ITOFS(ip); + return (getblk(ITODEVVP(ip), fsbtodb(fs, ino_to_fsba(fs, cg * fs->fs_ipg + cginoblk)), (int)fs->fs_bsize, 0, 0, gbflags)); } @@ -1997,13 +1999,13 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu int error, start, len, i; u_int32_t old_initediblk; - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; check_nifree: if (fs->fs_cs(fs, cg).cs_nifree == 0) return (0); UFS_UNLOCK(ump); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NOCRED, &bp); if (error) { brelse(bp); @@ -2101,7 +2103,7 @@ gotit: * to it, then leave it unchanged as the other thread * has already set it correctly. */ - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), + error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NOCRED, &bp); UFS_LOCK(ump); ACTIVECLEAR(fs, cg); @@ -2166,7 +2168,8 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size cg = dtog(fs, bno); if (devvp->v_type == VREG) { /* devvp is a snapshot */ - dev = VTOI(devvp)->i_devvp->v_rdev; + MPASS(devvp->v_mount->mnt_data == ump); + dev = ump->um_devvp->v_rdev; cgblkno = fragstoblks(fs, cgtod(fs, cg)); } else { /* devvp is a normal disk device */ @@ -2396,7 +2399,7 @@ ffs_checkblk(ip, bno, size) int i, error, frags, free; u_int8_t *blksfree; - fs = ip->i_fs; + fs = ITOFS(ip); if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { printf("bsize = %ld, size = %ld, fs = %s\n", (long)fs->fs_bsize, size, fs->fs_fsmnt); @@ -2404,7 +2407,7 @@ ffs_checkblk(ip, bno, size) } if ((u_int)bno >= fs->fs_size) panic("ffs_checkblk: bad block %jd", (intmax_t)bno); - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, dtog(fs, bno))), + error = bread(ITODEVVP(ip), fsbtodb(fs, cgtod(fs, dtog(fs, bno))), (int)fs->fs_cgsize, NOCRED, &bp); if (error) panic("ffs_checkblk: cg bread failed"); @@ -2438,6 +2441,7 @@ ffs_vfree(pvp, ino, mode) ino_t ino; int mode; { + struct ufsmount *ump; struct inode *ip; if (DOINGSOFTDEP(pvp)) { @@ -2445,8 +2449,8 @@ ffs_vfree(pvp, ino, mode) return (0); } ip = VTOI(pvp); - return (ffs_freefile(ip->i_ump, ip->i_fs, ip->i_devvp, ino, mode, - NULL)); + ump = VFSTOUFS(pvp->v_mount); + return (ffs_freefile(ump, ump->um_fs, ump->um_devvp, ino, mode, NULL)); } /* @@ -2473,7 +2477,8 @@ ffs_freefile(ump, fs, devvp, ino, mode, cg = ino_to_cg(fs, ino); if (devvp->v_type == VREG) { /* devvp is a snapshot */ - dev = VTOI(devvp)->i_devvp->v_rdev; + MPASS(devvp->v_mount->mnt_data == ump); + dev = ump->um_devvp->v_rdev; cgbno = fragstoblks(fs, cgtod(fs, cg)); } else { /* devvp is a normal disk device */ @@ -3056,7 +3061,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; AUDIT_ARG_VNODE1(vp); ip = VTOI(vp); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) error = copyin((void *)(intptr_t)cmd.size, ip->i_din1, sizeof(struct ufs1_dinode)); else @@ -3076,7 +3081,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) error = EPERM; break; } - if (VTOI(vp)->i_ump != ump) { + if (ITOUMP(VTOI(vp)) != ump) { error = EINVAL; break; } @@ -3173,11 +3178,11 @@ buffered_write(fp, uio, active_cred, fla return (EINVAL); } ip = VTOI(vp); - if (ip->i_devvp != devvp) { + if (ITODEVVP(ip) != devvp) { vput(vp); return (EINVAL); } - fs = ip->i_fs; + fs = ITOFS(ip); vput(vp); foffset_lock_uio(fp, uio, flags); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_balloc.c Sat Sep 17 16:47:34 2016 (r305902) @@ -111,8 +111,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t ip = VTOI(vp); dp = ip->i_din1; - fs = ip->i_fs; - ump = ip->i_ump; + fs = ITOFS(ip); + ump = ITOUMP(ip); lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; reclaimed = 0; @@ -548,7 +548,7 @@ fail: } lbns_remfree++; #endif - ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, + ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } return (error); @@ -584,8 +584,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t ip = VTOI(vp); dp = ip->i_din2; - fs = ip->i_fs; - ump = ip->i_ump; + fs = ITOFS(ip); + ump = ITOUMP(ip); lbn = lblkno(fs, startoffset); size = blkoff(fs, startoffset) + size; reclaimed = 0; @@ -1141,7 +1141,7 @@ fail: } lbns_remfree++; #endif - ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, + ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } return (error); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_inode.c Sat Sep 17 16:47:34 2016 (r305902) @@ -92,8 +92,8 @@ ffs_update(vp, waitfor) if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0) return (0); ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED); - fs = ip->i_fs; - if (fs->fs_ronly && ip->i_ump->um_fsckpid == 0) + fs = ITOFS(ip); + if (fs->fs_ronly && ITOUMP(ip)->um_fsckpid == 0) return (0); /* * If we are updating a snapshot and another process is currently @@ -110,7 +110,7 @@ ffs_update(vp, waitfor) if (IS_SNAPSHOT(ip)) flags = GB_LOCK_NOWAIT; loop: - error = breadn_flags(ip->i_devvp, + error = breadn_flags(ITODEVVP(ip), fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int) fs->fs_bsize, 0, 0, 0, NOCRED, flags, &bp); if (error != 0) { @@ -143,7 +143,7 @@ loop: softdep_update_inodeblock(ip, bp, waitfor); else if (ip->i_effnlink != ip->i_nlink) panic("ffs_update: bad link cnt"); - if (ip->i_ump->um_fstype == UFS1) { + if (I_IS_UFS1(ip)) { *((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1; /* XXX: FIX? The entropy here is desirable, but the harvesting may be expensive */ @@ -197,8 +197,8 @@ ffs_truncate(vp, length, flags, cred) off_t osize; ip = VTOI(vp); - fs = ip->i_fs; - ump = ip->i_ump; + ump = VFSTOUFS(vp->v_mount); + fs = ump->um_fs; bo = &vp->v_bufobj; ASSERT_VOP_LOCKED(vp, "ffs_truncate"); @@ -270,7 +270,7 @@ ffs_truncate(vp, length, flags, cred) for (i = 0; i < NXADDR; i++) { if (oldblks[i] == 0) continue; - ffs_blkfree(ump, fs, ip->i_devvp, oldblks[i], + ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i], sblksize(fs, osize, i), ip->i_number, vp->v_type, NULL); } @@ -346,7 +346,7 @@ ffs_truncate(vp, length, flags, cred) if (error) return (error); indiroff = (lbn - NDADDR) % NINDIR(fs); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) blkno = ((ufs1_daddr_t *)(bp->b_data))[indiroff]; else blkno = ((ufs2_daddr_t *)(bp->b_data))[indiroff]; @@ -518,7 +518,7 @@ ffs_truncate(vp, length, flags, cred) blocksreleased += count; if (lastiblock[level] < 0) { DIP_SET(ip, i_ib[level], 0); - ffs_blkfree(ump, fs, ip->i_devvp, bn, + ffs_blkfree(ump, fs, ump->um_devvp, bn, fs->fs_bsize, ip->i_number, vp->v_type, NULL); blocksreleased += nblocks; @@ -539,7 +539,7 @@ ffs_truncate(vp, length, flags, cred) continue; DIP_SET(ip, i_db[i], 0); bsize = blksize(fs, ip, i); - ffs_blkfree(ump, fs, ip->i_devvp, bn, bsize, ip->i_number, + ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number, vp->v_type, NULL); blocksreleased += btodb(bsize); } @@ -571,7 +571,7 @@ ffs_truncate(vp, length, flags, cred) * required for the storage we're keeping. */ bn += numfrags(fs, newspace); - ffs_blkfree(ump, fs, ip->i_devvp, bn, + ffs_blkfree(ump, fs, ump->um_devvp, bn, oldspace - newspace, ip->i_number, vp->v_type, NULL); blocksreleased += btodb(oldspace - newspace); } @@ -630,7 +630,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev ufs2_daddr_t *countp; { struct buf *bp; - struct fs *fs = ip->i_fs; + struct fs *fs; struct vnode *vp; caddr_t copy = NULL; int i, nblocks, error = 0, allerror = 0; @@ -638,7 +638,9 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev ufs2_daddr_t blkcount, factor, blocksreleased = 0; ufs1_daddr_t *bap1 = NULL; ufs2_daddr_t *bap2 = NULL; -# define BAP(ip, i) (((ip)->i_ump->um_fstype == UFS1) ? bap1[i] : bap2[i]) +#define BAP(ip, i) (I_IS_UFS1(ip) ? bap1[i] : bap2[i]) + + fs = ITOFS(ip); /* * Calculate index in current block of last @@ -686,7 +688,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev return (error); } - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) bap1 = (ufs1_daddr_t *)bp->b_data; else bap2 = (ufs2_daddr_t *)bp->b_data; @@ -694,7 +696,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev copy = malloc(fs->fs_bsize, M_TEMP, M_WAITOK); bcopy((caddr_t)bp->b_data, copy, (u_int)fs->fs_bsize); for (i = last + 1; i < NINDIR(fs); i++) - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) bap1[i] = 0; else bap2[i] = 0; @@ -705,7 +707,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev if (error) allerror = error; } - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) bap1 = (ufs1_daddr_t *)copy; else bap2 = (ufs2_daddr_t *)copy; @@ -725,7 +727,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev allerror = error; blocksreleased += blkcount; } - ffs_blkfree(ip->i_ump, fs, ip->i_devvp, nb, fs->fs_bsize, + ffs_blkfree(ITOUMP(ip), fs, ITODEVVP(ip), nb, fs->fs_bsize, ip->i_number, vp->v_type, NULL); blocksreleased += nblocks; } @@ -759,6 +761,6 @@ int ffs_rdonly(struct inode *ip) { - return (ip->i_ump->um_fs->fs_ronly != 0); + return (ITOFS(ip)->fs_ronly != 0); } Modified: head/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- head/sys/ufs/ffs/ffs_rawread.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_rawread.c Sat Sep 17 16:47:34 2016 (r305902) @@ -204,7 +204,7 @@ ffs_rawread_readahead(struct vnode *vp, bsize = vp->v_mount->mnt_stat.f_iosize; ip = VTOI(vp); - dp = ip->i_devvp; + dp = ITODEVVP(ip); iolen = ((vm_offset_t) udata) & PAGE_MASK; bp->b_bcount = len; @@ -440,7 +440,7 @@ ffs_rawread(struct vnode *vp, /* Only handle sector aligned reads */ ip = VTOI(vp); - secsize = ip->i_devvp->v_bufobj.bo_bsize; + secsize = ITODEVVP(ip)->v_bufobj.bo_bsize; if ((uio->uio_offset & (secsize - 1)) == 0 && (uio->uio_resid & (secsize - 1)) == 0) { @@ -460,7 +460,7 @@ ffs_rawread(struct vnode *vp, } partialbytes = ((unsigned int) ip->i_size) % - ip->i_fs->fs_bsize; + ITOFS(ip)->fs_bsize; blockbytes = (int) filebytes - partialbytes; if (blockbytes > 0) { skipbytes = uio->uio_resid - Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_snapshot.c Sat Sep 17 16:47:34 2016 (r305902) @@ -302,7 +302,7 @@ restart: vp = nd.ni_vp; vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); - devvp = ip->i_devvp; + devvp = ITODEVVP(ip); /* * Allocate and copy the last block contents so as to be able * to set size to that of the filesystem. @@ -587,7 +587,7 @@ loop: } } snaplistsize += 1; - if (xp->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1, BLK_NOCOPY, 1); else @@ -620,7 +620,7 @@ loop: goto out1; } xp = VTOI(xvp); - if (xp->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1, BLK_NOCOPY, 0); else @@ -706,7 +706,7 @@ out1: TAILQ_FOREACH(xp, &sn->sn_head, i_nextsnap) { if (xp == ip) break; - if (xp->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, fs, snapacct_ufs1, BLK_SNAP, 0); else @@ -735,7 +735,7 @@ out1: * blocks marked as used in the snapshot bitmaps. Also, collect * the list of allocated blocks in i_snapblklist. */ - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) error = expunge_ufs1(vp, ip, copy_fs, mapacct_ufs1, BLK_SNAP, 0); else @@ -887,9 +887,9 @@ cgaccount(cg, vp, nbp, passno) int error, len, loc, indiroff; ip = VTOI(vp); - fs = ip->i_fs; - error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, KERNCRED, &bp); + fs = ITOFS(ip); + error = bread(ITODEVVP(ip), fsbtodb(fs, cgtod(fs, cg)), + (int)fs->fs_cgsize, KERNCRED, &bp); if (error) { brelse(bp); return (error); @@ -899,7 +899,7 @@ cgaccount(cg, vp, nbp, passno) brelse(bp); return (EIO); } - UFS_LOCK(ip->i_ump); + UFS_LOCK(ITOUMP(ip)); ACTIVESET(fs, cg); /* * Recomputation of summary information might not have been performed @@ -908,7 +908,7 @@ cgaccount(cg, vp, nbp, passno) * fsck is slightly more consistent. */ fs->fs_cs(fs, cg) = cgp->cg_cs; - UFS_UNLOCK(ip->i_ump); + UFS_UNLOCK(ITOUMP(ip)); bcopy(bp->b_data, nbp->b_data, fs->fs_cgsize); if (fs->fs_cgsize < fs->fs_bsize) bzero(&nbp->b_data[fs->fs_cgsize], @@ -952,7 +952,7 @@ cgaccount(cg, vp, nbp, passno) } indiroff = 0; } - if (ip->i_ump->um_fstype == UFS1) { + if (I_IS_UFS1(ip)) { if (ffs_isblock(fs, cg_blksfree(cgp), loc)) ((ufs1_daddr_t *)(ibp->b_data))[indiroff] = BLK_NOCOPY; @@ -1257,7 +1257,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); - ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, + ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, vp->v_type, NULL); } return (0); @@ -1541,7 +1541,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); - ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, + ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, vp->v_type, NULL); } return (0); @@ -1565,7 +1565,7 @@ ffs_snapgone(ip) * Find snapshot in incore list. */ xp = NULL; - sn = ip->i_devvp->v_rdev->si_snapdata; + sn = ITODEVVP(ip)->v_rdev->si_snapdata; if (sn != NULL) TAILQ_FOREACH(xp, &sn->sn_head, i_nextsnap) if (xp == ip) @@ -1578,8 +1578,8 @@ ffs_snapgone(ip) /* * Delete snapshot inode from superblock. Keep list dense. */ - fs = ip->i_fs; - ump = ip->i_ump; + ump = ITOUMP(ip); + fs = ump->um_fs; UFS_LOCK(ump); for (snaploc = 0; snaploc < FSMAXSNAP; snaploc++) if (fs->fs_snapinum[snaploc] == ip->i_number) @@ -1611,8 +1611,8 @@ ffs_snapremove(vp) struct snapdata *sn; ip = VTOI(vp); - fs = ip->i_fs; - devvp = ip->i_devvp; + fs = ITOFS(ip); + devvp = ITODEVVP(ip); /* * If active, delete from incore list (this snapshot may * already have been in the process of being deleted, so @@ -1646,7 +1646,7 @@ ffs_snapremove(vp) if (dblk == BLK_NOCOPY || dblk == BLK_SNAP) DIP_SET(ip, i_db[blkno], 0); else if ((dblk == blkstofrags(fs, blkno) && - ffs_snapblkfree(fs, ip->i_devvp, dblk, fs->fs_bsize, + ffs_snapblkfree(fs, ITODEVVP(ip), dblk, fs->fs_bsize, ip->i_number, vp->v_type, NULL))) { DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - btodb(fs->fs_bsize)); @@ -1664,14 +1664,14 @@ ffs_snapremove(vp) else last = fs->fs_size - blkno; for (loc = 0; loc < last; loc++) { - if (ip->i_ump->um_fstype == UFS1) { + if (I_IS_UFS1(ip)) { dblk = ((ufs1_daddr_t *)(ibp->b_data))[loc]; if (dblk == 0) continue; if (dblk == BLK_NOCOPY || dblk == BLK_SNAP) ((ufs1_daddr_t *)(ibp->b_data))[loc]= 0; else if ((dblk == blkstofrags(fs, blkno) && - ffs_snapblkfree(fs, ip->i_devvp, dblk, + ffs_snapblkfree(fs, ITODEVVP(ip), dblk, fs->fs_bsize, ip->i_number, vp->v_type, NULL))) { ip->i_din1->di_blocks -= @@ -1686,7 +1686,7 @@ ffs_snapremove(vp) if (dblk == BLK_NOCOPY || dblk == BLK_SNAP) ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; else if ((dblk == blkstofrags(fs, blkno) && - ffs_snapblkfree(fs, ip->i_devvp, dblk, + ffs_snapblkfree(fs, ITODEVVP(ip), dblk, fs->fs_bsize, ip->i_number, vp->v_type, NULL))) { ip->i_din2->di_blocks -= btodb(fs->fs_bsize); ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; @@ -1781,7 +1781,7 @@ retry: if (error) break; indiroff = (lbn - NDADDR) % NINDIR(fs); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) blkno=((ufs1_daddr_t *)(ibp->b_data))[indiroff]; else blkno=((ufs2_daddr_t *)(ibp->b_data))[indiroff]; @@ -1806,7 +1806,7 @@ retry: if (lbn < NDADDR) { DIP_SET(ip, i_db[lbn], BLK_NOCOPY); ip->i_flag |= IN_CHANGE | IN_UPDATE; - } else if (ip->i_ump->um_fstype == UFS1) { + } else if (I_IS_UFS1(ip)) { ((ufs1_daddr_t *)(ibp->b_data))[indiroff] = BLK_NOCOPY; bdwrite(ibp); @@ -1854,7 +1854,7 @@ retry: } if (lbn < NDADDR) { DIP_SET(ip, i_db[lbn], bno); - } else if (ip->i_ump->um_fstype == UFS1) { + } else if (I_IS_UFS1(ip)) { ((ufs1_daddr_t *)(ibp->b_data))[indiroff] = bno; bdwrite(ibp); } else { @@ -2136,7 +2136,7 @@ ffs_bp_snapblk(devvp, bp) sn = devvp->v_rdev->si_snapdata; if (sn == NULL || TAILQ_FIRST(&sn->sn_head) == NULL) return (0); - fs = TAILQ_FIRST(&sn->sn_head)->i_fs; + fs = ITOFS(TAILQ_FIRST(&sn->sn_head)); lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno)); snapblklist = sn->sn_blklist; upper = sn->sn_listsize - 1; @@ -2263,7 +2263,7 @@ ffs_copyonwrite(devvp, bp) return (0); /* No snapshot */ } ip = TAILQ_FIRST(&sn->sn_head); - fs = ip->i_fs; + fs = ITOFS(ip); lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno)); snapblklist = sn->sn_blklist; upper = sn->sn_listsize - 1; @@ -2337,7 +2337,7 @@ ffs_copyonwrite(devvp, bp) if (error) break; indiroff = (lbn - NDADDR) % NINDIR(fs); - if (ip->i_ump->um_fstype == UFS1) + if (I_IS_UFS1(ip)) blkno=((ufs1_daddr_t *)(ibp->b_data))[indiroff]; else blkno=((ufs2_daddr_t *)(ibp->b_data))[indiroff]; @@ -2493,15 +2493,19 @@ readblock(vp, bp, lbn) { struct inode *ip = VTOI(vp); struct bio *bip; + struct fs *fs; + + ip = VTOI(vp); + fs = ITOFS(ip); bip = g_alloc_bio(); bip->bio_cmd = BIO_READ; - bip->bio_offset = dbtob(fsbtodb(ip->i_fs, blkstofrags(ip->i_fs, lbn))); + bip->bio_offset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn))); bip->bio_data = bp->b_data; bip->bio_length = bp->b_bcount; bip->bio_done = NULL; - g_io_request(bip, ip->i_devvp->v_bufobj.bo_private); + g_io_request(bip, ITODEVVP(ip)->v_bufobj.bo_private); bp->b_error = biowait(bip, "snaprdb"); g_destroy_bio(bip); return (bp->b_error); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Sep 17 16:45:57 2016 (r305901) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Sep 17 16:47:34 2016 (r305902) @@ -3998,7 +3998,7 @@ newjmvref(dp, ino, oldoff, newoff) struct jmvref *jmvref; jmvref = malloc(sizeof(*jmvref), M_JMVREF, M_SOFTDEP_FLAGS); - workitem_alloc(&jmvref->jm_list, D_JMVREF, UFSTOVFS(dp->i_ump)); + workitem_alloc(&jmvref->jm_list, D_JMVREF, ITOVFS(dp)); jmvref->jm_list.wk_state = ATTACHED | DEPCOMPLETE; jmvref->jm_parent = dp->i_number; jmvref->jm_ino = ino; @@ -4025,7 +4025,7 @@ newjremref(struct dirrem *dirrem, struct struct jremref *jremref; jremref = malloc(sizeof(*jremref), M_JREMREF, M_SOFTDEP_FLAGS); - workitem_alloc(&jremref->jr_list, D_JREMREF, UFSTOVFS(dp->i_ump)); + workitem_alloc(&jremref->jr_list, D_JREMREF, ITOVFS(dp)); jremref->jr_state = ATTACHED; newinoref(&jremref->jr_ref, ip->i_number, dp->i_number, diroff, nlink, ip->i_mode); @@ -4061,7 +4061,7 @@ newjaddref(struct inode *dp, ino_t ino, struct jaddref *jaddref; jaddref = malloc(sizeof(*jaddref), M_JADDREF, M_SOFTDEP_FLAGS); - workitem_alloc(&jaddref->ja_list, D_JADDREF, UFSTOVFS(dp->i_ump)); + workitem_alloc(&jaddref->ja_list, D_JADDREF, ITOVFS(dp)); jaddref->ja_state = ATTACHED; jaddref->ja_mkdir = NULL; newinoref(&jaddref->ja_ref, ino, dp->i_number, diroff, nlink, mode); @@ -4649,7 +4649,7 @@ inodedep_lookup_ip(ip) KASSERT(ip->i_nlink >= ip->i_effnlink, ("inodedep_lookup_ip: bad delta")); - (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC, + (void) inodedep_lookup(ITOVFS(ip), ip->i_number, DEPALLOC, &inodedep); inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked")); @@ -4672,12 +4672,12 @@ softdep_setup_create(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_create called on non-softdep filesystem")); KASSERT(ip->i_nlink == 1, ("softdep_setup_create: Invalid link count.")); dvp = ITOV(dp); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4686,7 +4686,7 @@ softdep_setup_create(dp, ip) ("softdep_setup_create: No addref structure present.")); } softdep_prelink(dvp, NULL); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4704,7 +4704,7 @@ softdep_setup_dotdot_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_dotdot_link called on non-softdep filesystem")); dvp = ITOV(dp); jaddref = NULL; @@ -4715,13 +4715,13 @@ softdep_setup_dotdot_link(dp, ip) if (DOINGSUJ(dvp)) jaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET, dp->i_effnlink - 1, dp->i_mode); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(dp); if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4739,20 +4739,20 @@ softdep_setup_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_link called on non-softdep filesystem")); dvp = ITOV(dp); jaddref = NULL; if (DOINGSUJ(dvp)) jaddref = newjaddref(dp, ip->i_number, 0, ip->i_effnlink - 1, ip->i_mode); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(ip); if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4772,7 +4772,7 @@ softdep_setup_mkdir(dp, ip) struct jaddref *jaddref; struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_mkdir called on non-softdep filesystem")); dvp = ITOV(dp); dotaddref = dotdotaddref = NULL; @@ -4784,7 +4784,7 @@ softdep_setup_mkdir(dp, ip) dp->i_effnlink - 1, dp->i_mode); dotdotaddref->ja_state |= MKDIR_PARENT; } - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4802,7 +4802,7 @@ softdep_setup_mkdir(dp, ip) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &dotdotaddref->ja_ref, if_deps); softdep_prelink(ITOV(dp), NULL); - FREE_LOCK(dp->i_ump); + FREE_LOCK(ITOUMP(dp)); } /* @@ -4816,14 +4816,14 @@ softdep_setup_rmdir(dp, ip) { struct vnode *dvp; - KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_rmdir called on non-softdep filesystem")); dvp = ITOV(dp); - ACQUIRE_LOCK(dp->i_ump); + ACQUIRE_LOCK(ITOUMP(dp)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Sep 17 18:14:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93281BDE1DC; Sat, 17 Sep 2016 18:14:32 +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 mx1.freebsd.org (Postfix) with ESMTPS id 573D13A5; Sat, 17 Sep 2016 18:14:32 +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 u8HIEV0m095615; Sat, 17 Sep 2016 18:14:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HIEVG6095612; Sat, 17 Sep 2016 18:14:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609171814.u8HIEVG6095612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 17 Sep 2016 18:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305903 - in head: lib/libprocstat sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 18:14:32 -0000 Author: kib Date: Sat Sep 17 18:14:31 2016 New Revision: 305903 URL: https://svnweb.freebsd.org/changeset/base/305903 Log: Fix libprocstat build after r305902. - Use _Bool to not require userspace to include stdbool.h. - Make extattr.h usable without vnode_if.h. - Follow i_ump to get cdev pointer. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libprocstat/common_kvm.c head/sys/ufs/ufs/extattr.h head/sys/ufs/ufs/inode.h Modified: head/lib/libprocstat/common_kvm.c ============================================================================== --- head/lib/libprocstat/common_kvm.c Sat Sep 17 16:47:34 2016 (r305902) +++ head/lib/libprocstat/common_kvm.c Sat Sep 17 18:14:31 2016 (r305903) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #undef _KERNEL @@ -88,17 +90,22 @@ int ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) { struct inode inode; + struct ufsmount um; if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &inode, sizeof(inode))) { warnx("can't read inode at %p", (void *)VTOI(vp)); return (1); } + if (!kvm_read_all(kd, (unsigned long)inode.i_ump, &um, sizeof(um))) { + warnx("can't read ufsmount at %p", (void *)inode.i_ump); + return (1); + } /* * The st_dev from stat(2) is a dev_t. These kernel structures * contain cdev pointers. We need to convert to dev_t to make * comparisons */ - vn->vn_fsid = dev2udev(kd, inode.i_dev); + vn->vn_fsid = dev2udev(kd, um.um_dev); vn->vn_fileid = inode.i_number; vn->vn_mode = (mode_t)inode.i_mode; vn->vn_size = inode.i_size; Modified: head/sys/ufs/ufs/extattr.h ============================================================================== --- head/sys/ufs/ufs/extattr.h Sat Sep 17 16:47:34 2016 (r305902) +++ head/sys/ufs/ufs/extattr.h Sat Sep 17 18:14:31 2016 (r305903) @@ -133,6 +133,10 @@ struct ufs_extattr_per_mount { int uepm_flags; }; +struct vop_getextattr_args; +struct vop_deleteextattr_args; +struct vop_setextattr_args; + void ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm); void ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm); int ufs_extattr_start(struct mount *mp, struct thread *td); Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Sat Sep 17 16:47:34 2016 (r305902) +++ head/sys/ufs/ufs/inode.h Sat Sep 17 18:14:31 2016 (r305903) @@ -145,14 +145,14 @@ struct inode { #define ITOFS(ip) (ITOUMP(ip)->um_fs) #define ITOVFS(ip) ((ip)->i_vnode->v_mount) -static inline bool +static inline _Bool I_IS_UFS1(const struct inode *ip) { return ((ip->i_flag & IN_UFS2) == 0); } -static inline bool +static inline _Bool I_IS_UFS2(const struct inode *ip) { From owner-svn-src-head@freebsd.org Sat Sep 17 21:49:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77CE3BDEA23; Sat, 17 Sep 2016 21:49:12 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4741DDDF; Sat, 17 Sep 2016 21:49:12 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HLnBOO074687; Sat, 17 Sep 2016 21:49:11 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HLnBiH074686; Sat, 17 Sep 2016 21:49:11 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201609172149.u8HLnBiH074686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Sat, 17 Sep 2016 21:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305905 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 21:49:12 -0000 Author: rene (doc,ports committer) Date: Sat Sep 17 21:49:11 2016 New Revision: 305905 URL: https://svnweb.freebsd.org/changeset/base/305905 Log: bapt stepped down from portmgr Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sat Sep 17 19:38:56 2016 (r305904) +++ head/share/misc/organization.dot Sat Sep 17 21:49:11 2016 (r305905) @@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretar doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\nmat, swills"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bdrewery,\nmat, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] From owner-svn-src-head@freebsd.org Sat Sep 17 22:13:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF6CBDEFA3; Sat, 17 Sep 2016 22:13:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 54364ABF; Sat, 17 Sep 2016 22:13:04 +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 u8HMD3pR085805; Sat, 17 Sep 2016 22:13:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HMD3vs085800; Sat, 17 Sep 2016 22:13:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609172213.u8HMD3vs085800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 17 Sep 2016 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305906 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 22:13:04 -0000 Author: np Date: Sat Sep 17 22:13:03 2016 New Revision: 305906 URL: https://svnweb.freebsd.org/changeset/base/305906 Log: cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/adapter.h Sat Sep 17 22:13:03 2016 (r305906) @@ -231,6 +231,7 @@ struct vi_info { int if_flags; uint16_t *rss, *nm_rss; + int smt_idx; /* for convenience */ uint16_t viid; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/common/t4_hw.c Sat Sep 17 22:13:03 2016 (r305906) @@ -8100,6 +8100,10 @@ int t4_port_init(struct adapter *adap, i return ret; p->vi[0].viid = ret; + if (chip_id(adap) <= CHELSIO_T5) + p->vi[0].smt_idx = (ret & 0x7f) << 1; + else + p->vi[0].smt_idx = (ret & 0x7f); p->tx_chan = j; p->rx_chan_map = t4_get_mps_bg_map(adap, j); p->lport = j; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/t4_main.c Sat Sep 17 22:13:03 2016 (r305906) @@ -2030,6 +2030,10 @@ vcxgbe_attach(device_t dev) return (-rc); } vi->viid = rc; + if (chip_id(sc) <= CHELSIO_T5) + vi->smt_idx = (rc & 0x7f) << 1; + else + vi->smt_idx = (rc & 0x7f); param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/tom/t4_tom.c Sat Sep 17 22:13:03 2016 (r305906) @@ -538,7 +538,6 @@ select_rcv_wscale(void) } extern int always_keepalive; -#define VIID_SMACIDX(v) (((unsigned int)(v) & 0x7f) << 1) /* * socket so could be a listening socket too. @@ -569,7 +568,7 @@ calc_opt0(struct socket *so, struct vi_i opt0 |= V_L2T_IDX(e->idx); if (vi != NULL) { - opt0 |= V_SMAC_SEL(VIID_SMACIDX(vi->viid)); + opt0 |= V_SMAC_SEL(vi->smt_idx); opt0 |= V_TX_CHAN(vi->pi->tx_chan); } From owner-svn-src-head@freebsd.org Sat Sep 17 22:18:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A4ABDF027; Sat, 17 Sep 2016 22:18:34 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBA55C86; Sat, 17 Sep 2016 22:18:33 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HMIX4M086012; Sat, 17 Sep 2016 22:18:33 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HMIXIf086011; Sat, 17 Sep 2016 22:18:33 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201609172218.u8HMIXIf086011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 17 Sep 2016 22:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305907 - head/sys/dev/bhnd/cores/chipc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 22:18:34 -0000 Author: landonf Date: Sat Sep 17 22:18:32 2016 New Revision: 305907 URL: https://svnweb.freebsd.org/changeset/base/305907 Log: bhnd(4): Fix regression in BCM4331 SPROM pin reference counting. In r304870, refcount handling was lifted out into a common OTP/SPROM code path, but the refcount assertions in chipc_disable_sprom_pins() were not updated accordingly; this triggered an assertion on BCM4331 devices when releasing a SPROM pin reservation. Approved by: adrian (mentor, implicit) Modified: head/sys/dev/bhnd/cores/chipc/chipc.c Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sat Sep 17 22:13:03 2016 (r305906) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sat Sep 17 22:18:32 2016 (r305907) @@ -1261,8 +1261,7 @@ chipc_disable_sprom_pins(struct chipc_so return; CHIPC_LOCK_ASSERT(sc, MA_OWNED); - KASSERT(sc->sprom_refcnt != 0, ("sprom pins already disabled")); - KASSERT(sc->sprom_refcnt == 1, ("sprom pins in use")); + KASSERT(sc->sprom_refcnt == 0, ("sprom pins in use")); cctrl = bhnd_bus_read_4(sc->core, CHIPC_CHIPCTRL); From owner-svn-src-head@freebsd.org Sat Sep 17 23:08:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76EB3BDFB28; Sat, 17 Sep 2016 23:08:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 523DA13C4; Sat, 17 Sep 2016 23:08:50 +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 u8HN8nNd004854; Sat, 17 Sep 2016 23:08:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HN8nFm004852; Sat, 17 Sep 2016 23:08:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609172308.u8HN8nFm004852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 17 Sep 2016 23:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305908 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 23:08:50 -0000 Author: np Date: Sat Sep 17 23:08:49 2016 New Revision: 305908 URL: https://svnweb.freebsd.org/changeset/base/305908 Log: cxgbe/t4_tom: Update the active/passive open code to support T6. Data path works as-is. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Sat Sep 17 22:18:32 2016 (r305907) +++ head/sys/dev/cxgbe/tom/t4_connect.c Sat Sep 17 23:08:49 2016 (r305908) @@ -277,19 +277,26 @@ t4_init_connect_cpl_handlers(void) static inline int act_open_cpl_size(struct adapter *sc, int isipv6) { - static const int sz_t4[] = { - sizeof (struct cpl_act_open_req), - sizeof (struct cpl_act_open_req6) - }; - static const int sz_t5[] = { - sizeof (struct cpl_t5_act_open_req), - sizeof (struct cpl_t5_act_open_req6) + int idx; + static const int sz_table[3][2] = { + { + sizeof (struct cpl_act_open_req), + sizeof (struct cpl_act_open_req6) + }, + { + sizeof (struct cpl_t5_act_open_req), + sizeof (struct cpl_t5_act_open_req6) + }, + { + sizeof (struct cpl_t6_act_open_req), + sizeof (struct cpl_t6_act_open_req6) + }, }; - if (is_t4(sc)) - return (sz_t4[!!isipv6]); - else - return (sz_t5[!!isipv6]); + MPASS(chip_id(sc) >= CHELSIO_T4); + idx = min(chip_id(sc) - CHELSIO_T4, 2); + + return (sz_table[idx][!!isipv6]); } /* @@ -373,28 +380,32 @@ t4_connect(struct toedev *tod, struct so if (isipv6) { struct cpl_act_open_req6 *cpl = wrtod(wr); + struct cpl_t5_act_open_req6 *cpl5 = (void *)cpl; + struct cpl_t6_act_open_req6 *cpl6 = (void *)cpl; - if ((inp->inp_vflag & INP_IPV6) == 0) { - /* XXX think about this a bit more */ - log(LOG_ERR, - "%s: time to think about AF_INET6 + vflag 0x%x.\n", - __func__, inp->inp_vflag); + if ((inp->inp_vflag & INP_IPV6) == 0) DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); - } toep->ce = hold_lip(td, &inp->in6p_laddr); if (toep->ce == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOENT); - if (is_t4(sc)) { + switch (chip_id(sc)) { + case CHELSIO_T4: INIT_TP_WR(cpl, 0); cpl->params = select_ntuple(vi, toep->l2te); - } else { - struct cpl_t5_act_open_req6 *c5 = (void *)cpl; - - INIT_TP_WR(c5, 0); - c5->iss = htobe32(tp->iss); - c5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T5: + INIT_TP_WR(cpl5, 0); + cpl5->iss = htobe32(tp->iss); + cpl5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T6: + default: + INIT_TP_WR(cpl6, 0); + cpl6->iss = htobe32(tp->iss); + cpl6->params = select_ntuple(vi, toep->l2te); + break; } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, qid_atid)); @@ -409,16 +420,25 @@ t4_connect(struct toedev *tod, struct so cpl->opt2 = calc_opt2a(so, toep); } else { struct cpl_act_open_req *cpl = wrtod(wr); + struct cpl_t5_act_open_req *cpl5 = (void *)cpl; + struct cpl_t6_act_open_req *cpl6 = (void *)cpl; - if (is_t4(sc)) { + switch (chip_id(sc)) { + case CHELSIO_T4: INIT_TP_WR(cpl, 0); cpl->params = select_ntuple(vi, toep->l2te); - } else { - struct cpl_t5_act_open_req *c5 = (void *)cpl; - - INIT_TP_WR(c5, 0); - c5->iss = htobe32(tp->iss); - c5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T5: + INIT_TP_WR(cpl5, 0); + cpl5->iss = htobe32(tp->iss); + cpl5->params = select_ntuple(vi, toep->l2te); + break; + case CHELSIO_T6: + default: + INIT_TP_WR(cpl6, 0); + cpl6->iss = htobe32(tp->iss); + cpl6->params = select_ntuple(vi, toep->l2te); + break; } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, qid_atid)); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Sat Sep 17 22:18:32 2016 (r305907) +++ head/sys/dev/cxgbe/tom/t4_listen.c Sat Sep 17 23:08:49 2016 (r305908) @@ -694,7 +694,7 @@ t4_syncache_respond(struct toedev *tod, synqe->iss = be32toh(th->th_seq); synqe->ts = to.to_tsval; - if (is_t5(sc)) { + if (chip_id(sc) >= CHELSIO_T5) { struct cpl_t5_pass_accept_rpl *rpl5 = wrtod(wr); rpl5->iss = th->th_seq; @@ -1053,8 +1053,8 @@ calc_opt2p(struct adapter *sc, struct po } static void -pass_accept_req_to_protohdrs(const struct mbuf *m, struct in_conninfo *inc, - struct tcphdr *th) +pass_accept_req_to_protohdrs(struct adapter *sc, const struct mbuf *m, + struct in_conninfo *inc, struct tcphdr *th) { const struct cpl_pass_accept_req *cpl = mtod(m, const void *); const struct ether_header *eh; @@ -1063,8 +1063,13 @@ pass_accept_req_to_protohdrs(const struc const struct tcphdr *tcp; eh = (const void *)(cpl + 1); - l3hdr = ((uintptr_t)eh + G_ETH_HDR_LEN(hlen)); - tcp = (const void *)(l3hdr + G_IP_HDR_LEN(hlen)); + if (chip_id(sc) >= CHELSIO_T6) { + l3hdr = ((uintptr_t)eh + G_T6_ETH_HDR_LEN(hlen)); + tcp = (const void *)(l3hdr + G_T6_IP_HDR_LEN(hlen)); + } else { + l3hdr = ((uintptr_t)eh + G_ETH_HDR_LEN(hlen)); + tcp = (const void *)(l3hdr + G_IP_HDR_LEN(hlen)); + } if (inc) { bzero(inc, sizeof(*inc)); @@ -1188,7 +1193,7 @@ do_pass_accept_req(struct sge_iq *iq, co CTR4(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p", __func__, stid, tid, lctx); - pass_accept_req_to_protohdrs(m, &inc, &th); + pass_accept_req_to_protohdrs(sc, m, &inc, &th); t4opt_to_tcpopt(&cpl->tcpopt, &to); pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; @@ -1427,14 +1432,14 @@ reject: } static void -synqe_to_protohdrs(struct synq_entry *synqe, +synqe_to_protohdrs(struct adapter *sc, struct synq_entry *synqe, const struct cpl_pass_establish *cpl, struct in_conninfo *inc, struct tcphdr *th, struct tcpopt *to) { uint16_t tcp_opt = be16toh(cpl->tcp_opt); /* start off with the original SYN */ - pass_accept_req_to_protohdrs(synqe->syn, inc, th); + pass_accept_req_to_protohdrs(sc, synqe->syn, inc, th); /* modify parts to make it look like the ACK to our SYN|ACK */ th->th_flags = TH_ACK; @@ -1536,7 +1541,7 @@ reset: KASSERT(so != NULL, ("%s: socket is NULL", __func__)); /* Come up with something that syncache_expand should be ok with. */ - synqe_to_protohdrs(synqe, cpl, &inc, &th, &to); + synqe_to_protohdrs(sc, synqe, cpl, &inc, &th, &to); /* * No more need for anything in the mbuf that carried the